处理个人中心 以及数据看板
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user