调试接口
This commit is contained in:
@ -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
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user