38 lines
1015 B
JavaScript
38 lines
1015 B
JavaScript
const { BRAND_CONFIG } = require('../../utils/config')
|
|
|
|
function resolveRoleText(type) {
|
|
const role = Number(type)
|
|
if (role === 2) return '店长'
|
|
if (role === 3) return '美甲师'
|
|
if (role === 4) return '管理员'
|
|
return '管理端'
|
|
}
|
|
|
|
Page({
|
|
data: {
|
|
shopName: BRAND_CONFIG.defaultShopName,
|
|
phone: '店长端',
|
|
roleText: '管理端',
|
|
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()
|
|
const userInfo = app.globalData.userInfo || {}
|
|
this.setData({
|
|
shopName: app.globalData.shopName || BRAND_CONFIG.appName,
|
|
phone: userInfo.phone || userInfo.account || '店长端',
|
|
roleText: resolveRoleText(userInfo.type)
|
|
})
|
|
},
|
|
|
|
go(event) {
|
|
wx.navigateTo({ url: event.currentTarget.dataset.url })
|
|
}
|
|
})
|