瀏覽代碼

联调购买vip

bayi 1 年之前
父節點
當前提交
91adecdc22

+ 3 - 10
pages/commodity/index.js

@@ -31,11 +31,6 @@ Page({
       selected: currentTarget.dataset.product
     })
   },
-  activation() {
-    this.setData({
-      activationModal: true
-    })
-  },
   closeModal() {
     this.setData({
       activationModal: false
@@ -51,7 +46,6 @@ Page({
     }).finally(() => {
       wx.hideLoading()
     })
-    console.log(res);
     let {
       timeStamp,
       nonceStr,
@@ -65,10 +59,9 @@ Page({
       package: res.package,
       signType,
       paySign,
-      success(res) {
-        wx.showToast({
-          title: "支付成功",
-          duration: 2500
+      success: (res) => {
+        this.setData({
+          activationModal: true
         })
         setTimeout(() => {
           this.setUserInfo()

+ 14 - 0
pages/commodity/index.less

@@ -137,6 +137,20 @@
     height: 100vh;
     background: rgba(0, 0, 0, 0.7);
 
+    .bg {
+      position: absolute;
+      width: 100%;
+      height: 200rpx;
+      z-index: -1;
+      border-radius: 0 0 100rpx 100rpx;
+      background-image: linear-gradient(132deg, #FFF4DB 14%, #FFF4DB 62%, #FEE5B5 100%);
+      font-size: 40rpx;
+      font-weight: bold;
+      padding-top: 60rpx;
+      box-sizing: border-box;
+      text-align: center;
+    }
+
     .box {
       position: absolute;
       left: 0;

+ 1 - 0
pages/commodity/index.wxml

@@ -38,6 +38,7 @@
   </view>
   <view class="activationModal" wx:if="{{activationModal}}">
     <view class="box zoomIn">
+      <view class="bg">您已成功获取</view>
       <image src="http://reader-wx.ai160.com/images/reader/v3/learn/svip.png" class="sLcon" />
       <image src="/static/lollipop.png" class="close" catchtap="closeModal" />
     </view>

+ 13 - 0
pages/commodity/index.wxss

@@ -117,6 +117,19 @@
   height: 100vh;
   background: rgba(0, 0, 0, 0.7);
 }
+.commodity .activationModal .bg {
+  position: absolute;
+  width: 100%;
+  height: 200rpx;
+  z-index: -1;
+  border-radius: 0 0 100rpx 100rpx;
+  background-image: linear-gradient(132deg, #FFF4DB 14%, #FFF4DB 62%, #FEE5B5 100%);
+  font-size: 40rpx;
+  font-weight: bold;
+  padding-top: 60rpx;
+  box-sizing: border-box;
+  text-align: center;
+}
 .commodity .activationModal .box {
   position: absolute;
   left: 0;

+ 1 - 1
pages/my/index.js

@@ -41,7 +41,7 @@ Page({
       this.setUserInfo()
     }
   },
-  // 设置用户信息及vip状态和任务完成情况
+  // 设置用户信息及vip状态
   async setUserInfo() {
     let userInfo = await getMyInfo()
     let vipTime = await getVipInfo()

+ 0 - 9
pages/my/index.less

@@ -128,15 +128,6 @@
       margin: 0;
     }
   }
-
-  .iosVip {
-    margin: 4rpx 0px 0px 6rpx;
-    font-size: 24rpx;
-    color: #333;
-  }
-
-
-
   .medalBox {
     margin: 30rpx 0rpx;
     padding: 20rpx 30rpx;

+ 4 - 5
pages/my/index.wxml

@@ -45,10 +45,6 @@
       </button>
     </view>
   </view>
-  <!-- ios会员展示到期时间 -->
-  <view class="iosVip" wx:if="{{isIos&&vipTime}}">
-    会员至:{{filters.formatDate(vipTime,4)}}
-  </view>
   <!-- 勋章 -->
   <!--   <view class="medalBox">
     <view class="header">
@@ -62,7 +58,7 @@
     </view>
   </view> -->
   <!-- 激活码 -->
-  <view class="activation" bindtap="activationCode">
+  <view class="activation" bindtap="activationCode" wx:if="{{!vipTime}}">
     <view class="tips">请输入学习卡激活码</view>
     <view class="subBtn">激活</view>
   </view>
@@ -76,6 +72,9 @@
   </view>
   <view class="payBox">
     <view class="copywriting" wx:if="{{!vipTime}}">开通<text>SVIP</text>/<text>VIP</text> 会员权益</view>
+    <view class="copywriting" wx:if="{{vipTime}}">
+      {{vipTime==1?'终身使用':filters.formatDate(vipTime,4)}}
+    </view>
     <view class="goPay" bindtap='jump' data-url="/pages/commodity/index" wx:if="{{!vipTime}}">
       立即开通
     </view>

+ 0 - 5
pages/my/index.wxss

@@ -109,11 +109,6 @@
   line-height: normal;
   margin: 0;
 }
-.container .iosVip {
-  margin: 4rpx 0px 0px 6rpx;
-  font-size: 24rpx;
-  color: #333;
-}
 .container .medalBox {
   margin: 30rpx 0rpx;
   padding: 20rpx 30rpx;