Commit 61e244eb authored by mengcuiguang's avatar mengcuiguang

支付弹窗添加首充逻辑

parent 5b46416b
......@@ -9,7 +9,7 @@
src="@/static/index/ic_quit_white.png"></image>
</view>
<view style="display: flex;flex-direction: column;align-items: center;margin-bottom: 20rpx;">
<view style="font-size: 38rpx;color: black;">超多精彩好剧一键解锁</view>
<view style="font-size: 38rpx;color: black;">{{title}}</view>
<view class="flex">
<view v-if="point>0" style="display: flex;flex-direction: row;margin-top: 10rpx;">
<view style="font-size: 28rpx;color: #644238;margin-top: 12rpx;">解锁本集:</view>
......@@ -26,7 +26,7 @@
</view>
</view>
</view>
<view class="section">
<view class="section" v-if="!isFirstPayFlag">
<view class="pack-box">
<view class="pack-item"
:style="item.largeType !=='vip' ?'background: #f5f5f5;':'background: #f4c98b;'"
......@@ -96,8 +96,10 @@
return {
vipList: [],
selectedIndex: 0,
title: '超多精彩好剧一键解锁',
userBean: {},
showClone: false
showClone: false,
isFirstPayFlag: false
};
},
methods: {
......@@ -110,7 +112,7 @@
let that = this;
this.$refs.coinPop.open('bottom');
this.post({
that.post({
url: '/vip/getVipProducts/point',
data: {
vedioId: that.point <= 0 ? null : that.vedioId
......@@ -119,13 +121,21 @@
success: ({
data
}) => {
this.vipList = data.list;
that.vipList = data.list;
that.isFirstPayFlag = data.forFirst;
if (data.list != null) {
// this.selectedIndex = data.list[0].activityType;
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) {
this.selectedIndex = i;
break;
if (that.isFirstPayFlag != null && that.isFirstPayFlag) {
that.firstCash = data.list[0].firstPayPrice;
that.title = that.firstCash + ' 元自动解锁后续剧集';
// 符合首充
that.handlePay()
} else {
that.title = '超多精彩好剧一键解锁';
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) {
that.selectedIndex = i;
break;
}
}
}
}
......@@ -170,22 +180,6 @@
}
});
},
wxPay(wxData, largeType) {
let wxParams = wxData.params;
let that = this;
// 发起微信支付
wx.requestPayment({
timeStamp: wxParams.timeStamp,
nonceStr: wxParams.nonceStr,
package: wxParams.packageStr,
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
that.paySuccess(largeType);
},
fail(res) {}
})
},
wxVirtuallyPay(wxData, largeType) {
// 虚拟支付
let wxParams = wxData.params;
......@@ -195,17 +189,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,
......@@ -217,8 +200,12 @@
errMsg,
errCode
}) {
// message.notify(errMsg);
// console.log('虚拟支付异常:errMsg=' + errMsg + ' errCode=' + errCode);
if (that.isFirstPayFlag && errCode == -2) {
// 符合首充
that.handleClose()
} else {
// message.notify(errMsg);
}
},
})
} else {
......@@ -226,10 +213,6 @@
}
},
queryOrderStatus(largeType, tid) {
// setTimeout(() => {
// }, 5000);
let that = this;
this.post({
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