systemsetting.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. },
  9. onLoad: function (options) {
  10. var that = this;
  11. that.setData({
  12. Containnerheight: main.getWindowHeight(),
  13. ProgramName: app.globalData.ProgramName,
  14. Version: app.globalData.Version,
  15. IsShow: app.globalData.userInfo.isShow,
  16. IsPromoter:app.globalData.userInfo.IsPromoter,
  17. });
  18. common.getStorageValue(this, "HasSound", true, function () {
  19. wx.setStorageSync("HasSound", that.data.HasSound);
  20. });
  21. },
  22. onShow:function(){
  23. var that = this;
  24. var messageInfo="关闭";
  25. if (app.globalData.userInfo.IsMessage)
  26. messageInfo="每天"+app.globalData.userInfo.MessageTime;
  27. that.setData({
  28. MessageInfo: messageInfo,
  29. });
  30. },
  31. goto: function (e) {
  32. var url = e.currentTarget.dataset.url;
  33. var gotoType = e.currentTarget.dataset.type;
  34. if (!gotoType) {
  35. wx.navigateTo({
  36. url: url,
  37. });
  38. } else {
  39. wx.redirectTo({
  40. url: url,
  41. })
  42. }
  43. },
  44. switch1Change(e) {
  45. var that = this;
  46. that.data.HasSound = e.detail.value;
  47. that.setData({
  48. HasSound: that.data.HasSound,
  49. });
  50. wx.setStorageSync("HasSound", that.data.HasSound);
  51. },
  52. onShareAppMessage: function () {
  53. return {
  54. title: app.globalData.ShareTitle,
  55. path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
  56. imageUrl: app.globalData.ShareImage,
  57. }
  58. },
  59. })