bayi %!s(int64=2) %!d(string=hai) anos
pai
achega
f43baafd2d

+ 19 - 1
pages/childClassify/index.js

@@ -3,6 +3,13 @@ import {
   searchWorks
 } from '~/api/works'
 import reachBottom from '~/mixins/reachBottom'
+import {
+  createStoreBindings
+} from 'mobx-miniprogram-bindings'
+import {
+  store
+} from '~/store/index'
+let storeBindings
 Page({
   behaviors: [reachBottom],
   data: {
@@ -37,6 +44,14 @@ Page({
     this.setData({
       type: options.type,
     })
+    this.storeBindings = createStoreBindings(this, {
+      store,
+      fields: {
+        userInfo: 'userInfo'
+      },
+    })
+    // 立刻更新
+    this.storeBindings.updateStoreBindings()
   },
   // 获取分类的内容
   loadMore() {
@@ -70,7 +85,7 @@ Page({
     }
     let res = await searchWorks({
       title: this.data.text,
-      grade: 'PRIMARY_FIRST_GRADE'
+      grade: this.data.userInfo.grade
     })
     let list = res.map(item => {
       return {
@@ -89,4 +104,7 @@ Page({
       url: `/pages/reading/index?videoId=${currentTarget.dataset.id}`
     })
   },
+  onUnload() {
+    this.storeBindings.destroyStoreBindings()
+  },
 })

+ 5 - 0
pages/match/index.js

@@ -83,6 +83,11 @@ Page({
       url: `/pages/personal/index?uid=${currentTarget.dataset.uid}`,
     })
   },
+  jumpIntro() {
+    wx.navigateTo({
+      url: `/pages/rankIntro/index?title=榜单说明&img=${this.data.explain}`,
+    })
+  },
   selectType({
     target
   }) {

+ 22 - 1
pages/match/index.less

@@ -8,6 +8,27 @@
     background-color: #5DE0C0;
   }
 
+  .rule {
+    position: absolute;
+    padding: 6rpx 10rpx 6rpx 24rpx;
+    right: 0rpx;
+    top: 20rpx;
+    font-size: 26rpx;
+    border-top-left-radius: 25rpx;
+    border-bottom-left-radius: 25rpx;
+    color: white;
+    background-color: rgba(0, 0, 0, 0.15);
+  }
+
+  .kaka {
+    position: fixed;
+    right: 10rpx;
+    top: 150rpx;
+    width: 120rpx;
+    height: 120rpx;
+    z-index: 3;
+  }
+
   .modelText {
     position: relative;
     width: 724rpx;
@@ -194,7 +215,7 @@
   .rankNull {
     display: block;
     margin: 0px auto;
-    padding:50rpx 0rpx;
+    padding: 50rpx 0rpx;
     width: 393rpx;
     height: 323rpx;
   }

+ 6 - 0
pages/match/index.wxml

@@ -1,6 +1,12 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="matchBox">
   <image src="" class="headerImg" />
+  <view class="rule" bindtap="jumpIntro">
+    活动规则
+  </view>
+  <button class="resetBtn" style="border: none;" open-type="contact" plain="true">
+    <image src="/static/kaka.png" class="kaka" />
+  </button>
   <view class="modelText">
     <view class="header">
       <image src="/static/modelBg.png" class="bg" />

+ 19 - 0
pages/match/index.wxss

@@ -7,6 +7,25 @@
   height: 216rpx;
   background-color: #5DE0C0;
 }
+.matchBox .rule {
+  position: absolute;
+  padding: 6rpx 10rpx 6rpx 24rpx;
+  right: 0rpx;
+  top: 20rpx;
+  font-size: 26rpx;
+  border-top-left-radius: 25rpx;
+  border-bottom-left-radius: 25rpx;
+  color: white;
+  background-color: rgba(0, 0, 0, 0.15);
+}
+.matchBox .kaka {
+  position: fixed;
+  right: 10rpx;
+  top: 150rpx;
+  width: 120rpx;
+  height: 120rpx;
+  z-index: 3;
+}
 .matchBox .modelText {
   position: relative;
   width: 724rpx;

+ 1 - 2
pages/my/index.wxml

@@ -74,8 +74,7 @@
     </view>
   </view> -->
   <!-- 支付 -->
-  <!-- <view class="payBox" wx:if="{{!isIos}}"> -->
-  <view class="payBox">
+  <view class="payBox" wx:if="{{!isIos}}">
     <view class="title">
       付费购
     </view>

+ 2 - 1
pages/pkResult/index.js

@@ -33,6 +33,8 @@ Page({
       pkRecord,
       pkRecordVOS
     } = await getPkResult(options.id)
+    console.log(pkRecord,
+      pkRecordVOS);
     this.setData({
       pkId: options.id,
       pkRecord,
@@ -122,7 +124,6 @@ Page({
       t += sec;
     }
     return t
-
   },
   result({
     currentTarget

+ 23 - 7
pages/reading/index.js

@@ -1,5 +1,6 @@
 import {
-  getreadInfo
+  getreadInfo,
+  submitPlayLog
 } from '~/api/video'
 import {
   publishWorks,
@@ -35,6 +36,7 @@ let recorderManager = wx.getRecorderManager();
 Page({
   data: {
     videoInfo: {},
+    videoPath: '',
     currentRow: null,
     state: false,
     // 示例播放状态
@@ -122,6 +124,7 @@ Page({
   // 获取阅读内容
   async getreadInfo(videoId, reset = false) {
     let videoInfo = await getreadInfo(videoId)
+    console.log(videoInfo);
     wx.setNavigationBarTitle({
       title: videoInfo.userRead.title
     })
@@ -132,6 +135,7 @@ Page({
       return item
     })
     this.setData({
+      videoPath: videoInfo.userRead.originVideo,
       article: data,
       videoInfo
     })
@@ -149,7 +153,7 @@ Page({
       })
       this.innerAudioContext.onStop((res) => {
         console.log("143innerAudioContext触发的");
-        // this.resetReading()
+
       });
     }
 
@@ -391,7 +395,6 @@ Page({
     this.resetReading()
   },
   videoPlay() {
-    console.log("触发");
     if (this.data.state) {
       return
     }
@@ -409,7 +412,6 @@ Page({
       })
     } else {
       if (this.data.readingReset) {
-        console.log('是我播放了');
         this.resultAudioContext.src = this.data.readDetail.tempFilePath;
         this.resultAudioContext.play();
         this.setData({
@@ -422,8 +424,17 @@ Page({
           exampleState: true
         })
       }
-      this.videoContext.play()
+      this.setData({
+        videoPath: this.data.videoInfo.userRead.videoPath
+      })
+      wx.nextTick(() => {
+        this.videoContext.play()
+      })
     }
+    submitPlayLog({
+      userReadId: this.data.videoInfo.userRead.exampleId,
+      playStopTime: 1000
+    })
   },
   // 控制视频或音频的播放状态
   async playMediaState() {
@@ -432,7 +443,12 @@ Page({
       muted: false
     })
     if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
-      this.videoContext.play()
+      this.setData({
+        videoPath: this.data.videoInfo.userRead.originVideo
+      })
+      wx.nextTick(() => {
+        this.videoContext.play()
+      })
     } else {
       this.innerAudioContext.play();
     }
@@ -445,7 +461,6 @@ Page({
   resetReading() {
     clearTimeout(this.setTimeoutObj)
     clearInterval(this.stl)
-    console.log(this.data.exampleState, this.data.state, 'vvvvvvvvvvvvvvvvvvvvvvv');
     // 重置视频
     if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
       this.videoContext.stop()
@@ -488,6 +503,7 @@ Page({
   },
   onUnload() {
     this.resetReading()
+    this.storeBindings.destroyStoreBindings()
   },
   creatShare() {
     return new Promise((resolve, reject) => {

+ 2 - 4
pages/reading/index.wxml

@@ -4,10 +4,8 @@
     <image src="/static/play-btn.png" bindtap="videoPlay" wx:if="{{!state&&!exampleState}}" class="playBtn" />
     <!-- 水印 -->
     <image src="{{videoInfo.readMaskTemplate.imgPath}}" class="watermark" />
-    <video id="myVideo" src="{{state?videoInfo.userRead.originVideo:videoInfo.userRead.videoPath}}" bindended='videoEnd'
-      show-center-play-btn="{{readingReset}}" controls="{{!state&&!readingReset}}" muted="{{muted}}"></video>
-    <!-- 这个用于预加载资源 -->
-    <video src="{{videoInfo.userRead.originVideo}}" style="display: none;"></video>
+    <video id="myVideo" src="{{videoPath}}" bindended='videoEnd' show-center-play-btn="{{readingReset}}"
+      controls="{{!state&&!readingReset}}" muted="{{muted}}"></video>
   </block>
   <view class="audio" wx:else>
     <image src="{{videoInfo.userRead.coverImg}}" class="audioBg" mode="" />

BIN=BIN
static/kaka.png