扫码支付成功二次确认

This commit is contained in:
weiwei committed 2025-03-26 14:35:07 +08:00
1 parent 242ae97c91
commit 62a90c100a
5 files changed
+34 -19

No files matched your search

-1
View File
@@ -342,7 +342,6 @@
"iconPath": "",
"selectedIconPath": ""
}
// {
// "pagePath": "pages/tabbar/canteen",
// "text": "食堂",
+1 -1
View File
@@ -139,7 +139,7 @@ const doProduct = (v: any) => {
:gutter="10"
:breakpoints="{
1200: { rowPerView: 4 },
800: { rowPerView: 3 },
900: { rowPerView: 3 },
375: { rowPerView: 2 },
}"
:hasAroundGutter="false"
+27 -8
View File
@@ -67,6 +67,22 @@
</view>
</view>
</view>
<tm-modal
v-model:show="show"
:overlayClick="false"
:showCancel="false"
title="支付成功"
confirmText="确定"
position="right"
@confirm="payConfirm"
>
<view class="w-full text-2xl text-[#333] flex justify-center">
共&nbsp;
<text class="text-3xl color-#0779FD">{{ Number(amount).toFixed(2) }}</text>
&nbsp;元
</view>
</tm-modal>
</crud-layout>
</template>
@@ -86,6 +102,7 @@ const keyboardLayout = ref([
])
const scanData = ref<{ id?: string; name?: string }>({})
const disabled = ref(false)
const show = ref(false)
onShow(() => {
scanData.value = usePayStore().payData
@@ -160,16 +177,18 @@ const pay = async () => {
if (res.code != 0) {
throw new Error()
}
uni.showToast({ title: "支付成功", icon: "success" })
usePayStore().payData = {}
setTimeout(() => {
router.back()
uni.hideLoading()
}, 1000)
show.value = true
uni.hideLoading()
} catch (error: any) {
// uni.showToast({ title: "错误", icon: "error" })
uni.showToast({ title: "错误", icon: "error" })
uni.hideLoading()
}
}
// 支付确认
const payConfirm = () => {
usePayStore().payData = {}
show.value = false
router.back()
}
</script>
+1 -1
View File
@@ -178,7 +178,7 @@ const doScanCode = async () => {
try {
let decodedString: string | undefined = ""
if (isDevEnv()) {
decodedString = decodeBase64("eyJpZCI6IjE4ODk0ODM5Mzg0ODQ1MzEyMDEiLCJuYW1lIjoi5rWL6K+V6LaF5biCIn0=")
decodedString = decodeBase64("eyJpZCI6IjE5MDQ3MDUzMDEwNTQ2NzY5OTMiLCJuYW1lIjoi5paw5Y6/5bqc6LaF5biCIn0=")
uni.showToast({ title: "开发环境不是浙政钉环境,扫码仅供测试", icon: "none" })
} else {
const res: any = await (window as any).dd.scan({ type: "all" })