lessonlist.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. if (e.currentTarget.dataset.url){
  34. wx.navigateTo({
  35. url: '../other/video?LessonID=' + id +idchild+"&imageurl="+e.currentTarget.dataset.imageurl+"&url="+e.currentTarget.dataset.url,
  36. });
  37. }
  38. else{
  39. wx.navigateTo({
  40. url: '../other/lesson?LessonID=' + id +idchild,
  41. });
  42. }
  43. },
  44. onShareAppMessage: function () {
  45. return {
  46. title: "《秒过学习法》教学课程",
  47. path: app.globalData.SharePath + '?type=lesson&LessonID=all&UserID=' + app.globalData.userInfo.UserID,
  48. imageUrl: app.globalData.uploadImageUrl+"web/program_screenshot_lesson_a00.png",
  49. }
  50. },
  51. })