|
|
@ -2,7 +2,7 @@
|
|
|
|
* @Author: ch
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2022-07-08 11:46:30
|
|
|
|
* @Date: 2022-07-08 11:46:30
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-07-12 14:53:15
|
|
|
|
* @LastEditTime: 2022-07-12 15:07:16
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
@ -36,7 +36,7 @@ const ENV = process.env;
|
|
|
|
payType : 'wxpay',
|
|
|
|
payType : 'wxpay',
|
|
|
|
orderInfo : {},
|
|
|
|
orderInfo : {},
|
|
|
|
payOrderNo : this.$route.query.payOrderNo,
|
|
|
|
payOrderNo : this.$route.query.payOrderNo,
|
|
|
|
openId : localStorage.getItem('payOpenId'),
|
|
|
|
openId : null,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed:{
|
|
|
|
computed:{
|
|
|
@ -73,6 +73,7 @@ const ENV = process.env;
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pay(){
|
|
|
|
pay(){
|
|
|
|
|
|
|
|
this.openId = uni.getStorage({key:'payOpenId'});
|
|
|
|
if(this.payType === 'wxpay'){
|
|
|
|
if(this.payType === 'wxpay'){
|
|
|
|
if(this.openId && WeixinJSBridge){
|
|
|
|
if(this.openId && WeixinJSBridge){
|
|
|
|
this.wxJsapiPay()
|
|
|
|
this.wxJsapiPay()
|
|
|
@ -129,16 +130,22 @@ const ENV = process.env;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getPayData(payCode){
|
|
|
|
async getPayData(payCode){
|
|
|
|
const {error, result} = await ApiPostH5Pay({
|
|
|
|
let par = {
|
|
|
|
payOrderNo : this.orderInfo.payOrderNo,
|
|
|
|
payOrderNo : this.orderInfo.payOrderNo,
|
|
|
|
payCode,
|
|
|
|
payCode
|
|
|
|
channelUser : payCode === 'WX_JSAPI' ? this.openId : null,
|
|
|
|
}
|
|
|
|
appCode : this.orderInfo.prepayAliApp.prepayAppCode
|
|
|
|
if(['WX_JSAPI','WX_H5'].includes(payCode)){
|
|
|
|
});
|
|
|
|
par.appCode = this.orderInfo.prepayWxApp.prepayAppCode
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
par.appCode = this.orderInfo.prepayAliApp.prepayAppCode
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(payCode === 'WX_JSAPI'){
|
|
|
|
|
|
|
|
par.channelUser = this.openId
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const {error, result} = await ApiPostH5Pay(par);
|
|
|
|
if(error){
|
|
|
|
if(error){
|
|
|
|
uni._$toast(error.message);
|
|
|
|
uni._$toast(error.message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {error, result};
|
|
|
|
return {error, result};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|