谢杰标 2 năm trước cách đây
mục cha
commit
ee48d6819a
4 tập tin đã thay đổi với 81 bổ sung33 xóa
  1. 10 0
      common/httpList/goods.js
  2. 12 1
      common/methodTool.js
  3. 0 1
      components/course/courseChapter.vue
  4. 59 31
      pages3/polyv/detail.vue

+ 10 - 0
common/httpList/goods.js

@@ -393,6 +393,7 @@ export default {
     });
   },
 
+  // 获得所有视频列表
   studyRecordMenuAllList(data) {
     return myRequest({
       url: "/study/record/menuAllList",
@@ -401,6 +402,15 @@ export default {
     });
   },
 
+  // 获得所有视频+考试列表
+  studMenuAllList(data) {
+    return myRequest({
+      url: "/study/record/menuAllListWithExam",
+      method: "get",
+      data: data,
+    });
+  },
+
   goodsTodayStudySectionNum(data) {
     return myRequest({
       url: "/goods/todayStudySectionNum",

+ 12 - 1
common/methodTool.js

@@ -641,5 +641,16 @@ export default {
     let domain =
       /^([\w-]+\.)+((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(net\.cn)|(org\.cn)|(name)|(biz)|(tv)|(cn)|(mobi)|(name)|(sh)|(ac)|   (io)|(tw)|(com\.tw)|(hk)|(com\.hk)|(ws)|(travel)|(us)|(tm)|(la)|(me\.uk)|(org\.uk)|(ltd\.uk)|(plc\.uk)|(in)|(eu)|(it)|(jp))$/;
     return domain.test(str);
-  }
+  },
+  isWeixin() {
+    var ua = window.navigator.userAgent.toLowerCase();
+    if (
+      ua.match(/MicroMessenger/i) == "micromessenger" ||
+      ua.match(/_SQ_/i) == "_sq_"
+    ) {
+      return true;
+    } else {
+      return false;
+    }
+  },
 };

+ 0 - 1
components/course/courseChapter.vue

@@ -364,7 +364,6 @@ export default {
         }
       } else if (this.learningOrder == 2 && !item.rebuild) {
         let canLearn = this.list[index - 1].learning == 1;
-
         let rows = this.menuAllList;
         let isStop = false;
         let newRows = [];

+ 59 - 31
pages3/polyv/detail.vue

@@ -1298,7 +1298,7 @@ export default {
         this.pauseTimer = null;
       }
     },
-    clearBarTimer(){
+    clearBarTimer() {
       if (this.barTimer) {
         clearInterval(this.barTimer);
         this.barTimer = null;
@@ -1326,7 +1326,7 @@ export default {
         this.hasStart = false;
       }
       this.clearPauseTimer();
-      this.clearBarTimer()
+      this.clearBarTimer();
       this.timer && clearInterval(this.timer);
       if (this.lockTimer) {
         clearInterval(this.lockTimer);
@@ -1942,7 +1942,7 @@ export default {
     studyRecordMenuAllList() {
       // study/record/menuAllList
       return this.$api
-        .studyRecordMenuAllList({
+        .studMenuAllList({
           courseId: this.courseId,
           gradeId: this.gradeId,
           goodsId: this.goodsId,
@@ -1950,7 +1950,9 @@ export default {
         .then((res) => {
           let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
           if (res.data.data) {
-            this.menuAllList = res.data.data;
+            this.menuAllList = res.data.data.filter(
+              (e) => e.doType != 1 || (e.doType == 2 && e.studyStatus == 1)
+            );
             this.livingItem = res.data.data.find(
               (item) =>
                 item.liveStartTime <= nowTime && item.liveEndTime > nowTime
@@ -2213,15 +2215,6 @@ export default {
         }
       });
     },
-
-    // /**
-    //  * 获取业务层次详情
-    //  */
-    // courseBusiness() {
-    //   this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
-    //     this.businessData = res.data.data;
-    //   });
-    // },
     /**
      * 计算tabs宽度
      */
@@ -2623,7 +2616,6 @@ export default {
       } else {
         this.vid = item.recordingUrl;
       }
-      console.log(79798)
       this.recordObj = null;
       this.recordObj = await this.getRecordLast();
       this.needSeek = true; //跳转到播放记录
@@ -3274,6 +3266,39 @@ export default {
           },
         });
       } else {
+        if (data.doType == 2) {
+          uni.showModal({
+            title: "温馨提示",
+            content: "当前节视频已学完,是否进入  ?",
+            success: (res) => {
+              if (res.confirm) {
+                uni.navigateTo({
+                  url:
+                    "/pages2/class/questionBank?courseId=" +
+                    this.courseId +
+                    "&gradeId=" +
+                    this.gradeId +
+                    "&isFromVideo=1&id=" +
+                    data.id +
+                    "&goodsid=" +
+                    this.goodsId +
+                    "&moduleId=" +
+                    data.moduleId +
+                    "&chapterId=" +
+                    data.chapterId +
+                    "&orderGoodsId=" +
+                    this.orderGoodsId +
+                    "&type=3" +
+                    "&learning=" +
+                    data.studyStatus +
+                    "&isBackVideo=" +
+                    1,
+                });
+              }
+            },
+          });
+          return;
+        }
         uni.showModal({
           title: "温馨提示",
           content: "当前节视频已学完,继续学习下一节?",
@@ -3845,7 +3870,6 @@ export default {
     loadPlayer() {
       const polyvPlayer = window.polyvPlayer;
       this.$api.polyvVideoSign(this.vid).then(async (res) => {
-        console.log(this.vid,res.data.data.ts,res.data.data.sign)
         this.player = await polyvPlayer({
           wrap: "#player",
           width: "100%",
@@ -3870,22 +3894,25 @@ export default {
           console.log("视频初次播放时触发:");
           // #ifdef H5
           // h5禁止拖动进度条
-          this.clearBarTimer()
-          let originTime = this.recordObj.videoCurrentTime || 0;
-          if (this.H5isAllowSeek == "on") {
-            this.barTimer = setInterval(()=>{ 
-              const currentTime = polyvPlayerContext.j2s_getCurrentTime();
-              console.log(currentTime, originTime, 789);
-              if (
-                currentTime - originTime > 15 ||
-                currentTime - originTime < 0
-              ) {
-                polyvPlayerContext.j2s_seekVideo(originTime);
-              } else {
-                originTime = currentTime;
-              }
-            }, 2000);
+          if (!this.$method.isWeixin()) {
+            this.clearBarTimer();
+            let originTime = this.recordObj.videoCurrentTime || 0;
+            if (this.H5isAllowSeek == "on") {
+              this.barTimer = setInterval(() => {
+                const currentTime = polyvPlayerContext.j2s_getCurrentTime();
+                // console.log(currentTime, originTime, 789);
+                if (
+                  currentTime - originTime > 15 ||
+                  currentTime - originTime < 0
+                ) {
+                  polyvPlayerContext.j2s_seekVideo(originTime);
+                } else {
+                  originTime = currentTime;
+                }
+              }, 2000);
+            }
           }
+
           // #endif
           this.loadedmetadata();
           this.postStudyRecord(0);
@@ -3895,7 +3922,7 @@ export default {
           console.log("视频暂停时触发", this.vid);
           this.erJianErZaoPauseTip();
 
-          this.clearBarTimer()
+          this.clearBarTimer();
           clearInterval(this.studyTimer);
           clearInterval(this.timer);
         });
@@ -3936,6 +3963,7 @@ export default {
         this.player.on("s2j_onPlayOver", async () => {
           // 当前视频播放完毕时触发
           this.hasStart = false;
+          this.clearBarTimer();
           clearInterval(this.studyTimer);
           clearInterval(this.timer);
           uni.showToast({