lsc 2 years ago
parent
commit
adad441b1e

+ 1 - 1
dist/index.html

@@ -18,7 +18,7 @@
       border-radius: 10px;
       -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
       background-color: rgba(0, 0, 0, 0.1);
-    }</style><link href=./static/css/app.682b075454693539c781f2e383bffed5.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.8d7171b1fe858bda1433.js></script><script type=text/javascript src=./static/js/app.94c1f24ba19792e2d0a3.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.576a2c363a4f212d378d24316758350c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.8d7171b1fe858bda1433.js></script><script type=text/javascript src=./static/js/app.bde862c4d5aab466a7bf.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.576a2c363a4f212d378d24316758350c.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.576a2c363a4f212d378d24316758350c.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.94c1f24ba19792e2d0a3.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.bde862c4d5aab466a7bf.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.bde862c4d5aab466a7bf.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 8 - 1
src/components/courseDetail.vue

@@ -997,7 +997,12 @@ export default {
     },
     randomNumber() {
       // 随机生成两位数
-      let num = Math.floor(Math.random() * 900) + 100;
+      // let num = Math.floor(Math.random() * 900) + 100;
+      // 生成 0 到 99 之间的随机整数
+      const randomNumber = Math.floor(Math.random() * 100);
+
+      // 如果随机数小于 10,补上前导零
+      const num = randomNumber < 10 ? "0" + randomNumber : randomNumber.toString();
 
       // 随机生成两个大写字母
       let letters = '';
@@ -1017,6 +1022,8 @@ export default {
       // 随机选择一种类型
       let type = Math.floor(Math.random() * 3);
 
+
+      return num;
       // 根据类型输出结果
       switch (type) {
         case 0:

+ 75 - 0
src/components/studyStudent.vue

@@ -3732,6 +3732,10 @@
             <span>禁止学生查看所有阶段</span>
             <el-switch v-model="IsLookOpen" active-text="" class="switchCss" @change="updateLookOpen"></el-switch>
           </div>
+          <div class="switch_box" v-if="courseDetail.userid == userid">
+            <span>开启跟随模式</span>
+            <el-switch v-model="IsFollow" active-text="" class="switchCss" @change="updateFollow"></el-switch>
+          </div>
         </div>
       </div>
       <div slot="footer">
@@ -4882,6 +4886,7 @@ export default {
       full: false,
       sIsOpen: false,
       IsLookOpen: false,
+      IsFollow:false,
       pzDialog: false,
       contentDialog: false,
       mlDialog: false,
@@ -7426,6 +7431,10 @@ export default {
       window.parent.postMessage({ allScreen: this.screenType }, "*");
     },
     nextOrpreSteps(t) {
+      if(this.IsFollow && this.courseDetail.userid != this.userid){
+        this.$message.error('已经开启跟随模式,请认真跟堂听讲')
+        return;
+      }
       var b = this.chapInfoList.length - 1;
       if (t == 0) {
         if (this.courseType == 0) {
@@ -7580,6 +7589,10 @@ export default {
       this.$forceUpdate();
     },
     openTask(s, n, i) {
+      if(this.IsFollow && this.courseDetail.userid != this.userid){
+        this.$message.error('已经开启跟随模式,请认真跟堂听讲')
+        return;
+      }
       if (this.IsLookOpen) {
         if (
           !this.chapInfoList[s].chapterInfo[0].taskJson[n].isLook &&
@@ -7654,6 +7667,10 @@ export default {
     },
 
     get(i) {
+      if(this.IsFollow && this.courseDetail.userid != this.userid){
+        this.$message.error('已经开启跟随模式,请认真跟堂听讲')
+        return;
+      }
       this.navList[i].isOpen = !this.navList[i].isOpen;
     },
     addQuestion() {
@@ -7955,6 +7972,9 @@ export default {
           this.selectStudent();
           this.selectSWorks(gindex);
           this.selectSLook();
+          if(this.courseDetail.userid == this.userid && this.IsFollow){
+            this.setCTask();
+          }
           let _this = this;
           if (_this.timer) {
             clearInterval(_this.timer);
@@ -8099,6 +8119,48 @@ export default {
           console.error(err);
         });
     },
+    updateFollow(){
+      let params = [
+        {
+          sopen: this.IsFollow == false ? 1 : 2,
+          cid: this.id,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "updateCourseFollow", params)
+        .then((res) => {
+          if (this.IsFollow == true) {
+            this.$message({
+              message: "开启成功",
+              type: "success",
+            });
+          } else {
+            this.$message({
+              message: "关闭成功",
+              type: "success",
+            });
+          }
+          this.setCTask();
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    setCTask(){
+      let params = [
+        {
+          sopen: this.courseType + '-' +  this.taskCount,
+          cid: this.id,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "updateCourseFollowC", params)
+        .then((res) => {  
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     updateLookOpen() {
       let params = [
         {
@@ -8138,11 +8200,24 @@ export default {
         .then((res) => {
           this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
           this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
+          this.IsFollow = res.data[0][0].follow == 1 ? false : true;
           if (!this.IsLookOpen) {
             this.setNavList();
           } else {
             this.getCourseState(1);
           }
+
+          if(this.IsFollow && this.courseDetail.userid != this.userid){
+            let _followC = res.data[0][0].followC.split('-')
+            if(this.courseType != _followC[0] || this.taskCount != _followC[1]){
+              this.navList[this.courseType].isOpen = false;
+              this.courseType = _followC[0]
+              this.navList[this.courseType].isOpen = true;
+              this.taskCount = parseInt(_followC[1])
+              this.navId = res.data[0][0].followC;
+              this.getCourseDetail()
+            }
+          }
         })
         .catch((err) => {
           console.error(err);

Some files were not shown because too many files changed in this diff