调试接口

This commit is contained in:
wangxiaowei
2025-12-23 17:54:43 +08:00
parent 11f53ea1bb
commit df5d7aa94e
3 changed files with 37 additions and 13 deletions

View File

@ -218,3 +218,10 @@ export interface IGetStoreIncomeListParams {
export function getStoreIncomeList(data: IGetStoreIncomeListParams) { export function getStoreIncomeList(data: IGetStoreIncomeListParams) {
return http.Post<any>('/storeapi/user/checkStoreAccountList', data) return http.Post<any>('/storeapi/user/checkStoreAccountList', data)
} }
/**
* 扫码验券
*/
export function scanVerifyCoupon(qr_sn: string, store_id: number) {
return http.Post<any>('/storeapi/group/cancelCode', { qr_sn, store_id })
}

View File

@ -27,19 +27,20 @@
<wd-img width="690rpx" height="240rpx" :src="`${OSS}images/store/home/image1.png`" mode="aspectFit" /> <wd-img width="690rpx" height="240rpx" :src="`${OSS}images/store/home/image1.png`" mode="aspectFit" />
<!-- 本月收入 --> <!-- 本月收入 -->
<view class="flex flex-col justify-center items-center absolute top-42rpx left-46rpx"> <view class=" absolute top-42rpx left-46rpx w-120rpx ">
<view class="flex flex-col justify-center items-center">
<view class="font-400 text-26rpx text-[#825F37] leading-36rpx">本月收入</view> <view class="font-400 text-26rpx text-[#825F37] leading-36rpx">本月收入</view>
<view class="mt-42rpx"> <view class="mt-42rpx">
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.month"></price-format> <price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.month"></price-format>
</view> </view>
</view> </view>
<view class="absolute top-20rpx left-160rpx">
<view class="absolute top-42rpx left-174rpx">
<wd-img width="6rpx" height="188rpx" :src="`${OSS}images/store/home/image2.png`" mode="aspectFit" /> <wd-img width="6rpx" height="188rpx" :src="`${OSS}images/store/home/image2.png`" mode="aspectFit" />
</view> </view>
</view>
<!-- 下单金额 --> <!-- 下单金额 -->
<view class="flex flex-col justify-center items-center absolute top-42rpx left-208rpx"> <view class="flex flex-col justify-center items-center absolute top-42rpx left-240rpx w-140rpx">
<view class="font-400 text-26rpx text-[#825F37] leading-36rpx">下单金额</view> <view class="font-400 text-26rpx text-[#825F37] leading-36rpx">下单金额</view>
<view class="mt-26rpx"> <view class="mt-26rpx">
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.today_price"></price-format> <price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.today_price"></price-format>
@ -48,7 +49,7 @@
</view> </view>
<!-- 核销金额 --> <!-- 核销金额 -->
<view class="flex flex-col justify-center items-center absolute top-42rpx left-368rpx"> <view class="flex flex-col justify-center items-center absolute top-42rpx left-420rpx w-140rpx">
<view class="font-400 text-26rpx text-[#825F37] leading-36rpx">核销金额</view> <view class="font-400 text-26rpx text-[#825F37] leading-36rpx">核销金额</view>
<view class="mt-26rpx"> <view class="mt-26rpx">
<price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.yan_price"></price-format> <price-format color="#825F37" :first-size="36" :second-size="36" :subscript-size="24" :price="statistics.yan_price"></price-format>
@ -125,8 +126,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { router } from '@/utils/tools' import { router } from '@/utils/tools'
import { getStoreList, getStoreDetails, getStoreStatistics } from '@/api/store' import { getStoreList, getStoreDetails, getStoreStatistics, scanVerifyCoupon } from '@/api/store'
import { useStoreStore } from '@/store' import { useStoreStore } from '@/store'
import { toast } from '@/utils/toast'
const OSS = inject('OSS') const OSS = inject('OSS')
const navbarHeight = inject('navbarHeight') const navbarHeight = inject('navbarHeight')
@ -240,6 +242,21 @@
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
console.log('scanCode res:', res) console.log('scanCode res:', res)
uni.showLoading({
title: '验券中...'
})
try {
scanVerifyCoupon(res.result, useStore.defaultStore.id).then((res) => {
toast.info('验券成功')
uni.hideLoading()
}).catch((error) => {
uni.hideLoading()
return false
})
} catch(e) {
uni.hideLoading()
return false
}
}, },
fail: (err) => { fail: (err) => {
console.log('scanCode err:', err) console.log('scanCode err:', err)

View File

@ -66,8 +66,8 @@
mobile: string mobile: string
passowrd: string passowrd: string
}>({ }>({
mobile: '15005837859', mobile: '',
passowrd: '123456' passowrd: ''
}) })