谢杰标 2 лет назад
Родитель
Сommit
af9522b2e1

+ 8 - 0
src/apis/polvy.js

@@ -31,6 +31,14 @@ export default {
           method: 'get',
       })
   },
+  //获取保利威视频播放凭证
+  obtainpolyvvideopcsign(data) {
+    return request({
+        url: `/polyv/video/sign/pc/` + data,
+        method: 'get',
+    })
+},
+
   //获取保利威视频信息详细信息
   inquirepolyvvideo(data) {
     return request({

+ 1 - 1
src/pages/bank-exam/index.vue

@@ -17,7 +17,7 @@
           <div class="explain-record">
             <div class="explain-record__body clearfix">
               <div class="left-box">
-                <Header-tab-box :num="questionOverNum(true)" :allNum="lastCount" @prevQuestion="prevQuestion"
+                <Header-tab-box :num="questionOverNum(true)" :allNum="questionList.length" @prevQuestion="prevQuestion"
                   @nextQuestion="nextQuestion">
                 </Header-tab-box>
                 <div class="left-box__body">

Разница между файлами не показана из-за своего большого размера
+ 624 - 302
src/pages/course-detail/index.vue


+ 394 - 349
src/pages/goods-detail/course-detail.vue

@@ -68,156 +68,202 @@
                         >试看</span
                       >
                     </div>
-                    
-                    <div class="goods-menu clearfix" >
-                      
+
+                    <div class="goods-menu clearfix">
                       <div class="left-box">
-                        <div v-for="(courseItem, tindex) in goodsTeacher" :key="tindex + 'one'">
-                        <div class="left-box__body">
-                          <template v-for="(course, cindex) in courseItem.courseList">
-                          <div
-                            class="course-list-item"
-                            v-if="course.show == 1"
-                            :key="cindex + 'two'"
-                          >
-                            <div class="doubles">
-                              <div
-                                class="course-list-item__title"
-                                @click="openCourse(course)"
-                              >
-                                <i
-                                  :class="{
-                                    'el-icon-caret-right': !course.showList,
-                                    'el-icon-caret-bottom': course.showList,
-                                  }"
-                                ></i>
-                                {{ course.courseName }}
-                              </div>
-                              <div v-if="courseItem.teaList && courseItem.teaList.length > 0" class="teacher_names">
-                                <div v-for="(tea, index) in courseItem.teaList" :key="index + 'three'" class="names"
-                                 :class="{nactive: States[tindex] == index}" @click="switchTeacher(tea, index, tindex)">
-                                  {{ tea.aliasName }}
-                                </div>
-                              </div>
-                            </div>
-                            <template v-if="course.showList">
+                        <div
+                          v-for="(courseItem, tindex) in goodsTeacher"
+                          :key="tindex + 'one'"
+                        >
+                          <div class="left-box__body">
+                            <template
+                              v-for="(course, cindex) in courseItem.courseList"
+                            >
                               <div
-                                class="item"
-                                v-for="(item, index) in course.list"
-                                :key="index"
+                                class="course-list-item"
+                                v-if="course.show == 1"
+                                :key="cindex + 'two'"
                               >
-                                <template v-if="item.type == 1">
+                                <div class="doubles">
                                   <div
-                                    class="item__title"
-                                    @click="openModule(item)"
+                                    class="course-list-item__title"
+                                    @click="openCourse(course)"
                                   >
                                     <i
                                       :class="{
-                                        'el-icon-caret-right': !item.showList,
-                                        'el-icon-caret-bottom': item.showList,
+                                        'el-icon-caret-right': !course.showList,
+                                        'el-icon-caret-bottom': course.showList,
                                       }"
                                     ></i>
-                                    {{ item.name }}
+                                    {{ course.courseName }}
                                   </div>
-                                  <div class="item__content">
+                                  <div
+                                    v-if="
+                                      courseItem.teaList &&
+                                      courseItem.teaList.length > 0
+                                    "
+                                    class="teacher_names"
+                                  >
                                     <div
-                                      class="bank-chapter"
-                                      v-if="item.showList"
+                                      v-for="(tea, index) in courseItem.teaList"
+                                      :key="index + 'three'"
+                                      class="names"
+                                      :class="{
+                                        nactive: States[tindex] == index,
+                                      }"
+                                      @click="switchTeacher(tea, index, tindex)"
                                     >
+                                      {{ tea.aliasName }}
+                                    </div>
+                                  </div>
+                                </div>
+                                <template v-if="course.showList">
+                                  <div
+                                    class="item"
+                                    v-for="(item, index) in course.list"
+                                    :key="index"
+                                  >
+                                    <template v-if="item.type == 1">
                                       <div
-                                        class="bank-chapter__item"
-                                        v-for="(
-                                          chapter, chapterIndex
-                                        ) in item.list"
-                                        :key="chapterIndex"
+                                        class="item__title"
+                                        @click="openModule(item)"
                                       >
+                                        <i
+                                          :class="{
+                                            'el-icon-caret-right':
+                                              !item.showList,
+                                            'el-icon-caret-bottom':
+                                              item.showList,
+                                          }"
+                                        ></i>
+                                        {{ item.name }}
+                                      </div>
+                                      <div class="item__content">
                                         <div
-                                          class="bank-chapter__item__text"
-                                          @click="openChapter(chapter)"
-                                        >
-                                          <i
-                                            :class="{
-                                              'el-icon-caret-right':
-                                                !chapter.showList,
-                                              'el-icon-caret-bottom':
-                                                chapter.showList,
-                                            }"
-                                          ></i
-                                          >{{ chapter.name }}
-                                        </div>
-
-                                        <div
-                                          class="bank-section"
-                                          v-if="chapter.showList"
+                                          class="bank-chapter"
+                                          v-if="item.showList"
                                         >
                                           <div
-                                            class="bank-section__item"
+                                            class="bank-chapter__item"
                                             v-for="(
-                                              section, sectionIndex
-                                            ) in chapter.list"
-                                            :key="sectionIndex"
+                                              chapter, chapterIndex
+                                            ) in item.list"
+                                            :key="chapterIndex"
                                           >
                                             <div
-                                              class="bank-section__item__text"
+                                              class="bank-chapter__item__text"
+                                              @click="openChapter(chapter)"
                                             >
-                                              {{ section.name }}
+                                              <i
+                                                :class="{
+                                                  'el-icon-caret-right':
+                                                    !chapter.showList,
+                                                  'el-icon-caret-bottom':
+                                                    chapter.showList,
+                                                }"
+                                              ></i
+                                              >{{ chapter.name }}
                                             </div>
+
                                             <div
-                                              v-if="section.tryListen"
-                                              @click="
-                                                toDo(section, item.courseId)
-                                              "
-                                              class="btn"
+                                              class="bank-section"
+                                              v-if="chapter.showList"
                                             >
-                                              试看
+                                              <div
+                                                class="bank-section__item"
+                                                v-for="(
+                                                  section, sectionIndex
+                                                ) in chapter.list"
+                                                :key="sectionIndex"
+                                              >
+                                                <div
+                                                  class="
+                                                    bank-section__item__text
+                                                  "
+                                                >
+                                                  {{ section.name }}
+                                                </div>
+                                                <div
+                                                  v-if="section.tryListen"
+                                                  @click="
+                                                    toDo(section, item.courseId)
+                                                  "
+                                                  class="btn"
+                                                >
+                                                  试看
+                                                </div>
+                                              </div>
                                             </div>
                                           </div>
                                         </div>
                                       </div>
-                                    </div>
-                                  </div>
-                                </template>
+                                    </template>
 
-                                <template v-if="item.type == 2">
-                                  <div class="item__content">
-                                    <div class="bank-chapter">
-                                      <div class="bank-chapter__item">
-                                        <div
-                                          class="bank-chapter__item__text"
-                                          @click="openChapter(item)"
-                                        >
-                                          <i
-                                            :class="{
-                                              'el-icon-caret-right':
-                                                !item.showList,
-                                              'el-icon-caret-bottom':
-                                                item.showList,
-                                            }"
-                                          ></i
-                                          >{{ item.name }}
+                                    <template v-if="item.type == 2">
+                                      <div class="item__content">
+                                        <div class="bank-chapter">
+                                          <div class="bank-chapter__item">
+                                            <div
+                                              class="bank-chapter__item__text"
+                                              @click="openChapter(item)"
+                                            >
+                                              <i
+                                                :class="{
+                                                  'el-icon-caret-right':
+                                                    !item.showList,
+                                                  'el-icon-caret-bottom':
+                                                    item.showList,
+                                                }"
+                                              ></i
+                                              >{{ item.name }}
+                                            </div>
+
+                                            <div
+                                              class="bank-section"
+                                              v-if="item.showList"
+                                            >
+                                              <div
+                                                class="bank-section__item"
+                                                v-for="(
+                                                  section, sectionIndex
+                                                ) in item.list"
+                                                :key="sectionIndex"
+                                              >
+                                                <div
+                                                  class="
+                                                    bank-section__item__text
+                                                  "
+                                                >
+                                                  {{ section.name }}
+                                                </div>
+                                                <div
+                                                  v-if="section.tryListen"
+                                                  @click="
+                                                    toDo(section, item.courseId)
+                                                  "
+                                                  class="btn"
+                                                >
+                                                  试看
+                                                </div>
+                                              </div>
+                                            </div>
+                                          </div>
                                         </div>
+                                      </div>
+                                    </template>
 
-                                        <div
-                                          class="bank-section"
-                                          v-if="item.showList"
-                                        >
-                                          <div
-                                            class="bank-section__item"
-                                            v-for="(
-                                              section, sectionIndex
-                                            ) in item.list"
-                                            :key="sectionIndex"
-                                          >
+                                    <template v-if="item.type == 3">
+                                      <div class="item__content">
+                                        <div class="bank-section">
+                                          <div class="bank-section__item">
                                             <div
                                               class="bank-section__item__text"
                                             >
-                                              {{ section.name }}
+                                              {{ item.name }}
                                             </div>
                                             <div
-                                              v-if="section.tryListen"
-                                              @click="
-                                                toDo(section, item.courseId)
-                                              "
+                                              v-if="item.tryListen"
+                                              @click="toDo(item, item.courseId)"
                                               class="btn"
                                             >
                                               试看
@@ -225,33 +271,12 @@
                                           </div>
                                         </div>
                                       </div>
-                                    </div>
-                                  </div>
-                                </template>
-
-                                <template v-if="item.type == 3">
-                                  <div class="item__content">
-                                    <div class="bank-section">
-                                      <div class="bank-section__item">
-                                        <div class="bank-section__item__text">
-                                          {{ item.name }}
-                                        </div>
-                                        <div
-                                          v-if="item.tryListen"
-                                          @click="toDo(item, item.courseId)"
-                                          class="btn"
-                                        >
-                                          试看
-                                        </div>
-                                      </div>
-                                    </div>
+                                    </template>
                                   </div>
                                 </template>
                               </div>
                             </template>
                           </div>
-                          </template>
-                        </div>
                         </div>
                       </div>
                       <div class="right-box">
@@ -294,7 +319,6 @@
                           </li>
                         </ul>
                       </div>
-                    
                     </div>
                   </el-tab-pane>
                   <el-tab-pane label="学员须知" name="3">
@@ -495,8 +519,13 @@
     <ToolBar></ToolBar>
     <Footer></Footer>
     <!-- 规格选择 -->
-    <index-sku-dialog :skuModal.sync="skuModal" :specTemplateId="goodsDetail.specTemplateId" :isCarOrBuy="isCarOrBuy"
-      @toShopCart='getAddCar($event)' @togoBuy="togoBuy($event)"></index-sku-dialog>
+    <index-sku-dialog
+      :skuModal.sync="skuModal"
+      :specTemplateId="goodsDetail.specTemplateId"
+      :isCarOrBuy="isCarOrBuy"
+      @toShopCart="getAddCar($event)"
+      @togoBuy="togoBuy($event)"
+    ></index-sku-dialog>
   </div>
 </template>
 
@@ -505,7 +534,7 @@ import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
 import GoodsItem from "@/components/goodsItem/index";
-import IndexSkuDialog from '@/components/goodsItem/IndexSkuDialog.vue'
+import IndexSkuDialog from "@/components/goodsItem/IndexSkuDialog.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "GoodsDetail",
@@ -594,7 +623,7 @@ export default {
       menuIndex: [], //需要展开的章节索引值
       freeMenuList: [], //赠送题卷列表
       teaIndex: 0,
-      States: {0: 0},
+      States: { 0: 0 },
       skuModal: false,
       isCarOrBuy: 1, // 1加入购物车 2立即购买
     };
@@ -804,12 +833,20 @@ export default {
      */
     judgeSelect(question, questionIndex, index) {
       if (question.ques) return;
-      this.$set(this.questionList[questionIndex], "ques", index == 0 ? '1' : '0');
+      this.$set(
+        this.questionList[questionIndex],
+        "ques",
+        index == 0 ? "1" : "0"
+      );
     },
     judgeSelectChild(questionIndex, jsonIndex, index) {
       console.log(this.questionList[questionIndex].ques[jsonIndex]);
       if (this.questionList[questionIndex].ques[jsonIndex]) return;
-      this.$set(this.questionList[questionIndex].ques, jsonIndex, index == 0 ? '1' : '0');
+      this.$set(
+        this.questionList[questionIndex].ques,
+        jsonIndex,
+        index == 0 ? "1" : "0"
+      );
     },
 
     /**
@@ -952,7 +989,7 @@ export default {
      * 试看
      */
     toDo(section, courseId) {
-      console.log('section, courseId', section, courseId)
+      console.log("section, courseId", section, courseId);
       this.videoModalShow = true;
       this.section;
       this.playCourseId = courseId;
@@ -995,34 +1032,36 @@ export default {
         }
       }).auditionMinute;
 
-      // self.$request.obtainpolyvvideosign(self.vid).then((res) => {
-      self.player = polyvPlayer({
-        wrap: "#player",
-        width: 800,
-        height: 450,
-        vid: self.vid,
-        start: 0,
-        end: auditionMinute,
-        teaser_show: 0,
-        // ts: res.data.ts,
-        // sign: res.data.sign,
-        playsafe: function (vid, next) {
-          next();
-        },
-      });
+      self.$request.obtainpolyvvideosign(self.vid).then((res) => {
+        self.player = polyvPlayer({
+          wrap: "#player",
+          width: 800,
+          height: 450,
+          vid: self.vid,
+          start: 0,
+          end: auditionMinute,
+          teaser_show: 0,
+          ts: res.data.ts,
+          sign: res.data.sign,
+          playsafe: function (vid, next) {
+            self.$request.obtainpolyvvideopcsign(vid).then((res) => {
+              next(res.data);
+            });
+          },
+        });
 
-      self.player.on("s2j_onPlayOver", () => {
-        this.$confirm("试看结束,购买课程可学习全部", "提示", {
-          closeOnClickModal: false,
-          showCancelButton: false,
-          closeOnPressEscape: false,
-          distinguishCancelAndClose: false,
-          showClose: false,
-        }).then((res) => {
-          this.videoModalShow = false;
+        self.player.on("s2j_onPlayOver", () => {
+          this.$confirm("试看结束,购买课程可学习全部", "提示", {
+            closeOnClickModal: false,
+            showCancelButton: false,
+            closeOnPressEscape: false,
+            distinguishCancelAndClose: false,
+            showClose: false,
+          }).then((res) => {
+            this.videoModalShow = false;
+          });
         });
       });
-      // });
     },
     /**
      * @param {String} 直播预览
@@ -1259,7 +1298,7 @@ export default {
      * 展开模块卷
      */
     openModule(Module) {
-      console.log('点击模块卷')
+      console.log("点击模块卷");
       this.$set(Module, "showList", !Module.showList);
       if (!Module.list.length) {
         this.getChapterList(Module);
@@ -1286,7 +1325,7 @@ export default {
      * 展开章卷
      */
     openChapter(chapter) {
-      console.log('点开章卷')
+      console.log("点开章卷");
       this.$set(chapter, "showList", !chapter.showList);
 
       if (!chapter.list.length) {
@@ -1326,39 +1365,37 @@ export default {
       });
     },
     cancelClassModal() {
-      this.selectClassModal = false
-      this.goodsId = this.$route.params.goodsId
+      this.selectClassModal = false;
+      this.goodsId = this.$route.params.goodsId;
     },
     selectClick(goodsDetail, type, goodsId) {
       if (type == "class") {
         //选择班级
         if (!this.gradeList.length) {
           // goodsDetail.goodsId
-          this.$request
-            .goodsGradeList({ goodsId: goodsId })
-            .then((res) => {
-              this.gradeList = res.rows;
-              if (this.gradeList.length == 0) {
+          this.$request.goodsGradeList({ goodsId: goodsId }).then((res) => {
+            this.gradeList = res.rows;
+            if (this.gradeList.length == 0) {
+              let item = {
+                className: "系统分班",
+                gradeId: 0,
+              };
+              this.gradeList.push(item);
+            } else {
+              let isGradeFull = this.gradeList.every(
+                (item) =>
+                  item.studentNum > 0 && item.studentNum == item.studentUpper
+              );
+              //所有班级都满了
+              if (isGradeFull) {
                 let item = {
                   className: "系统分班",
                   gradeId: 0,
                 };
-                this.gradeList.push(item);
-              } else {
-                let isGradeFull = this.gradeList.every(
-                  (item) =>
-                    item.studentNum > 0 && item.studentNum == item.studentUpper
-                );
-                //所有班级都满了
-                if (isGradeFull) {
-                  let item = {
-                    className: "系统分班",
-                    gradeId: 0,
-                  };
-                  this.gradeList.unshift(item);
-                }
+                this.gradeList.unshift(item);
               }
-            });
+            }
+          });
         }
       } else if (type == "apply") {
         //选择考试地点
@@ -1397,13 +1434,13 @@ export default {
       if (this.$tools.isLogin()) {
         // 判断有没有规格选择
         if (this.goodsDetail.specTemplateId) {
-          this.isCarOrBuy = 2
+          this.isCarOrBuy = 2;
           // this.skuModal = true
-          this.getSpecDetail()
-          return
+          this.getSpecDetail();
+          return;
         }
 
-        this.toPayment(this.goodsDetail)
+        this.toPayment(this.goodsDetail);
       } else {
         this.setCurrentRouter(this.$route);
         this.$router.push({
@@ -1413,53 +1450,48 @@ export default {
       }
     },
     togoBuy(skuItem) {
-      this.toPayment(skuItem)
-      this.goodsId = skuItem.goodsId
+      this.toPayment(skuItem);
+      this.goodsId = skuItem.goodsId;
     },
     toPayment(goodsDetail) {
       if (this.goodsDetail.templateType) {
-          this.selectClassModal = true;
-        } else {
-          // let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
-          let selectGoodsList = JSON.parse(JSON.stringify([goodsDetail]));
-          selectGoodsList.forEach((item) => {
-            if (item.goodsType == 1) {
-              if (item.templateType == "class") {
-                let goodsInputData = {
-                  type: "class",
-                  gradeId: this.gradeId,
-                  gradeJson: JSON.stringify(
-                    this.gradeList.find(
-                      (grade) => grade.gradeId == this.gradeId
-                    )
-                  ),
-                };
-                item.goodsInputData = goodsInputData;
-              }
-              if (item.templateType == "apply") {
-                let goodsInputData = {
-                  type: "apply",
-                  applyAreasJson: JSON.stringify(this.applyAreas),
-                  examDateJson: JSON.stringify(
-                    this.examineList.find(
-                      (exam) => exam.educationId == this.educationId
-                    )
-                  ),
-                };
-                item.goodsInputData = goodsInputData;
-              }
+        this.selectClassModal = true;
+      } else {
+        // let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
+        let selectGoodsList = JSON.parse(JSON.stringify([goodsDetail]));
+        selectGoodsList.forEach((item) => {
+          if (item.goodsType == 1) {
+            if (item.templateType == "class") {
+              let goodsInputData = {
+                type: "class",
+                gradeId: this.gradeId,
+                gradeJson: JSON.stringify(
+                  this.gradeList.find((grade) => grade.gradeId == this.gradeId)
+                ),
+              };
+              item.goodsInputData = goodsInputData;
             }
-          });
+            if (item.templateType == "apply") {
+              let goodsInputData = {
+                type: "apply",
+                applyAreasJson: JSON.stringify(this.applyAreas),
+                examDateJson: JSON.stringify(
+                  this.examineList.find(
+                    (exam) => exam.educationId == this.educationId
+                  )
+                ),
+              };
+              item.goodsInputData = goodsInputData;
+            }
+          }
+        });
 
-          localStorage.setItem(
-            "checkGoodsList",
-            JSON.stringify(selectGoodsList)
-          );
+        localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
 
-          this.$router.push({
-            path: "/payment",
-          });
-        }
+        this.$router.push({
+          path: "/payment",
+        });
+      }
     },
     pay() {
       if (
@@ -1539,17 +1571,18 @@ export default {
         return;
       }
       // 判断有没有规格选择
-			if (this.goodsDetail.specTemplateId) {
-				this.isCarOrBuy = 1
-				// this.skuModal = true
-        this.getSpecDetail()
-				return
-			}
-
-      this.getAddCar(this.goodsId)
+      if (this.goodsDetail.specTemplateId) {
+        this.isCarOrBuy = 1;
+        // this.skuModal = true
+        this.getSpecDetail();
+        return;
+      }
+
+      this.getAddCar(this.goodsId);
     },
     getAddCar(goodsId) {
-      this.$request.addCart({ goodsId: goodsId })
+      this.$request
+        .addCart({ goodsId: goodsId })
         .then((res) => {
           this.getCartCount();
           this.$message({
@@ -1567,23 +1600,24 @@ export default {
         });
     },
     getSpecDetail() {
-			this.$axios({
-				url: `/app/common/spec/${this.goodsDetail.specTemplateId}`,
-				method: 'get',
-				noToken: true
-			}).then((res) => {
+      this.$axios({
+        url: `/app/common/spec/${this.goodsDetail.specTemplateId}`,
+        method: "get",
+        noToken: true,
+      })
+        .then((res) => {
           if (res.data) {
-            this.skuModal = true
+            this.skuModal = true;
           } else {
             if (this.isCarOrBuy == 1) {
-              this.getAddCar(this.goodsId)
+              this.getAddCar(this.goodsId);
             } else {
-              this.toPayment(this.goodsDetail)
+              this.toPayment(this.goodsDetail);
             }
-
           }
-			}).catch(() => {})
-		},
+        })
+        .catch(() => {});
+    },
     /**
      * 获取商品详情
      */
@@ -1616,27 +1650,35 @@ export default {
         this.getRecommend();
       });
     },
-        //切换老师
-    switchTeacher(data, index, tindex){
-      this.States[tindex] = index
-      this.teaIndex = index
-        console.log(data,'data',index, tindex);
-        this.goodsTeacher.forEach((item,index) => {
-            if(item.teaList && item.teaList.length > 0){
-               let list = item.teaList.filter(x => x.courseId == data.courseId)
-               if(list && list.length > 0){
-                  item.courseList.forEach((course,courseIndex) => {
-                      if(course.courseId == data.courseId){
-                        // console.log(index,'index');
-                        //  console.log(courseIndex,'courseIndex');
-                        this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",1)
-                      }else{
-                        this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",0)
-                      }
-                  })
-               }
-            }
-        })
+    //切换老师
+    switchTeacher(data, index, tindex) {
+      this.States[tindex] = index;
+      this.teaIndex = index;
+      console.log(data, "data", index, tindex);
+      this.goodsTeacher.forEach((item, index) => {
+        if (item.teaList && item.teaList.length > 0) {
+          let list = item.teaList.filter((x) => x.courseId == data.courseId);
+          if (list && list.length > 0) {
+            item.courseList.forEach((course, courseIndex) => {
+              if (course.courseId == data.courseId) {
+                // console.log(index,'index');
+                //  console.log(courseIndex,'courseIndex');
+                this.$set(
+                  this.goodsTeacher[index].courseList[courseIndex],
+                  "show",
+                  1
+                );
+              } else {
+                this.$set(
+                  this.goodsTeacher[index].courseList[courseIndex],
+                  "show",
+                  0
+                );
+              }
+            });
+          }
+        }
+      });
     },
     /**
      * 是否是试做
@@ -1653,72 +1695,75 @@ export default {
           item.showList = false;
           item.list = [];
         });
-                 //获取商品双师资模板
-            this.$request.getGoodsCourseTeacher({
-               goodsId: this.goodsId
-            }).then((res1) => {
-              console.log(res1,'res1');
-              if(res1.data && res1.data.length > 0){
-                  //课程老师模板
-                  let teacherTel = res1.data;
-                  //商品课程
-                  let courses = res.rows;
-                  teacherTel.forEach((tea) => {
-                    let dataList = []
-                    let teacherList = []
-                      courses.forEach((item) => {
-                        let data = tea.courseList.filter(x => x.courseId == item.courseId)
-                        if(data && data.length > 0){
-                          dataList.push(item)
-                          teacherList = tea.courseList
-                        }
-                      })
-                      let result = {
-                        teaList:teacherList,
-                        courseList:dataList
-                      }
-                      this.goodsTeacher.push(result)
-                  })
-                  if(this.goodsTeacher && this.goodsTeacher.length > 0){
-                    let courseIds = []
-                    this.goodsTeacher.forEach((item) => {
-                        item.courseList.forEach((course) => {
-                          courseIds.push(course.courseId)
-                        })
-                    })
-                    if(courseIds.length > 0){
-                      courses.forEach((item) => {
-                          if(!courseIds.includes(item.courseId)){
-                              let data = {
-                                teaList:[],
-                                courseList: []
-                              }
-                              data.courseList.push(item)
-                              this.goodsTeacher.push(data)
-                          }
-                      })
-                    }
-                    this.goodsTeacher.forEach((item) => {
-                      if(item.courseList && item.courseList.length > 0){
-                        item.courseList[0].show = 1
-                      }
-                    })
+        //获取商品双师资模板
+        this.$request
+          .getGoodsCourseTeacher({
+            goodsId: this.goodsId,
+          })
+          .then((res1) => {
+            console.log(res1, "res1");
+            if (res1.data && res1.data.length > 0) {
+              //课程老师模板
+              let teacherTel = res1.data;
+              //商品课程
+              let courses = res.rows;
+              teacherTel.forEach((tea) => {
+                let dataList = [];
+                let teacherList = [];
+                courses.forEach((item) => {
+                  let data = tea.courseList.filter(
+                    (x) => x.courseId == item.courseId
+                  );
+                  if (data && data.length > 0) {
+                    dataList.push(item);
+                    teacherList = tea.courseList;
                   }
-              }else{
-                //没有双师资模板
-                res.rows.forEach((item) => {
-                  item.show = 1
-                  let data = {
-                      teaList:[],
-                      courseList: []
+                });
+                let result = {
+                  teaList: teacherList,
+                  courseList: dataList,
+                };
+                this.goodsTeacher.push(result);
+              });
+              if (this.goodsTeacher && this.goodsTeacher.length > 0) {
+                let courseIds = [];
+                this.goodsTeacher.forEach((item) => {
+                  item.courseList.forEach((course) => {
+                    courseIds.push(course.courseId);
+                  });
+                });
+                if (courseIds.length > 0) {
+                  courses.forEach((item) => {
+                    if (!courseIds.includes(item.courseId)) {
+                      let data = {
+                        teaList: [],
+                        courseList: [],
+                      };
+                      data.courseList.push(item);
+                      this.goodsTeacher.push(data);
+                    }
+                  });
+                }
+                this.goodsTeacher.forEach((item) => {
+                  if (item.courseList && item.courseList.length > 0) {
+                    item.courseList[0].show = 1;
                   }
-                  data.courseList.push(item)
-                  this.goodsTeacher.push(data)
-                })
-               
+                });
               }
-            }) 
-             console.log(this.goodsTeacher,'this.goodsTeacher'); 
+            } else {
+              //没有双师资模板
+              res.rows.forEach((item) => {
+                item.show = 1;
+                let data = {
+                  teaList: [],
+                  courseList: [],
+                };
+                data.courseList.push(item);
+                this.goodsTeacher.push(data);
+              });
+            }
+          });
+        console.log(this.goodsTeacher, "this.goodsTeacher");
         this.courseList = res.rows;
 
         if (this.needOpen) {
@@ -2796,21 +2841,21 @@ export default {
     }
   }
 
-// 老师名字样式
-.teacher_names {
-	display: flex;
-	margin-left: 20px;
+  // 老师名字样式
+  .teacher_names {
+    display: flex;
+    margin-left: 20px;
     .names {
       font-size: 13px;
       color: #666666;
       margin-right: 12px;
       cursor: pointer;
-      background: #F8F8F8;
+      background: #f8f8f8;
       border-radius: 4px;
       padding: 3px 6px;
       &.nactive {
-        color: #3F8DFD;
-        background: #F2F7FF;
+        color: #3f8dfd;
+        background: #f2f7ff;
       }
     }
   }

+ 123 - 108
src/pages/goods-detail/live-detail.vue

@@ -538,8 +538,13 @@
     <ToolBar></ToolBar>
     <Footer></Footer>
     <!-- 规格选择 -->
-    <index-sku-dialog :skuModal.sync="skuModal" :specTemplateId="goodsDetail.specTemplateId" :isCarOrBuy="isCarOrBuy"
-      @toShopCart='getAddCar($event)' @togoBuy="togoBuy($event)"></index-sku-dialog>
+    <index-sku-dialog
+      :skuModal.sync="skuModal"
+      :specTemplateId="goodsDetail.specTemplateId"
+      :isCarOrBuy="isCarOrBuy"
+      @toShopCart="getAddCar($event)"
+      @togoBuy="togoBuy($event)"
+    ></index-sku-dialog>
   </div>
 </template>
 
@@ -548,7 +553,7 @@ import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
 import GoodsItem from "@/components/goodsItem/index";
-import IndexSkuDialog from '@/components/goodsItem/IndexSkuDialog.vue'
+import IndexSkuDialog from "@/components/goodsItem/IndexSkuDialog.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "GoodsDetail",
@@ -821,12 +826,20 @@ export default {
      */
     judgeSelect(question, questionIndex, index) {
       if (question.ques) return;
-      this.$set(this.questionList[questionIndex], "ques", index == 0 ? '1' : '0');
+      this.$set(
+        this.questionList[questionIndex],
+        "ques",
+        index == 0 ? "1" : "0"
+      );
     },
     judgeSelectChild(questionIndex, jsonIndex, index) {
       console.log(this.questionList[questionIndex].ques[jsonIndex]);
       if (this.questionList[questionIndex].ques[jsonIndex]) return;
-      this.$set(this.questionList[questionIndex].ques, jsonIndex, index == 0 ? '1' : '0');
+      this.$set(
+        this.questionList[questionIndex].ques,
+        jsonIndex,
+        index == 0 ? "1" : "0"
+      );
     },
 
     /**
@@ -1011,34 +1024,36 @@ export default {
         }
       }).auditionMinute;
 
-      // self.$request.obtainpolyvvideosign(self.vid).then((res) => {
-      self.player = polyvPlayer({
-        wrap: "#player",
-        width: 800,
-        height: 450,
-        vid: self.vid,
-        start: 0,
-        end: auditionMinute,
-        teaser_show: 0,
-        // ts: res.data.ts,
-        // sign: res.data.sign,
-        playsafe: function (vid, next) {
-          next();
-        },
-      });
+      self.$request.obtainpolyvvideosign(self.vid).then((res) => {
+        self.player = polyvPlayer({
+          wrap: "#player",
+          width: 800,
+          height: 450,
+          vid: self.vid,
+          start: 0,
+          end: auditionMinute,
+          teaser_show: 0,
+          ts: res.data.ts,
+          sign: res.data.sign,
+          playsafe: function (vid, next) {
+            self.$request.obtainpolyvvideopcsign(vid).then((res) => {
+              next(res.data);
+            });
+          },
+        });
 
-      self.player.on("s2j_onPlayOver", () => {
-        this.$confirm("试看结束,购买课程可学习全部", "提示", {
-          closeOnClickModal: false,
-          showCancelButton: false,
-          closeOnPressEscape: false,
-          distinguishCancelAndClose: false,
-          showClose: false,
-        }).then((res) => {
-          this.videoModalShow = false;
+        self.player.on("s2j_onPlayOver", () => {
+          this.$confirm("试看结束,购买课程可学习全部", "提示", {
+            closeOnClickModal: false,
+            showCancelButton: false,
+            closeOnPressEscape: false,
+            distinguishCancelAndClose: false,
+            showClose: false,
+          }).then((res) => {
+            this.videoModalShow = false;
+          });
         });
       });
-      // });
     },
     /**
      * @param {String} 直播预览
@@ -1340,39 +1355,37 @@ export default {
       });
     },
     cancelClassModal() {
-      this.selectClassModal = false
-      this.goodsId = this.$route.params.goodsId
+      this.selectClassModal = false;
+      this.goodsId = this.$route.params.goodsId;
     },
     selectClick(goodsDetail, type, goodsId) {
       if (type == "class") {
-        //选择班级  
+        //选择班级
         // 之前的传参:goodsId:goodsDetail.goodsId
         if (!this.gradeList.length) {
-          this.$request
-            .goodsGradeList({ goodsId: goodsId })
-            .then((res) => {
-              this.gradeList = res.rows;
-              if (this.gradeList.length == 0) {
+          this.$request.goodsGradeList({ goodsId: goodsId }).then((res) => {
+            this.gradeList = res.rows;
+            if (this.gradeList.length == 0) {
+              let item = {
+                className: "系统分班",
+                gradeId: 0,
+              };
+              this.gradeList.push(item);
+            } else {
+              let isGradeFull = this.gradeList.every(
+                (item) =>
+                  item.studentNum > 0 && item.studentNum == item.studentUpper
+              );
+              //所有班级都满了
+              if (isGradeFull) {
                 let item = {
                   className: "系统分班",
                   gradeId: 0,
                 };
-                this.gradeList.push(item);
-              } else {
-                let isGradeFull = this.gradeList.every(
-                  (item) =>
-                    item.studentNum > 0 && item.studentNum == item.studentUpper
-                );
-                //所有班级都满了
-                if (isGradeFull) {
-                  let item = {
-                    className: "系统分班",
-                    gradeId: 0,
-                  };
-                  this.gradeList.unshift(item);
-                }
+                this.gradeList.unshift(item);
               }
-            });
+            }
+          });
         }
       } else if (type == "apply") {
         //选择考试地点
@@ -1411,13 +1424,13 @@ export default {
       if (this.$tools.isLogin()) {
         // 判断有没有规格选择
         if (this.goodsDetail.specTemplateId) {
-          this.isCarOrBuy = 2
+          this.isCarOrBuy = 2;
           // this.skuModal = true
-          this.getSpecDetail()
-          return
+          this.getSpecDetail();
+          return;
         }
-        
-        this.toPayment(this.goodsDetail)
+
+        this.toPayment(this.goodsDetail);
       } else {
         this.setCurrentRouter(this.$route);
         this.$router.push({
@@ -1427,43 +1440,43 @@ export default {
       }
     },
     togoBuy(skuItem) {
-      this.toPayment(skuItem)
-      this.goodsId = skuItem.goodsId
+      this.toPayment(skuItem);
+      this.goodsId = skuItem.goodsId;
     },
     toPayment(goodsDetail) {
       let selectGoodsList = JSON.parse(JSON.stringify([goodsDetail]));
-        selectGoodsList.forEach((item) => {
-          if (item.goodsType == 1) {
-            if (item.templateType == "class") {
-              let goodsInputData = {
-                type: "class",
-                gradeId: this.gradeId,
-                gradeJson: JSON.stringify(
-                  this.gradeList.find((grade) => grade.gradeId == this.gradeId)
-                ),
-              };
-              item.goodsInputData = goodsInputData;
-            }
-            if (item.templateType == "apply") {
-              let goodsInputData = {
-                type: "apply",
-                applyAreasJson: JSON.stringify(this.applyAreas),
-                examDateJson: JSON.stringify(
-                  this.examineList.find(
-                    (exam) => exam.educationId == this.educationId
-                  )
-                ),
-              };
-              item.goodsInputData = goodsInputData;
-            }
+      selectGoodsList.forEach((item) => {
+        if (item.goodsType == 1) {
+          if (item.templateType == "class") {
+            let goodsInputData = {
+              type: "class",
+              gradeId: this.gradeId,
+              gradeJson: JSON.stringify(
+                this.gradeList.find((grade) => grade.gradeId == this.gradeId)
+              ),
+            };
+            item.goodsInputData = goodsInputData;
           }
-        });
+          if (item.templateType == "apply") {
+            let goodsInputData = {
+              type: "apply",
+              applyAreasJson: JSON.stringify(this.applyAreas),
+              examDateJson: JSON.stringify(
+                this.examineList.find(
+                  (exam) => exam.educationId == this.educationId
+                )
+              ),
+            };
+            item.goodsInputData = goodsInputData;
+          }
+        }
+      });
 
-        localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
+      localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
 
-        this.$router.push({
-          path: "/payment",
-        });
+      this.$router.push({
+        path: "/payment",
+      });
     },
     pay() {
       if (
@@ -1543,16 +1556,17 @@ export default {
         return;
       }
       // 判断有没有规格选择
-			if (this.goodsDetail.specTemplateId) {
-				this.isCarOrBuy = 1
-				// this.skuModal = true
-        this.getSpecDetail()
-				return
-			}
-      this.getAddCar(this.goodsId)
+      if (this.goodsDetail.specTemplateId) {
+        this.isCarOrBuy = 1;
+        // this.skuModal = true
+        this.getSpecDetail();
+        return;
+      }
+      this.getAddCar(this.goodsId);
     },
     getAddCar(goodsId) {
-      this.$request.addCart({ goodsId: goodsId })
+      this.$request
+        .addCart({ goodsId: goodsId })
         .then((res) => {
           this.getCartCount();
           this.$message({
@@ -1570,23 +1584,24 @@ export default {
         });
     },
     getSpecDetail() {
-			this.$axios({
-				url: `/app/common/spec/${this.goodsDetail.specTemplateId}`,
-				method: 'get',
-				noToken: true
-			}).then((res) => {
+      this.$axios({
+        url: `/app/common/spec/${this.goodsDetail.specTemplateId}`,
+        method: "get",
+        noToken: true,
+      })
+        .then((res) => {
           if (res.data) {
-            this.skuModal = true
+            this.skuModal = true;
           } else {
             if (this.isCarOrBuy == 1) {
-              this.getAddCar(this.goodsId)
+              this.getAddCar(this.goodsId);
             } else {
-              this.toPayment(this.goodsDetail)
+              this.toPayment(this.goodsDetail);
             }
-
           }
-			}).catch(() => {})
-		},
+        })
+        .catch(() => {});
+    },
     /**
      * 获取商品详情
      */

+ 932 - 859
src/pages/goodsTopic/components/catalogue.vue

@@ -1,221 +1,260 @@
 <template>
-    <!-- <div> -->
-    <div class="container">
-        <div class="con_header">
-            <div v-for="(item, index) in subList" :key="index" class="con_item"
-                :class="{nactive: subIndex == index}" @click="toChangeCou(item, index)">{{ item.subjectName }}</div>
-        </div>
-        <div class="course_info">
-            <div
-                class="video_box"
-                :style="{ backgroundImage: `url(${$tools.splitImgHost(goodsDetail.coverUrl,false)})`,}"
-                >
-                <div v-show="vid" id="player" class="video"></div>
-                <div v-show="vidzb" id="playerzb" class="video"></div>
-            </div>
-            <div class="right-box">
-                <div class="right-box__header">
-                    <div class="tabs">
-                        <el-tabs v-model="courseTabIndex">
-                            <el-tab-pane
-                                :name="tab.name"
-                                v-for="(tab, index) in menuTab"
-                                :key="index"
-                            >
-                                <div slot="label">
-                                    <span class="label">{{ tab.label }}</span>
+  <!-- <div> -->
+  <div class="container">
+    <div class="con_header">
+      <div
+        v-for="(item, index) in subList"
+        :key="index"
+        class="con_item"
+        :class="{ nactive: subIndex == index }"
+        @click="toChangeCou(item, index)"
+      >
+        {{ item.subjectName }}
+      </div>
+    </div>
+    <div class="course_info">
+      <div
+        class="video_box"
+        :style="{
+          backgroundImage: `url(${$tools.splitImgHost(
+            goodsDetail.coverUrl,
+            false
+          )})`,
+        }"
+      >
+        <div v-show="vid" id="player" class="video"></div>
+        <div v-show="vidzb" id="playerzb" class="video"></div>
+      </div>
+      <div class="right-box">
+        <div class="right-box__header">
+          <div class="tabs">
+            <el-tabs v-model="courseTabIndex">
+              <el-tab-pane
+                :name="tab.name"
+                v-for="(tab, index) in menuTab"
+                :key="index"
+              >
+                <div slot="label">
+                  <span class="label">{{ tab.label }}</span>
+                </div>
+                <!-- 章节目录 -->
+                <template v-if="tab.name == '1'">
+                  <div class="mulu_body">
+                    <div class="left-box">
+                      <div
+                        v-for="(courseItem, tindex) in goodsTeacher"
+                        :key="tindex + 'one'"
+                      >
+                        <div class="left-box__body">
+                          <template
+                            v-for="(course, cindex) in courseItem.courseList"
+                          >
+                            <!-- v-for="(course, cindex) in s_courseList" -->
+                            <div v-if="course.show == 1" :key="cindex + 'two'">
+                              <div
+                                class="course-list-item"
+                                v-show="
+                                  course.subjectId === newActiveSubjectId ||
+                                  !newActiveSubjectId
+                                "
+                              >
+                                <div
+                                  class="course-list-item_title"
+                                  @click="openCourse(course)"
+                                >
+                                  <i
+                                    :class="{
+                                      'el-icon-caret-right': !course.showList,
+                                      'el-icon-caret-bottom': course.showList,
+                                    }"
+                                  ></i>
+                                  {{ course.courseName }}
                                 </div>
-                                <!-- 章节目录 -->
-                                <template v-if="tab.name == '1'">
-                                    <div class="mulu_body">
-                                        <div class="left-box">
-                                            <div v-for="(courseItem, tindex) in goodsTeacher" :key="tindex + 'one'">
-                                            <div class="left-box__body">
-                                                <template v-for="(course, cindex) in courseItem.courseList">
-                                                    <!-- v-for="(course, cindex) in s_courseList" -->
-                                                    <div v-if="course.show == 1" :key="cindex + 'two'">
-                                                        <div
-                                                            class="course-list-item"
-                                                            v-show="course.subjectId === newActiveSubjectId || !newActiveSubjectId"
-                                                        >
-                                                            <div
-                                                                class="course-list-item_title"
-                                                                @click="openCourse(course)"
-                                                            >
-                                                                <i
-                                                                :class="{
-                                                                    'el-icon-caret-right': !course.showList,
-                                                                    'el-icon-caret-bottom': course.showList,
-                                                                }"
-                                                                ></i>
-                                                                {{ course.courseName }}
-                                                            </div>
-                                                            <div v-if="courseItem.teaList && courseItem.teaList.length > 0" class="teacher_names">
-                                                                <div v-for="(tea, index) in courseItem.teaList" :key="index + 'three'" class="names"
-                                                                :class="{nactive: States[tindex] == index}"
-                                                                 @click="switchTeacher(tea, index, tindex)">
-                                                                {{ tea.aliasName }}
-                                                                </div>
-                                                            </div>
-                                                            <template v-if="course.showList">
-                                                                <div
-                                                                class="item"
-                                                                v-for="(item, index) in course.list"
-                                                                :key="index"
-                                                                >
-                                                                <template v-if="item.type == 1">
-                                                                    <div
-                                                                    class="item__title"
-                                                                    @click="openModule(item)"
-                                                                    >
-                                                                    <i
-                                                                        :class="{
-                                                                        'el-icon-caret-right': !item.showList,
-                                                                        'el-icon-caret-bottom': item.showList,
-                                                                        }"
-                                                                    ></i>
-                                                                    {{ item.name }}
-                                                                    </div>
-                                                                    <div class="item__content">
-                                                                    <div
-                                                                        class="bank-chapter"
-                                                                        v-if="item.showList"
-                                                                    >
-                                                                        <div
-                                                                        class="bank-chapter__item"
-                                                                        v-for="(
-                                                                            chapter, chapterIndex
-                                                                        ) in item.list"
-                                                                        :key="chapterIndex"
-                                                                        >
-                                                                        <div
-                                                                            class="bank-chapter__item__text"
-                                                                            @click="openChapter(chapter)"
-                                                                        >
-                                                                            <i
-                                                                            :class="{
-                                                                                'el-icon-caret-right':
-                                                                                !chapter.showList,
-                                                                                'el-icon-caret-bottom':
-                                                                                chapter.showList,
-                                                                            }"
-                                                                            ></i
-                                                                            >{{ chapter.name }}
-                                                                        </div>
-
-                                                                        <div
-                                                                            class="bank-section"
-                                                                            v-if="chapter.showList"
-                                                                        >
-                                                                            <div
-                                                                            class="bank-section__item"
-                                                                            v-for="(
-                                                                                section, sectionIndex
-                                                                            ) in chapter.list"
-                                                                            :key="sectionIndex"
-                                                                            >
-                                                                            <div
-                                                                                class="bank-section__item__text"
-                                                                            >
-                                                                                {{ section.name }}
-                                                                            </div>
-                                                                            <div
-                                                                                v-if="section.tryListen"
-                                                                                @click="
-                                                                                toDo(section, item.courseId)
-                                                                                "
-                                                                                class="btn"
-                                                                            >
-                                                                                试看
-                                                                            </div>
-                                                                            </div>
-                                                                        </div>
-                                                                        </div>
-                                                                    </div>
-                                                                    </div>
-                                                                </template>
+                                <div
+                                  v-if="
+                                    courseItem.teaList &&
+                                    courseItem.teaList.length > 0
+                                  "
+                                  class="teacher_names"
+                                >
+                                  <div
+                                    v-for="(tea, index) in courseItem.teaList"
+                                    :key="index + 'three'"
+                                    class="names"
+                                    :class="{
+                                      nactive: States[tindex] == index,
+                                    }"
+                                    @click="switchTeacher(tea, index, tindex)"
+                                  >
+                                    {{ tea.aliasName }}
+                                  </div>
+                                </div>
+                                <template v-if="course.showList">
+                                  <div
+                                    class="item"
+                                    v-for="(item, index) in course.list"
+                                    :key="index"
+                                  >
+                                    <template v-if="item.type == 1">
+                                      <div
+                                        class="item__title"
+                                        @click="openModule(item)"
+                                      >
+                                        <i
+                                          :class="{
+                                            'el-icon-caret-right':
+                                              !item.showList,
+                                            'el-icon-caret-bottom':
+                                              item.showList,
+                                          }"
+                                        ></i>
+                                        {{ item.name }}
+                                      </div>
+                                      <div class="item__content">
+                                        <div
+                                          class="bank-chapter"
+                                          v-if="item.showList"
+                                        >
+                                          <div
+                                            class="bank-chapter__item"
+                                            v-for="(
+                                              chapter, chapterIndex
+                                            ) in item.list"
+                                            :key="chapterIndex"
+                                          >
+                                            <div
+                                              class="bank-chapter__item__text"
+                                              @click="openChapter(chapter)"
+                                            >
+                                              <i
+                                                :class="{
+                                                  'el-icon-caret-right':
+                                                    !chapter.showList,
+                                                  'el-icon-caret-bottom':
+                                                    chapter.showList,
+                                                }"
+                                              ></i
+                                              >{{ chapter.name }}
+                                            </div>
 
-                                                                <template v-if="item.type == 2">
-                                                                    <div class="item__content">
-                                                                    <div class="bank-chapter">
-                                                                        <div class="bank-chapter__item">
-                                                                        <div
-                                                                            class="bank-chapter__item__text"
-                                                                            @click="openChapter(item)"
-                                                                        >
-                                                                            <i
-                                                                            :class="{
-                                                                                'el-icon-caret-right':
-                                                                                !item.showList,
-                                                                                'el-icon-caret-bottom':
-                                                                                item.showList,
-                                                                            }"
-                                                                            ></i
-                                                                            >{{ item.name }}
-                                                                        </div>
+                                            <div
+                                              class="bank-section"
+                                              v-if="chapter.showList"
+                                            >
+                                              <div
+                                                class="bank-section__item"
+                                                v-for="(
+                                                  section, sectionIndex
+                                                ) in chapter.list"
+                                                :key="sectionIndex"
+                                              >
+                                                <div
+                                                  class="
+                                                    bank-section__item__text
+                                                  "
+                                                >
+                                                  {{ section.name }}
+                                                </div>
+                                                <div
+                                                  v-if="section.tryListen"
+                                                  @click="
+                                                    toDo(section, item.courseId)
+                                                  "
+                                                  class="btn"
+                                                >
+                                                  试看
+                                                </div>
+                                              </div>
+                                            </div>
+                                          </div>
+                                        </div>
+                                      </div>
+                                    </template>
 
-                                                                        <div
-                                                                            class="bank-section"
-                                                                            v-if="item.showList"
-                                                                        >
-                                                                            <div
-                                                                            class="bank-section__item"
-                                                                            v-for="(
-                                                                                section, sectionIndex
-                                                                            ) in item.list"
-                                                                            :key="sectionIndex"
-                                                                            >
-                                                                            <div
-                                                                                class="bank-section__item__text"
-                                                                            >
-                                                                                {{ section.name }}
-                                                                            </div>
-                                                                            <div
-                                                                                v-if="section.tryListen"
-                                                                                @click="
-                                                                                toDo(section, item.courseId)
-                                                                                "
-                                                                                class="btn"
-                                                                            >
-                                                                                试看
-                                                                            </div>
-                                                                            </div>
-                                                                        </div>
-                                                                        </div>
-                                                                    </div>
-                                                                    </div>
-                                                                </template>
+                                    <template v-if="item.type == 2">
+                                      <div class="item__content">
+                                        <div class="bank-chapter">
+                                          <div class="bank-chapter__item">
+                                            <div
+                                              class="bank-chapter__item__text"
+                                              @click="openChapter(item)"
+                                            >
+                                              <i
+                                                :class="{
+                                                  'el-icon-caret-right':
+                                                    !item.showList,
+                                                  'el-icon-caret-bottom':
+                                                    item.showList,
+                                                }"
+                                              ></i
+                                              >{{ item.name }}
+                                            </div>
 
-                                                                <template v-if="item.type == 3">
-                                                                    <div class="item__content">
-                                                                    <div class="bank-section">
-                                                                        <div class="bank-section__item">
-                                                                        <div class="bank-section__item__text">
-                                                                            {{ item.name }}
-                                                                        </div>
-                                                                        <div
-                                                                            v-if="item.tryListen"
-                                                                            @click="toDo(item, item.courseId)"
-                                                                            class="btn"
-                                                                        >
-                                                                            试看
-                                                                        </div>
-                                                                        </div>
-                                                                    </div>
-                                                                    </div>
-                                                                </template>
-                                                                </div>
-                                                            </template>
-                                                        </div>
-                                                    </div>
-                                                </template>
+                                            <div
+                                              class="bank-section"
+                                              v-if="item.showList"
+                                            >
+                                              <div
+                                                class="bank-section__item"
+                                                v-for="(
+                                                  section, sectionIndex
+                                                ) in item.list"
+                                                :key="sectionIndex"
+                                              >
+                                                <div
+                                                  class="
+                                                    bank-section__item__text
+                                                  "
+                                                >
+                                                  {{ section.name }}
+                                                </div>
+                                                <div
+                                                  v-if="section.tryListen"
+                                                  @click="
+                                                    toDo(section, item.courseId)
+                                                  "
+                                                  class="btn"
+                                                >
+                                                  试看
+                                                </div>
+                                              </div>
                                             </div>
+                                          </div>
+                                        </div>
+                                      </div>
+                                    </template>
 
+                                    <template v-if="item.type == 3">
+                                      <div class="item__content">
+                                        <div class="bank-section">
+                                          <div class="bank-section__item">
+                                            <div
+                                              class="bank-section__item__text"
+                                            >
+                                              {{ item.name }}
                                             </div>
+                                            <div
+                                              v-if="item.tryListen"
+                                              @click="toDo(item, item.courseId)"
+                                              class="btn"
+                                            >
+                                              试看
+                                            </div>
+                                          </div>
                                         </div>
-                                    </div>
-                                    <div class="down_bottons">
-                                        <!-- <div class="asks">
+                                      </div>
+                                    </template>
+                                  </div>
+                                </template>
+                              </div>
+                            </div>
+                          </template>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                  <div class="down_bottons">
+                    <!-- <div class="asks">
                                             <div class="ask_manage" @click="toAskManage()">咨询管理</div>
                                             <div class="apply_ask">
                                                 <div class="ask_titles">报名咨询</div>
@@ -226,725 +265,759 @@
                                                 </div>
                                             </div>
                                         </div> -->
-                                        <el-popover placement="top" width="202" trigger="hover">
-                                            <div class="apply_ask">
-                                                <div class="ask_titles">报名咨询</div>
-                                                <div class="ask_time">{{ header.serviceTel.time }}</div>
-                                                <div class="phones" v-for="(item, index) in getTel(header.serviceTel.tel)" :key="index">
-                                                    <img class="icon_phone" src="@/assets/topic/ask_phone.png" alt="" />
-                                                    <span>{{ item }}</span>
-                                                </div>
-                                            </div>
-                                            <div slot="reference">
-                                                <div class="ask_manage" @click="toAskManage()">咨询管理</div>
-                                            </div>
-                                        </el-popover>
-                                        <div class="ask_buy" @click="togoBuy()">立即购买</div>
-                                        
-                                    </div>
-                                </template>
-                            </el-tab-pane>
-                        </el-tabs>
-                    </div>
-                </div>
-            </div>
+                    <el-popover placement="top" width="202" trigger="hover">
+                      <div class="apply_ask">
+                        <div class="ask_titles">报名咨询</div>
+                        <div class="ask_time">{{ header.serviceTel.time }}</div>
+                        <div
+                          class="phones"
+                          v-for="(item, index) in getTel(header.serviceTel.tel)"
+                          :key="index"
+                        >
+                          <img
+                            class="icon_phone"
+                            src="@/assets/topic/ask_phone.png"
+                            alt=""
+                          />
+                          <span>{{ item }}</span>
+                        </div>
+                      </div>
+                      <div slot="reference">
+                        <div class="ask_manage" @click="toAskManage()">
+                          咨询管理
+                        </div>
+                      </div>
+                    </el-popover>
+                    <div class="ask_buy" @click="togoBuy()">立即购买</div>
+                  </div>
+                </template>
+              </el-tab-pane>
+            </el-tabs>
+          </div>
         </div>
-        
-        <!-- 弹窗 -->
-        <buy-dialog :buyModal.sync="buyModal" :topicId="topicId" :subjectType="1" :type="3"></buy-dialog>
+      </div>
     </div>
-        
-    <!-- </div> -->
+
+    <!-- 弹窗 -->
+    <buy-dialog
+      :buyModal.sync="buyModal"
+      :topicId="topicId"
+      :subjectType="1"
+      :type="3"
+    ></buy-dialog>
+  </div>
+
+  <!-- </div> -->
 </template>
 
 <script>
-import { mapGetters } from "vuex"
-import buyDialog from './buyDialog.vue'
+import { mapGetters } from "vuex";
+import buyDialog from "./buyDialog.vue";
 export default {
-    name: 'boxs',
-    components: { buyDialog },
-    props: {
-        goodsId: {
-            type: [String, Number],
-            default: ''
+  name: "boxs",
+  components: { buyDialog },
+  props: {
+    goodsId: {
+      type: [String, Number],
+      default: "",
+    },
+    topicId: {
+      type: [String, Number],
+      default: "",
+    },
+  },
+  data() {
+    return {
+      vid: "",
+      vidzb: "",
+      player: "",
+      playerzb: "",
+      activeId: "", //当前选中ID
+      vodPlayerJs: "https://player.polyv.net/script/player.js",
+      playerJs:
+        "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
+      uidzb: "egsxlptzdq",
+      menuTab: [
+        {
+          name: "1",
+          label: "章节目录",
         },
-        topicId: {
-            type: [String, Number],
-            default: ''
+      ],
+      courseTabIndex: "1",
+      param: {
+        pageNum: 1,
+        pageSize: 100,
+        total: 0,
+      },
+      needOpen: true, //是否需要一进来展开第一章节
+      menuIndex: [], //需要展开的章节索引值
+      courseList: [],
+      s_courseList: [],
+      goodsAuditionConfigIdList: [],
+      listenConfigList: [],
+      courserIndex: 0,
+      goodsDetail: {},
+      goodsExamConfig: [],
+      subList: [],
+      subIndex: 0,
+      playCourseId: 0, // 播放课程id
+      showAsk: false,
+      buyModal: false,
+      goodsTeacher: [],
+      teaIndex: 0,
+      States: { 0: 0 },
+      newActiveSubjectId: "",
+    };
+  },
+  watch: {
+    async goodsId(newV, oldV) {
+      if (newV) {
+        await this.getGoodsDetail();
+        this.goodsCourseList();
+      }
+    },
+  },
+  computed: {
+    ...mapGetters(["header"]),
+  },
+  methods: {
+    getTel(tel) {
+      return tel ? tel.split(";") : [];
+    },
+    toAskManage() {
+      this.showAsk = !this.showAsk;
+    },
+    toChangeCou(item, index) {
+      this.newActiveSubjectId = item.subjectId;
+      this.subIndex = index;
+      // this.s_courseList = this.courseList.filter(e => e.subjectId == item.subjectId)
+    },
+    togoBuy() {
+      this.buyModal = true;
+    },
+    /**
+     * 获取商品详情
+     */
+    getGoodsDetail() {
+      this.$request.commonGoodsDetail(this.goodsId).then((res) => {
+        if (res.data.pcDetailHtml) {
+          res.data.pcDetailHtml =
+            res.data.pcDetailHtml &&
+            res.data.pcDetailHtml.replace(
+              /<img/gi,
+              '<img style="max-width:100%;height:100%;display:block;margin:0px auto;"'
+            );
+        }
+        this.goodsDetail = res.data;
+        this.goodsExamConfig = JSON.parse(res.data.goodsExamConfig);
+
+        if (this.goodsDetail.goodsAuditionConfig) {
+          this.listenConfigList = JSON.parse(
+            this.goodsDetail.goodsAuditionConfig
+          );
+          for (var itemChild of this.listenConfigList) {
+            this.goodsAuditionConfigIdList.push(itemChild.sectionId); //存储试听节ID
+          }
+          console.log(
+            this.goodsAuditionConfigIdList,
+            "this.goodsAuditionConfigIdList"
+          );
         }
+      });
     },
-    data() {
-        return {
-            vid: "",
-            vidzb: "",
-            player: "",
-            playerzb: "",
-            activeId: "", //当前选中ID
-            vodPlayerJs: "https://player.polyv.net/script/player.js",
-            playerJs:
-                "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
-            uidzb: "egsxlptzdq",
-            menuTab: [
-                {
-                    name: "1",
-                    label: "章节目录",
-                }
-            ],
-            courseTabIndex: "1",
-            param: {
-                pageNum: 1,
-                pageSize: 100,
-                total: 0,
-            },
-            needOpen: true, //是否需要一进来展开第一章节
-            menuIndex: [], //需要展开的章节索引值
-            courseList: [],
-            s_courseList: [],
-            goodsAuditionConfigIdList: [],
-            listenConfigList: [],
-            courserIndex: 0,
-            goodsDetail: {},
-            goodsExamConfig: [],
-            subList: [],
-            subIndex: 0,
-            playCourseId: 0, // 播放课程id
-            showAsk: false,
-            buyModal: false,
-            goodsTeacher: [],
-            teaIndex: 0,
-            States: {0: 0},
-            newActiveSubjectId: '',
+    //切换老师
+    switchTeacher(data, index, tindex) {
+      console.log(data, "data", index, tindex);
+      this.States[tindex] = index;
+      this.teaIndex = index;
+      this.goodsTeacher.forEach((item, index) => {
+        if (item.teaList && item.teaList.length > 0) {
+          let list = item.teaList.filter((x) => x.courseId == data.courseId);
+          if (list && list.length > 0) {
+            item.courseList.forEach((course, courseIndex) => {
+              if (course.courseId == data.courseId) {
+                this.$set(
+                  this.goodsTeacher[index].courseList[courseIndex],
+                  "show",
+                  1
+                );
+              } else {
+                this.$set(
+                  this.goodsTeacher[index].courseList[courseIndex],
+                  "show",
+                  0
+                );
+              }
+            });
+          }
         }
+      });
     },
-    watch: {
-        async goodsId(newV, oldV) {
-            if (newV) {
-                await this.getGoodsDetail()
-                this.goodsCourseList()
+    /**
+     * 获取课程章节列表,/app/common/goods/course/list/' + data,
+     */
+    goodsCourseList() {
+      this.$request.goodsCourseList(this.goodsId).then(async (res) => {
+        if (res.code == 200) {
+          res.rows.forEach((item) => {
+            item.showList = false;
+            item.list = [];
+          });
+          // 获取双师制
+          this.getCourseTeacher(res.rows);
+          this.courseList = res.rows || [];
+          // 筛选科目名称
+          let ids = [];
+          const newArr = [];
+          this.courseList.forEach((item) => {
+            if (ids.indexOf(item.subjectId) == -1) {
+              ids.push(item.subjectId);
+              newArr.push(item);
+            }
+          });
+          this.subList = [...newArr];
+          this.subList = this.subList.filter((item) => item.subjectName);
+          console.log("this.subList", this.subList);
+          this.subList.length &&
+            (this.newActiveSubjectId = this.subList[0].subjectId);
+
+          if (this.needOpen) {
+            for (let i = 0; i < this.courseList.length; i++) {
+              let menuIndexOrFalse = await this.getCourseMenus(
+                this.courseList[i]
+              );
+              // console.log('111menuIndexOrFalse', menuIndexOrFalse)
+              if (menuIndexOrFalse !== false) {
+                this.menuIndex = [i, menuIndexOrFalse];
+                this.openCourse(this.courseList[i]);
+                break;
+              }
             }
+            this.s_courseList = this.courseList.filter(
+              (item) => item.subjectId == this.subList[0].subjectId
+            );
+          }
+          console.log("s_courseList", this.s_courseList);
         }
+      });
     },
-    computed: {
-        ...mapGetters(["header"]),
-    },
-    methods: {
-        getTel(tel) {
-            return tel ? tel.split(";") : []
-        },
-        toAskManage() {
-            this.showAsk = !this.showAsk
-        },
-        toChangeCou(item, index) {
-            this.newActiveSubjectId = item.subjectId
-            this.subIndex = index
-            // this.s_courseList = this.courseList.filter(e => e.subjectId == item.subjectId)
-        },
-        togoBuy() {
-            this.buyModal = true
-        },
-        /**
-         * 获取商品详情
-         */
-        getGoodsDetail() {
-            this.$request.commonGoodsDetail(this.goodsId).then((res) => {
-                if (res.data.pcDetailHtml) {
-                res.data.pcDetailHtml =
-                    res.data.pcDetailHtml &&
-                    res.data.pcDetailHtml.replace(
-                    /<img/gi,
-                    '<img style="max-width:100%;height:100%;display:block;margin:0px auto;"'
-                    );
-                }
-                this.goodsDetail = res.data
-                this.goodsExamConfig = JSON.parse(res.data.goodsExamConfig)
-
-                if (this.goodsDetail.goodsAuditionConfig) {
-                    this.listenConfigList = JSON.parse(this.goodsDetail.goodsAuditionConfig);
-                    for (var itemChild of this.listenConfigList) {
-                        this.goodsAuditionConfigIdList.push(itemChild.sectionId); //存储试听节ID
-                    }
-                    console.log(
-                        this.goodsAuditionConfigIdList,
-                        "this.goodsAuditionConfigIdList"
-                    );
+    getCourseTeacher(rows) {
+      //获取商品双师资模板
+      this.$request
+        .getGoodsCourseTeacher({
+          goodsId: this.goodsId,
+        })
+        .then((res1) => {
+          console.log(res1, "res1");
+          if (res1.data && res1.data.length > 0) {
+            //课程老师模板
+            let teacherTel = res1.data;
+            //商品课程
+            let courses = rows;
+            teacherTel.forEach((tea) => {
+              let dataList = [];
+              let teacherList = [];
+              courses.forEach((item) => {
+                let data = tea.courseList.filter(
+                  (x) => x.courseId == item.courseId
+                );
+                if (data && data.length > 0) {
+                  dataList.push(item);
+                  teacherList = tea.courseList;
                 }
+              });
+              let result = {
+                teaList: teacherList,
+                courseList: dataList,
+              };
+              this.goodsTeacher.push(result);
             });
-        },
-        //切换老师
-        switchTeacher(data, index, tindex){
-            console.log(data,'data', index,tindex);
-            this.States[tindex] = index
-            this.teaIndex = index
-            this.goodsTeacher.forEach((item,index) => {
-                if(item.teaList && item.teaList.length > 0){
-                let list = item.teaList.filter(x => x.courseId == data.courseId)
-                if(list && list.length > 0){
-                    item.courseList.forEach((course,courseIndex) => {
-                        if(course.courseId == data.courseId){
-                            
-                            this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",1)
-                        }else{
-                            this.$set(this.goodsTeacher[index].courseList[courseIndex],"show",0)
-                        }
-                    })
-                }
-                }
-            })
-        },
-        /**
-         * 获取课程章节列表,/app/common/goods/course/list/' + data,
-         */
-        goodsCourseList() {
-            this.$request.goodsCourseList(this.goodsId).then(async (res) => {
-                if (res.code == 200) {
-                    res.rows.forEach((item) => {
-                        item.showList = false
-                        item.list = []
-                    })
-                    // 获取双师制
-                    this.getCourseTeacher(res.rows)
-                    this.courseList = res.rows || []
-                    // 筛选科目名称
-                    let ids = []
-                    const newArr = []
-                    this.courseList.forEach(item => {
-                        if (ids.indexOf(item.subjectId) == -1) {
-                            ids.push(item.subjectId)
-                            newArr.push(item)
-                        }
-                    })
-					this.subList = [...newArr]
-                    this.subList = this.subList.filter(item => item.subjectName)
-                    console.log('this.subList', this.subList)
-                    this.subList.length && (this.newActiveSubjectId = this.subList[0].subjectId)
-                    
-                    if (this.needOpen) {
-                        for (let i = 0; i < this.courseList.length; i++) {
-                            let menuIndexOrFalse = await this.getCourseMenus(
-                                this.courseList[i]
-                            )
-                            // console.log('111menuIndexOrFalse', menuIndexOrFalse)
-                            if (menuIndexOrFalse !== false) {
-                                this.menuIndex = [i, menuIndexOrFalse]
-                                this.openCourse(this.courseList[i])
-                                break
-                            }
-                        }
-                        this.s_courseList = this.courseList.filter(item => item.subjectId == this.subList[0].subjectId)
-                    }
-                    console.log('s_courseList', this.s_courseList);
-                }
-                
-            })
-        },
-        getCourseTeacher(rows) {
-            //获取商品双师资模板
-            this.$request.getGoodsCourseTeacher({
-               goodsId: this.goodsId
-            }).then((res1) => {
-              console.log(res1,'res1');
-              if(res1.data && res1.data.length > 0){
-                  //课程老师模板
-                  let teacherTel = res1.data;
-                  //商品课程
-                  let courses = rows;
-                  teacherTel.forEach((tea) => {
-                    let dataList = []
-                    let teacherList = []
-                      courses.forEach((item) => {
-                        let data = tea.courseList.filter(x => x.courseId == item.courseId)
-                        if(data && data.length > 0){
-                          dataList.push(item)
-                          teacherList = tea.courseList
-                        }
-                      })
-                      let result = {
-                        teaList:teacherList,
-                        courseList:dataList
-                      }
-                      this.goodsTeacher.push(result)
-                  })
-                  if(this.goodsTeacher && this.goodsTeacher.length > 0){
-                    let courseIds = []
-                    this.goodsTeacher.forEach((item) => {
-                        item.courseList.forEach((course) => {
-                          courseIds.push(course.courseId)
-                        })
-                    })
-                    if(courseIds.length > 0){
-                      courses.forEach((item) => {
-                          if(!courseIds.includes(item.courseId)){
-                              let data = {
-                                teaList:[],
-                                courseList: []
-                              }
-                              data.courseList.push(item)
-                              this.goodsTeacher.push(data)
-                          }
-                      })
-                    }
-                    this.goodsTeacher.forEach((item) => {
-                      if(item.courseList && item.courseList.length > 0){
-                        item.courseList[0].show = 1
-                      }
-                    })
-                  }
-              }else{
-                //没有双师资模板
-                rows.forEach((item) => {
-                  item.show = 1
-                  let data = {
-                      teaList:[],
-                      courseList: []
+            if (this.goodsTeacher && this.goodsTeacher.length > 0) {
+              let courseIds = [];
+              this.goodsTeacher.forEach((item) => {
+                item.courseList.forEach((course) => {
+                  courseIds.push(course.courseId);
+                });
+              });
+              if (courseIds.length > 0) {
+                courses.forEach((item) => {
+                  if (!courseIds.includes(item.courseId)) {
+                    let data = {
+                      teaList: [],
+                      courseList: [],
+                    };
+                    data.courseList.push(item);
+                    this.goodsTeacher.push(data);
                   }
-                  data.courseList.push(item)
-                  this.goodsTeacher.push(data)
-                })
-               
+                });
               }
-            }) 
-            console.log(this.goodsTeacher,'this.goodsTeacher');
-        },
-        // 获取课程目录,/app/common/course/menuList
-        getCourseMenus(item) {
-            return new Promise((resolve) => {
-                this.$request.menuList({ courseId: item.courseId }).then((res) => {
-                if (res.code == 200) {
-                    for (let i = 0; i < res.rows.length; i++) {
-                        // 1模块 2章 3节	
-                        if (res.rows[i].type == 1 || res.rows[i].type == 2) {
-                            resolve(i);
-                            break;
-                        }
-                    }
+              this.goodsTeacher.forEach((item) => {
+                if (item.courseList && item.courseList.length > 0) {
+                  item.courseList[0].show = 1;
                 }
-                });
+              });
+            }
+          } else {
+            //没有双师资模板
+            rows.forEach((item) => {
+              item.show = 1;
+              let data = {
+                teaList: [],
+                courseList: [],
+              };
+              data.courseList.push(item);
+              this.goodsTeacher.push(data);
             });
-        },
-        /**
-         * 点击课程大目录
-         */
-        openCourse(course) {
-            course.showList = !course.showList;
-
-            if (!course.list.length) {
-                this.getMenuList(course);
+          }
+        });
+      console.log(this.goodsTeacher, "this.goodsTeacher");
+    },
+    // 获取课程目录,/app/common/course/menuList
+    getCourseMenus(item) {
+      return new Promise((resolve) => {
+        this.$request.menuList({ courseId: item.courseId }).then((res) => {
+          if (res.code == 200) {
+            for (let i = 0; i < res.rows.length; i++) {
+              // 1模块 2章 3节
+              if (res.rows[i].type == 1 || res.rows[i].type == 2) {
+                resolve(i);
+                break;
+              }
             }
-        },
-        /**
-         * 获取模块列表
-         */
-        getMenuList(item) {
-            this.$request.menuList({ courseId: item.courseId }).then((res) => {
-                for (let i = 0; i < res.rows.length; i++) {
-                    let item = res.rows[i];
-                    item.showList = false;
-                    item.id = item.menuId;
-                    item.name = item.menuName;
+          }
+        });
+      });
+    },
+    /**
+     * 点击课程大目录
+     */
+    openCourse(course) {
+      course.showList = !course.showList;
 
-                    if (item.type == 3) {
-                        //判断是否试听
-                        item.tryListen = false;
-                        if (this.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
-                            item.tryListen = true;
-                        }
-                    } else {
-                        item.list = [];
-                    }
-                }
-                item.list = res.rows;
+      if (!course.list.length) {
+        this.getMenuList(course);
+      }
+    },
+    /**
+     * 获取模块列表
+     */
+    getMenuList(item) {
+      this.$request.menuList({ courseId: item.courseId }).then((res) => {
+        for (let i = 0; i < res.rows.length; i++) {
+          let item = res.rows[i];
+          item.showList = false;
+          item.id = item.menuId;
+          item.name = item.menuName;
 
-                if (this.needOpen) {
-                    if (item.list[this.menuIndex[1]].type == 1) {
-                        this.openModule(item.list[this.menuIndex[1]]);
-                    } else if (item.list[this.menuIndex[1]].type == 2) {
-                        this.needOpen = false;
-                        this.openChapter(item.list[this.menuIndex[1]]);
-                    }
-                }
-            });
-        },
-        /**
-         * 展开模块卷
-         */
-        openModule(Module) {
-            console.log('点击模块卷')
-            this.$set(Module, "showList", !Module.showList);
-            if (!Module.list.length) {
-                this.getChapterList(Module);
+          if (item.type == 3) {
+            //判断是否试听
+            item.tryListen = false;
+            if (this.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
+              item.tryListen = true;
             }
-        },
-        getChapterList(Module) {
-            this.$request.chapterList(Module.id).then((res) => {
-                for (let i = 0; i < res.data.length; i++) {
-                    let item = res.data[i];
-                    item.id = item.chapterId;
-                    item.showList = false;
-                    item.list = [];
-                    item.menuType = 2;
-                }
-                Module.list = res.data;
+          } else {
+            item.list = [];
+          }
+        }
+        item.list = res.rows;
 
-                if (this.needOpen) {
-                    this.needOpen = false;
-                    this.openChapter(Module.list[0]);
-                }
-            });
-        },
-        /**
-         * 展开章卷
-         */
-        openChapter(chapter) {
-            console.log('点开章卷')
-            this.$set(chapter, "showList", !chapter.showList);
+        if (this.needOpen) {
+          if (item.list[this.menuIndex[1]].type == 1) {
+            this.openModule(item.list[this.menuIndex[1]]);
+          } else if (item.list[this.menuIndex[1]].type == 2) {
+            this.needOpen = false;
+            this.openChapter(item.list[this.menuIndex[1]]);
+          }
+        }
+      });
+    },
+    /**
+     * 展开模块卷
+     */
+    openModule(Module) {
+      console.log("点击模块卷");
+      this.$set(Module, "showList", !Module.showList);
+      if (!Module.list.length) {
+        this.getChapterList(Module);
+      }
+    },
+    getChapterList(Module) {
+      this.$request.chapterList(Module.id).then((res) => {
+        for (let i = 0; i < res.data.length; i++) {
+          let item = res.data[i];
+          item.id = item.chapterId;
+          item.showList = false;
+          item.list = [];
+          item.menuType = 2;
+        }
+        Module.list = res.data;
 
-            if (!chapter.list.length) {
-                this.getSectionList(chapter);
-            }
-        },
-        getSectionList(chapter) {
-            this.$request.sectionList(chapter.id).then((res) => {
-                for (let i = 0; i < res.data.length; i++) {
-                    let item = res.data[i];
-                    item.id = item.sectionId;
-                    item.menuType = 3;
-                    //判断是否试听
-                    item.tryListen = false;
-                    if (this.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
-                        item.tryListen = true;
-                    }
-                }
-                chapter.list = res.data;
-            });
-        },
-        /**
-         * 试看
-         */
-        toDo(section, courseId) {
-            console.log('section, courseId', section, courseId)
-            this.playCourseId = courseId
-            console.log(this.playCourseId, "playCourseId")
-            this.initVideo(section)
-        },
-        async initVideo(option) {
-            await this.clears();
-            console.log('option:',option);
-            this.sectionItem = option;
-            if (option.sectionType === 2) {
-                this.vidzb = option.liveUrl;
-                this.loadPlayerScriptzb(this.loadPlayerzb);
-            } else {
-                this.vid = option.recordingUrl;
-                this.loadPlayerScript(this.loadPlayer);
-            }
-        },
-        /**
-         * @param {String} 关闭视频窗口-销毁实例
-         */
-        clears() {
-            return new Promise((resolve, reject) => {
-                this.vid = "";
-                this.vidzb = "";
-                if (this.player) {
-                    this.player.destroy();
-                }
-                if (this.playerzb) {
-                    this.playerzb.destroy();
-                }
-                resolve();
-            });
-        },
-        loadPlayerzb() {
-            const polyvLivePlayer = window.polyvLivePlayer;
-            this.playerzb = polyvLivePlayer({
-                wrap: "#playerzb",
-                // width: 700,
-                height: 484,
-                uid: this.uidzb,
-                vid: this.vidzb,
-            });
-        },
-        loadPlayer() {
-            const polyvPlayer = window.polyvPlayer;
-            let auditionMinute = this.listenConfigList.find((item) => {
-                if (item.sectionId == (this.sectionItem.sectionId || this.sectionItem.menuId) && item.courseId == this.playCourseId) {
-                    return true;
-                }
-            }).auditionMinute;
+        if (this.needOpen) {
+          this.needOpen = false;
+          this.openChapter(Module.list[0]);
+        }
+      });
+    },
+    /**
+     * 展开章卷
+     */
+    openChapter(chapter) {
+      console.log("点开章卷");
+      this.$set(chapter, "showList", !chapter.showList);
 
-            // this.$request.obtainpolyvvideosign(this.vid).then((res) => {
-            this.player = polyvPlayer({
-                wrap: "#player",
-                // width: 700,
-                height: 484,
-                vid: this.vid,
-                start: 0,
-                end: auditionMinute,
-                teaser_show: 0,
-                // ts: res.data.ts,
-                // sign: res.data.sign,
-                playsafe: function (vid, next) {
-                    next();
-                },
-            });
+      if (!chapter.list.length) {
+        this.getSectionList(chapter);
+      }
+    },
+    getSectionList(chapter) {
+      this.$request.sectionList(chapter.id).then((res) => {
+        for (let i = 0; i < res.data.length; i++) {
+          let item = res.data[i];
+          item.id = item.sectionId;
+          item.menuType = 3;
+          //判断是否试听
+          item.tryListen = false;
+          if (this.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
+            item.tryListen = true;
+          }
+        }
+        chapter.list = res.data;
+      });
+    },
+    /**
+     * 试看
+     */
+    toDo(section, courseId) {
+      console.log("section, courseId", section, courseId);
+      this.playCourseId = courseId;
+      console.log(this.playCourseId, "playCourseId");
+      this.initVideo(section);
+    },
+    async initVideo(option) {
+      await this.clears();
+      console.log("option:", option);
+      this.sectionItem = option;
+      if (option.sectionType === 2) {
+        this.vidzb = option.liveUrl;
+        this.loadPlayerScriptzb(this.loadPlayerzb);
+      } else {
+        this.vid = option.recordingUrl;
+        this.loadPlayerScript(this.loadPlayer);
+      }
+    },
+    /**
+     * @param {String} 关闭视频窗口-销毁实例
+     */
+    clears() {
+      return new Promise((resolve, reject) => {
+        this.vid = "";
+        this.vidzb = "";
+        if (this.player) {
+          this.player.destroy();
+        }
+        if (this.playerzb) {
+          this.playerzb.destroy();
+        }
+        resolve();
+      });
+    },
+    loadPlayerzb() {
+      const polyvLivePlayer = window.polyvLivePlayer;
+      this.playerzb = polyvLivePlayer({
+        wrap: "#playerzb",
+        // width: 700,
+        height: 484,
+        uid: this.uidzb,
+        vid: this.vidzb,
+      });
+    },
+    loadPlayer() {
+      const polyvPlayer = window.polyvPlayer;
+      let auditionMinute = this.listenConfigList.find((item) => {
+        if (
+          item.sectionId ==
+            (this.sectionItem.sectionId || this.sectionItem.menuId) &&
+          item.courseId == this.playCourseId
+        ) {
+          return true;
+        }
+      }).auditionMinute;
 
-            this.player.on("s2j_onPlayOver", () => {
-                this.$confirm("试看结束,购买课程可学习全部", "提示", {
-                    closeOnClickModal: false,
-                    showCancelButton: false,
-                    closeOnPressEscape: false,
-                    distinguishCancelAndClose: false,
-                    showClose: false,
-                }).then((res) => {
-                    // this.videoModalShow = false;
-                });
+      this.$request.obtainpolyvvideosign(this.vid).then((res) => {
+        this.player = polyvPlayer({
+          wrap: "#player",
+          // width: 700,
+          height: 484,
+          vid: this.vid,
+          start: 0,
+          end: auditionMinute,
+          teaser_show: 0,
+          ts: res.data.ts,
+          sign: res.data.sign,
+          playsafe: function (vid, next) {
+            self.$request.obtainpolyvvideopcsign(vid).then((res) => {
+              next(res.data);
             });
-            // });
-        },
-        /**
-         * @param {String} 直播预览
-         */
-        loadPlayerScriptzb(callback) {
-            if (!window.polyvLivePlayer) {
-                const myScript = document.createElement("script");
-                myScript.setAttribute("src", this.playerJs);
-                myScript.onload = callback;
-                document.body.appendChild(myScript);
-            } else {
-                callback();
-            }
-        },
-        loadPlayerScript(callback) {
-            if (!window.polyvPlayer) {
-                const myScript = document.createElement("script");
-                myScript.setAttribute("src", this.vodPlayerJs);
-                myScript.onload = callback;
-                document.body.appendChild(myScript);
-            } else {
-                callback();
-            }
-        },
-    }
-}
+          },
+        });
+
+        this.player.on("s2j_onPlayOver", () => {
+          this.$confirm("试看结束,购买课程可学习全部", "提示", {
+            closeOnClickModal: false,
+            showCancelButton: false,
+            closeOnPressEscape: false,
+            distinguishCancelAndClose: false,
+            showClose: false,
+          }).then((res) => {
+            // this.videoModalShow = false;
+          });
+        });
+      });
+    },
+    /**
+     * @param {String} 直播预览
+     */
+    loadPlayerScriptzb(callback) {
+      if (!window.polyvLivePlayer) {
+        const myScript = document.createElement("script");
+        myScript.setAttribute("src", this.playerJs);
+        myScript.onload = callback;
+        document.body.appendChild(myScript);
+      } else {
+        callback();
+      }
+    },
+    loadPlayerScript(callback) {
+      if (!window.polyvPlayer) {
+        const myScript = document.createElement("script");
+        myScript.setAttribute("src", this.vodPlayerJs);
+        myScript.onload = callback;
+        document.body.appendChild(myScript);
+      } else {
+        callback();
+      }
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
 .container {
-    width: 100%;
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-items: center;
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-items: center;
 }
 .con_header {
-    width: 1113px;
-    height: 44px;
-    background: #3F4449;
-    display: flex;
-    @media screen and (max-width: 1370px){
-        width: 900px;
-    }
-    .con_item {
-        padding: 12px 20px;
-        font-size: 14px;
-        font-weight: 500;
-        color: #FFFFFF;
-        cursor: pointer;
-        &.nactive {
-            background: #3F8DFD;
-        }
+  width: 1113px;
+  height: 44px;
+  background: #3f4449;
+  display: flex;
+  @media screen and (max-width: 1370px) {
+    width: 900px;
+  }
+  .con_item {
+    padding: 12px 20px;
+    font-size: 14px;
+    font-weight: 500;
+    color: #ffffff;
+    cursor: pointer;
+    &.nactive {
+      background: #3f8dfd;
     }
+  }
 }
 .course_info {
-    display: flex;
-    align-items: center;
-    justify-items: center;
+  display: flex;
+  align-items: center;
+  justify-items: center;
 }
 .video_box {
-    width: 709px;
-    height: 484px;
-    background-size: 100% 100%;
-    @media screen and (max-width: 1370px){
-        width: 497px;
-    }
-    .video {
-        width: 100%;
-        height: 100%;
-    }
+  width: 709px;
+  height: 484px;
+  background-size: 100% 100%;
+  @media screen and (max-width: 1370px) {
+    width: 497px;
+  }
+  .video {
+    width: 100%;
+    height: 100%;
+  }
 }
 .right-box {
-    width: 404px;
-    height: 484px;
-    background: #3f4449;
-    border-radius: 0px;
-    &__header {
-        .tabs {
-            /deep/.el-tabs__nav-wrap::after {
-                background-color: #999;
-            }
+  width: 404px;
+  height: 484px;
+  background: #3f4449;
+  border-radius: 0px;
+  &__header {
+    .tabs {
+      /deep/.el-tabs__nav-wrap::after {
+        background-color: #999;
+      }
 
-            /deep/ .el-tabs__header {
-                margin: 0;
-            }
+      /deep/ .el-tabs__header {
+        margin: 0;
+      }
 
-            .label {
-                color: #fff;
-                height: 40px;
-                line-height: 40px;
-                padding: 0 20px;
-            }
-            
-        }
+      .label {
+        color: #fff;
+        height: 40px;
+        line-height: 40px;
+        padding: 0 20px;
+      }
     }
+  }
 }
 .mulu_body {
-    width: 404px;
-    height: 401px;
-    background: #3f4449;
-    border-radius: 0px;
-    .left-box {
-        width: 100%;
-        height: 100%;
-        overflow-y: auto;
-        padding-top: 10px;
-        .course-list-item {
-            padding: 0px 16px 10px;
-            border-radius: 10px;
+  width: 404px;
+  height: 401px;
+  background: #3f4449;
+  border-radius: 0px;
+  .left-box {
+    width: 100%;
+    height: 100%;
+    overflow-y: auto;
+    padding-top: 10px;
+    .course-list-item {
+      padding: 0px 16px 10px;
+      border-radius: 10px;
 
-            .item {
-                overflow: hidden;
-                margin-top: 12px;
-                &__title {
-                    padding: 10px 0;
-                    cursor: pointer;
-                    font-size: 14px;
-                    font-family: Microsoft YaHei;
-                    font-weight: bold;
-                    color: #fff;
-                }
+      .item {
+        overflow: hidden;
+        margin-top: 12px;
+        &__title {
+          padding: 10px 0;
+          cursor: pointer;
+          font-size: 14px;
+          font-family: Microsoft YaHei;
+          font-weight: bold;
+          color: #fff;
+        }
 
-                &__content {
-                    .bank-chapter {
-                        margin-left: 4px;
+        &__content {
+          .bank-chapter {
+            margin-left: 4px;
 
-                        &__item {
-                            padding-top: 10px;
-                            // padding-bottom: 10px;
-                            font-size: 14px;
-                            color: #fff;
-                            &__text {
-                                cursor: pointer;
-                                flex: 1;
-                            }
-                        }
-                    }
+            &__item {
+              padding-top: 10px;
+              // padding-bottom: 10px;
+              font-size: 14px;
+              color: #fff;
+              &__text {
+                cursor: pointer;
+                flex: 1;
+              }
+            }
+          }
 
-                    .bank-section {
-                        margin-left: 40px;
+          .bank-section {
+            margin-left: 40px;
 
-                        &__item {
-                            padding-top: 10px;
-                            // padding-bottom: 10px;
-                            font-size: 14px;
-                            display: flex;
-                            color: #3f8dfd;
-                            &__text {
-                                flex: 1;
-                            }
+            &__item {
+              padding-top: 10px;
+              // padding-bottom: 10px;
+              font-size: 14px;
+              display: flex;
+              color: #3f8dfd;
+              &__text {
+                flex: 1;
+              }
 
-                            .btn {
-                                margin-right: 20px;
-                                width: 40px;
-                                height: 24px;
-                                border: 1px solid #ff3b30;
-                                border-radius: 8px;
-                                line-height: 22px;
-                                color: #ff3b30;
-                                text-align: center;
-                                cursor: pointer;
-                            }
-                        }
-                    }
-                }
+              .btn {
+                margin-right: 20px;
+                width: 40px;
+                height: 24px;
+                border: 1px solid #ff3b30;
+                border-radius: 8px;
+                line-height: 22px;
+                color: #ff3b30;
+                text-align: center;
+                cursor: pointer;
+              }
             }
+          }
         }
-        .course-list-item_title {
-            font-size: 16px;
-            color: #fff;
-            font-weight: bold;
-            cursor: pointer;
-        }
+      }
+    }
+    .course-list-item_title {
+      font-size: 16px;
+      color: #fff;
+      font-weight: bold;
+      cursor: pointer;
     }
+  }
 }
 .down_bottons {
-    width: 404px;
-    height: 44px;
-    display: flex;
-    align-items: center;
+  width: 404px;
+  height: 44px;
+  display: flex;
+  align-items: center;
 }
-.ask_manage, .ask_buy {
-    width: 202px;
-    height: 44px;
-    background: #1B2632;
-    font-size: 16px;
-    font-weight: 500;
-    color: #FFFFFF;
-    line-height: 44px;
-    text-align: center;
-    cursor: pointer;
+.ask_manage,
+.ask_buy {
+  width: 202px;
+  height: 44px;
+  background: #1b2632;
+  font-size: 16px;
+  font-weight: 500;
+  color: #ffffff;
+  line-height: 44px;
+  text-align: center;
+  cursor: pointer;
 }
 .ask_buy {
-    background: #3F8DFD;
+  background: #3f8dfd;
 }
 
 .apply_ask {
-    display: block;
-    width: 173px;
-    // height: 196px;
-    background: #FFFFFF;
-    border-radius: 2px;
-    padding: 20px;
-    .ask_titles {
-        font-size: 14px;
-        font-weight: bold;
-        color: #222222;
-    }
-    .ask_time {
-        font-size: 12px;
-        color: #999999;
-        margin: 3px 0px 21px 0px;
+  display: block;
+  width: 173px;
+  // height: 196px;
+  background: #ffffff;
+  border-radius: 2px;
+  padding: 20px;
+  .ask_titles {
+    font-size: 14px;
+    font-weight: bold;
+    color: #222222;
+  }
+  .ask_time {
+    font-size: 12px;
+    color: #999999;
+    margin: 3px 0px 21px 0px;
+  }
+  .phones {
+    margin-bottom: 21px;
+    display: flex;
+    align-items: center;
+    .icon_phone {
+      width: 16px;
+      height: 16px;
+      margin-right: 12px;
     }
-    .phones {
-        margin-bottom: 21px;
-        display: flex;
-        align-items: center;
-        .icon_phone {
-            width: 16px;
-            height: 16px;
-            margin-right: 12px;
-        }
-        >span {
-            font-size: 14px;
-            color: #222222;
-        }
+    > span {
+      font-size: 14px;
+      color: #222222;
     }
+  }
 }
 // 老师名称样式
 .teacher_names {
-    display: flex;
-    margin-left: 20px;
-    margin-top: 10px;
-    .names {
-        font-size: 13px;
-        color: #383838;
-        margin-right: 8px;
-        cursor: pointer;
-        background: #818181;
-        border-radius: 4px;
-        padding: 3px 6px;
-        &.nactive {
-            background: #CCCCCC;
-        }
+  display: flex;
+  margin-left: 20px;
+  margin-top: 10px;
+  .names {
+    font-size: 13px;
+    color: #383838;
+    margin-right: 8px;
+    cursor: pointer;
+    background: #818181;
+    border-radius: 4px;
+    padding: 3px 6px;
+    &.nactive {
+      background: #cccccc;
     }
+  }
 }
 </style>

+ 3 - 1
src/pages/live-detail/index.vue

@@ -5462,7 +5462,9 @@ export default {
           //   },
           // ],
           playsafe: function (vid, next) {
-            next();
+            self.$request.obtainpolyvvideopcsign(vid).then((res) => {
+              next(res.data);
+            });
           },
         });
 

+ 3 - 1
src/pages/person-center/my-mock/index.vue

@@ -713,7 +713,9 @@ export default {
           ts: res.data.ts,
           sign: res.data.sign,
           playsafe: function (vid, next) {
-            next();
+            self.$request.obtainpolyvvideopcsign(vid).then((res) => {
+              next(res.data);
+            });
           },
         });
       });

Некоторые файлы не были показаны из-за большого количества измененных файлов