bayi 1 年之前
父節點
當前提交
6539f7e452

+ 1 - 2
components/vipModal/index.js

@@ -40,7 +40,7 @@ Component({
             this.setData({
                 show: false
             })
-            if (typeof this.getTabBar === 'function') {
+            if (typeof this.getTabBar === 'function' && this.getTabBar()) {
                 this.getTabBar().setData({
                     mask: false
                 })
@@ -48,7 +48,6 @@ Component({
         },
         async getVipInfo() {
             let vipTime = await getVipInfo()
-            console.log(vipTime);
             this.setData({
                 vipTime
             })

+ 3 - 2
pages/my/index.less

@@ -201,7 +201,7 @@
         width: 710rpx;
         height: 224rpx;
         border-radius: 20rpx;
-        background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-1.png);
+        background: url(http://reader-wx.ai160.com/images/reader/v3/learn/SVIPpop.png);
         background-size: cover;
         -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
 
@@ -217,8 +217,9 @@
             letter-spacing: 2rpx;
         }
     }
+
     .payBox2 {
-        background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-2.png);
+        background: url(http://reader-wx.ai160.com/images/reader/v3/learn/VIPpop.png);
         background-size: cover;
     }
 

+ 2 - 2
pages/my/index.wxss

@@ -169,7 +169,7 @@
   width: 710rpx;
   height: 224rpx;
   border-radius: 20rpx;
-  background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-1.png);
+  background: url(http://reader-wx.ai160.com/images/reader/v3/learn/SVIPpop.png);
   background-size: cover;
   -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
 }
@@ -185,7 +185,7 @@
   letter-spacing: 2rpx;
 }
 .container .payBox2 {
-  background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-2.png);
+  background: url(http://reader-wx.ai160.com/images/reader/v3/learn/VIPpop.png);
   background-size: cover;
 }
 .container .renewBox {

+ 6 - 7
pages/reading/buyVip/index.js

@@ -15,22 +15,19 @@ Component({
      */
     data: {
         show: false,
-        vipTime: '',
-        products: []
+        products: [],
+        // 是否购买过vip
+        isPreferential: false
     },
 
     /**
      * 组件的方法列表
      */
     methods: {
-        open({
-            vipTime
-        }) {
-            console.log(vipTime);
+        open() {
             this.getProducts()
             this.setData({
                 show: true,
-                vipTime
             })
         },
         closeModal() {
@@ -40,10 +37,12 @@ Component({
         },
         async getProducts() {
             let {
+                isPreferential,
                 productList: products,
             } = await getProducts()
             this.setData({
                 products,
+                isPreferential
             })
         },
         triggerPay({

+ 5 - 0
pages/reading/buyVip/index.less

@@ -62,6 +62,11 @@
             -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
         }
 
+        .payBox3 {
+            background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-2.png);
+            background-size: cover;
+            -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
+        }
     }
 
     .close {

+ 16 - 3
pages/reading/buyVip/index.wxml

@@ -1,10 +1,14 @@
 <view class="buyVip" wx:if="{{show}}">
     <view class="modal">
-        <view class="header">
+        <view class="header" wx:if="{{!isPreferential}}">
             <view class="h1">您还不是VIP会员</view>
-            <view>选择下面的会员卡开通后使用</view>
+            <view>选择下面的会员卡开通后使用</view>
         </view>
-        <view wx:if="{{!vipTime}}">
+        <view class="header" wx:else>
+            <view class="h1">您的VIP会员已到期</view>
+            <view>请续费后使用</view>
+        </view>
+        <view wx:if="{{!isPreferential}}">
             <view class="payBox" bindtap="triggerPay" data-goods="{{products[0]}}">
             </view>
             <view class="payBox payBox2" bindtap="triggerPay" data-goods="{{products[1]}}">
@@ -15,6 +19,15 @@
                 </view> -->
             </view>
         </view>
+        <view wx:else>
+            <view class="payBox payBox3" bindtap="triggerPay" data-goods="{{products[1]}}">
+                <!--    <view class="buyBtn" bindtap="toBuy" data-id="{{products[1].id}}" wx:if="{{!vipTime}}">立即开通
+                </view>
+                <view class="buyBtn" style="font-size: 22rpx;" wx:else>
+                    有效期:{{filters.formatDate(vipTime,5)}}
+                </view> -->
+            </view>
+        </view>
     </view>
     <image src="/static/lollipop.png" class="close" catchtap="closeModal" />
 </view>

+ 5 - 0
pages/reading/buyVip/index.wxss

@@ -57,6 +57,11 @@
   background-size: cover;
   -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
 }
+.buyVip .modal .payBox3 {
+  background: url(http://reader-wx.ai160.com/images/reader/v3/learn/2-2.png);
+  background-size: cover;
+  -webkit-box-reflect: below 2rpx linear-gradient(to bottom, transparent 92%, rgba(0, 0, 0, 0.3));
+}
 .buyVip .close {
   display: block;
   margin: 0 auto;

+ 2 - 2
pages/reading/index.js

@@ -238,7 +238,7 @@ Page({
         if (!this.data.isVip) {
             this.resetReading()
             return this.selectComponent('#buyVip').open({
-                vipTime: this.data.isVip
+                isVip: this.data.isVip
             })
         }
         /* let child = this.selectComponent('#readingTips').data
@@ -695,7 +695,7 @@ Page({
             signType,
             paySign,
             success: (res) => {
-                this.selectComponent('#buyVip').close()
+                this.selectComponent('#buyVip').closeModal()
                 this.selectComponent('#vipModal').open({
                     type: detail.payType == 'LIFELONG' ? 'sip' : 'vip'
                 })