systemsetting.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. List: [],
  7. IsPay: true,
  8. IsShow: 0,
  9. },
  10. onLoad: function (options) {
  11. var that = this;
  12. var childUserID = 0;
  13. if (app.globalData.userInfo.ChildUserID && app.globalData.userInfo.ChildUserID != undefined)
  14. childUserID = app.globalData.userInfo.ChildUserID;
  15. var productServiceTime = common.formatDateCHS(common.formatTime(new Date(app.globalData.userInfo.ProductServiceTime)));
  16. var today15 = common.formatDateCHS(common.formatTime(common.addDate("d", 15, new Date())));
  17. var isPay = true;
  18. if (productServiceTime > today15) {
  19. isPay = false;
  20. }
  21. that.setData({
  22. Containnerheight: main.getWindowHeight(),
  23. ProgramName: app.globalData.ProgramName,
  24. Version: app.globalData.Version,
  25. ProductServiceTime: productServiceTime,
  26. IsPay: isPay,
  27. IsShow: app.globalData.IsShow,
  28. ChildUserID: childUserID,
  29. });
  30. },
  31. gotoPay: function () {
  32. var payindex = 3;
  33. if (app.globalData.userInfo.IsFinishTask == 1)
  34. payindex = 2;
  35. wx.navigateTo({
  36. url: '../other/pay?paypanel=1&payindex=' + payindex,
  37. });
  38. },
  39. gotoBinding: function () {
  40. wx.navigateTo({
  41. url: '../other/binding',
  42. })
  43. },
  44. gotoUserbook:function(){
  45. wx.navigateTo({
  46. url: '../other/userbook',
  47. });
  48. },
  49. updateMember: function () {
  50. wx.reLaunch({
  51. url: '../index/index',
  52. })
  53. },
  54. gotoPayTemp: function (e) {
  55. if (app.globalData.userInfo.UserID <= 7) {
  56. wx.navigateTo({
  57. url: '../other/pay?paypanel=0&payindex=0',
  58. });
  59. }
  60. },
  61. gotoLesson: function () {
  62. if (app.globalData.userInfo.UserID <= 7) {
  63. wx.navigateTo({
  64. url: '../other/lessonlist',
  65. });
  66. }
  67. },
  68. gotoMarketingUserList: function (e) {
  69. wx.navigateTo({
  70. url: '../../marketing/main/index',
  71. });
  72. },
  73. onShareAppMessage: function () {
  74. return {
  75. title: app.globalData.ShareTitle,
  76. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  77. imageUrl: app.globalData.ShareImage,
  78. }
  79. },
  80. })