Commit ccc79a3d authored by mengcuiguang's avatar mengcuiguang

代码优化

parent d78b06dd
<template> <template>
<view> <view>
<uni-popup :type="popType" ref="coinPop" :maskClick="false" :isMaskClick="false"> <uni-popup :type="popType" ref="coinPop" :maskClick="false" :isMaskClick="false">
<view class="body" style="margin-top: 500rpx;border-radius: 10rpx;"> <view class="body" style="margin-top: 500rpx;border-radius: 10rpx;width: 100%;height: 100%;">
<scroll-view scroll-y> <scroll-view scroll-y>
<view style="display: flex;flex-direction: column;align-items: flex-end;"> <view style="display: flex;flex-direction: column;align-items: flex-end;">
<image @click="handleClose" <image @click="handleClose"
...@@ -114,7 +114,9 @@ ...@@ -114,7 +114,9 @@
}, },
handleShow() { handleShow() {
let that = this; let that = this;
that.post({ that.post({
url: '/vip/getVipProducts/point', url: '/vip/getVipProducts/point',
data: { data: {
...@@ -125,7 +127,9 @@ ...@@ -125,7 +127,9 @@
data data
}) => { }) => {
that.isFirstPayFlag = data.forFirst; that.isFirstPayFlag = data.forFirst;
if (data.list != null && data.list.length > 0) { if (data.list != null && data.list.length > 0) {
that.vipList=[];
that.firstPayList=[];
if (that.isFirstPayFlag != null && that.isFirstPayFlag) { if (that.isFirstPayFlag != null && that.isFirstPayFlag) {
// 符合首充 // 符合首充
var tempFirstPayFlag = false; var tempFirstPayFlag = false;
...@@ -144,7 +148,8 @@ ...@@ -144,7 +148,8 @@
that.title = that.firstCash + ' 元自动解锁后续剧集'; that.title = that.firstCash + ' 元自动解锁后续剧集';
that.showPop('top') that.showPop('top')
that.handlePay() that.handlePay()
} else { } else {
that.showPop('bottom')
that.vipList = data.list; 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++) {
...@@ -169,7 +174,7 @@ ...@@ -169,7 +174,7 @@
}); });
}, },
handleClose() { handleClose() {
this.$refs.coinPop.close('bottom'); this.$refs.coinPop.close(this.popType);
this.$emit('close'); this.$emit('close');
}, },
choosePack(item, index) { choosePack(item, index) {
...@@ -282,7 +287,8 @@ ...@@ -282,7 +287,8 @@
}, },
watch: { watch: {
show: { show: {
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal) { if (newVal) {
this.handleShow(); this.handleShow();
} }
......
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