Commit 623f381f authored by IvyXia123's avatar IvyXia123

支付

parent 23b8e891
......@@ -380,58 +380,17 @@ export default {
let payTypeArr = ['WX', 'ALI', 'KFQ']
let data = { pay_type: payTypeArr[this.payIndex], return_url: window.location.href, goods_id: json.goods_id, buy_type: this.groupDetail.goods_type, group_order_id: json.group_order_id, order_coupon_id:json.order_coupon_id }
/*postPayBillApi(data).then(res => {
postPayBillApi(data).then(res => {
if(this.payIndex === 0) {
this.orderNo = res.out_trade_no;
if (res.out_trade_no && !res.appId) {
console.log(9999)
getCourseInfoApi().then(res => {
this.userCourse = res;
localStorage.setItem(
"userCourse",
JSON.stringify(this.userCourse)
);
this.navPage(res);
});
} else {
console.log(8888)
let that = this;
this.orderNo = res.out_trade_no;
this.jsApiParameters = res;
wx.miniProgram.getEnv(function(res) {
if (res.miniprogram) {
let payParam = encodeURIComponent(JSON.stringify(json));
wx.miniProgram.navigateTo({
url: `pages/wxPay/main?payParam=${payParam}`
});
} else if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
that.jsApiCall,
false
);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", that.jsApiCall);
document.attachEvent(
"onWeixinJSBridgeReady",
that.jsApiCall
);
}
} else {
that.jsApiCall();
}
});
}
window.location.href = res.pay_url;
}else if(this.payIndex === 1){
this.payUrl = res.pay_url;
}else if(this.payIndex === 2) {
this.payUrl = res.pay_url;
}
})*/
})
payApi(json).then(res => {
/*payApi(json).then(res => {
this.orderNo = res.out_trade_no;
console.log(res)
if (res.out_trade_no && !res.appId) {
......@@ -476,7 +435,7 @@ export default {
.catch(res => {
// alert(res)
this.orderFlag = true;
});
});*/
}
},
closeAdd(data) {
......
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