|
|
@@ -0,0 +1,40 @@
|
|
|
+<script setup lang="ts">
|
|
|
+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)
|
|
|
+ priceInfo.value = res
|
|
|
+}
|
|
|
+async function handleGoPay() {
|
|
|
+ if (priceInfo.value?.payType !== 1) {
|
|
|
+ try {
|
|
|
+ await useUserStore().getWxCommonPayment(priceInfo.value as wxpay)
|
|
|
+ }
|
|
|
+ catch {
|
|
|
+ // console.log(111)
|
|
|
+ useGlobalToast().show({ msg: '支付失败!请重试' })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <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>
|
|
|
+
|
|
|
+<style lang="scss" scoped></style>
|