feat(M08-C): 建立管理员房态运营入口

This commit is contained in:
Codex
2026-08-10 10:06:12 +08:00
parent 1160f16e8d
commit b70ada06a8
24 changed files with 699 additions and 15 deletions
+31
View File
@@ -7,6 +7,8 @@ Page({
loading: false,
errorMessage: '',
stores: [],
showManagerEntry: false,
showCleanerEntry: false,
},
onLoad(options) {
@@ -15,6 +17,27 @@ Page({
}
},
onShow() {
this.loadRoleEntrances()
},
async loadRoleEntrances() {
if (!wx.getStorageSync('qipai_access_token')) {
this.setData({ showManagerEntry: false, showCleanerEntry: false })
return
}
try {
const response = await request('/auth/me')
const roles = response.data?.access?.roles || []
this.setData({
showManagerEntry: roles.some((role) => ['STAFF', 'STORE_ADMIN', 'TENANT_ADMIN', 'PLATFORM_ADMIN'].includes(role)),
showCleanerEntry: roles.includes('CLEANER'),
})
} catch (_) {
this.setData({ showManagerEntry: false, showCleanerEntry: false })
}
},
onCityInput(event) {
this.setData({ city: event.detail.value })
},
@@ -73,6 +96,14 @@ Page({
wx.navigateTo({ url: '/pages/profile/index' })
},
openManager() {
wx.navigateTo({ url: '/pages/manager/dashboard' })
},
openCleaner() {
wx.navigateTo({ url: '/pages/cleaner/tasks' })
},
async resolveScene(code, sourceType) {
this.setData({ loading: true, errorMessage: '' })
try {