setting.js 619 B

123456789101112131415161718192021222324252627282930
  1. // miniprogram/pages/setting/setting.js
  2. const app = getApp()
  3. Page({
  4. data: {
  5. userInfo: null,
  6. hasUserInfo: false,
  7. notiForm: 0,
  8. notiFormType: ['数字', '红点', '不显示']
  9. },
  10. onLoad: function () {
  11. if (app.globalData.hasUserInfo) {
  12. this.setData({
  13. userInfo: app.globalData.userInfo,
  14. hasUserInfo: true,
  15. notiForm: app.globalData.notiForm
  16. })
  17. } else {
  18. wx.showToast({
  19. title: '请先登录',
  20. icon: 'none'
  21. })
  22. }
  23. },
  24. onUnload: function () {
  25. app.globalData.notiForm = this.data.notiForm
  26. }
  27. })