Commit 17957b0b authored by mengcuiguang's avatar mengcuiguang

添加抖音支付

parent a91d7f3b
...@@ -154,22 +154,36 @@ ...@@ -154,22 +154,36 @@
handlePay() { handlePay() {
let that = this; let that = this;
let vipBean = this.vipList[this.selectedIndex]; let vipBean = this.vipList[this.selectedIndex];
let myPayChannel = 'WEIXIN'
// #ifdef MP-TOUTIAO // 快手支付
myPayChannel = 'TT' // #ifdef MP-KUAISHOU
// #endif // #endif
// #ifdef MP-WEIXIN // 抖音支付
myPayChannel = 'WEIXIN' // #ifdef MP-TOUTIAO
this.post({
url: '/vip/getVipPayParams/xdouyin',
data: {
vedioId: that.point <= 0 ? null : that.vedioId,
pid: vipBean.pid
},
showLoading: true,
success: ({
data
}) => {
that.ttPay(data, vipBean.largeType);
}
});
// #endif // #endif
// 微信虚拟支付
// #ifdef MP-WEIXIN
this.post({ this.post({
url: '/vip/getVipPayParams/xpay', url: '/vip/getVipPayParams/xpay',
data: { data: {
vedioId: that.point <= 0 ? null : that.vedioId, vedioId: that.point <= 0 ? null : that.vedioId,
pid: vipBean.pid, pid: vipBean.pid
payChannel: myPayChannel
}, },
showLoading: true, showLoading: true,
success: ({ success: ({
...@@ -178,6 +192,30 @@ ...@@ -178,6 +192,30 @@
that.wxVirtuallyPay(data, vipBean.largeType); that.wxVirtuallyPay(data, vipBean.largeType);
} }
}); });
// #endif
},
ttPay(ttData, largeType) {
let that = this;
tt.pay({
orderInfo: {
order_id: ttData.order_id,
order_token: ttData.order_token,
},
service: 5,
success(res) {
if (res.code == 0) {
// 拉取服务器,是否支付成功
that.queryOrderStatus(largeType, ttData.tid)
}else{
message.notify('支付异常');
}
},
fail(res) {
message.notify(res.errMsg);
},
});
}, },
wxPay(wxData, largeType) { wxPay(wxData, largeType) {
let wxParams = wxData.params; let wxParams = wxData.params;
...@@ -190,7 +228,7 @@ ...@@ -190,7 +228,7 @@
signType: wxParams.signType, signType: wxParams.signType,
paySign: wxParams.paySign, paySign: wxParams.paySign,
success(res) { success(res) {
that.paySuccess(largeType); that.queryOrderStatus(largeType, wxData.tid)
}, },
fail(res) {} fail(res) {}
}) })
...@@ -204,17 +242,6 @@ ...@@ -204,17 +242,6 @@
if (this.compareVersion(SDKVersion, '2.19.2') >= 0 || wx.canIUse('requestVirtualPayment')) { if (this.compareVersion(SDKVersion, '2.19.2') >= 0 || wx.canIUse('requestVirtualPayment')) {
wx.requestVirtualPayment({ wx.requestVirtualPayment({
signData: JSON.stringify(wxData.params.sigData), signData: JSON.stringify(wxData.params.sigData),
// signData: JSON.stringify({
// offerId: signDataParams.offerId,
// buyQuantity: signDataParams.buyQuantity,
// env: signDataParams.env,
// currencyType: signDataParams.currencyType,
// platform: signDataParams.platform,
// productId: signDataParams.productId,
// goodsPrice: signDataParams.goodsPrice,
// outTradeNo: signDataParams.outTradeNo,
// attach: signDataParams.attach,
// }),
paySig: wxParams.paySig, paySig: wxParams.paySig,
signature: wxParams.signature, signature: wxParams.signature,
mode: wxParams.mode, mode: wxParams.mode,
...@@ -226,8 +253,7 @@ ...@@ -226,8 +253,7 @@
errMsg, errMsg,
errCode errCode
}) { }) {
// message.notify(errMsg); message.notify(errMsg);
// console.log('虚拟支付异常:errMsg=' + errMsg + ' errCode=' + errCode);
}, },
}) })
} else { } else {
......
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