systemsetting.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. updateMember: function () {
  45. wx.reLaunch({
  46. url: '../index/index',
  47. })
  48. },
  49. gotoPayTemp: function (e) {
  50. if (app.globalData.userInfo.UserID <= 7) {
  51. wx.navigateTo({
  52. url: '../other/pay?paypanel=0&payindex=0',
  53. });
  54. }
  55. },
  56. gotoLesson: function () {
  57. if (app.globalData.userInfo.UserID <= 7) {
  58. wx.navigateTo({
  59. url: '../other/lessonlist',
  60. });
  61. }
  62. },
  63. onShareAppMessage: function () {
  64. return {
  65. title: app.globalData.ShareTitle,
  66. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  67. imageUrl: app.globalData.ShareImage,
  68. }
  69. },
  70. })