bayi 2 years ago
parent
commit
d27c86f0ae

+ 2 - 3
components/videoPreview/index.less

@@ -43,7 +43,7 @@
         }
 
         .playNum {
-          margin: 4rpx 4rpx 0rpx 30rpx;
+          margin: 4rpx 4rpx 0rpx 20rpx;
           width: 30rpx;
           height: 30rpx;
         }
@@ -53,10 +53,9 @@
     .wH-right {
       display: flex;
       align-items: center;
-
       .wH-right-btn {
         text-align: center;
-        margin-right: 30rpx;
+        margin-left: 30rpx;
 
         .img {
           width: 27rpx;

+ 2 - 0
components/videoPreview/index.wxml

@@ -7,6 +7,8 @@
         <view class="nickname textOver">{{videoInfoCopy.user.nickName||videoInfoCopy.user.eid}}</view>
         <view class="time">{{videoInfoCopy.userRead.day}}
           <image src="/static/play3.png" class="playNum" /> {{filters.numFilter(videoInfo.userRead.playAmount)}}
+          <image src="/static/pf.png" class="playNum" />
+          <text style="color:#00C657">{{videoInfo.userRead.score>0?videoInfo.userRead.score:'0'}}分</text>
         </view>
       </view>
     </view>

+ 2 - 2
components/videoPreview/index.wxss

@@ -40,7 +40,7 @@
   color: rgba(0, 0, 0, 0.6);
 }
 .work .workHead .wH-left .wH-left-user .playNum {
-  margin: 4rpx 4rpx 0rpx 30rpx;
+  margin: 4rpx 4rpx 0rpx 20rpx;
   width: 30rpx;
   height: 30rpx;
 }
@@ -50,7 +50,7 @@
 }
 .work .workHead .wH-right .wH-right-btn {
   text-align: center;
-  margin-right: 30rpx;
+  margin-left: 30rpx;
 }
 .work .workHead .wH-right .wH-right-btn .img {
   width: 27rpx;

+ 15 - 6
pages/commodity/index.js

@@ -13,9 +13,6 @@ Page({
   onLoad(options) {
     this.getProducts()
   },
-  onShow() {
-
-  },
   async getProducts() {
     let products = await getProducts()
     console.log(products);
@@ -35,6 +32,7 @@ Page({
     this.setData({
       activationModal: false
     })
+    wx.navigateBack()
   },
   async toBuy() {
     wx.showLoading({
@@ -60,12 +58,13 @@ Page({
       signType,
       paySign,
       success: (res) => {
+        console.log(res);
         this.setData({
           activationModal: true
         })
-        setTimeout(() => {
-          this.setUserInfo()
-        }, 1500)
+        /*   setTimeout(() => {
+            this.setUserInfo()
+          }, 1500) */
       },
       fail(res) {
         wx.showToast({
@@ -76,4 +75,14 @@ Page({
       }
     })
   },
+  /* // 设置用户信息及vip状态
+  async setUserInfo() {
+    let userInfo = await getMyInfo()
+    let vipTime = await getVipInfo()
+    this.setUser(userInfo.user)
+    this.setData({
+      userInfo,
+      vipTime,
+    })
+  }, */
 })

+ 3 - 1
pages/commodity/index.wxml

@@ -39,7 +39,9 @@
   <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="{{selected.payType=='LIFELONG'?'http://reader-wx.ai160.com/images/reader/v3/learn/svip.png':'http://reader-wx.ai160.com/images/reader/v3/learn/vip.png'}}"
+        class="sLcon" />
       <image src="/static/lollipop.png" class="close" catchtap="closeModal" />
     </view>
   </view>

+ 1 - 1
pages/my/index.wxml

@@ -58,7 +58,7 @@
     </view>
   </view> -->
   <!-- 激活码 -->
-  <view class="activation" bindtap="activationCode" wx:if="{{!vipTime}}">
+  <view class="activation" bindtap="activationCode" wx:if="{{vipTime!='1'}}">
     <view class="tips">请输入学习卡激活码</view>
     <view class="subBtn">激活</view>
   </view>

+ 14 - 6
pages/reading/index.js

@@ -71,17 +71,15 @@ Page({
     activityId: '',
     isVip: false
   },
-  async onLoad(options) {
+  onLoad(options) {
     console.log(options);
     let videoId = options.videoId
     wx.setNavigationBarTitle({
       title: options.navBarTitle
     })
-    let isVip = await getVipInfo()
-    console.log(isVip);
     this.getreadInfo(videoId, options.reset).then(res => {
       wx.nextTick(() => {
-        if (options.voluntarily) {
+        if (options.voluntarily && this.data.isVip) {
           this.setCountDown()
         }
         if (options.autoPlay) {
@@ -94,7 +92,6 @@ Page({
       readingType: options.readingType || 'public',
       uploadHide: options.uploadHide,
       activityId: options.activityId || '',
-      isVip
     })
     // 手工绑定 
     this.storeBindings = createStoreBindings(this, {
@@ -189,6 +186,17 @@ Page({
       })
     })
   },
+  onShow() {
+    this.getVipInfo()
+  },
+  // 获取是否vip
+  async getVipInfo() {
+    let isVip = await getVipInfo()
+    console.log(isVip, '111');
+    this.setData({
+      isVip
+    })
+  },
   // 获取阅读内容
   getreadInfo(videoId, reset = false) {
     return new Promise(async (resolve, reject) => {
@@ -225,7 +233,7 @@ Page({
   },
   // 开始录制
   setCountDown() {
-    if (this.data.isVip) {
+    if (!this.data.isVip) {
       return wx.navigateTo({
         url: '/pages/commodity/index',
       })

+ 1 - 1
pages/reading/index.wxml

@@ -106,7 +106,7 @@
   <view class="controller">
     <!--     <image wx:else src="/static/work.png" class="playImg" bindtap="eeeeee" /> -->
     <view class="workBox">
-      <view class="vipLogo">VIP</view>
+      <view class="vipLogo" wx:if="{{!isVip}}">VIP</view>
       <image wx:if="{{state}}" src="/static/readingNow.gif" class="readingNow" bindtap="setCountDown" />
       <image wx:else src="/static/work.png" class="playImg" bindtap="setCountDown" />
     </view>

BIN
static/pf.png