Commit 17957b0b authored by mengcuiguang's avatar mengcuiguang

添加抖音支付

parent a91d7f3b
......@@ -154,22 +154,36 @@
handlePay() {
let that = this;
let vipBean = this.vipList[this.selectedIndex];
let myPayChannel = 'WEIXIN'
// #ifdef MP-TOUTIAO
myPayChannel = 'TT'
// 快手支付
// #ifdef MP-KUAISHOU
// #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
// 微信虚拟支付
// #ifdef MP-WEIXIN
this.post({
url: '/vip/getVipPayParams/xpay',
data: {
vedioId: that.point <= 0 ? null : that.vedioId,
pid: vipBean.pid,
payChannel: myPayChannel
pid: vipBean.pid
},
showLoading: true,
success: ({
......@@ -178,6 +192,30 @@
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) {
let wxParams = wxData.params;
......@@ -190,7 +228,7 @@
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
that.paySuccess(largeType);
that.queryOrderStatus(largeType, wxData.tid)
},
fail(res) {}
})
......@@ -204,17 +242,6 @@
if (this.compareVersion(SDKVersion, '2.19.2') >= 0 || wx.canIUse('requestVirtualPayment')) {
wx.requestVirtualPayment({
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,
signature: wxParams.signature,
mode: wxParams.mode,
......@@ -226,8 +253,7 @@
errMsg,
errCode
}) {
// message.notify(errMsg);
// console.log('虚拟支付异常:errMsg=' + errMsg + ' errCode=' + errCode);
message.notify(errMsg);
},
})
} 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