systemsetting.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. IsShow: 0,
  7. HasSound: true,
  8. ShowUserID:"000000000"
  9. },
  10. onLoad: function (options) {
  11. var that = this;
  12. that.setData({
  13. Containnerheight: main.getWindowHeight(),
  14. ProgramName: app.globalData.ProgramName,
  15. Version: app.globalData.Version,
  16. IsShow: app.globalData.userInfo.isShow,
  17. ShowUserID:app.globalData.userInfo.ShowUserID,
  18. IsPromoter:app.globalData.userInfo.IsPromoter,
  19. });
  20. common.getStorageValue(this, "HasSound", true, function () {
  21. wx.setStorageSync("HasSound", that.data.HasSound);
  22. });
  23. },
  24. onShow:function(){
  25. var that = this;
  26. var messageInfo="关闭";
  27. if (app.globalData.userInfo.IsMessage)
  28. messageInfo="每天"+app.globalData.userInfo.MessageTime;
  29. that.setData({
  30. MessageInfo: messageInfo,
  31. });
  32. },
  33. goto: function (e) {
  34. var url = e.currentTarget.dataset.url;
  35. var gotoType = e.currentTarget.dataset.type;
  36. if (!gotoType) {
  37. wx.navigateTo({
  38. url: url,
  39. });
  40. } else {
  41. wx.redirectTo({
  42. url: url,
  43. })
  44. }
  45. },
  46. switch1Change(e) {
  47. var that = this;
  48. that.data.HasSound = e.detail.value;
  49. that.setData({
  50. HasSound: that.data.HasSound,
  51. });
  52. wx.setStorageSync("HasSound", that.data.HasSound);
  53. },
  54. resetTodayTask:function(){
  55. main.ResetTodayTask();
  56. },
  57. onShareAppMessage: function () {
  58. return {
  59. title: app.globalData.ShareTitle,
  60. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  61. imageUrl: app.globalData.ShareImage,
  62. }
  63. },
  64. })