Tang 2 năm trước cách đây
mục cha
commit
38586c3ffe

+ 13 - 0
src/apis/user.js

@@ -27,6 +27,19 @@ export default {
       noToken: true
     })
   },
+  /**
+   * 
+   * @param {*} data 
+   * @returns 
+   * 消息数量
+   */
+   appinformUsercount(data) {
+    return request({
+      url: '/app/informUser/count',
+      method: 'get',
+      params: data
+    })
+  },
   /**
    * 
    * @param {*} data 

+ 5 - 15
src/components/footer/index.vue

@@ -19,10 +19,10 @@
       </div>
 
       <div class="footer__footer">
-        <p v-html="recodeMsg.footerRecordNo"></p>
-        <p v-html="recodeMsg.footerTip"></p>
-        <p v-if="recodeMsg.tips1">{{ recodeMsg.tips1 }}</p>
-        <p v-if="recodeMsg.tips2">{{ recodeMsg.tips2 }}</p>
+        <p v-html="footerRecord.footerRecordNo"></p>
+        <p v-html="footerRecord.footerTip"></p>
+        <p v-if="footerRecord.tips1">{{ footerRecord.tips1 }}</p>
+        <p v-if="footerRecord.tips2">{{ footerRecord.tips2 }}</p>
       </div>
     </div>
   </div>
@@ -35,11 +35,10 @@ export default {
   name: "Footer",
   data() {
     return {
-      recodeMsg: {}
     };
   },
   computed: {
-    ...mapGetters(["footer", "links"]),
+    ...mapGetters(["footer", "links","footerRecord"]),
     showList: function() {
       return function(list) {
         let showList = [];
@@ -52,15 +51,6 @@ export default {
       };
     }
   },
-  created() {
-    this.$request.getCommonBaseHomeList().then(res => {
-      res.rows.forEach(item => {
-        if (item.configKey === "home.footer.record") {
-          this.recodeMsg = JSON.parse(item.configValue);
-        }
-      });
-    });
-  }
 };
 </script>
 

+ 27 - 8
src/components/videoCy/index.vue

@@ -25,10 +25,17 @@ import takePicture from "@/components/takePicture/index.vue";
 export default {
   components: { takePicture },
   inject: ["getGoodsData"],
+  props: {
+    activeSection: {
+      type: Object,
+      default: () => {
+        return {};
+      } //当前节数据
+    }
+  },
   data() {
     return {
       vodPlayerJs: "https://player.polyv.net/script/player.js",
-      activeSection: {},
       player: null,
       photoList: [], //抓拍时间拍照数组
       photoHistoryList: [], //历史和已拍照数据
@@ -67,7 +74,6 @@ export default {
   },
   mounted() {
     this.$bus.$on("toPlay", async item => {
-      this.activeSection = Object.assign({}, item);
       if (this.player) {
         this.player.destroy(); //初始化播放器
       }
@@ -109,7 +115,11 @@ export default {
           sectionId: this.activeSection.sectionId
         };
         this.$request.recordLast(data).then(res => {
-          if (res.data && res.data.videoCurrentTime && res.data.videoCurrentTime - 3 >= 0) {
+          if (
+            res.data &&
+            res.data.videoCurrentTime &&
+            res.data.videoCurrentTime - 3 >= 0
+          ) {
             this.activeSection.videoCurrentTime = res.data.videoCurrentTime - 3;
           }
           resolve();
@@ -299,6 +309,15 @@ export default {
         self.$request
           .obtainpolyvvideosign(self.activeSection.recordingUrl)
           .then(res => {
+            const autoPlay = self.goodsData.goodsPlayConfig
+              ? self.goodsData.goodsPlayConfig.autoPlay
+              : true;
+            const isAllowSeek = self.goodsData.goodsPlayConfig
+              ? self.goodsData.goodsPlayConfig.isAllowSeek
+              : "off";
+            const playbackRate = self.goodsData.goodsPlayConfig
+              ? self.goodsData.goodsPlayConfig.playbackRate
+              : false;
             self.player = polyvPlayer({
               wrap: "#player",
               width: 810,
@@ -306,13 +325,13 @@ export default {
               showLine: true, //是否显示线路选择按钮
               ban_history_time: "on", //是否禁用续播功能,取值:{on,off}。
               vid: self.activeSection.recordingUrl,
-              autoplay: this.goodsData.goodsPhotographConfig.autoplay, //	是否自动播放。
-              ban_seek: this.goodsData.goodsPhotographConfig.isAllowSeek, //是否禁止拖拽进度条,取值:{on,off}。
-              speed: this.goodsData.goodsPhotographConfig.playbackRate, //当speed参数值为boolean类型时,代表是否显示倍速切换的按钮。
+              autoplay: autoPlay, //	是否自动播放。
+              ban_seek: isAllowSeek, //是否禁止拖拽进度条,取值:{on,off}。
+              speed: playbackRate, //当speed参数值为boolean类型时,代表是否显示倍速切换的按钮。
               teaser_show: 1, //是否播放片头:0 不播放,1 播放。片头可在管理后台进行设置。
               tail_show: 1, //是否播放片尾:0 不播放,1 播放。片尾可在管理后台进行设置。
               hideSwitchPlayer: true, //是否隐藏H5和Flash播放器的切换按钮。
-              watchStartTime: this.activeSection.videoCurrentTime || 0, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长。
+              watchStartTime: self.activeSection.videoCurrentTime || 0, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长。
               ts: res.data.ts, //移动播放加密视频需传入的时间戳。
               sign: res.data.sign, //移动端播放加密视频所需的签名。
               playsafe: function(vid, next) {
@@ -342,7 +361,7 @@ export default {
       if (
         this.photoList.length == 0 ||
         this.activeSection.learning == 1 ||
-        this.$refs.takePicture.takePhotoModal
+        this.$refs.takePicture.takePhotoModal || this.failToRegister
       )
         return;
       let videoTime = this.player.j2s_getCurrentTime();

+ 88 - 92
src/pages/bank-exam/index.vue

@@ -1092,7 +1092,7 @@ import ToolBar from "@/components/toolbar/index";
 import CollectionBox from "@/components/common/CollectionBox.vue";
 import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
-import myMixins from "@/mixin"
+import myMixins from "@/mixin";
 export default {
   name: "BankExplain",
   components: {
@@ -1102,7 +1102,7 @@ export default {
     CollectionBox,
     HeaderTabBox
   },
-  mixins:[myMixins],
+  mixins: [myMixins],
   data() {
     return {
       recordId: 0,
@@ -1163,7 +1163,7 @@ export default {
       postTimer: null,
       number: "",
       simulateExamId: "",
-      examData:{}
+      examData: {}
     };
   },
   async mounted() {
@@ -1192,96 +1192,91 @@ export default {
     } catch (err) {}
   },
   beforeRouteLeave(to, from, next) {
-    if (this.mustBack) {
+    if (this.mustBack || this.isSubmit) {
       next();
     } else {
-      if (this.isSubmit) {
-        //交卷
-        next();
-      } else {
-        next(false)
-        //离开
-        if (this.bankType == 1) {
-          console.log(1);
-          let ansCount = this.questionOverNum(true); //已答题数
-          this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
-
-          //所有题目答完
-          if (this.lastCount == 0) {
-            // this.testOver = true;
-            this.$nextTick(() => {
-              this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
-                confirmButtonText: "结束做题",
+      next(false);
+      //离开
+      if (this.bankType == 1) {
+        console.log(1);
+        let ansCount = this.questionOverNum(true); //已答题数
+        this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
+
+        //所有题目答完
+        if (this.lastCount == 0) {
+          // this.testOver = true;
+          this.$nextTick(() => {
+            this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
+              confirmButtonText: "结束做题",
+              cancelButtonText: "下次继续",
+              type: "warning"
+            })
+              .then(() => {
+                this.examSubmit();
+              })
+              .catch(() => {
+                this.examRecordEdit();
+                next();
+              });
+          });
+          //未答完
+        } else {
+          this.$nextTick(() => {
+            this.$confirm(
+              `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
+              "温馨提示",
+              {
+                confirmButtonText: "继续作答",
                 cancelButtonText: "下次继续",
                 type: "warning"
+              }
+            )
+              .then(() => {
+                // confirmButton回调
               })
-                .then(() => {
-                  this.examSubmit();
-                })
-                .catch(() => {
-                  this.examRecordEdit();
-                  next();
-                });
-            });
-            //未答完
-          } else {
-            this.$nextTick(() => {
-              this.$confirm(
-                `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
-                "温馨提示",
-                {
-                  confirmButtonText: "继续作答",
-                  cancelButtonText: "下次继续",
-                  type: "warning"
-                }
-              )
-                .then(() => {
-                  // confirmButton回调
-                })
-                .catch(() => {
-                  this.examRecordEdit();
-                  next();
-                });
-            });
-            // this.isLastCount = true;
-          }
-        } else if (this.bankType == 2) {
-          console.log(2);
-          let ansCount = this.questionOverNum(true); //已答题数
-          this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
-          //所有题目答完
-          if (this.lastCount == 0) {
-            this.$nextTick(() => {
-              this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
-                confirmButtonText: "立即交卷",
-                cancelButtonText: "暂不交卷",
+              .catch(() => {
+                this.examRecordEdit();
+                next();
+              });
+          });
+          // this.isLastCount = true;
+        }
+      } else if (this.bankType == 2) {
+        console.log(2);
+        let ansCount = this.questionOverNum(true); //已答题数
+        this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
+        //所有题目答完
+        if (this.lastCount == 0) {
+          this.$nextTick(() => {
+            this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
+              confirmButtonText: "立即交卷",
+              cancelButtonText: "暂不交卷",
+              type: "warning"
+            })
+              .then(() => {
+                // confirmButton回调
+                this.examSubmit();
+                next();
+              })
+              .catch(() => {});
+          });
+          //未答完
+        } else {
+          this.$nextTick(() => {
+            this.$confirm(
+              `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
+              "温馨提示",
+              {
+                confirmButtonText: "继续离开",
+                cancelButtonText: "暂不离开",
                 type: "warning"
+              }
+            )
+              .then(() => {
+                this.examSubmit();
               })
-                .then(() => {
-                  // confirmButton回调
-                  this.examSubmit();
-                  next();
-                })
-                .catch(() => {});
-            });
-            //未答完
-          } else {
-            this.$nextTick(() => {
-              this.$confirm(
-                `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
-                "温馨提示",
-                {
-                  confirmButtonText: "继续离开",
-                  cancelButtonText: "暂不离开",
-                  type: "warning"
-                }
-              )
-                .then(() => {
-                  this.examSubmit();
-                })
-                .catch(() => {});
-            });
-          }
+              .catch(() => {});
+          });
         }
       }
     }
@@ -1370,7 +1365,8 @@ export default {
             return;
           }
           this.allTimes = this.examData.answerTime * 60;
-          this.lastTime = this.examData.answerTime && this.examData.answerTime * 60;
+          this.lastTime =
+            this.examData.answerTime && this.examData.answerTime * 60;
 
           //考试时间到了自动交卷
           if (this.lastTime) {
@@ -1731,8 +1727,8 @@ export default {
     examRecordEdit() {
       clearInterval(this.postTimer);
       clearInterval(this.timer);
-      
-      let form = this.calculateScore(this.questionList)
+
+      let form = this.calculateScore(this.questionList);
 
       this.$request
         .examRecordEdit({
@@ -1762,7 +1758,7 @@ export default {
         }
         this.$request.bankExam(this.examId).then(res => {
           this.bankType = res.data.doType;
-          this.examData = res.data
+          this.examData = res.data;
           if (this.bankType == 2) {
             this.needBack = true;
           }
@@ -2359,7 +2355,7 @@ export default {
         return "";
       }
     },
-    
+
     /**
      * 交卷,跳转报告页
      */
@@ -2367,7 +2363,7 @@ export default {
       this.loading = true;
       clearInterval(this.timer);
       clearInterval(this.postTimer);
-      let form = this.calculateScore(this.questionList)
+      let form = this.calculateScore(this.questionList);
       //交卷 /exam/record/edit
       this.$request
         .examRecordEdit({

+ 43 - 30
src/pages/course-detail/components/CourseTree.vue

@@ -576,10 +576,11 @@ export default {
       });
     },
     //展开模块
-    openModule(item, status = false) {
+    openModule(item, status = false, renewal = false) {
       if (item.children && item.children.length > 0) {
         item.showStatus = status ? true : !item.showStatus;
-      } else {
+      }
+      if (!(item.children && item.children.length > 0) || renewal) {
         return new Promise(resolve => {
           this.$request
             .reChapterList({
@@ -1048,32 +1049,37 @@ export default {
       }
     },
     //展开定位列表
-    async unfoldFunc(item, status = false, Renewal = false) {
-      if (item.moduleId) {
-        let moduleChildren = await this.openModule(
-          this.courseDataList.find(i => i.moduleId == item.moduleId),
-          status
-        );
-        if (item.chapterId) {
+    unfoldFunc(item, status = false, Renewal = false) {
+      return new Promise(async resolve => {
+        if (item.moduleId) {
+          let moduleChildren = await this.openModule(
+            this.courseDataList.find(i => i.moduleId == item.moduleId),
+            status,
+            Renewal
+          );
+          if (item.chapterId) {
+            await this.openChapter(
+              moduleChildren.find(i => i.chapterId == item.chapterId),
+              status,
+              Renewal
+            );
+          }
+        }
+        if (!item.moduleId && item.chapterId) {
           await this.openChapter(
-            moduleChildren.find(i => i.chapterId == item.chapterId),
+            this.courseDataList.find(i => i.chapterId == item.chapterId),
             status,
             Renewal
           );
         }
-      }
-      if (!item.moduleId && item.chapterId) {
-        await this.openChapter(
-          this.courseDataList.find(i => i.chapterId == item.chapterId),
-          status,
-          Renewal
-        );
-      }
+        resolve();
+      });
     },
     //已学完,重新定位
     async BackVideoFunc() {
+      let hasNoStudyStatus = this.allSectionList.find(i => i.studyStatus == -1); //更新前是否存在未学完的课程
       await this.getAllSectionList(); //获取所有节列表
-      this.unfoldFunc(this.activeSection, true, true);
+      await this.unfoldFunc(this.activeSection, true, true);
       if (this.businessData.goodsLearningOrder == 2) {
         var ary = this.allSectionList.find(i => i.studyStatus != 1);
       } else {
@@ -1085,6 +1091,11 @@ export default {
             i.chapterId == this.activeSection.chapterId &&
             i.sectionId == this.activeSection.sectionId
         );
+
+        this.$emit(
+          "update:activeSection",
+          Object.assign({}, this.allSectionList[index])
+        ); //重新赋值当前节数据
         ary = this.allSectionList[index + 1];
       }
       if (ary) {
@@ -1117,19 +1128,21 @@ export default {
             .catch(() => {});
         }
       } else {
-        this.$alert(
-          "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
-          "温馨提示",
-          {
-            confirmButtonText: "确定",
-            showClose: false,
-            callback: action => {
-              if (action == "confirm") {
-                this.jumpPage();
+        if (hasNoStudyStatus) {
+          this.$alert(
+            "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
+            "温馨提示",
+            {
+              confirmButtonText: "确定",
+              showClose: false,
+              callback: action => {
+                if (action == "confirm") {
+                  this.jumpPage();
+                }
               }
             }
-          }
-        );
+          );
+        }
       }
     },
     //回到个人中心

+ 1 - 0
src/pages/course-detail/components/coreContent.vue

@@ -6,6 +6,7 @@
         v-show="video_iframe == 'video' && !viewStatus ? false : true"
         ref="video_cy"
         @videoScript="videoScript"
+        :activeSection.sync="activeSection"
       ></video-cy>
       <div
         class="office_style"

+ 1 - 1
src/pages/course-detail/index.vue

@@ -85,7 +85,7 @@ export default {
           //播放设置
           if (this.goodsData.goodsPlayConfig) {
             var goodsPlayConfig = JSON.parse(this.goodsData.goodsPlayConfig);
-            goodsPlayConfig.autoplay =
+            goodsPlayConfig.autoPlay =
               goodsPlayConfig.autoPlay > 0 ? true : false;
             goodsPlayConfig.isAllowSeek =
               goodsPlayConfig.drag > 0 ? "off" : "on";

+ 133 - 417
src/pages/course-exam/index.vue

@@ -1059,71 +1059,15 @@
     </section>
     <ToolBar></ToolBar>
     <Footer></Footer>
-
-    <el-dialog
-      width="800px"
-      class="take-photo"
-      :visible.sync="takePhotoModal"
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-      :show-close="false"
-    >
-      <div class="take-photo__content">
-        <!-- <div class="take-photo__close" @click="takePhotoModal = false">X</div> -->
-        <div class="take-photo__header">人脸验证</div>
-        <div class="take-photo__body clearfix">
-          <div class="left-box">
-            <div class="title">重要提示:</div>
-            <div class="content">
-              <p>1、请保证摄像头正对自己,避免头像偏左或者偏右。</p>
-              <p>
-                2、请保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。
-              </p>
-              <p>
-                3、请保证整个头像在人脸识别区域内,脸部无遮挡装饰物(佩戴眼镜会降低通过率)。
-              </p>
-              <p>
-                4、如果下面视频中出现黑屏,摄像头可能被其他进程占用,请关闭其他调用摄像头的程序,重新刷新当前页面重新拍照识别。
-              </p>
-            </div>
-          </div>
-          <div class="right-box">
-            <img v-show="!isTaking" :src="faceUrl" alt="" />
-            <video v-show="isTaking" id="video" :src="stream"></video>
-            <div v-show="isTaking" class="mask"></div>
-          </div>
-        </div>
-        <div class="take-photo__footer">
-          <el-button
-            type="primary"
-            v-if="isTaking"
-            class="take"
-            @click="onPhoto"
-            >拍照</el-button
-          >
-          <el-button
-            type="primary"
-            v-if="!isTaking"
-            class="take"
-            @click="reTake"
-            :loading="loading"
-            >重拍</el-button
-          >
-          <el-button
-            type="primary"
-            v-if="!isTaking"
-            class="take"
-            @click="takeOk"
-            :loading="loading"
-            >确认</el-button
-          >
-        </div>
-      </div>
-    </el-dialog>
+    <takePicture
+      ref="takePicture"
+      @returnParameter="returnParameter"
+    ></takePicture>
   </div>
 </template>
 
 <script>
+import takePicture from "@/components/takePicture/index.vue";
 import myMixins from "@/mixin";
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
@@ -1138,23 +1082,19 @@ export default {
     Header,
     ToolBar,
     CollectionBox,
-    HeaderTabBox
+    HeaderTabBox,
+    takePicture
   },
   mixins: [myMixins],
   data() {
     return {
       openPhotoStatus: 0,
-      hasTake: false,
       recordId: 0,
       tabIndex: "1",
       textarea: "",
       questionIndex: 0,
       checked: false,
-      activeName: "1",
       questionList: [],
-      goodsExamConfig: [],
-      goodsDetail: {},
-      bankList: [],
       judge: ["正确", "错误"],
       ast: [
         "A",
@@ -1190,30 +1130,21 @@ export default {
       allTimes: 0, //总考试时长
       lastCount: 0,
       examId: 0,
-      learning: false,
       goodsId: 0,
       courseId: 0,
       gradeId: 0,
       moduleId: 0,
       chapterId: 0,
       sectionId: 0,
-      faceUrl: "",
-      stream: null,
-      ossAvatarUrl: "",
       orderGoodsId: 0,
       current: 0,
       timer: null,
-      takePhotoModal: false,
-      isTaking: true, //是否正在拍照
-      stream: null,
-      loading: false,
       type: 0, //type:1章卷,2节卷,3模块卷
       bankType: 0,
       compareFaceData: 0, // 拍照匹配相似度
       collectList: [],
       doMode: 1,
-      simulateExamId: "",
-      examData: {}
+      simulateExamId: ""
     };
   },
   async mounted() {
@@ -1254,21 +1185,20 @@ export default {
     },
     getGoodsDetail() {
       return new Promise(resolve => {
-        let self = this;
         this.$request.goodsDetail(this.goodsId).then(res => {
-          self.goodsDetail = res.data;
-          if (self.goodsDetail.goodsPhotoExamConfig) {
-            let goodsPhotoExamConfig = JSON.parse(
-              self.goodsDetail.goodsPhotoExamConfig
-            );
-            if (goodsPhotoExamConfig.photograph > 0) {
-              self.needPhoto = true;
+          if (this.type != 2) {
+            if (res.data.goodsPhotoExamConfig) {
+              let goodsPhotoExamConfig = JSON.parse(
+                res.data.goodsPhotoExamConfig
+              );
+              if (goodsPhotoExamConfig.photograph > 0) {
+                this.needPhoto = true;
+              }
+            }
+            if (res.data.erJianErZao) {
+              this.needPhoto = true;
             }
           }
-          if (res.data.erJianErZao) {
-            self.needPhoto = true;
-          }
-
           resolve();
         });
       });
@@ -1293,6 +1223,18 @@ export default {
           this.$set(this.collectList, current, false);
         });
     },
+    //提示且允许返回
+    mustBackPage(msg, text) {
+      this.$alert(msg || "未知异常", "提示", {
+        confirmButtonText: text || "返回上一页",
+        showClose: false,
+        callback: action => {
+          this.mustBack = true;
+          this.$router.go(-1);
+        }
+      });
+      return;
+    },
     /**
      * 请求题目列表
      */
@@ -1311,15 +1253,9 @@ export default {
             data = data.questionList;
           }
           if (!data.length) {
-            this.$message({
-              type: "warning",
-              message: "该试卷暂无题目"
-            });
+            this.mustBackPage("该试卷暂无题目");
             return;
           }
-          this.allTimes = this.examData.answerTime * 60;
-          this.lastTime =
-            this.examData.answerTime && this.examData.answerTime * 60;
           this.questionList = this.questionOptimizeFormat(data);
           this.lastCount = this.questionList.length;
           this.getCollectInfo(this.current);
@@ -1327,182 +1263,98 @@ export default {
         })
         .catch(err => {
           if (this.doMode == 3) {
-            this.$alert("你已做完所有题目", "提示", {
-              confirmButtonText: "确定,并且返回上一页",
-              showClose: false,
-              callback: action => {
-                this.mustBack = true;
-                this.$router.go(-1);
-                return;
-              }
-            });
+            this.mustBackPage("你已做完所有题目", "确定,并且返回上一页");
+          } else {
+            this.mustBackPage(err.msg);
           }
         });
     },
     //拍照
     openPhoto() {
-      this.$nextTick(() => {
-        if (
-          (window.navigator.mediaDevices &&
-            window.navigator.mediaDevices.getUserMedia) ||
-          window.navigator.getUserMedia ||
-          window.navigator.webkitGetUserMedia ||
-          window.navigator.mozGetUserMedia
-        ) {
-          // 调用用户媒体设备, 访问摄像头
-          this.getUserMedia(
-            {
-              video: {
-                width: 400,
-                height: 400
-              }
-            },
-            this.photographSuccess,
-            this.photographError
-          );
-        } else {
-          this.photographError();
-        }
-      });
+      this.$refs.takePicture.openPhoto();
     },
 
-    async takeOk() {
-      this.loading = true;
-      let compareFaceData = await this.faceRecognition();
-      this.compareFaceData = compareFaceData;
+    //拍照成功回显 url
+    async returnParameter(url) {
+      let compareFaceData = await this.faceRecognition(url);
       if (compareFaceData >= 80) {
-        this.$message({
-          type: "success",
-          message: "拍照成功"
+        let file = this.$tools.convertBase64UrlToBlob(url);
+        const photoUrl = await this.$upload.upload(file, 0, {
+          gradeId: this.gradeId,
+          orderGoodsId: this.orderGoodsId
         });
-        const waitYS = await this.imageInfos();
-        this.loading = false;
-        this.takePhotoModal = false;
-        this.isTaking = true;
-        this.postStudyRecord(); //提交记录
+        //提交拍照记录
+        if (await this.postStudyRecord(0, photoUrl, compareFaceData)) {
+          this.needPhoto = false
+          if (this.openPhotoStatus == 1) {
+            this.examSubmit();
+            return;
+          }
+          if (this.allTimes) {
+            this.BeginTime(); //需要开启计时器
+          }
+        }
       } else {
         this.$message({
           type: "warning",
           message: "人脸匹配不通过,请重新拍照上传"
         });
-
         setTimeout(() => {
-          this.loading = false;
-          this.reTake();
-        }, 2000);
+          this.openPhoto();
+        }, 1500);
       }
     },
-
-    postStudyRecord() {
-      let self = this;
-      let data = {
-        photo: self.ossAvatarUrl,
-        recordId: self.recordId
-      };
-      if (this.ossAvatarUrl) {
-        data.similarity = this.compareFaceData; // 相似度
-      }
-      this.$request
-        .studyExamPhotoRecord(data)
-        .then(res => {
-          this.hasTake = true;
-          // console.log(res, "拍照提交结果");
-          self.ossAvatarUrl = "";
-          if (this.openPhotoStatus == 1) {
-            this.openPhotoStatus = 0;
-            this.examSubmit();
-            return;
-          }
-          //拍照
-          if (this.lastTime) {
-            this.timer = setInterval(() => {
-              if (this.lastTime <= 0) {
-                clearInterval(this.timer);
-                this.$confirm("考试时间已到,系统将自动交卷", "提示", {
-                  showConfirmButton: false,
-                  closeOnClickModal: false,
-                  showCancelButton: false,
-                  closeOnPressEscape: false,
-                  distinguishCancelAndClose: false,
-                  showClose: false
-                });
-
-                setTimeout(() => {
-                  this.examSubmit();
-                }, 3000);
-                return;
-              }
-              this.lastTime--;
-            }, 1000);
-          }
-        })
-        .catch(err => {
-          this.$message({
-            type: "warning",
-            message: err.msg
+    //需要开启计时器
+    BeginTime() {
+      this.timer = setInterval(() => {
+        if (this.lastTime <= 0) {
+          clearInterval(this.timer);
+          this.$confirm("考试时间已到,系统将自动交卷", "提示", {
+            showConfirmButton: false,
+            closeOnClickModal: false,
+            showCancelButton: false,
+            closeOnPressEscape: false,
+            distinguishCancelAndClose: false,
+            showClose: false
           });
-        });
-    },
+          setTimeout(() => {
+            this.examSubmit();
+          }, 2000);
 
-    imageInfos() {
-      var self = this;
-      return new Promise(async (resolve, reject) => {
-        const waitUpload = await self.uploadFile(self.faceUrl, 0);
-        resolve(waitUpload);
-      });
+          return;
+        }
+        this.lastTime--;
+      }, 1000);
     },
-
-    uploadFile(options, int) {
-      var self = this;
-      return new Promise((resolve, reject) => {
-        var data = {
-          imageStatus: int,
-          gradeId: this.gradeId,
-          orderGoodsId: this.orderGoodsId
+    //提交拍照记录
+    postStudyRecord(status = 0, imgUrl, compareFaceData) {
+      return new Promise(resolve => {
+        let data = {
+          photo: imgUrl,
+          recordId: this.recordId
         };
-        self.$request
-          .getPolicy(data)
+        if (imgUrl) {
+          data.similarity = compareFaceData; // 相似度
+        }
+        this.$request
+          .studyExamPhotoRecord(data)
           .then(res => {
-            var ossToken = res.data.resultContent;
-            if (ossToken.host == null || ossToken.host == undefined) {
-              this.$message({
-                type: "warning",
-                message: "上传路径报错" + JSON.stringify(res.data)
-              });
-              return;
-            }
-
-            let data = this.$tools.convertBase64UrlToBlob(this.faceUrl);
-
-            this.$upload
-              .upload(data, 0)
-              .then(res => {
-                this.ossAvatarUrl = res;
-                resolve(res);
-              })
-              .catch(err => {
-                this.$message({
-                  type: "warning",
-                  message: "上传接口报错,请重新拍照上传"
-                });
-                this.reTake();
-              });
+            resolve(true);
           })
           .catch(err => {
             this.$message({
               type: "warning",
-              message: "签名错误" + JSON.stringify(err)
+              message: err.msg
             });
-            return;
           });
       });
     },
-
-    faceRecognition() {
+    //人脸校验
+    faceRecognition(url) {
       return new Promise(resolve => {
         this.$request
           .faceCertificationCompareFace({
-            imageA: this.faceUrl,
+            imageA: url,
             orderGoodsId: this.orderGoodsId,
             gradeId: this.gradeId
           })
@@ -1515,142 +1367,28 @@ export default {
                 msg: "拍照超时,请重新拍照"
               };
             }
-            this.loading = false;
             this.$message({
               type: "warning",
               message: err.msg
             });
+            setTimeout(() => {
+              this.openPhoto();
+            }, 1500);
           });
       });
     },
-    /**
-     * 点击重拍
-     */
-    reTake() {
-      this.faceUrl = "";
-      this.isTaking = true;
-      this.getUserMedia({
-        video: {
-          width: 400,
-          height: 400
-        }
-      });
-    },
-    // 点击拍照按钮
-    onPhoto() {
-      // if (this.isIE) {
-      //   window.webcam.capture();
-      // } else {
-      const canvas = document.createElement("canvas");
-      canvas.width = 400;
-      canvas.height = 400;
-      const context = canvas.getContext("2d");
-      const video = document.getElementById("video");
-      context.drawImage(video, 0, 0, 400, 400);
-      this.faceUrl = canvas.toDataURL("image/png");
-      this.isTaking = false;
-      // }
-    },
-    getUserMedia(constraints, success, error) {
-      if (window.navigator.mediaDevices.getUserMedia) {
-        // 最新的标准API
-        window.navigator.mediaDevices
-          .getUserMedia(constraints)
-          .then(success)
-          .catch(error);
-      } else if (window.navigator.webkitGetUserMedia) {
-        // webkit核心浏览器
-        window.navigator.webkitGetUserMedia(constraints, success, error);
-      } else if (window.navigator.mozGetUserMedia) {
-        // firfox浏览器
-        window.navigator.mozGetUserMedia(constraints, success, error);
-      } else if (window.navigator.getUserMedia) {
-        // 旧版API
-        window.navigator.getUserMedia(constraints, success, error);
-      }
-    },
-
-    photographSuccess(stream) {
-      // 兼容webkit核心浏览器
-      if (this.isVirtualCamera(stream)) {
-        return;
-      }
-      this.isTaking = true;
-      this.takePhotoModal = true;
-
-      this.$nextTick(() => {
-        const video = document.getElementById("video");
-        // 将视频流设置为video元素的源
-        // console.dir(video);
-        video.srcObject = stream;
-        this.mediaStreamTrack =
-          typeof stream.stop === "function" ? stream : stream.getTracks()[0];
-        video.play();
-      });
-    },
-    photographError(err) {
-      this.$confirm(
-        "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
-        "提示",
-        {
-          confirmButtonText: "返回",
-          showConfirmButton: true,
-          closeOnClickModal: false,
-          showCancelButton: false,
-          closeOnPressEscape: false,
-          distinguishCancelAndClose: false,
-          showClose: false
-        }
-      ).then(() => {
-        this.mustBack = true;
-        this.$router.go(-1);
-      });
-    },
-    isVirtualCamera(stream) {
-      const list = [
-        "VCam",
-        "ManyCam",
-        "OBS",
-        "ClassInCam",
-        "Ev",
-        "Video2Webcam"
-      ];
-      let isT = list.some(e => {
-        return stream.getTracks()[0].label.indexOf(e) != -1;
-      });
-      if (isT) {
-        this.$confirm("检测到你使用虚拟摄像头,无法继续学习。", "提示", {
-          confirmButtonText: "返回",
-          showConfirmButton: true,
-          closeOnClickModal: false,
-          showCancelButton: false,
-          closeOnPressEscape: false,
-          distinguishCancelAndClose: false,
-          showClose: false
-        }).then(() => {
-          this.mustBack = true;
-          this.$router.go(-1);
-        });
-      }
-      return isT;
-    },
     /**
      * 记录总题数,获取recordId
-     * hasSpecial (是否包含简答和案例) true 包含  false 不包含
      */
-    examRecord(hasSpecial) {
+    examRecord() {
       return new Promise(resolve => {
         let self = this;
         let questionList = 0;
-        // if(!hasSpecial) {
         this.questionList.forEach((item, index) => {
           if (item.type == 1 || item.type == 2 || item.type == 3) {
             questionList++;
           }
         });
-        // } else {
-        // 	questionList = this.questionList.length;
-        // }
         this.$request
           .bankRecord({
             courseId: this.courseId,
@@ -1669,34 +1407,13 @@ export default {
           })
           .then(res => {
             this.recordId = res.data;
-            console.error(self.needPhoto, this.type, this.learning);
             //  节不需要拍照
-            if (self.needPhoto && this.type != 2 && !this.learning) {
+            if (self.needPhoto) {
               this.openPhoto();
             } else {
               if (this.lastTime) {
-                this.timer = setInterval(() => {
-                  if (this.lastTime <= 0) {
-                    clearInterval(this.timer);
-                    this.$confirm("考试时间已到,系统将自动交卷", "提示", {
-                      showConfirmButton: false,
-                      closeOnClickModal: false,
-                      showCancelButton: false,
-                      closeOnPressEscape: false,
-                      distinguishCancelAndClose: false,
-                      showClose: false
-                    });
-
-                    setTimeout(() => {
-                      this.examSubmit();
-                    }, 2000);
-
-                    return;
-                  }
-                  this.lastTime--;
-                }, 1000);
+                this.BeginTime(); //需要开启计时器
               }
-
               resolve();
             }
           });
@@ -1704,17 +1421,17 @@ export default {
     },
 
     /**
-     * 获取试卷类型2考试,1练习
+     * 获取试卷类型:1练习,2考试
      */
     bankExam() {
-      return this.$request.bankExam(this.examId).then(res => {
-        this.bankType = res.data.doType;
-        this.examData = res.data;
-        if (this.bankType == 2) {
-          this.needBack = true;
-        }
-        this.doMode = res.data.simulateStatus ? 3 : 1;
-        return Promise.resolve();
+      return new Promise(resolve => {
+        this.$request.bankExam(this.examId).then(res => {
+          this.bankType = res.data.doType; //1练习,2考试
+          this.allTimes = (res.data.answerTime || 0) * 60;
+          this.lastTime = (res.data.answerTime || 0) * 60;
+          this.doMode = res.data.simulateStatus ? 3 : 1;
+          resolve();
+        });
       });
     },
     /**
@@ -2249,16 +1966,6 @@ export default {
       }
     },
     examSubmit() {
-      if (!this.learning && this.needPhoto && !this.hasTake) {
-        this.$confirm("未拍照成功不能交卷", "提示", {
-          closeOnClickModal: false,
-          showCancelButton: false,
-          closeOnPressEscape: false,
-          distinguishCancelAndClose: false,
-          showClose: false
-        });
-        return;
-      }
       let form = this.calculateScore(this.questionList);
       clearInterval(this.timer);
       //交卷 /bank/record/edit
@@ -2280,7 +1987,7 @@ export default {
           ...form
         })
         .then(res => {
-          this.isSubmit = true;
+          this.mustBack = true
           clearInterval(this.timer);
           this.$message({
             type: "success",
@@ -2317,7 +2024,10 @@ export default {
             this.$message.error(err.msg);
             console.log("拍照不够触发");
             this.openPhotoStatus = 1;
+            this.needPhoto = true
             this.openPhoto();
+          } else {
+            this.$message.error(err.msg);
           }
           console.log(err, "err");
         });
@@ -2343,27 +2053,33 @@ export default {
         .catch(err => {});
     },
     getExamLearnStatus(section) {
-      return this.$request
-        .getExamLearnStatus({
-          goodsId: this.goodsId,
-          gradeId: this.gradeId,
-          chapterId: this.chapterId,
-          courseId: this.courseId,
-          moduleId: this.moduleId,
-          type: this.type,
-          examId: this.examId,
-          orderGoodsId: this.orderGoodsId
-        })
-        .then(res => {
-          this.learning = res.data;
-          return Promise.resolve();
-        });
+      return new Promise(resolve => {
+        this.$request
+          .getExamLearnStatus({
+            goodsId: this.goodsId,
+            gradeId: this.gradeId,
+            chapterId: this.chapterId,
+            courseId: this.courseId,
+            moduleId: this.moduleId,
+            type: this.type,
+            examId: this.examId,
+            orderGoodsId: this.orderGoodsId
+          })
+          .then(res => {
+            if (res.data) {
+              //之前是否拍照过,拍过则不需要再拍
+              this.needPhoto = false;
+            }
+            resolve();
+          });
+      });
     },
     /**
      * 返回统计回答正确题数
      */
     examRecordEdit() {
-      if (this.needPhoto && !this.hasTake) {
+      if (this.needPhoto) {
+        this.$message.error("未拍照");
         return;
       }
       clearInterval(this.postTimer);
@@ -2399,7 +2115,7 @@ export default {
     }
   },
   beforeRouteLeave(to, from, next) {
-    if (this.mustBack || this.isSubmit) {
+    if (this.mustBack || this.$refs.takePicture.photoBadStatus) {
       next();
     } else {
       next(false);

+ 48 - 49
src/pages/course-report/index.vue

@@ -202,19 +202,21 @@ export default {
       });
     },
     checkListDontStudy(list) {
-      if (list.length === 0) {
-        this.$message.warning("该课程无学习内容");
-        return false;
-      }
-      const index = list.findIndex(
-        i => i.studyStatus == -1 || i.studyStatus == 0
-      );
-      if (index != -1) {
-        return list[index];
-      } else {
-        this.$message.success("该课程内容已全部学完");
-        return false;
-      }
+      return new Promise(resolve => {
+        if (list.length === 0) {
+          this.$message.warning("该课程无学习内容");
+          resolve(false);
+        }
+        const index = list.findIndex(
+          i => i.studyStatus == -1 || i.studyStatus == 0
+        );
+        if (index != -1) {
+          resolve(list[index]);
+        } else {
+          this.$message.success("该课程内容已全部学完");
+          resolve(false);
+        }
+      });
     },
     // 新增用户视频学习日志
     studyLog(item, studyItem) {
@@ -248,31 +250,26 @@ export default {
             courseId: studyItem.courseId,
             chapterId: studyItem.chapterId,
             moduleId: studyItem.moduleId,
-            sectionId: studyItem.sectionId,
-            recordingUrl: studyItem.recordingUrl,
-            liveUrl: studyItem.liveUrl,
-            sectionType: studyItem.sectionType,
-            liveStartTime: studyItem.liveStartTime,
-            liveEndTime: studyItem.liveEndTime
+            sectionId: studyItem.sectionId
           }
         });
       }
       if (studyItem.examId) {
-          this.$router.replace({
-            path: "/course-exam/" + item.goodsId,
-            query: {
-              courseId: studyItem.courseId,
-              gradeId: item.gradeId,
-              moduleId: studyItem.moduleId || 0,
-              sectionId: studyItem.sectionId || 0,
-              examId: studyItem.examId,
-              learning: studyItem.studyStatus,
-              type: studyItem.examType, //题卷类型 1章卷 2节卷 3模块卷,
-              chapterId: studyItem.chapterId || 0,
-              orderGoodsId: item.orderGoodsId,
-              nextStatus: "next" //是否继续播放课程
-            }
-          });
+        this.$router.replace({
+          path: "/course-exam/" + item.goodsId,
+          query: {
+            gradeId: item.gradeId,
+            orderGoodsId: item.orderGoodsId,
+            courseId: studyItem.courseId,
+            moduleId: studyItem.moduleId || 0,
+            chapterId: studyItem.chapterId || 0,
+            sectionId: studyItem.sectionId || 0,
+            examId: studyItem.examId,
+            learning: studyItem.studyStatus,
+            type: studyItem.examType, //题卷类型 1章卷 2节卷 3模块卷,
+            nextStatus: "next" //是否继续播放课程
+          }
+        });
       }
       this.nextDialogStatus = false;
     },
@@ -283,8 +280,10 @@ export default {
       //获取当前课程所有节和试卷
       let list = await this.studyRecordMenuAllList(item);
       //返回第一个没学习的节或试卷
-      this.studyItem = this.checkListDontStudy(list);
-      this.nextDialogStatus = true;
+      this.studyItem = await this.checkListDontStudy(list);
+      if (this.studyItem) {
+        this.nextDialogStatus = true;
+      }
     },
     getcourList() {
       this.$axios({
@@ -327,19 +326,19 @@ export default {
      */
     async doRepeat(reportdata) {
       // answerNum==0没有答题次数限制
-        this.$router.replace({
-          path: "/course-exam/" + this.reportdata.goodsId,
-          query: {
-            courseId: this.reportdata.courseId,
-            gradeId: this.reportdata.gradeId || 0,
-            moduleId: this.reportdata.moduleId || 0,
-            sectionId: this.reportdata.sectionId || 0,
-            examId: this.reportdata.examId,
-            type: this.type,
-            chapterId: this.reportdata.chapterId || 0,
-            orderGoodsId: this.reportdata.orderGoodsId
-          }
-        });
+      this.$router.replace({
+        path: "/course-exam/" + this.reportdata.goodsId,
+        query: {
+          courseId: this.reportdata.courseId,
+          gradeId: this.reportdata.gradeId || 0,
+          moduleId: this.reportdata.moduleId || 0,
+          sectionId: this.reportdata.sectionId || 0,
+          examId: this.reportdata.examId,
+          type: this.type,
+          chapterId: this.reportdata.chapterId || 0,
+          orderGoodsId: this.reportdata.orderGoodsId
+        }
+      });
     },
     wrongExplain(reportdata) {
       this.$router.push({

+ 116 - 98
src/pages/goods-detail/bank-detail.vue

@@ -31,7 +31,7 @@
                     class="price"
                     v-if="
                       !goodsDetail.specTemplateId ||
-                      (!goodsDetail.maxPrice && !goodsDetail.minPrice)
+                        (!goodsDetail.maxPrice && !goodsDetail.minPrice)
                     "
                   >
                     {{
@@ -71,11 +71,16 @@
               <div class="goods-info__body">
                 <el-tabs v-model="activeName">
                   <el-tab-pane label="课程详情" name="1">
-                    <div class="detail" v-html="goodsDetail.pcDetailHtml"></div>
+                    <div
+                      class="detail"
+                      v-if="goodsDetail.pcDetailHtml"
+                      v-html="goodsDetail.pcDetailHtml"
+                    ></div>
+                    <el-empty description="暂无课程详情" v-else></el-empty>
                   </el-tab-pane>
-                  <el-tab-pane label="章节目录" name="2">
+                  <el-tab-pane label="题库目录" name="2">
                     <div slot="label" style="position: relative">
-                      <span class="label">章节目录</span>
+                      <span class="label">题库目录</span>
                       <span v-if="goodsExamConfig.length" class="view-note"
                         >试做</span
                       >
@@ -83,7 +88,7 @@
 
                     <div class="goods-menu clearfix">
                       <div class="left-box">
-                        <div class="left-box__body">
+                        <div class="left-box__body" v-if="bankList.length > 0">
                           <div
                             class="item"
                             v-for="(item, index) in bankList"
@@ -97,7 +102,7 @@
                                 <i
                                   :class="{
                                     'el-icon-caret-right': !item.showList,
-                                    'el-icon-caret-bottom': item.showList,
+                                    'el-icon-caret-bottom': item.showList
                                   }"
                                 ></i>
                                 {{ item.name }}
@@ -115,10 +120,9 @@
                                     >
                                       <i
                                         :class="{
-                                          'el-icon-caret-right':
-                                            !chapter.showList,
+                                          'el-icon-caret-right': !chapter.showList,
                                           'el-icon-caret-bottom':
-                                            chapter.showList,
+                                            chapter.showList
                                         }"
                                       ></i
                                       >{{ chapter.name }}
@@ -130,9 +134,8 @@
                                     >
                                       <div
                                         class="bank-section__item"
-                                        v-for="(
-                                          section, sectionIndex
-                                        ) in chapter.list"
+                                        v-for="(section,
+                                        sectionIndex) in chapter.list"
                                         :key="sectionIndex"
                                       >
                                         <div class="bank-section__item__text">
@@ -163,7 +166,7 @@
                                       <i
                                         :class="{
                                           'el-icon-caret-right': !item.showList,
-                                          'el-icon-caret-bottom': item.showList,
+                                          'el-icon-caret-bottom': item.showList
                                         }"
                                       ></i
                                       >{{ item.name }}
@@ -175,9 +178,8 @@
                                     >
                                       <div
                                         class="bank-section__item"
-                                        v-for="(
-                                          section, sectionIndex
-                                        ) in item.list"
+                                        v-for="(section,
+                                        sectionIndex) in item.list"
                                         :key="sectionIndex"
                                       >
                                         <div class="bank-section__item__text">
@@ -217,13 +219,14 @@
                             </template>
                           </div>
                         </div>
+                    <el-empty description="暂无题库目录" v-else></el-empty>
                       </div>
                       <div class="right-box">
                         <div class="title">
                           推荐题库
                           <a class="more" @click="comeMoreList">更多></a>
                         </div>
-                        <ul class="list">
+                        <ul class="list" v-if="recommendList.goodsList && recommendList.goodsList.length > 0">
                           <li
                             class="course-item"
                             v-for="(itemy, index) in compyRecommend(
@@ -257,12 +260,22 @@
                             </div> -->
                           </li>
                         </ul>
+                        <el-empty description="暂无推荐题库" v-else></el-empty>
                       </div>
                     </div>
                   </el-tab-pane>
                   <el-tab-pane label="学员须知" name="3">
-                    {{ goodsDetail.buyNote }}</el-tab-pane
-                  >
+                    <div
+                      class="ql-editor"
+                      style="white-space: pre-wrap"
+                      v-if="goodsDetail.buyNote"
+                      v-html="
+                        goodsDetail.buyNote &&
+                          goodsDetail.buyNote.replace(/\n|\r\n/g, '<br>')
+                      "
+                    ></div>
+                    <el-empty description="暂无学员须知" v-else></el-empty>
+                  </el-tab-pane>
                 </el-tabs>
               </div>
             </div>
@@ -273,8 +286,8 @@
           class="section__footer"
           v-if="
             recommendList.goodsList &&
-            recommendList.goodsList.length &&
-            activeName == 1
+              recommendList.goodsList.length &&
+              activeName == 1
           "
         >
           <div class="recommend">
@@ -346,7 +359,7 @@
                 class="question"
                 v-if="
                   question.type == 1 &&
-                  questionModalData.current == questionIndex
+                    questionModalData.current == questionIndex
                 "
                 :key="questionIndex"
               >
@@ -376,7 +389,7 @@
                           item.optionsId == question.ans,
                         wrong:
                           item.optionsId == question.ques &&
-                          question.ques != question.ans,
+                          question.ques != question.ans
                       }"
                       v-for="(item, index) in question.jsonStr"
                       :key="index"
@@ -405,7 +418,7 @@
                 class="question"
                 v-if="
                   question.type == 2 &&
-                  questionModalData.current == questionIndex
+                    questionModalData.current == questionIndex
                 "
                 :key="questionIndex"
               >
@@ -435,7 +448,7 @@
                           question.ans.indexOf(item.optionsId) != -1,
                         wrong:
                           question.ques.indexOf(item.optionsId) != -1 &&
-                          question.ans.indexOf(item.optionsId) == -1,
+                          question.ans.indexOf(item.optionsId) == -1
                       }"
                       v-for="(item, index) in question.jsonStr"
                       :key="index"
@@ -481,7 +494,7 @@
                 class="question"
                 v-if="
                   question.type == 3 &&
-                  questionModalData.current == questionIndex
+                    questionModalData.current == questionIndex
                 "
                 :key="questionIndex"
               >
@@ -509,7 +522,7 @@
                           index != question.ans,
                         wrong:
                           index == (question.ques == 1 ? 0 : 1) &&
-                          question.ques != question.ans,
+                          question.ques != question.ans
                       }"
                       v-for="(item, index) in judge"
                       :key="index"
@@ -538,7 +551,7 @@
                 class="question"
                 v-if="
                   question.type == 4 &&
-                  questionModalData.current == questionIndex
+                    questionModalData.current == questionIndex
                 "
                 :key="questionIndex"
               >
@@ -595,7 +608,7 @@
                                 wrong:
                                   item.optionsId == question.ques[jsonIndex] &&
                                   question.ques[jsonIndex] !=
-                                    question.ans[jsonIndex],
+                                    question.ans[jsonIndex]
                               }"
                               v-for="(item, index) in json.optionsList"
                               :key="index"
@@ -672,7 +685,7 @@
                                   ) != -1 &&
                                   question.ans[jsonIndex].indexOf(
                                     item.optionsId
-                                  ) == -1,
+                                  ) == -1
                               }"
                               v-for="(item, index) in json.optionsList"
                               :key="index"
@@ -768,7 +781,7 @@
                                   index ==
                                     (question.ques[jsonIndex] == 1 ? 0 : 1) &&
                                   question.ques[jsonIndex] !=
-                                    question.ans[jsonIndex],
+                                    question.ans[jsonIndex]
                               }"
                               v-for="(item, index) in judge"
                               :key="index"
@@ -863,8 +876,8 @@
                             class="explain-list"
                             v-if="
                               question.ques[jsonIndex] &&
-                              (question.ques[jsonIndex].imageList.length ||
-                                question.ques[jsonIndex].text)
+                                (question.ques[jsonIndex].imageList.length ||
+                                  question.ques[jsonIndex].text)
                             "
                           >
                             <div class="explain-list__header">我的答案:</div>
@@ -918,7 +931,7 @@
                 class="question"
                 v-if="
                   question.type == 5 &&
-                  questionModalData.current == questionIndex
+                    questionModalData.current == questionIndex
                 "
                 :key="questionIndex"
               >
@@ -1028,7 +1041,7 @@
                       green: isRight(item, index),
                       red: isWrong(item, index),
                       disabled: index >= questionModalData.num,
-                      blue: isOver(item, index),
+                      blue: isOver(item, index)
                     }"
                     @click="changeIndex(index)"
                   >
@@ -1073,7 +1086,7 @@ export default {
     ToolBar,
     GoodsItem,
     IndexSkuDialog,
-    HeaderTabBox,
+    HeaderTabBox
   },
   data() {
     return {
@@ -1089,7 +1102,7 @@ export default {
       questionModalData: {
         activeName: "0",
         num: 0, //试做题数
-        current: 0,
+        current: 0
       },
       judge: ["正确", "错误"],
       ast: [
@@ -1118,16 +1131,16 @@ export default {
         "W",
         "X",
         "Y",
-        "Z",
+        "Z"
       ],
       recommendList: [],
       skuModal: false,
-      isCarOrBuy: 1, // 1加入购物车 2立即购买
+      isCarOrBuy: 1 // 1加入购物车 2立即购买
     };
   },
   computed: {
-    compyRecommend: function () {
-      return function (array) {
+    compyRecommend: function() {
+      return function(array) {
         let ary = [];
         if (array) {
           for (let i = 0; i < array.length; i++) {
@@ -1140,7 +1153,7 @@ export default {
         }
         return ary;
       };
-    },
+    }
   },
   mounted() {
     this.goodsId = this.$route.params.goodsId;
@@ -1164,7 +1177,7 @@ export default {
     },
     toGoodsDetail(item) {
       this.$router.push({
-        path: "/bank-detail/" + item.goodsId,
+        path: "/bank-detail/" + item.goodsId
       });
       location.reload();
     },
@@ -1177,8 +1190,8 @@ export default {
         query: {
           educationId: this.goodsDetail.educationTypeId,
           projectId: this.goodsDetail.projectId,
-          businessId: this.goodsDetail.businessId,
-        },
+          businessId: this.goodsDetail.businessId
+        }
       });
     },
     /**
@@ -1189,9 +1202,9 @@ export default {
       this.$request
         .appCommonActivityRecommendList({
           businessId: this.goodsDetail.businessId,
-          type: 2,
+          type: 2
         })
-        .then((res) => {
+        .then(res => {
           if (res.rows.length) {
             this.recommendList = res.rows[0];
           }
@@ -1220,7 +1233,7 @@ export default {
     checkboxSubmit(question, questionIndex) {
       if (this.questionList[questionIndex].ques) return;
       let arr = [];
-      this.questionList[questionIndex].jsonStr.forEach((item) => {
+      this.questionList[questionIndex].jsonStr.forEach(item => {
         if (item.checked) {
           arr.push(item.optionsId);
         }
@@ -1228,7 +1241,7 @@ export default {
       if (!arr.length) {
         this.$message({
           type: "warning",
-          message: "请选择答案",
+          message: "请选择答案"
         });
         return;
       }
@@ -1242,7 +1255,7 @@ export default {
       if (this.questionList[questionIndex].ques[ansIndex]) return;
       let arr = [];
       this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
-        (item) => {
+        item => {
           if (item.checked) {
             arr.push(item.optionsId);
           }
@@ -1252,7 +1265,7 @@ export default {
       if (!arr.length) {
         this.$message({
           type: "warning",
-          message: "请选择答案",
+          message: "请选择答案"
         });
         return;
       }
@@ -1288,7 +1301,10 @@ export default {
         this.$message.warn("图片不得大于2000kb");
         return;
       }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      var type = e.target.value
+        .toLowerCase()
+        .split(".")
+        .splice(-1);
       if (
         type[0] != "jpg" &&
         type[0] != "png" &&
@@ -1300,7 +1316,7 @@ export default {
         return;
       }
 
-      this.$upload.upload(file, 0).then((res) => {
+      this.$upload.upload(file, 0).then(res => {
         question.ansText.imageList.push(res);
       });
     },
@@ -1314,7 +1330,10 @@ export default {
         this.$message.warn("图片不得大于2000kb");
         return;
       }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      var type = e.target.value
+        .toLowerCase()
+        .split(".")
+        .splice(-1);
       if (
         type[0] != "jpg" &&
         type[0] != "png" &&
@@ -1326,7 +1345,7 @@ export default {
         return;
       }
 
-      this.$upload.upload(file, 0).then((res) => {
+      this.$upload.upload(file, 0).then(res => {
         this.questionList[questionIndex].jsonStr[
           jsonIndex
         ].ansText.imageList.push(res);
@@ -1383,7 +1402,7 @@ export default {
       if (!question.ansText.text && !question.ansText.imageList.length) {
         this.$message({
           type: "warning",
-          message: "请输入内容或上传图片",
+          message: "请输入内容或上传图片"
         });
         return;
       }
@@ -1401,7 +1420,7 @@ export default {
       ) {
         this.$message({
           type: "warning",
-          message: "请输入内容或上传图片",
+          message: "请输入内容或上传图片"
         });
         return;
       }
@@ -1411,8 +1430,7 @@ export default {
           this.questionList[questionIndex].jsonStr[jsonIndex].ansText
             .imageList || [],
         text:
-          this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
-          "",
+          this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text || ""
       });
     },
     /**
@@ -1421,9 +1439,9 @@ export default {
     toDo(item) {
       this.$request
         .goodsQuestionList({
-          examId: item.majorId || item.examId,
+          examId: item.majorId || item.examId
         })
-        .then((res) => {
+        .then(res => {
           this.questionModalData.num = this.isTest(
             item.majorId || item.examId
           ).num;
@@ -1433,7 +1451,7 @@ export default {
 
               if (item.type == 2) {
                 //多选
-                item.jsonStr.forEach((str) => {
+                item.jsonStr.forEach(str => {
                   str.optionsId = "" + str.optionsId;
                 });
                 let arr = item.answerQuestion.split(",");
@@ -1457,11 +1475,11 @@ export default {
                 //简答题
                 item.ansText = {
                   text: "",
-                  imageList: [],
+                  imageList: []
                 };
                 item.ques = {
                   text: "",
-                  imageList: [],
+                  imageList: []
                 };
                 item.analysisContent &&
                   (item.analysisContent = item.analysisContent.replace(
@@ -1490,7 +1508,7 @@ export default {
                         '<img style="max-width:100%;"'
                       ));
                   } else if (json.type == 2) {
-                    json.optionsList.forEach((str) => {
+                    json.optionsList.forEach(str => {
                       str.optionsId = "" + str.optionsId;
                     });
                     let arr = json.answerQuestion.split(",");
@@ -1513,15 +1531,15 @@ export default {
                   } else if (json.type == 5) {
                     ansArr[index] = {
                       text: "",
-                      imageList: [],
+                      imageList: []
                     };
                     json.ansText = {
                       text: "",
-                      imageList: [],
+                      imageList: []
                     };
                     json.ques = {
                       text: "",
-                      imageList: [],
+                      imageList: []
                     };
                     json.content &&
                       (json.content = json.content.replace(
@@ -1560,7 +1578,7 @@ export default {
       } else {
         this.$message({
           type: "warning",
-          message: "试做题目已经结束~",
+          message: "试做题目已经结束~"
         });
       }
     },
@@ -1568,7 +1586,7 @@ export default {
       if (this.questionModalData.current >= this.questionModalData.num - 1) {
         this.$message({
           type: "warning",
-          message: "试做题目已经结束~",
+          message: "试做题目已经结束~"
         });
         return;
       } else {
@@ -1697,7 +1715,7 @@ export default {
      */
     questionOverNum(hasSpecail) {
       let count = 0;
-      this.questionList.forEach((item) => {
+      this.questionList.forEach(item => {
         if (item.type == 1 || item.type == 2 || item.type == 3) {
           if (item.ques) {
             count++;
@@ -1755,10 +1773,10 @@ export default {
       this.$request
         .goodsChapterList({
           moduleExamId: Module.majorId,
-          goodsId: this.goodsId,
+          goodsId: this.goodsId
         })
-        .then((res) => {
-          res.data.forEach((item) => {
+        .then(res => {
+          res.data.forEach(item => {
             item.showList = false;
             item.list = [];
           });
@@ -1778,9 +1796,9 @@ export default {
       this.$request
         .goodsExamList({
           chapterExamId: chapter.chapterExamId || chapter.majorId,
-          goodsId: this.goodsId,
+          goodsId: this.goodsId
         })
-        .then((res) => {
+        .then(res => {
           this.$set(chapter, "showList", !chapter.showList);
           chapter.list = res.data;
         });
@@ -1789,7 +1807,7 @@ export default {
       if (!this.$tools.isLogin()) {
         this.setCurrentRouter(this.$route);
         this.$router.push({
-          path: "/login",
+          path: "/login"
         });
         return;
       }
@@ -1810,14 +1828,14 @@ export default {
       let selectGoodsList = JSON.parse(JSON.stringify(data));
       localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
       this.$router.push({
-        path: "/payment",
+        path: "/payment"
       });
     },
     addCart() {
       if (!this.$tools.isLogin()) {
         this.setCurrentRouter(this.$route);
         this.$router.push({
-          path: "/login",
+          path: "/login"
         });
         return;
       }
@@ -1837,18 +1855,18 @@ export default {
       }
       this.$request
         .addCart({ goodsIds })
-        .then((res) => {
+        .then(res => {
           this.getCartCount();
           this.$message({
             message: "加入购物车成功",
-            type: "success",
+            type: "success"
           });
         })
-        .catch((err) => {
+        .catch(err => {
           if (err.code == 500) {
             this.$message({
               message: err.msg,
-              type: "warning",
+              type: "warning"
             });
           }
         });
@@ -1857,9 +1875,9 @@ export default {
       this.$axios({
         url: `/app/common/spec/${this.goodsDetail.specTemplateId}`,
         method: "get",
-        noToken: true,
+        noToken: true
       })
-        .then((res) => {
+        .then(res => {
           if (res.data) {
             this.skuModal = true;
           } else {
@@ -1876,7 +1894,7 @@ export default {
      * 获取商品详情
      */
     getGoodsDetail() {
-      this.$request.commonGoodsDetail(this.goodsId).then((res) => {
+      this.$request.commonGoodsDetail(this.goodsId).then(res => {
         this.goodsDetail = res.data;
         this.goodsExamConfig = JSON.parse(res.data.goodsExamConfig);
         this.getRecommend();
@@ -1886,14 +1904,14 @@ export default {
      * 是否是试做
      */
     isTest(id) {
-      return this.goodsExamConfig.find((item) => item.examId == id);
+      return this.goodsExamConfig.find(item => item.examId == id);
     },
     /**
      * 获取课程列表
      */
     getGoodsBankList() {
-      this.$request.goodsBankList({ goodsId: this.goodsId }).then((res) => {
-        res.data.forEach((item) => {
+      this.$request.goodsBankList({ goodsId: this.goodsId }).then(res => {
+        res.data.forEach(item => {
           if (item.type == 2 || item.type == 1) {
             item.showList = false;
             item.list = [];
@@ -1913,10 +1931,10 @@ export default {
           //第一个是模块直接展开,再展开章下面的节
           this.$request
             .goodsChapterList({
-              moduleExamId: this.bankList[i].majorId,
+              moduleExamId: this.bankList[i].majorId
             })
-            .then((res) => {
-              res.data.forEach((re) => {
+            .then(res => {
+              res.data.forEach(re => {
                 re.list = [];
               });
               this.$set(this.bankList[i], "showList", true);
@@ -1934,7 +1952,7 @@ export default {
     collect() {
       this.$message({
         message: "试做题目,不支持收藏~",
-        type: "warning",
+        type: "warning"
       });
       return;
     },
@@ -1945,14 +1963,14 @@ export default {
         closeOnClickModal: false,
         closeOnPressEscape: false,
         distinguishCancelAndClose: false,
-        showClose: false,
+        showClose: false
       })
-        .then((_) => {})
-        .catch((_) => {
+        .then(_ => {})
+        .catch(_ => {
           this.questionModalShow = false;
         });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 7 - 3
src/pages/goods-detail/course-detail.vue

@@ -75,7 +75,8 @@
               <div class="goods-info__body">
                 <el-tabs v-model="activeName">
                   <el-tab-pane label="课程详情" name="1">
-                    <div class="detail ql-editor" style="white-space: pre-wrap"  v-html="goodsDetail.pcDetailHtml"></div>
+                    <div class="detail ql-editor" v-if="goodsDetail.pcDetailHtml" style="white-space: pre-wrap"  v-html="goodsDetail.pcDetailHtml"></div>
+                    <el-empty description="暂无课程详情" v-else></el-empty>
                   </el-tab-pane>
                   <el-tab-pane label="章节目录" name="2">
                     <div slot="label" style="position: relative">
@@ -296,11 +297,11 @@
                         </div>
                       </div>
                       <div class="right-box">
-                        <div class="title" v-if="recommendList.goodsList">
+                        <div class="title">
                           推荐课程
                           <a class="more" @click="comeMoreList">更多></a>
                         </div>
-                        <ul class="list" v-if="recommendList.goodsList">
+                        <ul class="list" v-if="recommendList.goodsList && recommendList.goodsList.length > 0">
                           <li
                             class="course-item"
                             v-for="(itemy, index) in compyRecommend(
@@ -334,16 +335,19 @@
                             </div> -->
                           </li>
                         </ul>
+                        <el-empty description="暂无推荐课程" v-else></el-empty>
                       </div>
                     </div>
                   </el-tab-pane>
                   <el-tab-pane label="学员须知" name="3">
                     <div class="ql-editor" style="white-space: pre-wrap" 
+                  v-if="goodsDetail.buyNote"
                       v-html="
                         goodsDetail.buyNote &&
                         goodsDetail.buyNote.replace(/\n|\r\n/g, '<br>')
                       "
                     ></div>
+                    <el-empty description="暂无学员须知" v-else></el-empty>
                   </el-tab-pane>
                   <el-tab-pane
                     label="赠送题卷"

+ 6 - 2
src/pages/goods-detail/handout-detail.vue

@@ -71,23 +71,26 @@
               <div class="goods-info__body">
                 <el-tabs v-model="activeName">
                   <el-tab-pane label="课程详情" name="1">
-                    <div
+                    <div v-if="goodsDetail.pcDetailHtml"
                       class="detail ql-editor"
                       style="white-space: pre-wrap"
                       v-html="goodsDetail.pcDetailHtml"
                     ></div>
+                    <el-empty description="暂无课程详情" v-else></el-empty>
                   </el-tab-pane>
                   <el-tab-pane label="章节目录" name="2">
-                    <h2 style="font-size: 18px;">
+                    <h2 style="font-size: 16px;">
                       讲义标题:{{ courseHandoutsData.handoutsName }}
                     </h2>
                     <el-tree
+                    style="margin:14px 0px;"
                       :data="courseHandoutsData.fileList"
                       :props="defaultProps"
                     ></el-tree>
                   </el-tab-pane>
                   <el-tab-pane label="学员须知" name="3">
                     <div
+                    v-if="goodsDetail.buyNote"
                       class="ql-editor"
                       style="white-space: pre-wrap"
                       v-html="
@@ -95,6 +98,7 @@
                           goodsDetail.buyNote.replace(/\n|\r\n/g, '<br>')
                       "
                     ></div>
+                    <el-empty description="暂无学员须知" v-else></el-empty>
                   </el-tab-pane>
                 </el-tabs>
               </div>

+ 125 - 120
src/pages/goods-detail/live-detail.vue

@@ -35,7 +35,7 @@
                     class="price"
                     v-if="
                       !goodsDetail.specTemplateId ||
-                      (!goodsDetail.maxPrice && !goodsDetail.minPrice)
+                        (!goodsDetail.maxPrice && !goodsDetail.minPrice)
                     "
                   >
                     {{
@@ -75,15 +75,15 @@
               <div class="goods-info__body">
                 <el-tabs v-model="activeName">
                   <el-tab-pane label="课程详情" name="1">
-                    <div class="detail ql-editor" style="white-space: pre-wrap"  v-html="goodsDetail.pcDetailHtml"></div>
+                    <div
+                      class="detail ql-editor"
+                      v-if="goodsDetail.pcDetailHtml"
+                      style="white-space: pre-wrap"
+                      v-html="goodsDetail.pcDetailHtml"
+                    ></div>
+                    <el-empty description="暂无课程详情" v-else></el-empty>
                   </el-tab-pane>
                   <el-tab-pane label="章节目录" name="2">
-                    <div slot="label" style="position: relative">
-                      <span class="label">章节目录</span>
-                      <!-- <span v-if="listenConfigList.length" class="view-note"
-                        >试看</span
-                      > -->
-                    </div>
                     <div class="goods-menu clearfix">
                       <div class="left-box">
                         <div class="left-box__body">
@@ -99,7 +99,7 @@
                               <i
                                 :class="{
                                   'el-icon-caret-right': !course.showList,
-                                  'el-icon-caret-bottom': course.showList,
+                                  'el-icon-caret-bottom': course.showList
                                 }"
                               ></i>
                               {{ course.courseName }}
@@ -118,7 +118,7 @@
                                     <i
                                       :class="{
                                         'el-icon-caret-right': !item.showList,
-                                        'el-icon-caret-bottom': item.showList,
+                                        'el-icon-caret-bottom': item.showList
                                       }"
                                     ></i>
                                     {{ item.name }}
@@ -130,9 +130,8 @@
                                     >
                                       <div
                                         class="bank-chapter__item"
-                                        v-for="(
-                                          chapter, chapterIndex
-                                        ) in item.list"
+                                        v-for="(chapter,
+                                        chapterIndex) in item.list"
                                         :key="chapterIndex"
                                       >
                                         <div
@@ -141,10 +140,9 @@
                                         >
                                           <i
                                             :class="{
-                                              'el-icon-caret-right':
-                                                !chapter.showList,
+                                              'el-icon-caret-right': !chapter.showList,
                                               'el-icon-caret-bottom':
-                                                chapter.showList,
+                                                chapter.showList
                                             }"
                                           ></i
                                           >{{ chapter.name }}
@@ -156,9 +154,8 @@
                                         >
                                           <div
                                             class="bank-section__item"
-                                            v-for="(
-                                              section, sectionIndex
-                                            ) in chapter.list"
+                                            v-for="(section,
+                                            sectionIndex) in chapter.list"
                                             :key="sectionIndex"
                                           >
                                             <div
@@ -212,10 +209,9 @@
                                         >
                                           <i
                                             :class="{
-                                              'el-icon-caret-right':
-                                                !item.showList,
+                                              'el-icon-caret-right': !item.showList,
                                               'el-icon-caret-bottom':
-                                                item.showList,
+                                                item.showList
                                             }"
                                           ></i
                                           >{{ item.name }}
@@ -227,9 +223,8 @@
                                         >
                                           <div
                                             class="bank-section__item"
-                                            v-for="(
-                                              section, sectionIndex
-                                            ) in item.list"
+                                            v-for="(section,
+                                            sectionIndex) in item.list"
                                             :key="sectionIndex"
                                           >
                                             <div
@@ -315,11 +310,11 @@
                         </div>
                       </div>
                       <div class="right-box">
-                        <div class="title" v-if="recommendList.goodsList">
+                        <div class="title">
                           推荐直播
                           <a class="more" @click="comeMoreList">更多></a>
                         </div>
-                        <ul class="list" v-if="recommendList.goodsList">
+                        <ul class="list" v-if="recommendList.goodsList && recommendList.goodsList.length > 0">
                           <li
                             class="course-item"
                             v-for="(itemy, index) in compyRecommend(
@@ -353,16 +348,21 @@
                             </div> -->
                           </li>
                         </ul>
+                        <el-empty description="暂无推荐直播" v-else></el-empty>
                       </div>
                     </div>
                   </el-tab-pane>
                   <el-tab-pane label="学员须知" name="3">
-                    <div class="ql-editor" style="white-space: pre-wrap" 
+                    <div
+                      class="ql-editor"
+                      style="white-space: pre-wrap"
+                      v-if="goodsDetail.buyNote"
                       v-html="
                         goodsDetail.buyNote &&
-                        goodsDetail.buyNote.replace(/\n|\r\n/g, '<br>')
+                          goodsDetail.buyNote.replace(/\n|\r\n/g, '<br>')
                       "
                     ></div>
+                    <el-empty description="暂无学员须知" v-else></el-empty>
                   </el-tab-pane>
                   <el-tab-pane
                     label="赠送题卷"
@@ -418,8 +418,8 @@
           class="section__footer"
           v-if="
             recommendList.goodsList &&
-            recommendList.goodsList.length &&
-            (activeName == 1 || activeName == 3)
+              recommendList.goodsList.length &&
+              (activeName == 1 || activeName == 3)
           "
         >
           <div class="recommend">
@@ -577,14 +577,14 @@ export default {
     Header,
     ToolBar,
     GoodsItem,
-    IndexSkuDialog,
+    IndexSkuDialog
   },
   data() {
     return {
       questionList: [],
       goodsExamConfig: [],
       goodsDetail: {
-        standPrice: 0,
+        standPrice: 0
       },
       courseList: [],
       goodsId: "",
@@ -596,7 +596,7 @@ export default {
       questionModalData: {
         activeName: "0",
         num: 0, //试做题数
-        current: 0,
+        current: 0
       },
       judge: ["正确", "错误"],
       ast: [
@@ -625,7 +625,7 @@ export default {
         "W",
         "X",
         "Y",
-        "Z",
+        "Z"
       ],
       goodsAuditionConfigIdList: [], //试听列表
       listenConfigList: [],
@@ -645,7 +645,7 @@ export default {
       educationId: "",
       props: {
         lazy: true,
-        lazyLoad: this.lazyLoad,
+        lazyLoad: this.lazyLoad
       },
       applyAreas: [],
       provinceList: [],
@@ -656,7 +656,7 @@ export default {
       menuIndex: [], //需要展开的章节索引值
       freeMenuList: [], //赠送题卷列表
       skuModal: false,
-      isCarOrBuy: 1, // 1加入购物车 2立即购买
+      isCarOrBuy: 1 // 1加入购物车 2立即购买
     };
   },
   mounted() {
@@ -670,8 +670,8 @@ export default {
     document.addEventListener("visibilitychange", this.pauseVideo);
   },
   computed: {
-    compyRecommend: function () {
-      return function (array) {
+    compyRecommend: function() {
+      return function(array) {
         let ary = [];
         if (array) {
           for (let i = 0; i < array.length; i++) {
@@ -684,7 +684,7 @@ export default {
         }
         return ary;
       };
-    },
+    }
   },
   methods: {
     ...mapMutations(["setCurrentRouter", "getCartCount"]),
@@ -696,7 +696,7 @@ export default {
     appCommonGoodsCourseModuleFreeExamList() {
       this.$request
         .appCommonGoodsCourseModuleFreeExamList(this.goodsId)
-        .then((res) => {
+        .then(res => {
           if (res.data.length) {
             this.freeMenuList = res.data;
           }
@@ -704,7 +704,7 @@ export default {
     },
     toGoodsDetail(item) {
       this.$router.push({
-        path: "/course-detail/" + item.goodsId,
+        path: "/course-detail/" + item.goodsId
       });
       location.reload();
     },
@@ -717,8 +717,8 @@ export default {
         query: {
           educationId: this.goodsDetail.educationTypeId,
           projectId: this.goodsDetail.projectId,
-          businessId: this.goodsDetail.businessId,
-        },
+          businessId: this.goodsDetail.businessId
+        }
       });
     },
     /**
@@ -739,9 +739,9 @@ export default {
       this.$request
         .appCommonActivityRecommendList({
           businessId: this.goodsDetail.businessId,
-          type: 6,
+          type: 6
         })
-        .then((res) => {
+        .then(res => {
           if (res.rows.length) {
             this.recommendList = res.rows[0];
           }
@@ -751,7 +751,7 @@ export default {
      * 获取模块列表
      */
     getMenuList(item) {
-      this.$request.menuList({ courseId: item.courseId }).then((res) => {
+      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;
@@ -803,7 +803,7 @@ export default {
     checkboxSubmit(question, questionIndex) {
       if (this.questionList[questionIndex].ques) return;
       let arr = [];
-      this.questionList[questionIndex].jsonStr.forEach((item) => {
+      this.questionList[questionIndex].jsonStr.forEach(item => {
         if (item.checked) {
           arr.push(item.optionsId);
         }
@@ -811,7 +811,7 @@ export default {
       if (!arr.length) {
         this.$message({
           type: "warning",
-          message: "请选择答案",
+          message: "请选择答案"
         });
         return;
       }
@@ -825,7 +825,7 @@ export default {
       if (this.questionList[questionIndex].ques[ansIndex]) return;
       let arr = [];
       this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
-        (item) => {
+        item => {
           if (item.checked) {
             arr.push(item.optionsId);
           }
@@ -835,7 +835,7 @@ export default {
       if (!arr.length) {
         this.$message({
           type: "warning",
-          message: "请选择答案",
+          message: "请选择答案"
         });
         return;
       }
@@ -872,7 +872,10 @@ export default {
         this.$message.warn("图片不得大于2000kb");
         return;
       }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      var type = e.target.value
+        .toLowerCase()
+        .split(".")
+        .splice(-1);
       if (
         type[0] != "jpg" &&
         type[0] != "png" &&
@@ -884,7 +887,7 @@ export default {
         return;
       }
 
-      this.$upload.upload(file, 0).then((res) => {
+      this.$upload.upload(file, 0).then(res => {
         question.ansText.imageList.push(res);
       });
     },
@@ -898,7 +901,10 @@ export default {
         this.$message.warn("图片不得大于2000kb");
         return;
       }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      var type = e.target.value
+        .toLowerCase()
+        .split(".")
+        .splice(-1);
       if (
         type[0] != "jpg" &&
         type[0] != "png" &&
@@ -910,7 +916,7 @@ export default {
         return;
       }
 
-      this.$upload.upload(file, 0).then((res) => {
+      this.$upload.upload(file, 0).then(res => {
         this.questionList[questionIndex].jsonStr[
           jsonIndex
         ].ansText.imageList.push(res);
@@ -967,7 +973,7 @@ export default {
       if (!question.ansText.text && !question.ansText.imageList.length) {
         this.$message({
           type: "warning",
-          message: "请输入内容或上传图片",
+          message: "请输入内容或上传图片"
         });
         return;
       }
@@ -985,7 +991,7 @@ export default {
       ) {
         this.$message({
           type: "warning",
-          message: "请输入内容或上传图片",
+          message: "请输入内容或上传图片"
         });
         return;
       }
@@ -995,8 +1001,7 @@ export default {
           this.questionList[questionIndex].jsonStr[jsonIndex].ansText
             .imageList || [],
         text:
-          this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
-          "",
+          this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text || ""
       });
     },
     /**
@@ -1029,13 +1034,13 @@ export default {
         width: 800,
         height: 450,
         uid: this.uidzb,
-        vid: this.vidzb,
+        vid: this.vidzb
       });
     },
     loadPlayer() {
       var self = this;
       const polyvPlayer = window.polyvPlayer;
-      let auditionMinute = this.listenConfigList.find((item) => {
+      let auditionMinute = this.listenConfigList.find(item => {
         if (
           item.sectionId ==
             (this.sectionItem.sectionId || this.sectionItem.menuId) &&
@@ -1045,7 +1050,7 @@ export default {
         }
       }).auditionMinute;
 
-      self.$request.obtainpolyvvideosign(self.vid).then((res) => {
+      self.$request.obtainpolyvvideosign(self.vid).then(res => {
         self.player = polyvPlayer({
           wrap: "#player",
           width: 800,
@@ -1056,11 +1061,11 @@ export default {
           teaser_show: 0,
           ts: res.data.ts,
           sign: res.data.sign,
-          playsafe: function (vid, next) {
-            self.$request.obtainpolyvvideopcsign(vid).then((res) => {
+          playsafe: function(vid, next) {
+            self.$request.obtainpolyvvideopcsign(vid).then(res => {
               next(res.data);
             });
-          },
+          }
         });
 
         self.player.on("s2j_onPlayOver", () => {
@@ -1069,8 +1074,8 @@ export default {
             showCancelButton: false,
             closeOnPressEscape: false,
             distinguishCancelAndClose: false,
-            showClose: false,
-          }).then((res) => {
+            showClose: false
+          }).then(res => {
             this.videoModalShow = false;
           });
         });
@@ -1121,7 +1126,7 @@ export default {
       } else {
         this.$message({
           type: "warning",
-          message: "试做题目已经结束~",
+          message: "试做题目已经结束~"
         });
       }
     },
@@ -1129,7 +1134,7 @@ export default {
       if (this.questionModalData.current >= this.questionModalData.num - 1) {
         this.$message({
           type: "warning",
-          message: "试做题目已经结束~",
+          message: "试做题目已经结束~"
         });
         return;
       } else {
@@ -1258,7 +1263,7 @@ export default {
      */
     questionOverNum(hasSpecail) {
       let count = 0;
-      this.questionList.forEach((item) => {
+      this.questionList.forEach(item => {
         if (item.type == 1 || item.type == 2 || item.type == 3) {
           if (item.ques) {
             count++;
@@ -1317,7 +1322,7 @@ export default {
       }
     },
     getChapterList(Module) {
-      this.$request.chapterList(Module.id).then((res) => {
+      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;
@@ -1349,11 +1354,11 @@ export default {
       console.log(node);
       if (level == 0) {
       } else if (level == 1) {
-        this.$request.getCityList({ parentId: node.value }).then((res) => {
-          const nodes = res.rows.map((item) => ({
+        this.$request.getCityList({ parentId: node.value }).then(res => {
+          const nodes = res.rows.map(item => ({
             value: item.areaId,
             label: `${item.areaName}`,
-            leaf: level >= 1,
+            leaf: level >= 1
           }));
           resolve(nodes);
         });
@@ -1361,7 +1366,7 @@ export default {
     },
 
     getSectionList(chapter) {
-      this.$request.sectionList(chapter.id).then((res) => {
+      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;
@@ -1384,24 +1389,24 @@ export default {
         //选择班级
         // 之前的传参:goodsId:goodsDetail.goodsId
         if (!this.gradeList.length) {
-          this.$request.goodsGradeList({ goodsId: goodsId }).then((res) => {
+          this.$request.goodsGradeList({ goodsId: goodsId }).then(res => {
             this.gradeList = res.rows;
             if (this.gradeList.length == 0) {
               let item = {
                 className: "系统分班",
-                gradeId: 0,
+                gradeId: 0
               };
               this.gradeList.push(item);
             } else {
               let isGradeFull = this.gradeList.every(
-                (item) =>
+                item =>
                   item.studentNum > 0 && item.studentNum == item.studentUpper
               );
               //所有班级都满了
               if (isGradeFull) {
                 let item = {
                   className: "系统分班",
-                  gradeId: 0,
+                  gradeId: 0
                 };
                 this.gradeList.unshift(item);
               }
@@ -1414,7 +1419,7 @@ export default {
         //选择考期
         this.$request
           .getExamineList({ projectId: goodsDetail.projectId })
-          .then((res) => {
+          .then(res => {
             this.examineList = res.rows;
           });
       }
@@ -1423,11 +1428,11 @@ export default {
      * 获取所有省份
      */
     getProvinceList() {
-      this.$request.getProvinceList().then((res) => {
-        this.provinceList = res.rows.map((item) => ({
+      this.$request.getProvinceList().then(res => {
+        this.provinceList = res.rows.map(item => ({
           value: item.areaId,
           label: `${item.areaName}`,
-          leaf: false,
+          leaf: false
         }));
       });
     },
@@ -1438,7 +1443,7 @@ export default {
         areaName: node.parent.label,
         areaId: node.parent.value,
         cityId: node.value,
-        cityName: node.label,
+        cityName: node.label
       };
     },
     buyNow() {
@@ -1455,22 +1460,22 @@ export default {
       } else {
         this.setCurrentRouter(this.$route);
         this.$router.push({
-          path: "/login",
+          path: "/login"
         });
         return;
       }
     },
     toPayment(goodsDetail) {
       let selectGoodsList = JSON.parse(JSON.stringify([goodsDetail]));
-      selectGoodsList.forEach((item) => {
+      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)
-              ),
+                this.gradeList.find(grade => grade.gradeId == this.gradeId)
+              )
             };
             item.goodsInputData = goodsInputData;
           }
@@ -1480,9 +1485,9 @@ export default {
               applyAreasJson: JSON.stringify(this.applyAreas),
               examDateJson: JSON.stringify(
                 this.examineList.find(
-                  (exam) => exam.educationId == this.educationId
+                  exam => exam.educationId == this.educationId
                 )
-              ),
+              )
             };
             item.goodsInputData = goodsInputData;
           }
@@ -1492,7 +1497,7 @@ export default {
       localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
 
       this.$router.push({
-        path: "/payment",
+        path: "/payment"
       });
     },
     pay() {
@@ -1503,7 +1508,7 @@ export default {
         if (!this.gradeId && this.gradeId !== 0) {
           this.$message({
             message: "请选择班级",
-            type: "warning",
+            type: "warning"
           });
           return;
         }
@@ -1524,22 +1529,22 @@ export default {
         if (!this.educationId) {
           this.$message({
             message: "请选择考期",
-            type: "warning",
+            type: "warning"
           });
           return false;
         }
       }
 
       let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
-      selectGoodsList.forEach((item) => {
+      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)
-              ),
+                this.gradeList.find(grade => grade.gradeId == this.gradeId)
+              )
             };
             item.goodsInputData = goodsInputData;
           }
@@ -1549,9 +1554,9 @@ export default {
               applyAreasJson: JSON.stringify(this.applyAreas),
               examDateJson: JSON.stringify(
                 this.examineList.find(
-                  (exam) => exam.educationId == this.educationId
+                  exam => exam.educationId == this.educationId
                 )
-              ),
+              )
             };
             item.goodsInputData = goodsInputData;
           }
@@ -1561,14 +1566,14 @@ export default {
       localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
 
       this.$router.push({
-        path: "/payment",
+        path: "/payment"
       });
     },
     addCart(status, goodsId) {
       if (!this.$tools.isLogin()) {
         this.setCurrentRouter(this.$route);
         this.$router.push({
-          path: "/login",
+          path: "/login"
         });
         return;
       }
@@ -1587,18 +1592,18 @@ export default {
       }
       this.$request
         .addCart({ goodsIds })
-        .then((res) => {
+        .then(res => {
           this.getCartCount();
           this.$message({
             message: "加入购物车成功",
-            type: "success",
+            type: "success"
           });
         })
-        .catch((err) => {
+        .catch(err => {
           if (err.code == 500) {
             this.$message({
               message: err.msg,
-              type: "warning",
+              type: "warning"
             });
           }
         });
@@ -1607,9 +1612,9 @@ export default {
       this.$axios({
         url: `/app/common/spec/${this.goodsDetail.specTemplateId}`,
         method: "get",
-        noToken: true,
+        noToken: true
       })
-        .then((res) => {
+        .then(res => {
           if (res.data) {
             this.skuModal = true;
           } else {
@@ -1626,7 +1631,7 @@ export default {
      * 获取商品详情
      */
     getGoodsDetail() {
-      this.$request.commonGoodsDetail(this.goodsId).then((res) => {
+      this.$request.commonGoodsDetail(this.goodsId).then(res => {
         if (res.data.pcDetailHtml) {
           res.data.pcDetailHtml =
             res.data.pcDetailHtml &&
@@ -1658,14 +1663,14 @@ export default {
      * 是否是试做
      */
     isTest(id) {
-      return this.goodsExamConfig.find((item) => item.examId == id);
+      return this.goodsExamConfig.find(item => item.examId == id);
     },
     /**
      * 获取课程章节列表
      */
     goodsCourseList() {
-      this.$request.goodsCourseList(this.goodsId).then(async (res) => {
-        res.rows.forEach((item) => {
+      this.$request.goodsCourseList(this.goodsId).then(async res => {
+        res.rows.forEach(item => {
           item.showList = false;
           item.list = [];
         });
@@ -1688,8 +1693,8 @@ export default {
     },
 
     getCourseMenus(item) {
-      return new Promise((resolve) => {
-        this.$request.menuList({ courseId: item.courseId }).then((res) => {
+      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++) {
               if (res.rows[i].type == 3) {
@@ -1704,7 +1709,7 @@ export default {
     collect() {
       this.$message({
         message: "试做题目,不支持收藏~",
-        type: "warning",
+        type: "warning"
       });
       return;
     },
@@ -1715,17 +1720,17 @@ export default {
         closeOnClickModal: false,
         closeOnPressEscape: false,
         distinguishCancelAndClose: false,
-        showClose: false,
+        showClose: false
       })
-        .then((_) => {})
-        .catch((_) => {
+        .then(_ => {})
+        .catch(_ => {
           this.questionModalShow = false;
         });
-    },
+    }
   },
   beforeDestroy() {
     document.removeEventListener("visibilitychange", this.pauseVideo);
-  },
+  }
 };
 </script>
 
@@ -1801,7 +1806,7 @@ export default {
                   font-weight: bold;
                 }
               }
-              i{
+              i {
                 font-size: 32px;
               }
             }
@@ -1876,7 +1881,7 @@ export default {
 
               &__body {
                 .course-list-item {
-                  margin-top: 24px;
+                  margin-bottom: 20px;
                   padding: 16px;
                   background: #f5f7fa;
                   border-radius: 10px;

+ 1 - 1
src/pages/handout-list/index.vue

@@ -8,7 +8,7 @@
             <el-breadcrumb-item :to="{ path: '/index' }"
               >首页</el-breadcrumb-item
             >
-            <el-breadcrumb-item>课程</el-breadcrumb-item>
+            <el-breadcrumb-item>讲义资料</el-breadcrumb-item>
           </el-breadcrumb>
         </div>
       </div>

+ 8 - 12
src/pages/person-center/index.vue

@@ -26,7 +26,6 @@
               <h2 class="link_two">随时随地提升分数</h2>
             </div>
             <img :src="$tools.splitImgHost(mobile.mobileImage)" alt="" />
-            
           </div>
         </div>
 
@@ -151,9 +150,7 @@
               </div>
             </div>
           </div>
-          <div class="content">
-            <router-view></router-view>
-          </div>
+          <div class="content"><router-view></router-view></div>
         </div>
       </div>
     </section>
@@ -176,7 +173,7 @@ export default {
     swiperSlide,
     Footer,
     Header,
-    ToolBar,
+    ToolBar
   },
   data() {
     return {
@@ -192,13 +189,13 @@ export default {
         // 设置点击箭头
         navigation: {
           nextEl: ".swiper-button-next",
-          prevEl: ".swiper-button-prev",
-        },
-      },
+          prevEl: ".swiper-button-prev"
+        }
+      }
     };
   },
   computed: {
-    ...mapGetters(["userInfo", "businessList", "businessItem","mobile"]),
+    ...mapGetters(["userInfo", "businessList", "businessItem", "mobile"])
   },
   mounted() {},
   methods: {
@@ -212,8 +209,8 @@ export default {
     },
     swiperClick(item) {
       this.setBusinessItem(item);
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -271,7 +268,6 @@ export default {
           .link_two {
             text-indent: 3rem;
           }
-
         }
       }
     }

+ 5 - 5
src/pages/person-center/my-bank/index/index.vue

@@ -1,6 +1,9 @@
 <template>
   <div id="Mybank">
-    <div class="no-data" v-if="!bankData.goodsName">暂无可以学习的题库哦~</div>
+    <el-empty
+      description="暂无可以学习的题库哦"
+      v-if="!bankData.goodsName"
+    ></el-empty>
     <div v-else>
       <h4 class="headerTitle">
         <span v-if="bankData.subjectNames" style="font-size: 20px"
@@ -23,10 +26,7 @@
           >进入学习</el-button
         >
       </h4>
-      <bank-detail
-        ref="bankDetail"
-        v-show="!bankData.externalLinkStatus"
-      />
+      <bank-detail ref="bankDetail" v-show="!bankData.externalLinkStatus" />
     </div>
     <el-dialog title="切换题库" :visible.sync="dialogVisible" width="900px">
       <div class="topstyle">

+ 1 - 0
src/pages/person-center/my-course/index.vue

@@ -1152,6 +1152,7 @@ export default {
       } else {
         param.studyStatus = this.activeStudyStatus;
       }
+      param.querySign = 1
       this.$request
         .courseGoodsList(param)
         .then(res => {

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

@@ -9,7 +9,7 @@
       <div class="my-course__body">
         <el-main class="list" v-loading="loading">
           <el-empty
-            description="请前往购买商品"
+            description="暂未购买讲义资料商品"
             v-if="courseList.length === 0"
           ></el-empty>
           <div

+ 2 - 1
src/pages/person-center/my-live/index.vue

@@ -12,7 +12,7 @@
       <div class="note">正在直播中</div>
       <div class="note">></div>
     </div>
-    <div class="my-course__body">
+    <div class="my-course__body" v-if="courseList && courseList.length > 0">
       <div class="list">
         <div
           class="course-item"
@@ -64,6 +64,7 @@
         </el-pagination>
       </div>
     </div>
+    <el-empty description="暂未购买直播商品" v-else></el-empty>
   </div>
 </template>
 

+ 14 - 14
src/pages/person-center/play-record/index.vue

@@ -4,7 +4,7 @@
       播放记录
       <!-- <a class="clear-btn">清空记录</a> -->
     </div>
-    <div class="play-record__body">
+    <div class="play-record__body" v-if="total > 0">
       <div class="date-item" v-for="(v, k) in recordList" :key="k">
         <div class="date-item__header">{{ k }}</div>
         <div class="date-item__body">
@@ -66,21 +66,21 @@
           </div>
         </div>
       </div>
-    </div>
-
-    <div class="play-record__footer">
-      <div class="pagination">
-        <el-pagination
-          @current-change="currentChange"
-          background
-          layout="prev, pager, next"
-          :total="total"
-          :pager-count="5"
-          :page-size="params.pageSize"
-        >
-        </el-pagination>
+      <div class="play-record__footer">
+        <div class="pagination">
+          <el-pagination
+            @current-change="currentChange"
+            background
+            layout="prev, pager, next"
+            :total="total"
+            :pager-count="5"
+            :page-size="params.pageSize"
+          >
+          </el-pagination>
+        </div>
       </div>
     </div>
+    <el-empty description="暂无播放记录" v-else></el-empty>
 
     <RebuildModal
       ref="rebuildModal"

+ 8 - 2
src/store/index.js

@@ -26,6 +26,7 @@ export default new Vuex.Store({
       serviceTel: {}
     },//页头配置
     footer: [],//页尾配置
+    footerRecord: null,//底部说明
     links: null,//友情链接
     mobile: null,//移动端设置
     sysTime: 0,
@@ -45,6 +46,7 @@ export default new Vuex.Store({
     token: state => state.token,
     header: state => state.header,
     footer: state => state.footer,
+    footerRecord: state => state.footerRecord,
     links: state => state.links,
     mobile: state => state.mobile,
     getApplyData: state => state.applyData,
@@ -94,6 +96,10 @@ export default new Vuex.Store({
           state.footer = JSON.parse(item.configValue)
           console.log(state.footer)
         }
+        if (item.configKey === 'home.footer.record') {
+          state.footerRecord = JSON.parse(item.configValue) || {}
+        }
+
         if (item.configKey === 'home.links') {
           state.links = JSON.parse(item.configValue)
           console.log(state.links)
@@ -111,11 +117,11 @@ export default new Vuex.Store({
     },
 
     getMsgCount(state) {
-      user.getappinformUserlist({
+      user.appinformUsercount({
         systemStatusList: '1,2',
         receiptStatus: 0,
       }).then(res => {
-        state.msgCount = res.total
+        state.msgCount = res.data
       })
     }
   },