处理问题

This commit is contained in:
2026-01-17 02:33:39 +08:00
parent 9ea4f0e999
commit 32993ff52c
10 changed files with 54 additions and 28 deletions

View File

@@ -12,12 +12,12 @@
<view class="content">
<nut-cell-group title="">
<nut-grid>
<nut-grid-item text="订单管理" @click="navigateTo('/pages/order/index?tab=0')">
<nut-icon name="order"></nut-icon>
</nut-grid-item>
<nut-grid-item v-if="staffRole == 1" text="运营数据" @click="navigateTo('/pages/data/index')">
<nut-icon name="eye"></nut-icon>
<nut-grid>
<nut-grid-item text="订单管理" @click="navigateTo('/pages/order/index?tab=0')">
<nut-icon name="order"></nut-icon>
</nut-grid-item>
<nut-grid-item v-if="staffRole == 1" text="运营数据" @click="navigateTo('/pages/data/index')">
<nut-icon name="eye"></nut-icon>
</nut-grid-item>
</nut-grid>
</nut-cell-group>
@@ -39,15 +39,20 @@
onLoad,
onShow,
} from '@dcloudio/uni-app';
import {
navigateTo
} from '@/utils/helper';
import {
fetchRooms,
fetchBooking,
fetchUnBooking,
fetchUserInfo,
} from '@/api/index';
// 用户ID
const uid = ref(0);
const staffName = ref('');
const staffName = ref('');
const staffRole = ref(0);
@@ -59,19 +64,25 @@
// 获取配置
const init = () => {
fetchUserInfo().then(res => {
console.log(res);
uni.setStorageSync('uid', res.user_id)
uni.setStorageSync('user_name', res.user_name)
uni.setStorageSync('role', res.role.value)
uni.setStorageSync('staff_name', res.staff_name)
})
let user_name = uni.getStorageSync('user_name')
let staff_name = uni.getStorageSync('staff_name')
let role = uni.getStorageSync('role')
let user_id = uni.getStorageSync('uid');
console.log("staff_name", staff_name);
uid.value = user_id
staffName.value = staff_name
staffName.value = staff_name
staffRole.value = role
}
/**
* 页面显示生命周期钩子