Files
JayuCloud/FM-Wechat-Fronted/pages/profile/index.js
T

38 lines
1015 B
JavaScript
Raw Normal View History

2026-06-24 22:13:00 +08:00
const { BRAND_CONFIG } = require('../../utils/config')
2026-06-27 01:46:44 +08:00
function resolveRoleText(type) {
const role = Number(type)
if (role === 2) return '店长'
if (role === 3) return '美甲师'
if (role === 4) return '管理员'
return '管理端'
}
2026-06-04 16:39:06 +08:00
Page({
data: {
2026-06-24 22:13:00 +08:00
shopName: BRAND_CONFIG.defaultShopName,
2026-06-04 16:39:06 +08:00
phone: '店长端',
2026-06-27 01:46:44 +08:00
roleText: '管理端',
2026-06-04 16:39:06 +08:00
menus: [
{ title: '店铺设置', url: '/pages/shop-settings/index' },
{ title: '数据导出', url: '/pages/export/index' },
{ title: '修改密码', url: '/pages/password/index' },
{ title: '关于系统', url: '/pages/about/index' }
]
},
onShow() {
const app = getApp()
2026-06-27 01:46:44 +08:00
const userInfo = app.globalData.userInfo || {}
2026-06-04 16:39:06 +08:00
this.setData({
2026-06-24 22:13:00 +08:00
shopName: app.globalData.shopName || BRAND_CONFIG.appName,
2026-06-27 01:46:44 +08:00
phone: userInfo.phone || userInfo.account || '店长端',
roleText: resolveRoleText(userInfo.type)
2026-06-04 16:39:06 +08:00
})
},
go(event) {
wx.navigateTo({ url: event.currentTarget.dataset.url })
}
})