Commit c3260a91 authored by mengcuiguang's avatar mengcuiguang

首充逻辑优化

parent 1c213f02
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
:class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList' :key='index' :class="[{active: index==selectedIndex}]" v-for='(item, index) in vipList' :key='index'
@click="choosePack(item, index)"> @click="choosePack(item, index)">
<view style="display: flex;flex-direction: column;align-items: center;"> <view style="display: flex;flex-direction: column;align-items: center;">
<view class="price row"> <view class="price row">
{{item.firstPayPrice}} {{item.firstPayPrice}}
</view> </view>
...@@ -59,8 +58,6 @@ ...@@ -59,8 +58,6 @@
</view> </view>
</view> </view>
<view v-if="isTimeoutPayFlag" style="width: 100%;height: 700rpx;background-color: white;"></view>
<view style="display: flex;flex-direction: column;align-items: center;"> <view style="display: flex;flex-direction: column;align-items: center;">
<view style="font-size: 24rpx;color: gray;margin-top: 16rpx;margin-bottom: 18rpx;"> <view style="font-size: 24rpx;color: gray;margin-top: 16rpx;margin-bottom: 18rpx;">
订单中如有疑问,请在个人中心联系客服</view> 订单中如有疑问,请在个人中心联系客服</view>
...@@ -96,13 +93,11 @@ ...@@ -96,13 +93,11 @@
data() { data() {
return { return {
vipList: [], vipList: [],
screenH: 700, firstPayList: [],
selectedIndex: 0, selectedIndex: 0,
title: '超多精彩好剧一键解锁', title: '超多精彩好剧一键解锁',
userBean: {}, userBean: {},
showClone: false, isFirstPayFlag: false
isFirstPayFlag: false,
isTimeoutPayFlag: false
}; };
}, },
methods: { methods: {
...@@ -112,8 +107,6 @@ ...@@ -112,8 +107,6 @@
this.handleClose(); this.handleClose();
}, },
handleShow() { handleShow() {
this.screenH = uni.getSystemInfoSync().screenHeight;
let that = this; let that = this;
this.$refs.coinPop.open('bottom'); this.$refs.coinPop.open('bottom');
...@@ -126,15 +119,25 @@ ...@@ -126,15 +119,25 @@
success: ({ success: ({
data data
}) => { }) => {
that.vipList = data.list;
that.isFirstPayFlag = data.forFirst; that.isFirstPayFlag = data.forFirst;
if (data.list != null) { if (data.list != null && data.list.length > 0) {
if (that.isFirstPayFlag != null && that.isFirstPayFlag) { if (that.isFirstPayFlag != null && that.isFirstPayFlag) {
// 符合首充
var tempFirstPayFlag = false;
for (let i = 0; i < data.list.length; i++) {
if (data.list[i].forFirst == 1 && !tempFirstPayFlag) {
// 首充
tempFirstPayFlag = true;
that.firstPayList.push(data.list[i]);
} else {
that.vipList.push(data.list[i]);
}
}
that.firstCash = data.list[0].firstPayPrice; that.firstCash = data.list[0].firstPayPrice;
that.title = that.firstCash + ' 元自动解锁后续剧集'; that.title = that.firstCash + ' 元自动解锁后续剧集';
// 符合首充
that.handlePay() that.handlePay()
} else { } else {
that.vipList = data.list;
that.title = '超多精彩好剧一键解锁'; that.title = '超多精彩好剧一键解锁';
for (let i = 0; i < data.list.length; i++) { for (let i = 0; i < data.list.length; i++) {
if (data.list[i].activityType == 1) { if (data.list[i].activityType == 1) {
...@@ -160,7 +163,6 @@ ...@@ -160,7 +163,6 @@
handleClose() { handleClose() {
this.$refs.coinPop.close('bottom'); this.$refs.coinPop.close('bottom');
this.$emit('close'); this.$emit('close');
this.isTimeoutPayFlag=false;
}, },
choosePack(item, index) { choosePack(item, index) {
this.selectedIndex = index; this.selectedIndex = index;
...@@ -169,7 +171,11 @@ ...@@ -169,7 +171,11 @@
}, },
handlePay() { handlePay() {
let that = this; let that = this;
let vipBean = this.vipList[this.selectedIndex]; var vipBean = this.vipList[this.selectedIndex];
if (this.isFirstPayFlag != null && this.isFirstPayFlag && this.firstPayList.length > 0) {
// 符合首充
vipBean = this.firstPayList[0];
}
this.post({ this.post({
url: '/vip/getVipPayParams/xpay', url: '/vip/getVipPayParams/xpay',
...@@ -193,12 +199,6 @@ ...@@ -193,12 +199,6 @@
let that = this; let that = this;
const SDKVersion = wx.getSystemInfoSync().SDKVersion; const SDKVersion = wx.getSystemInfoSync().SDKVersion;
if (this.compareVersion(SDKVersion, '2.19.2') >= 0 || wx.canIUse('requestVirtualPayment')) { if (this.compareVersion(SDKVersion, '2.19.2') >= 0 || wx.canIUse('requestVirtualPayment')) {
if (that.isFirstPayFlag) {
setTimeout(() => {
that.isTimeoutPayFlag = true;
}, 1800);
}
wx.requestVirtualPayment({ wx.requestVirtualPayment({
signData: JSON.stringify(wxData.params.sigData), signData: JSON.stringify(wxData.params.sigData),
paySig: wxParams.paySig, paySig: wxParams.paySig,
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
}, },
methods: { methods: {
show() { show() {
this.os = wx.getSystemInfoSync().platform; // this.os = wx.getSystemInfoSync().platform;
this.windowHeight = uni.getSystemInfoSync().windowHeight this.windowHeight = uni.getSystemInfoSync().windowHeight
// loadData() { // loadData() {
this.post({ this.post({
......
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