Browse Source

开发活动限免

bayi 1 year ago
parent
commit
b1e7fda0b0
3 changed files with 8 additions and 11 deletions
  1. 1 1
      pages/match/index.js
  2. 6 9
      pages/reading/index.js
  3. 1 1
      pages/reading/index.wxml

+ 1 - 1
pages/match/index.js

@@ -102,7 +102,7 @@ Page({
         target
     }) {
         wx.navigateTo({
-            url: `/pages/reading/index?videoId=${target.dataset.id}&activityId=${this.data.activityId}&readingType=readMatch&autoPlay=true`
+            url: `/pages/reading/index?videoId=${target.dataset.id}&activityId=${this.data.activityId}&readingType=readMatch&autoPlay=true&free=true`
         })
     },
     jumpUserInfo({

+ 6 - 9
pages/reading/index.js

@@ -55,12 +55,12 @@ Page({
             num: 3,
         },
         contentH: 0,
+        percent: 0,
         scrollTop: 0,
         //如果readingReset为true就是重读
         readingReset: false,
         //readingType为public是普通阅读,为pk是pk逻辑,readMatch为朗读赛
         readingType: 'public',
-        percent: 0,
         uploadState: false,
         article: [],
         silderData: {
@@ -70,6 +70,8 @@ Page({
         },
         // 朗读赛的id
         activityId: '',
+        // 是否免费
+        free: false,
         isVip: false
     },
     onLoad(options) {
@@ -93,6 +95,7 @@ Page({
             readingType: options.readingType || 'public',
             uploadHide: options.uploadHide,
             activityId: options.activityId || '',
+            free: options.free || false
         })
         // 手工绑定 
         this.storeBindings = createStoreBindings(this, {
@@ -234,18 +237,12 @@ Page({
     },
     // 开始录制
     setCountDown() {
-        if (!this.data.isVip) {
+        if (!this.data.isVip && !this.data.free) {
             this.resetReading()
             return this.selectComponent('#buyVip').open({
                 isVip: this.data.isVip
             })
         }
-        /* let child = this.selectComponent('#readingTips').data
-        // 判断是否有权限朗读 不是vip并且没有朗读机会
-        const isVip = child.vipTime ? true : false
-        if (!isVip && child.userInfo.experienceAmount <= 0) {
-          return this.selectComponent('#readingTips').showModal();
-        } */
         if (this.data.state) {
             this.resetReading()
             return
@@ -413,7 +410,7 @@ Page({
         })
         if (this.data.readingType == 'public' || this.data.readingType == 'readMatch') {
             wx.navigateTo({
-                url: `/pages/score/index?readingType=${this.data.readingType}&activityId=${this.data.activityId}`,
+                url: `/pages/score/index?readingType=${this.data.readingType}&activityId=${this.data.activityId}&free=${this.data.free}`,
                 events: {
                     // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                     goback: (data) => {

+ 1 - 1
pages/reading/index.wxml

@@ -114,7 +114,7 @@
     <view class="controller">
         <!--     <image wx:else src="/static/work.png" class="playImg" bindtap="eeeeee" /> -->
         <view class="workBox">
-            <view class="vipLogo" wx:if="{{!isVip}}">VIP</view>
+            <view class="vipLogo" wx:if="{{!isVip}}">{{!free?'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>