diff --git a/src/pages.json b/src/pages.json index 76e0a93..23690ce 100644 --- a/src/pages.json +++ b/src/pages.json @@ -287,6 +287,13 @@ "navigationBarTitleText": "支付", "disableScroll": true } + }, + { + "path": "payComplete", + "style": { + "navigationBarTitleText": "支付完成", + "disableScroll": true + } } ] } diff --git a/src/pages/pay/payComplete.vue b/src/pages/pay/payComplete.vue new file mode 100644 index 0000000..ff44af4 --- /dev/null +++ b/src/pages/pay/payComplete.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/pages/pay/scanPay.vue b/src/pages/pay/scanPay.vue index bf9540c..0055bfb 100644 --- a/src/pages/pay/scanPay.vue +++ b/src/pages/pay/scanPay.vue @@ -67,22 +67,6 @@ - - - - 共  - {{ Number(amount).toFixed(2) }} -  元 - - @@ -102,7 +86,6 @@ const keyboardLayout = ref([ ]) const scanData = ref<{ id?: string; name?: string }>({}) const disabled = ref(false) -const show = ref(false) onShow(() => { scanData.value = usePayStore().payData @@ -177,18 +160,12 @@ const pay = async () => { if (res.code != 0) { throw new Error() } - show.value = true uni.hideLoading() + usePayStore().setPayData({ ...scanData.value, customPrice: Number(amount.value).toFixed(2) }) + router.jump("/pages/pay/payComplete", {}, 2) } catch (error: any) { uni.showToast({ title: "错误", icon: "error" }) uni.hideLoading() } } - -// 支付确认 -const payConfirm = () => { - usePayStore().payData = {} - show.value = false - router.back() -} diff --git a/src/sheep/stores/pay.ts b/src/sheep/stores/pay.ts index c644023..5b4937c 100644 --- a/src/sheep/stores/pay.ts +++ b/src/sheep/stores/pay.ts @@ -1,7 +1,7 @@ import { defineStore } from "pinia" export const usePayStore = defineStore("pay", { - state: (): { payData: { id?: string; name?: string } } => { + state: (): { payData: { id?: string; name?: string; customPrice?: number } } => { return { payData: {}, }