调试接口

This commit is contained in:
wangxiaowei
2025-12-25 00:06:10 +08:00
parent df5d7aa94e
commit 2e61a619d3
13 changed files with 64 additions and 41 deletions

View File

@ -128,11 +128,12 @@
import { router } from '@/utils/tools'
import { getStoreList, getStoreDetails, getStoreStatistics, scanVerifyCoupon } from '@/api/store'
import { useStoreStore } from '@/store'
import { toast } from '@/utils/toast'
import { useToast } from 'wot-design-uni'
const OSS = inject('OSS')
const navbarHeight = inject('navbarHeight')
const useStore = useStoreStore()
const toast = useToast()
// 扫码验券弹出框
const showScanMenu = ref<boolean>(false)
@ -241,20 +242,22 @@ import { toast } from '@/utils/toast'
handleScanCode: () => {
uni.scanCode({
success: (res) => {
console.log('scanCode res:', res)
uni.showLoading({
title: '验券中...'
toast.loading({
msg: '验券中...'
})
try {
scanVerifyCoupon(res.result, useStore.defaultStore.id).then((res) => {
toast.info('验券成功')
uni.hideLoading()
toast.close()
toast.info({
msg: '验券成功',
duration: 1500
})
}).catch((error) => {
uni.hideLoading()
toast.close()
return false
})
} catch(e) {
uni.hideLoading()
toast.close()
return false
}
},