menu.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. import constant from '../../utils/constant';
  4. const app = getApp();
  5. Page({
  6. data: {
  7. },
  8. onLoad: function (options) {
  9. var that = this;
  10. that.setData({
  11. Containnerheight: main.getWindowHeight(),
  12. Menu:constant.arrMenuText[options.Type],
  13. });
  14. wx.setNavigationBarColor({
  15. frontColor: "#ffffff",
  16. backgroundColor: "#0B8457",
  17. })
  18. },
  19. goto:function(e){
  20. var that = this;
  21. var url = e.currentTarget.dataset.url;
  22. if (url.indexOf("studyplan")>0){
  23. var cardType=url.substr(url.length-1);
  24. wx.setStorageSync("CardType", Number(cardType));
  25. main.UploadUserConfig(function () {
  26. that.onClose();
  27. });
  28. }
  29. else{
  30. wx.redirectTo({
  31. url: url,
  32. });
  33. }
  34. },
  35. onClose: function () {
  36. wx.navigateBack({
  37. delta: 1,
  38. });
  39. },
  40. onShareAppMessage: function () {
  41. return {
  42. title: app.globalData.ShareTitle,
  43. path: app.globalData.SharePath + '?LessonID=all&UserID=' + app.globalData.userInfo.UserID,
  44. imageUrl: app.globalData.ShareImage,
  45. }
  46. },
  47. })