123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- const { sessionStorageKey } = require('../../api/request')
- const app = getApp()
- Page({
-
- data: {
- navBarHeight: app.globalData.navBarHeight,
- navBarConfig: {
- booFixed: true,
- backgroundColor: ''
- },
- sessionId: '',
- userInfo: {}
- },
-
- onLoad: function (options) {
- },
-
- onReady: function () {
- },
-
- onShow: function () {
- this.setData({
- sessionId: wx.getStorageSync(sessionStorageKey),
- userInfo: app.globalData.userInfo
- })
- },
-
- onHide: function () {
- },
-
- onUnload: function () {
- },
- jump(e) {
- const { navigate } = e.currentTarget.dataset
- const index = ['order', 'invoice', 'setting', 'feedback'].findIndex(item => item === navigate)
- if (!this.data.sessionId && index > -1) {
- wx.navigateTo({
- url: '/pages/login/login'
- })
- return
- }
- if (this.data.sessionId && navigate === 'login') {
- return
- }
- wx.navigateTo({
- url: `/pages/${navigate}/${navigate}`
- })
- }
- })
|