Commit c3260a91 authored by mengcuiguang's avatar mengcuiguang

首充逻辑优化

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