Rorschach 3 lat temu
rodzic
commit
4e1d0bc721
2 zmienionych plików z 30 dodań i 18 usunięć
  1. 29 17
      pages/reading/reading.js
  2. 1 1
      pages/reading/reading.wxml

+ 29 - 17
pages/reading/reading.js

@@ -61,6 +61,7 @@ Page({
             this.setData({
                 title: res.data.data.userRead.title,
                 videoUrl: res.data.data.userRead.videoPath,
+                videoPathTemp: res.data.data.userRead.videoPath,
                 originVideo: res.data.data.userRead.originVideo,
                 img: res.data.data.userRead.iconImg,
                 id: res.data.data.userRead.id,
@@ -504,6 +505,17 @@ Page({
         } */
     },
 
+    exampleVideoPlay: function () {
+        if (this.data.videoPathTemp == this.data.videoUrl) {
+            // 播放记录增加一条
+            httpRequestApi.playLogReport({
+                userReadId: this.data.id,
+                playStopTime: 1000
+            }).success(res => {
+                console.log('播放记录', res)
+            })
+        }
+    },
     videoComplete: function () {
         this.setData({
             recordFlag: 1,
@@ -679,20 +691,20 @@ Page({
     commentTap: function (e) {
         console.log('点击评论区', e)
         if (e.target.dataset.type === 'blank') {
-          if (this.data.commentShow && this.data.commentId) {
-            httpRequestApi.getClassDetail(this.data.commentId).success(res => {
-              console.log('评论回显', res.data.data.userRead.commentAmount)
-              let str = `videoList[${this.data.commentIndex}].commentAmount`;
-              this.setData({
-                [str]:res.data.data.userRead.commentAmount
-              })
+            if (this.data.commentShow && this.data.commentId) {
+                httpRequestApi.getClassDetail(this.data.commentId).success(res => {
+                    console.log('评论回显', res.data.data.userRead.commentAmount)
+                    let str = `videoList[${this.data.commentIndex}].commentAmount`;
+                    this.setData({
+                        [str]: res.data.data.userRead.commentAmount
+                    })
+                })
+            }
+            this.setData({
+                commentShow: false
             })
-          }
-          this.setData({
-            commentShow: false
-          })
         }
-      },
+    },
     scrollToLower: function (e) {
         console.log('滑动到底部', e)
         this.setData({
@@ -777,10 +789,10 @@ Page({
         let str2 = `videoList[${index}].favoritesAmount`;
         let favoritesAmount = e.detail.isCollect ? this.data.videoList[index].favoritesAmount + 1 : this.data.videoList[index].favoritesAmount - 1
         this.setData({
-          [str]: e.detail.isCollect,
-          [str2]: favoritesAmount
+            [str]: e.detail.isCollect,
+            [str2]: favoritesAmount
         })
-      },
+    },
     likeTap: function (e) {
         console.log('点赞', e)
         const index = e.detail.index;
@@ -814,7 +826,7 @@ Page({
         console.log('+++++1', e)
         let str = `videoList[${e.detail.index}].shareAmount`;
         this.setData({
-          [str]: this.data.videoList[e.detail.index].shareAmount + 1
+            [str]: this.data.videoList[e.detail.index].shareAmount + 1
         })
-      }
+    }
 })

+ 1 - 1
pages/reading/reading.wxml

@@ -3,7 +3,7 @@
     <!-- <view class="videoSection" wx:if="{{!isIOS}}">
         <image wx:if="{{!videoLoad}}" class="videoIcon" src="{{iconImg}}" />
     </view> -->
-    <video id="myVideo" class="videoSection" src="{{videoUrl}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}" show-center-play-btn="{{centerBtn}}" muted="{{muted}}" enable-progress-gesture="{{gesture}}" bindended="recordingVideoEnd"></video>
+    <video id="myVideo" class="videoSection" src="{{videoUrl}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}" show-center-play-btn="{{centerBtn}}" muted="{{muted}}" enable-progress-gesture="{{gesture}}" bindplay="exampleVideoPlay" bindended="recordingVideoEnd"></video>
     <!-- bindwaiting="videoWaiting"
   bindplay="videoPlay" -->
     <!-- <audio name="123" author="123" src="{{recordSource}}" id="myAudio" controls loop></audio> -->