help.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. var id=0;
  5. var idchild=0;
  6. Page({
  7. data: {
  8. List: [],
  9. ImagePath: app.globalData.uploadImageUrl,
  10. },
  11. onLoad: function (options) {
  12. var that = this;
  13. id=options.id;
  14. idchild=options.idchild;
  15. var list = wx.getStorageSync("MiaoguoTipsList");
  16. that.setData({
  17. Containnerheight: main.getWindowHeight(),
  18. Item:list[options.id].List[options.idchild],
  19. IsShare:options.IsShare,
  20. });
  21. wx.setNavigationBarColor({
  22. frontColor: "#000000",
  23. backgroundColor: "#ffffff",
  24. });
  25. },
  26. goto: function (e) {
  27. if (this.data.IsShare==1){
  28. var url = e.currentTarget.dataset.url;
  29. wx.redirectTo({
  30. url: url,
  31. });
  32. }
  33. else{
  34. wx.navigateBack({
  35. delta: 1,
  36. });
  37. }
  38. },
  39. onShareAppMessage: function () {
  40. return {
  41. title: "《秒过学习法》小贴士",
  42. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID + '&type=help&ID=' + id + '&IDChild=' + idchild,
  43. imageUrl: app.globalData.uploadImageUrl+'web/'+this.data.Item.Cover,
  44. }
  45. },
  46. })