Tang 2 سال پیش
والد
کامیت
dd88592dc0

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

@@ -1192,7 +1192,8 @@ export default {
     } catch (err) {}
   },
   beforeRouteLeave(to, from, next) {
-    if (this.mustBack || this.isSubmit) {
+    if (this.mustBack || this.isSubmit ||
+      (to.path == "/home" && !this.$store.state.userInfo)) {
       next();
     } else {
       next(false);

+ 9 - 0
src/pages/course-detail/components/CourseTree.vue

@@ -1051,6 +1051,13 @@ export default {
     //展开定位列表
     unfoldFunc(item, status = false, Renewal = false) {
       return new Promise(async resolve => {
+        var scrollTopFunc = () => {
+          var scrollTop = document.getElementsByClassName("activeImg_style")[0]
+            .offsetTop;
+          document.getElementsByClassName(
+            "courseTree"
+          )[0].scrollTop = scrollTop;
+        }; //滚动到当前播放位置
         if (item.moduleId) {
           let moduleChildren = await this.openModule(
             this.courseDataList.find(i => i.moduleId == item.moduleId),
@@ -1063,6 +1070,7 @@ export default {
               status,
               Renewal
             );
+            scrollTopFunc();
           }
         }
         if (!item.moduleId && item.chapterId) {
@@ -1071,6 +1079,7 @@ export default {
             status,
             Renewal
           );
+          scrollTopFunc();
         }
         resolve();
       });

+ 8 - 4
src/pages/course-exam/index.vue

@@ -1285,7 +1285,7 @@ export default {
         });
         //提交拍照记录
         if (await this.postStudyRecord(0, photoUrl, compareFaceData)) {
-          this.needPhoto = false
+          this.needPhoto = false;
           if (this.openPhotoStatus == 1) {
             this.examSubmit();
             return;
@@ -1987,7 +1987,7 @@ export default {
           ...form
         })
         .then(res => {
-          this.mustBack = true
+          this.mustBack = true;
           clearInterval(this.timer);
           this.$message({
             type: "success",
@@ -2024,7 +2024,7 @@ export default {
             this.$message.error(err.msg);
             console.log("拍照不够触发");
             this.openPhotoStatus = 1;
-            this.needPhoto = true
+            this.needPhoto = true;
             this.openPhoto();
           } else {
             this.$message.error(err.msg);
@@ -2115,7 +2115,11 @@ export default {
     }
   },
   beforeRouteLeave(to, from, next) {
-    if (this.mustBack || this.$refs.takePicture.photoBadStatus) {
+    if (
+      this.mustBack ||
+      this.$refs.takePicture.photoBadStatus ||
+      (to.path == "/home" && !this.$store.state.userInfo)
+    ) {
       next();
     } else {
       next(false);

+ 3 - 2
src/pages/mock-exam/index.vue

@@ -1173,13 +1173,14 @@ export default {
     } catch (err) {}
   },
   beforeRouteLeave(to, from, next) {
-    if (this.isSubmit) {
+    if (this.isSubmit ||
+      (to.path == "/home" && !this.$store.state.userInfo)) {
       //交卷
       next();
     } else {
+      next(false)
       //离开
       if (this.bankType == 1) {
-        console.log(1);
         let ansCount = this.questionOverNum(true); //已答题数
         this.lastCount = this.questionList.length - ansCount; //统计未答完的题数