谢杰标 2 년 전
부모
커밋
00b7de2f89
1개의 변경된 파일32개의 추가작업 그리고 43개의 파일을 삭제
  1. 32 43
      pages3/polyv/detail.vue

+ 32 - 43
pages3/polyv/detail.vue

@@ -894,12 +894,10 @@ export default {
       clearTimer: null,
       livingItem: "",
       option: null,
-      isOther: "",
       downLoading: false, //下载讲义加载
       muluStyle: false, //显示和隐藏目录样式
       bottomHeight: 0,
       toggleCourseShow: false, // 切换课程弹窗
-      informId: "", //消息id,从公众号消息模板进来的才有
       courseList: [], // 课程列表
       reStart: false, // 是否显示模块/章/节
       subList: [],
@@ -925,7 +923,13 @@ export default {
     };
   },
   computed: {
-    ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID",'config']),
+    ...mapGetters([
+      "userInfo",
+      "playSectionId",
+      "playChannelId",
+      "playVID",
+      "config",
+    ]),
   },
   watch: {
     showSet(n) {
@@ -950,37 +954,36 @@ export default {
       }
     },
   },
-  onLoad(option) {
-    console.log("--option--", option);
+  async onLoad(option) {
+    if (option.skipPort) {
+      await this.$method.skipLogin(option.skipPort);
+    }
+    if (this.$method.isGoLogin()) {
+      // 从公众号消息进来的没登录需要跳到登录页,登录后返回
+      return;
+    }
+    if (option.isOther) {
+      this.showMark = true;
+      return;
+    }
+    !this.userInfo && this.$api.refreshUserInfo();
     this.courseId = Number(option.id) || "";
     this.goodsId = Number(option.goodsId);
     this.orderGoodsId = Number(option.orderGoodsId) || "";
     this.gradeId = option.gradeId;
-    this.isOther = option.isOther;
-    if (this.isOther) {
-      this.showMark = true;
-      return;
-    }
     this.option = option;
-
     // 公众号模板消息的数据埋点
-    if (option.informId) {
-      this.informId = option.informId;
-    }
+    option.informId && this.clickOfficial(option.informId);
+    this.courseCourseList();
   },
   async onShow() {
-    if (this.option.skipPort) {
-      await this.$method.skipLogin(this.option.skipPort);
-    }
-    if (this.$method.isGoLogin()) {
-      // 从公众号消息进来的没登录需要跳到登录页,登录后返回
-      return;
-    }
-    console.log("onshow返回之后");
-    this.courseCourseList();
-    this.informId && this.clickOfficial(); // 从公众号消息点击进来上报一次
-    !this.userInfo && this.$api.refreshUserInfo();
-    this.$store.getters.dictObj;
+    // if (this.option.skipPort) {
+    //   await this.$method.skipLogin(this.option.skipPort);
+    // }
+    // if (this.$method.isGoLogin()) {
+    //   return;
+    // }
+    // this.courseCourseList();
   },
   onUnload() {
     console.log("onUnloadonUnloadonUnloadonUnload");
@@ -994,15 +997,11 @@ export default {
   methods: {
     ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
     // 新增微信公众号模板消息点击数据
-    clickOfficial() {
+    clickOfficial(informId) {
       this.$http({
         url: "/data/click",
         method: "post",
-        data: { informId: this.informId },
-      }).then((res) => {
-        if (res.data.code == 200) {
-          console.log("上报埋点");
-        }
+        data: { informId },
       });
     },
     // 点击课程目录
@@ -1036,12 +1035,6 @@ export default {
               }
             });
             this.subList = [...allItem, ...newArr];
-            console.log(
-              "this.courseList:",
-              this.courseList,
-              "length:",
-              res.data.rows.length
-            );
             if (res.data.rows.length) {
               this.courseBusiness(res.data.rows[0].businessId);
             }
@@ -1171,10 +1164,6 @@ export default {
 
     // 原来onshow里面的内容
     originOnShow() {
-      if (this.isOther) {
-        this.showMark = true;
-        return;
-      }
       this.getbaseprofiletplists().then((res) => {
         this.courseDetail();
         this.getGoodsDetail();
@@ -4777,4 +4766,4 @@ page {
     border: 1rpx solid red;
   }
 }
-</style>
+</style>