完善接口
This commit is contained in:
@ -30,7 +30,7 @@
|
||||
<view class="flex flex-col justify-center items-center absolute top-42rpx left-46rpx">
|
||||
<view class="font-400 text-26rpx text-[#825F37] leading-36rpx">本月收入</view>
|
||||
<view class="mt-42rpx">
|
||||
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="23.02"></price-format>
|
||||
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.month"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -42,18 +42,18 @@
|
||||
<view class="flex flex-col justify-center items-center absolute top-42rpx left-208rpx">
|
||||
<view class="font-400 text-26rpx text-[#825F37] leading-36rpx">下单金额</view>
|
||||
<view class="mt-26rpx">
|
||||
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="23.02"></price-format>
|
||||
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.today_price"></price-format>
|
||||
</view>
|
||||
<view class="font-400 text-24rpx text-[#825F37] leading-34rpx mt-10rpx">昨日¥223</view>
|
||||
<view class="font-400 text-24rpx text-[#825F37] leading-34rpx mt-10rpx">昨日¥{{ statistics.yesterday_price }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 核销金额 -->
|
||||
<view class="flex flex-col justify-center items-center absolute top-42rpx left-368rpx">
|
||||
<view class="font-400 text-26rpx text-[#825F37] leading-36rpx">核销金额</view>
|
||||
<view class="mt-26rpx">
|
||||
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="23.02"></price-format>
|
||||
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.yan_price"></price-format>
|
||||
</view>
|
||||
<view class="font-400 text-24rpx text-[#825F37] leading-34rpx mt-10rpx">昨日¥223</view>
|
||||
<view class="font-400 text-24rpx text-[#825F37] leading-34rpx mt-10rpx">昨日¥{{ statistics.yesterday_yan_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { router } from '@/utils/tools'
|
||||
import { getStoreList, getStoreDetails } from '@/api/store'
|
||||
import { getStoreList, getStoreDetails, getStoreStatistics } from '@/api/store'
|
||||
import { useStoreStore } from '@/store'
|
||||
|
||||
const OSS = inject('OSS')
|
||||
@ -154,6 +154,13 @@
|
||||
index: 0
|
||||
})
|
||||
const store = ref<any>({})
|
||||
const statistics = ref({
|
||||
month: 0, // 本月数据
|
||||
today_price: 0, // 今日收入
|
||||
yan_price: 0, // 验券
|
||||
yesterday_price: 0, // 昨日收入
|
||||
yesterday_yan_price: 0 // 昨日验券
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
// 初始化页面数据
|
||||
@ -168,6 +175,7 @@
|
||||
handleInit: async() => {
|
||||
await Index.handleGetStoreList()
|
||||
await Index.handleGetStoreDetails()
|
||||
await Index.handleGetStoreStatistics()
|
||||
},
|
||||
|
||||
/**
|
||||
@ -201,6 +209,16 @@
|
||||
store.value = storeDetails.details
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取门店统计数据
|
||||
*/
|
||||
handleGetStoreStatistics: async() => {
|
||||
if (!defaultStore.value) return
|
||||
const res = await getStoreStatistics(useStore.defaultStore.id)
|
||||
statistics.value = res.result
|
||||
console.log("🚀 ~ statistics:", statistics)
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择扫码验券菜单
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user