Files
JayuCloud/WeChatProgram/pages/index/index.js
T

29 lines
486 B
JavaScript
Raw Normal View History

const auth = require('../../utils/auth')
2026-04-01 15:18:35 +08:00
Page({
data: {
navTitle: '游客模式'
},
2026-04-01 15:18:35 +08:00
onLoad() {
this.syncNavTitle()
2026-04-01 15:18:35 +08:00
wx.switchTab({
url: '/pages/home/index'
})
},
onShow() {
this.syncNavTitle()
},
syncNavTitle() {
const userInfo = auth.getStoredUserInfo()
const navTitle = userInfo && String(userInfo.shopName || '').trim()
? String(userInfo.shopName).trim()
: '游客模式'
this.setData({
navTitle
})
2026-04-01 15:18:35 +08:00
}
})