Commit 7fbf069f by sunchao

微信支付

parent 8f6a8577
......@@ -346,5 +346,9 @@ export default {
// 子女教育测算
educationEstimate(params){
return request(`${baseURL}/api/sfp/calcuteUtil/educationEstimate`, "POST", params)
},
//微信认证
wxAuthorize(params){
return request(`${baseURL}/api/pay/wxAuthorize`, "POST", params)
}
}
......@@ -206,7 +206,9 @@
paymentMethod:this.paymentMethod,
userId:this.userId,
integralExchange:this.isDeduction == true ? parseFloat(this.deductionCore) : 0,
paymentType:''
paymentType:'',
isPayOrAuth:'',
fileId:this.fileId
}
if(this.paymentMethod==1){
// APP:微信app支付
......@@ -221,29 +223,16 @@
param.paymentType = 2;
//deviceType:PC为1,移动端为2,微信为3
if(this.deviceType == 3){
//微信h5支付
uni.login({
provider: 'weixin',
success: function (loginRes) {
console.log(loginRes)
// 登录成功
uni.getUserInfo({
provider: 'weixin',
success: function(info) {
alert(JSON.stringify(info))
param.openId=info.openId;
}
})
},
fail: function (err) {
// 登录授权失败
// err.code是错误码
}
});
param.isPayOrAuth = 1;
api.wxAuthorize(param).then((res)=>{
if(res['success']){
window.location.href = res['data']['paymentForm']['action'];
}
})
}else{
//微信二维码支付
}
// #endif
......@@ -401,6 +390,9 @@
this.courseDetail();
this.queryByUserIdFortuneStatistic()
this.deviceType = common.checkDeviceType();
if(this.deviceType == 3){
this.paymentMethod = 1;
}
this.isRedirect = option.isRedirect;
if(this.isRedirect == 1){
if(option.amount){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment