Commit 7fbf069f by sunchao

微信支付

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