123 lines
2.3 KiB
Vue
123 lines
2.3 KiB
Vue
<template>
|
||
<view class="page-content">
|
||
<view class="user-inner" v-if="uid > 0">
|
||
<view>
|
||
<nut-avatar size="large">用户</nut-avatar>
|
||
</view>
|
||
<view class="user-info-style">
|
||
<text class="nickname">{{ staffName }}</text>
|
||
<text class="user-id">UID:{{ uid }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<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 text="运营数据" @click="navigateTo('/pages/order/shopOrder/index?tab=0')">
|
||
<nut-icon name="eye"></nut-icon>
|
||
</nut-grid-item>
|
||
</nut-grid>
|
||
</nut-cell-group>
|
||
</view>
|
||
</view>
|
||
|
||
|
||
|
||
|
||
|
||
</template>
|
||
<script setup>
|
||
// 导入Vue的响应式函数
|
||
import {
|
||
reactive,
|
||
ref
|
||
} from 'vue';
|
||
import {
|
||
onLoad,
|
||
onShow,
|
||
} from '@dcloudio/uni-app';
|
||
|
||
import {
|
||
navigateTo
|
||
} from '@/utils/helper';
|
||
|
||
|
||
// 用户ID
|
||
const uid = ref(0);
|
||
const staffName = ref('');
|
||
|
||
|
||
|
||
|
||
onLoad(options => {
|
||
init();
|
||
});
|
||
|
||
|
||
|
||
|
||
|
||
// 获取配置
|
||
const init = () => {
|
||
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
|
||
|
||
}
|
||
/**
|
||
* 页面显示生命周期钩子
|
||
* 每次页面显示时都会执行
|
||
*/
|
||
onShow(() => {
|
||
console.log('init');
|
||
init();
|
||
});
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.page-content {
|
||
min-height: 100vh;
|
||
background-color: #f2f3f5;
|
||
}
|
||
|
||
.user-inner {
|
||
background: linear-gradient(30deg, rgba(198, 77, 255, 0.99), rgba(102, 204, 255, 0.99));
|
||
height: 300rpx;
|
||
width: calc(100% - 40rpx);
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 0px 20rpx;
|
||
gap: 30rpx;
|
||
}
|
||
|
||
.user-info-style {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-start;
|
||
}
|
||
|
||
.nickname {
|
||
font-size: 28rpx;
|
||
color: #333;
|
||
margin-bottom: 10rpx;
|
||
}
|
||
|
||
.user-id {
|
||
font-size: 26rpx;
|
||
color: #fff;
|
||
}
|
||
|
||
.content {
|
||
display: flex;
|
||
flex-direction: column;
|
||
background-color: #f2f3f5;
|
||
padding: 0px 20rpx;
|
||
}
|
||
</style> |