|
|
@@ -7,9 +7,13 @@ definePage({ name: 'smqjh-threePay', islogin: false, style: { navigationBarTitle
|
|
|
const { token } = storeToRefs(useUserStore())
|
|
|
const { tenantCode } = storeToRefs(useSysStore())
|
|
|
const orderNumber = ref()
|
|
|
+const model = ref('mixture')
|
|
|
onLoad((options: any) => {
|
|
|
orderNumber.value = options.orderNumber
|
|
|
tenantCode.value = options.tenantCode
|
|
|
+ if (options.model) {
|
|
|
+ model.value = options.model
|
|
|
+ }
|
|
|
token.value = ''
|
|
|
handleLogin(options.phone)
|
|
|
console.log(options, '============options=======')
|
|
|
@@ -40,9 +44,22 @@ function handleLogin(phoneCode: string) {
|
|
|
}
|
|
|
|
|
|
async function handlePay() {
|
|
|
- const res = await useUserStore().handleCommonPayMent(orderNumber.value)
|
|
|
- priceInfo.value = res
|
|
|
- console.log(priceInfo.value, '=========================')
|
|
|
+ console.log(model.value, '========model.value=============')
|
|
|
+
|
|
|
+ if (model.value === 'wx') {
|
|
|
+ const payRes = await Apis.charge.wxJsApiPay({
|
|
|
+ data: {
|
|
|
+ orderNumber: orderNumber.value,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ priceInfo.value = payRes.data
|
|
|
+ await useUserStore().getWxCommonPayment(payRes.data)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ const res = await useUserStore().handleCommonPayMent(orderNumber.value)
|
|
|
+ priceInfo.value = res
|
|
|
+ // console.log(priceInfo.value, '=============priceInfo.value============')
|
|
|
+ }
|
|
|
}
|
|
|
async function handleGoPay() {
|
|
|
if (priceInfo.value?.payType !== 1) {
|