280 lines
7.0 KiB
Vue
280 lines
7.0 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="user-inner" v-else>
|
||
<view @click="goToLoginPage()">
|
||
<nut-avatar size="large">
|
||
<nut-icon name="my" />
|
||
</nut-avatar>
|
||
</view>
|
||
<view @click="goToLoginPage()">
|
||
<text>点击登录</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-item text="商城配置" @click="navigateTo('/pages/config/store')">
|
||
<nut-icon name="people"></nut-icon>
|
||
</nut-grid-item>
|
||
<nut-grid-item text="价格调整" @click="navigateTo('/pages/config/price')">
|
||
<nut-icon name="refresh"></nut-icon>
|
||
</nut-grid-item>
|
||
<nut-grid-item text="商品管理" @click="navigateTo('/pages/config/goodsList')">
|
||
<nut-icon name="shop"></nut-icon>
|
||
</nut-grid-item> -->
|
||
|
||
<!-- <nut-grid-item text="仓库订单" @click="navigateTo('/pages/order/list/index?tab=3')">
|
||
<nut-icon name="order"></nut-icon> -->
|
||
<!-- </nut-grid-item> -->
|
||
</nut-grid>
|
||
</nut-cell-group>
|
||
|
||
|
||
<!-- <nut-cell-group title="我的订单" v-if="showMyOrder && !audit">
|
||
<nut-grid>
|
||
<nut-grid-item text="全部"
|
||
@click="navigateTo('/pages/order/index?tab=0')">{{ countInfo.all }}</nut-grid-item>
|
||
<nut-grid-item text="待付款"
|
||
@click="navigateTo('/pages/order/index?tab=1')">{{ countInfo.payment }}</nut-grid-item>
|
||
<nut-grid-item text="待发货"
|
||
@click="navigateTo('/pages/order/index?tab=2')">{{ countInfo.delivery }}</nut-grid-item>
|
||
<nut-grid-item text="待收货"
|
||
@click="navigateTo('/pages/order/index?tab=3')">{{ countInfo.received }}</nut-grid-item>
|
||
</nut-grid>
|
||
</nut-cell-group> -->
|
||
|
||
|
||
<!-- <nut-cell-group title="控制台">
|
||
<nut-cell title="商城配置" @click="navigateTo('')"></nut-cell>
|
||
<nut-cell title="价格调整" @click="navigateTo('/pages/config/index')"></nut-cell>
|
||
<nut-cell title="店内机器管理" @click="navigateTo('/pages/config/index')"></nut-cell>
|
||
<nut-cell title="订单管理" @click="navigateTo('/pages/config/index')"></nut-cell> -->
|
||
|
||
<!-- <nut-cell v-if="user_info.super_user_from.includes('parts')" title="配件管理"
|
||
@click="navigateTo('/pages/control/parts/index')"></nut-cell> -->
|
||
<!-- </nut-cell-group> -->
|
||
|
||
<!-- <nut-cell-group title="控制台" v-if="user_info.is_super_user">
|
||
<nut-cell v-if="user_info.super_user_from.includes('store')" title="手机管理"
|
||
@click="navigateTo('/pages/control/goods/index')"></nut-cell> -->
|
||
<!-- <nut-cell v-if="user_info.super_user_from.includes('parts')" title="配件管理"
|
||
@click="navigateTo('/pages/control/parts/index')"></nut-cell> -->
|
||
<!-- </nut-cell-group> -->
|
||
<!--
|
||
<nut-cell-group title="联系我们">
|
||
<nut-cell :title="phone" @click="makePhoneCall(phone)"></nut-cell>
|
||
</nut-cell-group> -->
|
||
</view>
|
||
</view>
|
||
|
||
|
||
|
||
|
||
|
||
</template>
|
||
<script setup>
|
||
// 导入Vue的响应式函数
|
||
import {
|
||
reactive,
|
||
ref
|
||
} from 'vue';
|
||
import {
|
||
onLoad,
|
||
onShow,
|
||
} from '@dcloudio/uni-app';
|
||
// import TabBar from '@/components/TabBar/TabBar.vue';
|
||
// 默认选中第一个tab
|
||
// const currentTab = ref(3);
|
||
|
||
|
||
|
||
|
||
// 导入获取用户信息的API函数
|
||
// import {
|
||
// fetchUserInfo
|
||
// } from '@/api/user';
|
||
// 导入页面跳转工具函数
|
||
import {
|
||
goToLoginPage,
|
||
navigateTo
|
||
} from '@/utils/helper';
|
||
// 导入uni-app生命周期钩子
|
||
|
||
// 导入获取订单总数的API函数
|
||
// import {
|
||
// fetchOrderTotalCount
|
||
// } from '@/api/order';
|
||
|
||
// import {
|
||
// fetchGetConfig
|
||
// } from '@/api/config';
|
||
|
||
// const audit = ref(true);
|
||
|
||
// const showMyOrder = ref(false);
|
||
|
||
// const phone = ref('');
|
||
|
||
// 用户ID
|
||
const uid = ref(0);
|
||
const staffName = ref('');
|
||
/**
|
||
* 用户信息响应式对象
|
||
*/
|
||
// const userInfo = reactive({});
|
||
|
||
|
||
|
||
// /**
|
||
// * 订单统计信息响应式对象
|
||
// */
|
||
// const countInfo = reactive({
|
||
// all: 0,
|
||
// payment: 0,
|
||
// delivery: 0,
|
||
// received: 0
|
||
// });
|
||
|
||
|
||
|
||
onLoad(options => {
|
||
init();
|
||
});
|
||
|
||
|
||
|
||
// const makePhoneCall = (phoneNumber) => {
|
||
// console.log(123);
|
||
// uni.makePhoneCall({
|
||
// phoneNumber: phoneNumber,
|
||
// success: () => {
|
||
// console.log('拨打电话成功');
|
||
// },
|
||
// fail: (err) => {
|
||
// console.error('拨打电话失败:', err);
|
||
// }
|
||
// });
|
||
// }
|
||
|
||
|
||
// 获取配置
|
||
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
|
||
// fetchGetConfig().then(res => {
|
||
// console.log('getConfig=====>', res)
|
||
// audit.value = res.appConfig.is_audit == 1
|
||
// phone.value = res.appConfig.shop_phone
|
||
// })
|
||
}
|
||
/**
|
||
* 页面显示生命周期钩子
|
||
* 每次页面显示时都会执行
|
||
*/
|
||
onShow(() => {
|
||
|
||
console.log('init');
|
||
init();
|
||
|
||
|
||
|
||
// // 获取配置
|
||
// getConfig()
|
||
|
||
|
||
// // 如果用户登陆
|
||
// if (uid.value > 0) {
|
||
|
||
// // 获取用户信息
|
||
// fetchUserInfo().then(res => {
|
||
// // if (res.is_bind_phone) {
|
||
// // navigateTo('/pages/login/phoneAuthorization');
|
||
// // return
|
||
// // }
|
||
// // 将API返回的数据合并到userInfo响应式对象中
|
||
// Object.assign(userInfo, res);
|
||
// // 显示订单
|
||
// showMyOrder.value = true
|
||
// // 获取订单总数统计
|
||
// fetchOrderTotalCount().then(res => {
|
||
// // 将API返回的数据合并到count_info响应式对象中
|
||
// Object.assign(countInfo, res);
|
||
// });
|
||
// });
|
||
|
||
|
||
|
||
// }
|
||
|
||
|
||
|
||
});
|
||
</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> |