处理个人中心 以及数据看板

This commit is contained in:
2026-01-16 16:39:07 +08:00
parent 7bff4f6191
commit ccacfdb4e9
15 changed files with 103 additions and 38 deletions

View File

@@ -5,13 +5,14 @@
<view class="top-inner-price">
<view style="display: flex;">{{day}}日营业额
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
¥{{dayTotalPrice}}
</view>
</view>
<view style="display: flex;">{{formatDate(day)}}月营业额
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
</view>
¥{{monthTotalPrice}}
</view>
</view>
<!-- <view style="display: flex;">总计
<view style="color: #fa2c19;font-size: 26rpx;">
@@ -19,7 +20,7 @@
</view>
</view> -->
</view>
<view class="top-inner-price">
<!-- <view class="top-inner-price">
<view style="display: flex;">优惠
<view style="color: #fa2c19;font-size: 26rpx;">
¥2000.00
@@ -35,7 +36,7 @@
¥2000.00
</view>
</view>
</view>
</view> -->
</view>
</nut-sticky>
@@ -111,7 +112,7 @@
</view>
<view style="display: flex;">总计
<view style="color: #fa2c19;font-size: 26rpx;">
¥{{order?.discount_amount}}
¥{{order?.totalPrice}}
</view>
</view>
</view>
@@ -145,12 +146,20 @@
} from '@/utils/helper';
import {
fetchDayOrderList,
fetchDashboard
} from '@/api/index';
const dayTotalPrice = ref(0)
const monthTotalPrice = ref(0)
const day = ref('');
onLoad((options) => {
day.value = options.date
console.log(day.value);
if (day.value) {
getDashboard()
}
})
// 格式化日期为 Y-m 格式
const formatDate = (date) => {
@@ -166,6 +175,17 @@
const paging = ref(null);
const getDashboard = () => {
fetchDashboard({
date: day.value
}).then(res => {
console.log(res);
dayTotalPrice.value =res.dayTotalPrice
monthTotalPrice.value =res.monthTotalPrice
// paging.value.complete(res.list);
})
}
// 获取订单列表
const queryList = (pageNo = 1, pageSize = 10) => {
@@ -188,6 +208,10 @@
* 每次页面显示时都会执行
*/
onShow(() => {
if (day.value) {
getDashboard()
}
// 获取配置
// getConfig()
if (paging.value) {

View File

@@ -16,7 +16,7 @@
<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/data/index')">
<nut-grid-item v-if="staffRole == 1" text="运营数据" @click="navigateTo('/pages/data/index')">
<nut-icon name="eye"></nut-icon>
</nut-grid-item>
</nut-grid>
@@ -47,7 +47,8 @@
// 用户ID
const uid = ref(0);
const staffName = ref('');
const staffName = ref('');
const staffRole = ref(0);
@@ -68,7 +69,8 @@
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
}
/**

View File

@@ -85,7 +85,7 @@
</view>
<view style="display: flex;">总计
<view style="color: #fa2c19;font-size: 26rpx;">
¥{{order?.discount_amount}}
¥{{order?.totalPrice}}
</view>
</view>
</view>