lessonlist.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. ImagePath: app.globalData.uploadImageUrl,
  7. },
  8. onLoad: function () {
  9. var that = this;
  10. that.setData({
  11. CheckListUserID: app.globalData.userInfo.UserID,
  12. Containnerheight: main.getWindowHeight(),
  13. UserID: app.globalData.userInfo.UserID,
  14. });
  15. var userid = app.globalData.userInfo.UserID;
  16. main.getData("GetMiaoguoLesson2?UserID=" + userid, function (data) {
  17. if (data) {
  18. var arr=[];
  19. for(var i=0;i<4;i++)
  20. arr.push(data[i]);
  21. that.setData({
  22. List: arr,
  23. });
  24. wx.setStorageSync("LessonList", data);
  25. }
  26. });
  27. },
  28. gotoLesson: function (e) {
  29. var id = e.currentTarget.dataset.id;
  30. var idchild="";
  31. if (e.currentTarget.dataset.idchild && id>1)
  32. idchild = '&LessonPage=' +e.currentTarget.dataset.idchild;
  33. wx.navigateTo({
  34. url: '../other/lesson?LessonID=' + id +idchild,
  35. });
  36. },
  37. onShareAppMessage: function () {
  38. return {
  39. title: "《秒过学习法》教学课程",
  40. path: app.globalData.SharePath + '?type=lesson&LessonID=all&UserID=' + app.globalData.userInfo.UserID,
  41. imageUrl: app.globalData.uploadImageUrl+"web/program_screenshot_lesson_a00.png",
  42. }
  43. },
  44. })