userinfo.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import common from '../../utils/util';
  2. import server from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. FileUrl: app.globalData.imageUrl,
  7. Version: app.globalData.Version,
  8. ProgramName: app.globalData.ProgramName,
  9. },
  10. onLoad: function (options) {
  11. this.setData({
  12. Containnerheight: common.getSystemHeight(),
  13. ProgramList: server.getProgramList(),
  14. ProgramID:app.globalData.ProgramID,
  15. IsShow: app.globalData.userInfo.IsShow,
  16. IsLocked: app.globalData.IsLocked,
  17. });
  18. },
  19. goto:function(e){
  20. var url=e.currentTarget.dataset.url;
  21. wx.navigateTo({
  22. url: url,
  23. })
  24. },
  25. switchProgram: function (e) {
  26. wx.navigateToMiniProgram({
  27. appId: e.currentTarget.dataset.appid,
  28. path: e.currentTarget.dataset.path,
  29. extraData: {
  30. },
  31. success(res) {
  32. // 打开成功
  33. }
  34. });
  35. },
  36. gotoFeedback: function () {
  37. server.gotoFeedback();
  38. },
  39. updateMember: function () {
  40. if (app.globalData.userInfo.UserID == 1) {
  41. if (app.globalData.userInfo.IsMember == 1) {
  42. app.globalData.userInfo.IsMember = 0;
  43. this.setData({
  44. IsMember: 0,
  45. });
  46. }
  47. else {
  48. app.globalData.userInfo.IsMember = 1;
  49. this.setData({
  50. IsMember: 1,
  51. });
  52. }
  53. }
  54. },
  55. });