谢杰标 2 years ago
parent
commit
b4bf2b94c4
2 changed files with 20 additions and 12 deletions
  1. 11 4
      pages/learn/index.vue
  2. 9 8
      pages3/polyv/detail.vue

+ 11 - 4
pages/learn/index.vue

@@ -194,7 +194,9 @@
                 </template>
 
                 <template v-else>
-                  <template v-if="item.classEndTime && item.classEndTime < sysTime">
+                  <template
+                    v-if="item.classEndTime && item.classEndTime < sysTime"
+                  >
                     <view class="class-warm">
                       <u-icon
                         class="class-warm__icon"
@@ -1040,8 +1042,9 @@ export default {
 
       // 进入视频课
       this.activeItem = item;
-      if (!item.interfaceAccountId) {
+      if (item.interfaceAccountId > 0) {
         //学习账号已开通
+
         if (item.learnStatus > 0) {
           //跳转第三方h5
           uni.navigateTo({
@@ -1184,11 +1187,15 @@ export default {
                 if (res.data.total > 1) {
                   // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
                   uni.navigateTo({
-                    url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
+                    url: `/pages3/polyv/detail?id=''&goodsId=${
+                      item.goodsId
+                    }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+                      item.gradeId
+                    }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
                   });
                 } else if (res.data.total == 1) {
                   uni.navigateTo({
-                    url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
+                    url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&periodWaitTime=${item.periodWaitTime ? "" : 1}`,
                   });
                 } else {
                   uni.showToast({

+ 9 - 8
pages3/polyv/detail.vue

@@ -178,7 +178,7 @@
             v-for="(item, index) in menuList"
             :key="index"
           >
-            <template v-if="sectionItem.sectionId || sectionItem.id">
+            <template v-if="sectionItem.userId">
               <!--模块 -->
               <view v-if="item.type == 1"
                 ><courseModule
@@ -1649,8 +1649,10 @@ export default {
         });
     },
     async initPlayVideo(sectionItem) {
+      console.log(sectionItem,'this.sectionItem',this.menuList)
       this.moduleId = sectionItem.moduleId;
       this.chapterId = sectionItem.chapterId;
+      this.sectionItem = sectionItem;
       if (sectionItem.sectionType == 1) {
         //录播
         this.$store.commit("setPlaySectionId", {
@@ -1659,8 +1661,6 @@ export default {
         this.$store.commit("setPlayVID", {
           playVID: sectionItem.recordingUrl,
         });
-
-        this.sectionItem = sectionItem;
         await this.getPhotoLastRecord(); // 获取拍照历史
         this.playVideo(sectionItem);
       } else if (sectionItem.sectionType == 2) {
@@ -1674,7 +1674,6 @@ export default {
         this.$store.commit("setPlayVID", {
           playVID: sectionItem.recordingUrl,
         });
-        this.sectionItem = sectionItem;
         this.playVideo(sectionItem);
       } else if (sectionItem.doType == 2) {
         uni.showModal({
@@ -1724,11 +1723,13 @@ export default {
         })
         .then((res) => {
           let { data } = res.data;
+          console.log(data,789)
           if (!data.sectionId) {
             data = this.menuAllList[0];
           } else {
             if (data.learning == 1 && this.orderNum == 2) {
               let next = this.menuAllList.find((e) => e.studyStatus != 1);
+              console.log(next,789)
               next && (data = next);
             }
           }
@@ -3005,15 +3006,15 @@ export default {
                   uni.navigateBack();
                 },
               });
-            } else if (code == 558) {          
-              this.CountTo1 = msg.split(",")[1]
+            } else if (code == 558) {
+              this.CountTo1 = msg.split(",")[1];
               this.noticeShow1 = true;
               var timer = setInterval(() => {
                 this.CountTo1--;
                 if (this.CountTo1 < 0) {
                   this.noticeShow1 = false;
                   clearInterval(timer);
-                  this.postStudyRecord(1)
+                  this.postStudyRecord(1);
                 }
               }, 1000);
               reject("中断执行");
@@ -3707,7 +3708,7 @@ export default {
       // '/goods/'+ data,
       this.$api.goodsDetail(this.goodsId).then(async (res) => {
         this.goodsData = res.data.data;
-        // await this.checkFinishRequiredCourse();
+        this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
         if (self.goodsData.buyNote) {
           this.baseHandoutTipList();
         }