处理订单列表

This commit is contained in:
2026-01-16 02:04:09 +08:00
parent 1364fb2446
commit ff07af055f
45 changed files with 665 additions and 1772 deletions

View File

@@ -4,13 +4,12 @@
<view>
<nut-avatar size="large">用户</nut-avatar>
</view>
<!--<image :src="user_info.image"></image>-->
<view class="user-info-style">
<text class="nickname">{{ userInfo.nickName }}</text>
<text class="user-id">UID{{ userInfo.user_id }}</text>
<text class="nickname">{{ staffName }}</text>
<text class="user-id">UID{{ uid }}</text>
</view>
</view>
<view class="user-inner" v-else>
<!-- <view class="user-inner" v-else>
<view @click="goToLoginPage()">
<nut-avatar size="large">
<nut-icon name="my" />
@@ -19,16 +18,24 @@
<view @click="goToLoginPage()">
<text>点击登录</text>
</view>
</view>
</view> -->
<view class="content">
<nut-cell-group title="店铺管理">
<nut-grid>
<nut-grid-item text="商城配置" @click="navigateTo('/pages/config/store')">
<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')">
@@ -36,18 +43,16 @@
</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/config/shopOrder/index?tab=0')">
<nut-icon name="order"></nut-icon>
</nut-grid-item>
<!-- <nut-grid-item text="仓库订单" @click="navigateTo('/pages/order/list/index?tab=3')">
</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-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>
@@ -58,7 +63,7 @@
<nut-grid-item text="待收货"
@click="navigateTo('/pages/order/index?tab=3')">{{ countInfo.received }}</nut-grid-item>
</nut-grid>
</nut-cell-group>
</nut-cell-group> -->
<!-- <nut-cell-group title="控制台">
@@ -77,10 +82,10 @@
<!-- <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>
</nut-cell-group> -->
</view>
</view>
@@ -107,9 +112,9 @@
// 导入获取用户信息的API函数
import {
fetchUserInfo
} from '@/api/user';
// import {
// fetchUserInfo
// } from '@/api/user';
// 导入页面跳转工具函数
import {
goToLoginPage,
@@ -118,68 +123,76 @@
// 导入uni-app生命周期钩子
// 导入获取订单总数的API函数
import {
fetchOrderTotalCount
} from '@/api/order';
// import {
// fetchOrderTotalCount
// } from '@/api/order';
import {
fetchGetConfig
} from '@/api/config';
// import {
// fetchGetConfig
// } from '@/api/config';
const audit = ref(true);
// const audit = ref(true);
const showMyOrder = ref(false);
// const showMyOrder = ref(false);
const phone = ref('');
// const phone = ref('');
// 用户ID
const uid = ref(0);
const staffName = ref('');
/**
* 用户信息响应式对象
*/
const userInfo = reactive({});
// const userInfo = reactive({});
/**
* 订单统计信息响应式对象
*/
const countInfo = reactive({
all: 0,
payment: 0,
delivery: 0,
received: 0
});
// /**
// * 订单统计信息响应式对象
// */
// 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 makePhoneCall = (phoneNumber) => {
// console.log(123);
// uni.makePhoneCall({
// phoneNumber: phoneNumber,
// success: () => {
// console.log('拨打电话成功');
// },
// fail: (err) => {
// console.error('拨打电话失败:', err);
// }
// });
// }
// 获取配置
const getConfig = () => {
fetchGetConfig().then(res => {
console.log('getConfig=====>', res)
audit.value = res.appConfig.is_audit == 1
phone.value = res.appConfig.shop_phone
})
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
// })
}
/**
* 页面显示生命周期钩子
@@ -188,38 +201,37 @@
onShow(() => {
console.log('init');
let userId = uni.getStorageSync('uid');
console.log("userId", userId);
uid.value = userId
// 获取配置
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);
});
});
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);
// });
// });
// }
@@ -234,12 +246,12 @@
.user-inner {
background: linear-gradient(30deg, rgba(198, 77, 255, 0.99), rgba(102, 204, 255, 0.99));
height: 150px;
width: calc(100% - 20px);
height: 300rpx;
width: calc(100% - 40rpx);
display: flex;
align-items: center;
padding: 0px 10px;
gap: 15px;
padding: 0px 20rpx;
gap: 30rpx;
}
.user-info-style {
@@ -249,30 +261,20 @@
}
.nickname {
font-size: 20px;
/* 大字体 */
font-weight: bold;
/* 加粗 */
font-size: 28rpx;
color: #333;
/* 深色文字 */
margin-bottom: 5px;
/* 与UID的间距 */
margin-bottom: 10rpx;
}
.user-id {
font-size: 14px;
/* 小字体 */
font-size: 26rpx;
color: #fff;
/* 浅色文字 */
}
.content {
display: flex;
flex-direction: column;
/* align-items: center; */
// justify-content: center;
background-color: #f2f3f5;
padding: 0px 10px;
// height: calc(100vh - 150px);
padding: 0px 20rpx;
}
</style>