diff --git a/pages/index/index.vue b/pages/index/index.vue index 1ff9daa..371f92c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -32,13 +32,23 @@ - - 基础数据 + + 今日数据 - + + {{ item.name }} + {{ index !== 0 ? item.value : fen2yuan(item.value) }} + + + + + + + 昨日数据 + + {{ item.name }} {{ index !== 0 ? item.value : fen2yuan(item.value) }} - 昨日 {{ index === 0 ? fen2yuan(item.last) : item.last ? item.last : 0 }} @@ -71,18 +81,16 @@ const state = ref({ refundCount: 0, refundAmount: 0, }, - more: [ + now: [ { name: '销售金额', key: 'Amount', value: 0, - last: 0, }, { name: '订单数', key: 'orderCount', value: 0, - last: 0, }, { name: '待核销', @@ -95,6 +103,18 @@ const state = ref({ value: 0, }, ], + yesterday: [ + { + name: '销售金额', + key: 'Amount', + value: 0, + }, + { + name: '订单数', + key: 'orderCount', + value: 0, + }, + ], }) const userStore = $store('user') @@ -109,12 +129,12 @@ async function getStatistic() { state.value.statistic[key] = res.data[key] } - state.value.more[0].value = res.data.todayPaymentAmount ?? 0 - state.value.more[0].last = res.data.yesterdaySalesAmount ?? 0 - state.value.more[1].value = res.data.orderCount - state.value.more[1].last = res.data.yesterdayOrderCount - state.value.more[2].value = res.data.verificationOrderCount - state.value.more[3].value = res.data.deliveryOrderCount + state.value.now[0].value = res.data.todayPaymentAmount ?? 0 + state.value.yesterday[0].value = res.data.yesterdaySalesAmount ?? 0 + state.value.now[1].value = res.data.orderCount + state.value.yesterday[1].value = res.data.yesterdayOrderCount + state.value.now[2].value = res.data.verificationOrderCount + state.value.now[3].value = res.data.deliveryOrderCount } /** @@ -227,8 +247,8 @@ onShow(() => { padding: 19rpx 32rpx; display: flex; flex-direction: column; - justify-content: space-between; - height: 170rpx; + justify-content: space-around; + height: 120rpx; .name { font-weight: 600; color: var(--ui-TC);