谢杰标 2 роки тому
батько
коміт
6262d5b228
1 змінених файлів з 33 додано та 3 видалено
  1. 33 3
      pages3/polyv/detail.vue

+ 33 - 3
pages3/polyv/detail.vue

@@ -840,11 +840,41 @@ export default {
             }
             if (res.data.total > 1) {
               this.getUserWatchLast();
-            } 
-            this.originOnShow();
-            this.originMounted();
+            } else{
+              this.originOnShow();
+              this.originMounted();
+            }
+            
           }
         });
+    },
+        // 查询用户最后一次看的录播的信息
+    getUserWatchLast() {
+      this.$http({
+        url: "/study/record/getUserWatchLast",
+        method: "get",
+        data: {
+          orderGoodsId: this.orderGoodsId,
+        },
+      }).then((res) => {
+        if (res.data.code == 200) {
+          this.sectionItem = res.data.data || {};
+          if (res.data.data && Object.keys(res.data.data).length) {
+            //有最后一次看的录播的信息
+            this.courseId = res.data.data.courseId;
+            // console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
+          } else {
+            this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
+            // this.toggleCourseShow = true
+          }
+        } else {
+          this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
+        }
+        this.originOnShow();
+        this.originMounted();
+        //获取商品双师资模板
+        this.getCourseTeacher(this.courseList);
+      });
     },
     getCourseTeacher(rows) {
       this.goodsTeacher = [];