Commit 61e244eb authored by mengcuiguang's avatar mengcuiguang

支付弹窗添加首充逻辑

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