|
|
@@ -1,28 +1,39 @@
|
|
|
<script setup lang="ts">
|
|
|
-definePage({ name: 'smqjh-threePay', islogin: false, style: { navigationBarTitleText: '下单' } })
|
|
|
+import type { wxpay } from '@/api/globals'
|
|
|
+
|
|
|
+definePage({ name: 'smqjh-threePay', islogin: false, style: { navigationBarTitleText: '支付' } })
|
|
|
|
|
|
const orderNumber = ref()
|
|
|
onLoad((options: any) => {
|
|
|
orderNumber.value = options.orderNumber
|
|
|
handlePay()
|
|
|
})
|
|
|
+const priceInfo = ref<wxpay>()
|
|
|
async function handlePay() {
|
|
|
const res = await useUserStore().handleCommonPayMent(orderNumber.value)
|
|
|
- if (res.payType !== 1) {
|
|
|
+ priceInfo.value = res
|
|
|
+}
|
|
|
+async function handleGoPay() {
|
|
|
+ if (priceInfo.value?.payType !== 1) {
|
|
|
try {
|
|
|
- await useUserStore().getWxCommonPayment(res)
|
|
|
- await useUserStore().paySuccess('xsb-order', 'subPack-xsb/commonTab/index')
|
|
|
+ await useUserStore().getWxCommonPayment(priceInfo.value as wxpay)
|
|
|
}
|
|
|
catch {
|
|
|
- await useUserStore().payError('xsb-order', 'subPack-xsb/commonTab/index')
|
|
|
+ // console.log(111)
|
|
|
+ useGlobalToast().show({ msg: '支付失败!请重试' })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <view class="">
|
|
|
- view
|
|
|
+ <view class="px20rpx pt20rpx">
|
|
|
+ <view class="mb20rpx text-center text-48rpx text-#FF4A39">
|
|
|
+ ¥{{ priceInfo?.price }}
|
|
|
+ </view>
|
|
|
+ <wd-button block @click="handleGoPay">
|
|
|
+ 确认支付
|
|
|
+ </wd-button>
|
|
|
</view>
|
|
|
</template>
|
|
|
|