Bläddra i källkod

修复做题图片超出边界,注册增加身份证号码填写

Tang 2 år sedan
förälder
incheckning
1e6ab7045f

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

@@ -93,6 +93,7 @@
                               {{ ast[index] }}. {{ item.content }}
                               <div v-if="item.imgUrl">
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(item.imgUrl)"
                                   alt=""
                                 />
@@ -149,6 +150,7 @@
                               {{ ast[index] }}. {{ item.content }}
                               <div v-if="item.imgUrl">
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(item.imgUrl)"
                                   alt=""
                                 />
@@ -182,6 +184,7 @@
                               {{ ast[index] }}. {{ item.content }}
                               <div v-if="item.imgUrl">
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(item.imgUrl)"
                                   alt=""
                                 />
@@ -794,6 +797,7 @@
                                       :key="imgIndex"
                                     >
                                       <img
+                                        style="max-width: 100%"
                                         :src="$tools.splitImgHost(img, true)"
                                         alt=""
                                       />
@@ -840,6 +844,7 @@
                                         :key="imgIndex"
                                       >
                                         <img
+                                          style="max-width: 100%"
                                           :src="$tools.splitImgHost(img, true)"
                                           alt=""
                                         />
@@ -921,6 +926,7 @@
                               :key="imgIndex"
                             >
                               <img
+                                style="max-width: 100%"
                                 :src="$tools.splitImgHost(img, true)"
                                 alt=""
                               />
@@ -956,6 +962,7 @@
                                 :key="imgIndex"
                               >
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(img, true)"
                                   alt=""
                                 />
@@ -1183,8 +1190,8 @@ export default {
   },
   beforeRouteLeave(to, from, next) {
     if (this.mustBack) {
-      next()
-    }else{
+      next();
+    } else {
       if (this.isSubmit) {
         //交卷
         next();

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 251 - 240
src/pages/course-exam/index.vue


+ 125 - 93
src/pages/login/index.vue

@@ -48,7 +48,9 @@
                       <el-form-item prop="account">
                         <el-input
                           autocomplete="new-password"
-                          :placeholder="dualStatus ? '手机号' :'手机号/身份证号'"
+                          :placeholder="
+                            dualStatus ? '手机号' : '手机号/身份证号'
+                          "
                           v-model="loginForm.account"
                           @keyup.enter.native="login"
                         ></el-input>
@@ -215,6 +217,14 @@
                         ></i> </el-input
                     ></el-form-item>
                   </div>
+                  <div class="input">
+                    <el-form-item prop="idcard"
+                      ><el-input
+                        placeholder="身份证"
+                        v-model="registerForm.idcard"
+                      ></el-input
+                    ></el-form-item>
+                  </div>
                   <div class="text">
                     已有账号?
                     <a @click="state = 1">去登录</a>
@@ -869,7 +879,7 @@ export default {
   name: "login",
   components: {
     Footer,
-    wxLogin,
+    wxLogin
   },
   data() {
     const pwdAgainCheck = async (rule, value, callback) => {
@@ -896,6 +906,15 @@ export default {
         callback();
       }
     };
+    const validateRegisAccept = (rule, value, callback) => {
+      let _IDRe18 = /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
+      let _IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
+      if (!_IDRe18.test(value) && !_IDre15.test(value)) {
+        return callback(new Error("请输入正确身份证号码"));
+      } else {
+        callback();
+      }
+    };
     return {
       state: 1, //1登录 2注册  3找回密码 4绑定学员身份
       tabIndex: 1,
@@ -905,7 +924,8 @@ export default {
         tel: "",
         code: "",
         pwd: "",
-        read: false,
+        idcard: "",
+        read: false
       },
       forgetForm: {},
       bindForm: {},
@@ -921,55 +941,60 @@ export default {
       getBindCodeLock: false,
       loginRules: {
         account: [
-          { required: true, trigger: "blur", message: "请输入手机号/身份证号" },
+          { required: true, trigger: "blur", message: "请输入手机号/身份证号" }
         ],
-        pwd: [{ required: true, trigger: "blur", message: "请输入密码" }],
+        pwd: [{ required: true, trigger: "blur", message: "请输入密码" }]
       },
       loginSmsRules: {
         code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
         tel: [
           { required: true, trigger: "blur", message: "请输入手机号" },
-          { validator: validatorTel, trigger: "blur" },
-        ],
+          { validator: validatorTel, trigger: "blur" }
+        ]
       },
       forgetRules: {
         code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
         tel: [
           { required: true, trigger: "blur", message: "请输入手机号" },
-          { validator: validatorTel, trigger: "blur" },
+          { validator: validatorTel, trigger: "blur" }
         ],
         pwd: [{ required: true, trigger: "blur", message: "请输入新密码" }],
         pwdAgain: [
           {
             required: true,
             validator: pwdAgainCheck,
-            trigger: "blur",
-          },
-        ],
+            trigger: "blur"
+          }
+        ]
       },
       registerRules: {
         tel: [
           { required: true, trigger: "blur", message: "请输入手机号" },
-          { validator: validatorTel, trigger: "blur" },
+          { validator: validatorTel, trigger: "blur" }
         ],
         code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
         pwd: [{ required: true, trigger: "blur", message: "请输入密码" }],
+        idcard: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: validateRegisAccept
+          }
+        ],
         read: [
           {
             required: true,
             trigger: ["blur", "change"],
-            validator: validateAccept,
-          },
-        ],
+            validator: validateAccept
+          }
+        ]
       },
 
       bindRules: {
         realname: [
-          { required: true, trigger: "blur", message: "请输入真实姓名" },
-        ],
-        idCard: [
-          { required: true, trigger: "blur", message: "请输入身份证号" },
+          { required: true, trigger: "blur", message: "请输入真实姓名" }
         ],
+        idCard: [{ required: true, trigger: "blur", message: "请输入身份证号" }]
       },
       islogin: false,
       isloginSms: false,
@@ -982,19 +1007,19 @@ export default {
       registerPwdShow: false,
       forgetPwdShow: false,
       showAgreementModal: false,
-      dualStatus: false, //是否需要双重校验
+      dualStatus: false //是否需要双重校验
     };
   },
   computed: {
-    ...mapGetters(["header", "currentRouter"]),
+    ...mapGetters(["header", "currentRouter"])
   },
   mounted() {
     this.state = this.$route.query.state || 1;
     //双重校验
-    this.$request.dualAuth().then((res) => {
+    this.$request.dualAuth().then(res => {
       this.dualStatus = res.data === "1" ? true : false;
-      if(this.dualStatus){
-        this.loginRules["account"][0].message = "请输入手机号"
+      if (this.dualStatus) {
+        this.loginRules["account"][0].message = "请输入手机号";
       }
     });
   },
@@ -1029,17 +1054,17 @@ export default {
       this.$router.push(path);
     },
     login() {
-      this.$refs.loginForm.validate((valid) => {
+      this.$refs.loginForm.validate(valid => {
         if (valid) {
           this.islogin = true;
           let loginForm = JSON.parse(JSON.stringify(this.loginForm));
           loginForm.pwd = this.$tools.encryptor(loginForm.pwd);
-          if(this.dualStatus){
-            loginForm.tel = loginForm.account
+          if (this.dualStatus) {
+            loginForm.tel = loginForm.account;
           }
           this.$request
             .login(loginForm)
-            .then((res) => {
+            .then(res => {
               localStorage.setItem("user_account", res.data.user_account);
               localStorage.setItem("token", res.data.token);
               this.$tools.setUuid(new Date().valueOf() + "");
@@ -1053,12 +1078,12 @@ export default {
                 this.state = 4;
               }
             })
-            .catch((err) => {
+            .catch(err => {
               this.islogin = false;
               console.log(err, "err");
               this.$message({
                 message: err.msg,
-                type: "error",
+                type: "error"
               });
             });
         }
@@ -1068,43 +1093,49 @@ export default {
      * 获取登录短信
      */
     getLoginSms(int) {
-      this.$refs[int === 1 ? 'loginForm' :'loginSmsForm'].validateField(int === 1 ? "account" :"tel", (valid) => {
-        if (!valid) {
-          if (this.countDown == 0) {
-            if (this.getLoginCodeLock) {
-              return;
-            }
-            this.getLoginCodeLock = true;
-            this.$request
-              .getLoginSms({ tel: int === 1 ? this.loginForm.account : this.loginSmsForm.tel })
-              .then((res) => {
-                this.getLoginCodeLock = false;
-                this.$message({
-                  message: `验证码已发送`,
-                  type: "success",
+      this.$refs[int === 1 ? "loginForm" : "loginSmsForm"].validateField(
+        int === 1 ? "account" : "tel",
+        valid => {
+          if (!valid) {
+            if (this.countDown == 0) {
+              if (this.getLoginCodeLock) {
+                return;
+              }
+              this.getLoginCodeLock = true;
+              this.$request
+                .getLoginSms({
+                  tel:
+                    int === 1 ? this.loginForm.account : this.loginSmsForm.tel
+                })
+                .then(res => {
+                  this.getLoginCodeLock = false;
+                  this.$message({
+                    message: `验证码已发送`,
+                    type: "success"
+                  });
+                  this.countDown = 60;
+                  this.countDownTimer = setInterval(() => {
+                    if (this.countDown == 0) {
+                      clearInterval(this.countDownTimer);
+                    } else {
+                      this.countDown--;
+                    }
+                  }, 1000);
+                })
+                .catch(err => {
+                  this.$message.error(err.msg);
+                  this.getLoginCodeLock = false;
                 });
-                this.countDown = 60;
-                this.countDownTimer = setInterval(() => {
-                  if (this.countDown == 0) {
-                    clearInterval(this.countDownTimer);
-                  } else {
-                    this.countDown--;
-                  }
-                }, 1000);
-              })
-              .catch((err) => {
-                this.$message.error(err.msg);
-                this.getLoginCodeLock = false;
-              });
+            }
           }
         }
-      });
+      );
     },
     /**
      * 获取找回密码短信
      */
     getCode() {
-      this.$refs.forgetForm.validateField("tel", (valid) => {
+      this.$refs.forgetForm.validateField("tel", valid => {
         if (!valid) {
           if (this.forgetCountDown == 0) {
             if (this.getForgetCodeLock) {
@@ -1113,11 +1144,11 @@ export default {
             this.getForgetCodeLock = true;
             this.$request
               .getRegisterSmsforget({ tel: this.forgetForm.tel })
-              .then((res) => {
+              .then(res => {
                 this.getForgetCodeLock = false;
                 this.$message({
                   message: `验证码已发送`,
-                  type: "success",
+                  type: "success"
                 });
                 this.forgetCountDown = 60;
                 this.forgetCountDownTimer = setInterval(() => {
@@ -1128,10 +1159,10 @@ export default {
                   }
                 }, 1000);
               })
-              .catch((err) => {
+              .catch(err => {
                 this.$message({
                   message: err.msg,
-                  type: "warning",
+                  type: "warning"
                 });
                 this.getForgetCodeLock = false;
               });
@@ -1143,12 +1174,12 @@ export default {
      * 手机号登录
      */
     loginSms() {
-      this.$refs.loginSmsForm.validate((valid) => {
+      this.$refs.loginSmsForm.validate(valid => {
         if (valid) {
           this.isloginSms = true;
           this.$request
             .loginSms(this.loginSmsForm)
-            .then((res) => {
+            .then(res => {
               localStorage.setItem("user_account", res.data.user_account);
               localStorage.setItem("token", res.data.token);
               this.$tools.setUuid(new Date().valueOf() + "");
@@ -1161,11 +1192,11 @@ export default {
                 this.state = 4;
               }
             })
-            .catch((err) => {
+            .catch(err => {
               this.isloginSms = false;
               this.$message({
                 message: err.msg,
-                type: "error",
+                type: "error"
               });
             });
         }
@@ -1177,7 +1208,7 @@ export default {
     getInfo() {
       this.$request
         .getInfo({ fromPlat: 2 })
-        .then((res) => {
+        .then(res => {
           this.isRegister = false;
           this.islogin = false;
           this.isloginSms = false;
@@ -1191,14 +1222,14 @@ export default {
             this.$router.replace("/");
           }
         })
-        .catch((err) => {
+        .catch(err => {
           this.isRegister = false;
           this.islogin = false;
           this.isloginSms = false;
           console.log(err, "err");
           this.$message({
             message: err.msg,
-            type: "error",
+            type: "error"
           });
         });
     },
@@ -1207,16 +1238,16 @@ export default {
      * 注册
      */
     register() {
-      this.$refs.registerForm.validate((valid) => {
+      this.$refs.registerForm.validate(valid => {
         if (valid) {
           this.isRegister = true;
           this.$request
             .registerUser(this.registerForm)
-            .then((res) => {
+            .then(res => {
               //自动登录
               this.autoLogin();
             })
-            .catch((err) => {
+            .catch(err => {
               this.isRegister = false;
               this.$message.warning(err.msg);
             });
@@ -1228,7 +1259,7 @@ export default {
      */
     getRegisterSms() {
       var self = this;
-      this.$refs.registerForm.validateField("tel", (valid) => {
+      this.$refs.registerForm.validateField("tel", valid => {
         if (!valid) {
           if (this.registerCountDown == 0) {
             if (this.getRegisterCodeLock) {
@@ -1237,11 +1268,11 @@ export default {
             this.getRegisterCodeLock = true;
             this.$request
               .getRegisterSms({ tel: this.registerForm.tel })
-              .then((res) => {
+              .then(res => {
                 this.getRegisterCodeLock = false;
                 this.$message({
                   message: `验证码已发送`,
-                  type: "success",
+                  type: "success"
                 });
                 this.registerCountDown = 60;
                 this.registerCountDownTimer = setInterval(() => {
@@ -1251,10 +1282,10 @@ export default {
                   }
                 }, 1000);
               })
-              .catch((err) => {
+              .catch(err => {
                 this.$message({
                   message: err.msg,
-                  type: "error",
+                  type: "error"
                 });
                 this.getRegisterCodeLock = false;
               });
@@ -1271,7 +1302,7 @@ export default {
       loginForm.pwd = this.$tools.encryptor(loginForm.pwd);
       this.$request
         .login(loginForm)
-        .then((res) => {
+        .then(res => {
           localStorage.setItem("user_account", res.data.user_account);
           localStorage.setItem("token", res.data.token);
           this.$tools.setUuid(new Date().valueOf() + "");
@@ -1287,30 +1318,30 @@ export default {
             this.state = 4;
           }
         })
-        .catch((err) => {
+        .catch(err => {
           this.isRegister = false;
           this.$message({
             message: err.msg,
-            type: "error",
+            type: "error"
           });
         });
     },
 
     forget() {
-      this.$refs.forgetForm.validate((valid) => {
+      this.$refs.forgetForm.validate(valid => {
         if (valid) {
           this.isForget = true;
           this.$request
             .forgetUser(this.forgetForm)
-            .then((res) => {
+            .then(res => {
               this.isForget = false;
               this.$message({
                 message: "修改成功",
-                type: "success",
+                type: "success"
               });
               this.$refs.forgetForm.resetFields();
             })
-            .catch((err) => {
+            .catch(err => {
               this.isForget = false;
               this.$message.warning(err.msg);
             });
@@ -1326,18 +1357,18 @@ export default {
     },
 
     bind() {
-      this.$refs.bindForm.validate((valid) => {
+      this.$refs.bindForm.validate(valid => {
         if (valid) {
           this.isBind = true;
           let bindForm = JSON.parse(JSON.stringify(this.bindForm));
           bindForm.token = this.token;
           this.$request
             .bindIdCard(bindForm)
-            .then((res) => {
+            .then(res => {
               this.isBind = false;
               this.$message({
                 message: "关联成功",
-                type: "success",
+                type: "success"
               });
 
               localStorage.setItem("user_account", this.user_account);
@@ -1351,17 +1382,17 @@ export default {
                 this.$router.replace("/");
               }
             })
-            .catch((err) => {
+            .catch(err => {
               this.isBind = false;
               this.$message({
                 message: err.msg,
-                type: "error",
+                type: "error"
               });
             });
         }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -1405,7 +1436,8 @@ export default {
     .right-box {
       float: right;
       width: 348px;
-      height: 427px;
+      // height: 427px;
+      padding-bottom: 20px;
       background: #ffffff;
       box-shadow: 0px 0px 13px 3px rgba(63, 141, 253, 0.1);
       border-radius: 8px;

+ 119 - 107
src/pages/mock-exam/index.vue

@@ -76,8 +76,7 @@
                                 item.optionsId == question.ques &&
                                 question.ques != question.ans,
                               user_choose:
-                                bankType == 2 &&
-                                item.optionsId == question.ques,
+                                bankType == 2 && item.optionsId == question.ques
                             }"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
@@ -93,6 +92,7 @@
                               {{ ast[index] }}. {{ item.content }}
                               <div v-if="item.imgUrl">
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(item.imgUrl)"
                                   alt=""
                                 />
@@ -150,6 +150,7 @@
                               {{ ast[index] }}. {{ item.content }}
                               <div v-if="item.imgUrl">
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(item.imgUrl)"
                                   alt=""
                                 />
@@ -172,7 +173,7 @@
                                 question.ans.indexOf(item.optionsId) == -1,
                               user_choose:
                                 bankType == 2 &&
-                                question.ques.indexOf(item.optionsId) != -1,
+                                question.ques.indexOf(item.optionsId) != -1
                             }"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
@@ -183,6 +184,7 @@
                               {{ ast[index] }}. {{ item.content }}
                               <div v-if="item.imgUrl">
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(item.imgUrl)"
                                   alt=""
                                 />
@@ -277,7 +279,7 @@
                                 question.ques != question.ans,
                               user_choose:
                                 bankType == 2 &&
-                                index == (question.ques == 1 ? 0 : 1),
+                                index == (question.ques == 1 ? 0 : 1)
                             }"
                             v-for="(item, index) in judge"
                             :key="index"
@@ -405,7 +407,7 @@
                                       user_choose:
                                         bankType == 2 &&
                                         item.optionsId ==
-                                          question.ques[jsonIndex],
+                                          question.ques[jsonIndex]
                                     }"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"
@@ -532,7 +534,7 @@
                                         bankType == 2 &&
                                         question.ques[jsonIndex].indexOf(
                                           item.optionsId
-                                        ) != -1,
+                                        ) != -1
                                     }"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"
@@ -595,7 +597,8 @@
                                 <div
                                   v-if="
                                     bankType == 2 ||
-                                    (bankType == 1 && !question.ques[jsonIndex])
+                                      (bankType == 1 &&
+                                        !question.ques[jsonIndex])
                                   "
                                   class="submit"
                                   @click="
@@ -680,7 +683,7 @@
                                         index ==
                                           (question.ques[jsonIndex] == 1
                                             ? 0
-                                            : 1),
+                                            : 1)
                                     }"
                                     v-for="(item, index) in judge"
                                     :key="index"
@@ -758,13 +761,13 @@
                                   class="question-list textarea"
                                   v-if="
                                     bankType == 2 ||
-                                    (bankType == 1 &&
-                                      !(
-                                        question.ques[jsonIndex] &&
-                                        (question.ques[jsonIndex].imageList
-                                          .length ||
-                                          question.ques[jsonIndex].text)
-                                      ))
+                                      (bankType == 1 &&
+                                        !(
+                                          question.ques[jsonIndex] &&
+                                          (question.ques[jsonIndex].imageList
+                                            .length ||
+                                            question.ques[jsonIndex].text)
+                                        ))
                                   "
                                 >
                                   <el-input
@@ -781,6 +784,7 @@
                                       :key="imgIndex"
                                     >
                                       <img
+                                        style="max-width: 100%"
                                         :src="$tools.splitImgHost(img, true)"
                                         alt=""
                                       />
@@ -805,10 +809,10 @@
                                   class="explain-list"
                                   v-if="
                                     bankType == 1 &&
-                                    question.ques[jsonIndex] &&
-                                    (question.ques[jsonIndex].imageList
-                                      .length ||
-                                      question.ques[jsonIndex].text)
+                                      question.ques[jsonIndex] &&
+                                      (question.ques[jsonIndex].imageList
+                                        .length ||
+                                        question.ques[jsonIndex].text)
                                   "
                                 >
                                   <div class="explain-list__header">
@@ -827,6 +831,7 @@
                                         :key="imgIndex"
                                       >
                                         <img
+                                          style="max-width: 100%"
                                           :src="$tools.splitImgHost(img, true)"
                                           alt=""
                                         />
@@ -846,13 +851,13 @@
                                 <div
                                   v-if="
                                     bankType == 2 ||
-                                    (bankType == 1 &&
-                                      !(
-                                        question.ques[jsonIndex] &&
-                                        (question.ques[jsonIndex].imageList
-                                          .length ||
-                                          question.ques[jsonIndex].text)
-                                      ))
+                                      (bankType == 1 &&
+                                        !(
+                                          question.ques[jsonIndex] &&
+                                          (question.ques[jsonIndex].imageList
+                                            .length ||
+                                            question.ques[jsonIndex].text)
+                                        ))
                                   "
                                   class="submit"
                                   @click="
@@ -890,9 +895,9 @@
                           class="question-list textarea"
                           v-if="
                             bankType == 2 ||
-                            (bankType == 1 &&
-                              !question.ques.imageList.length &&
-                              !question.ques.text)
+                              (bankType == 1 &&
+                                !question.ques.imageList.length &&
+                                !question.ques.text)
                           "
                         >
                           <el-input
@@ -909,6 +914,7 @@
                               :key="imgIndex"
                             >
                               <img
+                                style="max-width: 100%"
                                 :src="$tools.splitImgHost(img, true)"
                                 alt=""
                               />
@@ -929,8 +935,8 @@
                           class="explain-list"
                           v-if="
                             bankType == 1 &&
-                            (question.ques.imageList.length ||
-                              question.ques.text)
+                              (question.ques.imageList.length ||
+                                question.ques.text)
                           "
                         >
                           <div class="explain-list__header">我的答案:</div>
@@ -944,6 +950,7 @@
                                 :key="imgIndex"
                               >
                                 <img
+                                  style="max-width: 100%"
                                   :src="$tools.splitImgHost(img, true)"
                                   alt=""
                                 />
@@ -961,9 +968,9 @@
                         <div
                           v-if="
                             bankType == 2 ||
-                            (bankType == 1 &&
-                              !question.ques.imageList.length &&
-                              !question.ques.text)
+                              (bankType == 1 &&
+                                !question.ques.imageList.length &&
+                                !question.ques.text)
                           "
                           class="submit"
                           @click="ansSubmit(question, questionIndex)"
@@ -1039,7 +1046,7 @@
                             red: bankType == 1 && isWrong(item, index),
                             yellow: bankType == 1 && isPart(item, index),
                             blue: bankType == 1 && isOver(item, index),
-                            check_ans: bankType == 2 && isCheck(item, index),
+                            check_ans: bankType == 2 && isCheck(item, index)
                           }"
                           @click="changeIndex(index)"
                         >
@@ -1072,10 +1079,10 @@ export default {
     Footer,
     Header,
     ToolBar,
-    HeaderTabBox,
+    HeaderTabBox
   },
   computed: {
-    ...mapGetters(["sysTime"]),
+    ...mapGetters(["sysTime"])
   },
   data() {
     return {
@@ -1116,7 +1123,7 @@ export default {
         "W",
         "X",
         "Y",
-        "Z",
+        "Z"
       ],
       loading: false,
       needPhoto: false,
@@ -1139,7 +1146,7 @@ export default {
       examEndTime: 0,
       examStartTime: 0,
       doMode: 1, //3模考组卷1普通考卷
-      simulateExamId: "",
+      simulateExamId: ""
     };
   },
   async mounted() {
@@ -1181,7 +1188,7 @@ export default {
             this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
               confirmButtonText: "结束做题",
               cancelButtonText: "下次继续",
-              type: "warning",
+              type: "warning"
             })
               .then(() => {
                 this.examSubmit();
@@ -1200,7 +1207,7 @@ export default {
               {
                 confirmButtonText: "继续作答",
                 cancelButtonText: "下次继续",
-                type: "warning",
+                type: "warning"
               }
             )
               .then(() => {
@@ -1224,7 +1231,7 @@ export default {
             this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
               confirmButtonText: "立即交卷",
               cancelButtonText: "暂不交卷",
-              type: "warning",
+              type: "warning"
             })
               .then(() => {
                 // confirmButton回调
@@ -1242,7 +1249,7 @@ export default {
               {
                 confirmButtonText: "继续离开",
                 cancelButtonText: "暂不离开",
-                type: "warning",
+                type: "warning"
               }
             )
               .then(() => {
@@ -1261,9 +1268,9 @@ export default {
       this.$request
         .mockSubscribeEdit({
           subscribeId: this.subscribeId,
-          handStatus: this.isAutoSubmit ? 2 : 1,
+          handStatus: this.isAutoSubmit ? 2 : 1
         })
-        .then((res) => {});
+        .then(res => {});
     },
     toFixed(num) {
       if (num) {
@@ -1290,12 +1297,12 @@ export default {
           questionId: this.questionList[current].questionId,
           goodsId: this.goodsId,
           orderGoodsId: this.orderGoodsId,
-          doMode: this.doMode,
+          doMode: this.doMode
         })
-        .then((res) => {
+        .then(res => {
           this.$set(this.collectList, current, res.data);
         })
-        .catch((err) => {
+        .catch(err => {
           this.$set(this.collectList, current, false);
         });
     },
@@ -1311,7 +1318,7 @@ export default {
           this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
             confirmButtonText: "立即交卷",
             cancelButtonText: "暂不交卷",
-            type: "warning",
+            type: "warning"
           })
             .then(() => {
               // confirmButton回调
@@ -1333,8 +1340,8 @@ export default {
         examId: this.examId,
         goodsId: this.goodsId,
         orderGoodsId: this.orderGoodsId,
-        from: this.doMode == 3 ? 3 : "",
-      }).then(async (data) => {
+        from: this.doMode == 3 ? 3 : ""
+      }).then(async data => {
         if (this.doMode == 3) {
           this.simulateExamId = data.data.simulateExamId;
           data = data.data.questionList;
@@ -1342,7 +1349,7 @@ export default {
         if (!data.length) {
           this.$message({
             type: "warning",
-            message: "该试卷暂无题目",
+            message: "该试卷暂无题目"
           });
           return;
         }
@@ -1360,7 +1367,7 @@ export default {
                   showCancelButton: false,
                   closeOnPressEscape: false,
                   distinguishCancelAndClose: false,
-                  showClose: false,
+                  showClose: false
                 });
                 this.isAutoSubmit = true;
 
@@ -1382,7 +1389,7 @@ export default {
           item.jsonStr = JSON.parse(item.jsonStr);
           if (item.type == 2) {
             //多选
-            item.jsonStr.forEach((str) => {
+            item.jsonStr.forEach(str => {
               str.optionsId = "" + str.optionsId;
             });
             let arr = item.answerQuestion.split(",");
@@ -1406,11 +1413,11 @@ export default {
             //简答题
             item.ansText = {
               text: "",
-              imageList: [],
+              imageList: []
             };
             item.ques = {
               text: "",
-              imageList: [],
+              imageList: []
             };
             item.analysisContent &&
               (item.analysisContent = item.analysisContent.replace(
@@ -1439,7 +1446,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(",");
@@ -1462,15 +1469,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(
@@ -1508,7 +1515,7 @@ export default {
      * hasSpecial (是否包含简答和案例) true 包含  false 不包含
      */
     mockRecord(hasSpecial) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         let self = this;
         let questionList = 0;
         // if(!hasSpecial) {
@@ -1528,9 +1535,9 @@ export default {
             totalQuestionNum: questionList,
             allQuestionNum: this.questionList.length,
             doMode: this.doMode,
-            simulateExamId: this.simulateExamId,
+            simulateExamId: this.simulateExamId
           })
-          .then((res) => {
+          .then(res => {
             this.recordId = res.data;
           });
       });
@@ -1654,17 +1661,17 @@ export default {
           lessQuestionNum: lessQuestionNum,
           status: 1,
           doQuestionNum: doQuestionNum,
-          historyExamJson: JSON.stringify(this.questionList),
+          historyExamJson: JSON.stringify(this.questionList)
         })
-        .then((res) => {});
+        .then(res => {});
     },
 
     /**
      * 获取试卷类型2考试,1练习
      */
     bankExam() {
-      return new Promise((resolve) => {
-        this.$request.bankExam(this.examId).then((res) => {
+      return new Promise(resolve => {
+        this.$request.bankExam(this.examId).then(res => {
           this.bankType = res.data.doType;
           this.examData = res.data;
           this.doMode = res.data.simulateStatus ? 3 : 1;
@@ -1712,7 +1719,7 @@ export default {
         return;
       }
       let arr = [];
-      this.questionList[questionIndex].jsonStr.forEach((item) => {
+      this.questionList[questionIndex].jsonStr.forEach(item => {
         if (item.checked) {
           arr.push(item.optionsId);
         }
@@ -1721,7 +1728,7 @@ export default {
         delete this.questionList[questionIndex].ques;
         this.$message({
           type: "warning",
-          message: "请选择答案",
+          message: "请选择答案"
         });
         return;
       }
@@ -1742,7 +1749,7 @@ export default {
       }
       let arr = [];
       this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
-        (item) => {
+        item => {
           if (item.checked) {
             arr.push(item.optionsId);
           }
@@ -1753,7 +1760,7 @@ export default {
         delete this.questionList[questionIndex].ques[ansIndex];
         this.$message({
           type: "warning",
-          message: "请选择答案",
+          message: "请选择答案"
         });
         return;
       }
@@ -1802,7 +1809,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" &&
@@ -1814,7 +1824,7 @@ export default {
         return;
       }
 
-      this.$upload.upload(file, 0).then((res) => {
+      this.$upload.upload(file, 0).then(res => {
         question.ansText.imageList.push(res);
       });
     },
@@ -1828,7 +1838,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" &&
@@ -1840,7 +1853,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);
@@ -1897,7 +1910,7 @@ export default {
       if (!question.ansText.text && !question.ansText.imageList.length) {
         this.$message({
           type: "warning",
-          message: "请输入内容或上传图片",
+          message: "请输入内容或上传图片"
         });
         return;
       }
@@ -1917,7 +1930,7 @@ export default {
       ) {
         this.$message({
           type: "warning",
-          message: "请输入内容或上传图片",
+          message: "请输入内容或上传图片"
         });
         return;
       }
@@ -1927,8 +1940,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 || ""
       });
 
       this.isDoOver();
@@ -1942,7 +1954,7 @@ export default {
       if (this.current >= this.questionList.length - 1) {
         this.$message({
           type: "warning",
-          message: "已经是最后一题了!",
+          message: "已经是最后一题了!"
         });
         return;
       }
@@ -1953,7 +1965,7 @@ export default {
       if (this.current == 0) {
         this.$message({
           type: "warning",
-          message: "已经是第一题了!",
+          message: "已经是第一题了!"
         });
         return;
       } else {
@@ -2081,7 +2093,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++;
@@ -2139,9 +2151,9 @@ export default {
             questionId: this.questionList[index].questionId,
             goodsId: this.goodsId || "",
             orderGoodsId: this.orderGoodsId,
-            doMode: this.doMode,
+            doMode: this.doMode
           })
-          .then((res) => {
+          .then(res => {
             this.$set(this.collectList, index, true);
             this.$message.success("收藏成功");
             this.getCollectInfo(index);
@@ -2149,7 +2161,7 @@ export default {
       } else {
         this.$request
           .deleteCollectQuestion(this.collectList[index].collectQuestionId)
-          .then((res) => {
+          .then(res => {
             this.$set(this.collectList, index, false);
             this.$message.success("取消收藏成功");
           });
@@ -2170,13 +2182,13 @@ export default {
             closeOnClickModal: false,
             closeOnPressEscape: false,
             distinguishCancelAndClose: false,
-            showClose: false,
+            showClose: false
           }
         )
-          .then((_) => {
+          .then(_ => {
             this.examSubmit();
           })
-          .catch((_) => {});
+          .catch(_ => {});
         return;
       }
 
@@ -2189,12 +2201,12 @@ export default {
             closeOnClickModal: false,
             closeOnPressEscape: false,
             distinguishCancelAndClose: false,
-            showClose: false,
+            showClose: false
           })
-            .then((_) => {
+            .then(_ => {
               this.examSubmit();
             })
-            .catch((_) => {});
+            .catch(_ => {});
           return;
         }
       }
@@ -2402,14 +2414,14 @@ export default {
           totalScore: allScore,
           examTime: parseInt(this.allTimes),
           doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
-          historyExamJson: JSON.stringify(this.questionList),
+          historyExamJson: JSON.stringify(this.questionList)
         })
-        .then((res) => {
+        .then(res => {
           this.isSubmit = true;
           this.loading = false;
           this.$message({
             type: "success",
-            message: "交卷成功",
+            message: "交卷成功"
           });
 
           setTimeout(() => {
@@ -2419,12 +2431,12 @@ export default {
                 subscribeId: this.subscribeId,
                 eachExamId: this.eachExamId,
                 examId: this.examId,
-                recordId: this.recordId,
-              },
+                recordId: this.recordId
+              }
             });
           }, 1000);
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading = false;
         });
 
@@ -2434,10 +2446,10 @@ export default {
           eachExamId: this.eachExamId,
           examId: this.examId,
           questionIds: doWrongQuestionIds,
-          recordId: this.recordId,
+          recordId: this.recordId
         })
-        .then((res) => {})
-        .catch((err) => {});
+        .then(res => {})
+        .catch(err => {});
     },
 
     /**
@@ -2609,9 +2621,9 @@ export default {
           totalScore: allScore,
           examTime: parseInt(this.allTimes),
           doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
-          historyExamJson: JSON.stringify(this.questionList),
+          historyExamJson: JSON.stringify(this.questionList)
         })
-        .then((res) => {});
+        .then(res => {});
 
       console.log(222);
       //错题集id提交(客观题)
@@ -2621,16 +2633,16 @@ export default {
           examId: this.examId,
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
-          doMode: this.doMode,
+          doMode: this.doMode
         })
-        .then((res) => {
+        .then(res => {
           this.loading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading = false;
         });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 169 - 149
src/pages/person-center/my-course/index.vue

@@ -13,23 +13,29 @@
           style="margin-left: 14px"
           @click="changeCourse"
           >切换科目</el-button
-        ><el-button v-if="outerChain()" @click="jumpExternalLink" size="mini" type="primary">进入学习</el-button>
+        ><el-button
+          v-if="outerChain()"
+          @click="jumpExternalLink"
+          size="mini"
+          type="primary"
+          >进入学习</el-button
+        >
 
         <el-button
           v-if="
             goodsData.applyStatus === 1 &&
-            !(
-              sysTime <= goodsData.serviceStartTime ||
-              sysTime >= goodsData.serviceEndTime ||
-              (goodsData.classStartTime &&
-                sysTime <= goodsData.classStartTime) ||
-              (goodsData.classEndTime && sysTime >= goodsData.classEndTime) ||
-              goodsData.learningStatus == 2 ||
-              goodsData.classStatus == 0 ||
-              (goodsData.learningStatus == 3 &&
-                sysTime < goodsData.learningTimeStart) ||
-              !goodsData.examApplyGoodsList.length
-            )
+              !(
+                sysTime <= goodsData.serviceStartTime ||
+                sysTime >= goodsData.serviceEndTime ||
+                (goodsData.classStartTime &&
+                  sysTime <= goodsData.classStartTime) ||
+                (goodsData.classEndTime && sysTime >= goodsData.classEndTime) ||
+                goodsData.learningStatus == 2 ||
+                goodsData.classStatus == 0 ||
+                (goodsData.learningStatus == 3 &&
+                  sysTime < goodsData.learningTimeStart) ||
+                !goodsData.examApplyGoodsList.length
+              )
           "
           size="mini"
           type="warning"
@@ -44,7 +50,7 @@
           {{ goodsData.classHours }}学时
         </div>
       </h4>
-      <div style="margin: 14px 0px"  v-if="!outerChain()">
+      <div style="margin: 14px 0px" v-if="!outerChain()">
         <el-button
           size="small"
           v-for="(item, index) in subjectList"
@@ -112,8 +118,8 @@
                   <template
                     v-if="
                       items.showStatus &&
-                      items.children &&
-                      items.children.length > 0
+                        items.children &&
+                        items.children.length > 0
                     "
                   >
                     <div
@@ -248,8 +254,8 @@
                               <span v-show="is.studyDuration">
                                 {{
                                   $tools.secondToDate(is.studyDuration) +
-                                  "/" +
-                                  $tools.secondToDate(is.durationTime)
+                                    "/" +
+                                    $tools.secondToDate(is.durationTime)
                                 }}
                               </span>
                             </el-col>
@@ -301,8 +307,8 @@
                                 style="width: 90px !important"
                                 v-if="
                                   is.studyDuration > 0 &&
-                                  is.durationTime > 0 &&
-                                  is.studyDuration == is.durationTime
+                                    is.durationTime > 0 &&
+                                    is.studyDuration == is.durationTime
                                 "
                                 @click="studyFunc(item, is)"
                                 >再次学习</el-button
@@ -313,8 +319,8 @@
                                 style="width: 90px !important"
                                 v-else-if="
                                   is.studyDuration > 0 &&
-                                  is.durationTime > 0 &&
-                                  is.studyDuration != is.durationTime
+                                    is.durationTime > 0 &&
+                                    is.studyDuration != is.durationTime
                                 "
                                 @click="studyFunc(item, is)"
                                 >继续学习</el-button
@@ -362,7 +368,7 @@
                                 "
                                 v-else-if="
                                   is.liveEndTime > sysTime &&
-                                  is.liveStartTime < sysTime
+                                    is.liveStartTime < sysTime
                                 "
                                 @click="studyFunc(item, is)"
                                 >进入直播间</el-button
@@ -440,8 +446,8 @@
                           <span v-show="i.studyDuration">
                             {{
                               $tools.secondToDate(i.studyDuration) +
-                              "/" +
-                              $tools.secondToDate(i.durationTime)
+                                "/" +
+                                $tools.secondToDate(i.durationTime)
                             }}
                           </span>
                         </el-col>
@@ -487,8 +493,8 @@
                             style="width: 90px !important"
                             v-if="
                               i.studyDuration > 0 &&
-                              i.durationTime > 0 &&
-                              i.studyDuration == i.durationTime
+                                i.durationTime > 0 &&
+                                i.studyDuration == i.durationTime
                             "
                             @click="studyFunc(item, i)"
                             >再次学习</el-button
@@ -499,8 +505,8 @@
                             style="width: 90px !important"
                             v-else-if="
                               i.studyDuration > 0 &&
-                              i.durationTime > 0 &&
-                              i.studyDuration != i.durationTime
+                                i.durationTime > 0 &&
+                                i.studyDuration != i.durationTime
                             "
                             @click="studyFunc(item, i)"
                             >继续学习</el-button
@@ -545,7 +551,7 @@
                             type="primary"
                             v-else-if="
                               i.liveEndTime > sysTime &&
-                              i.liveStartTime < sysTime
+                                i.liveStartTime < sysTime
                             "
                             @click="studyFunc(item, i)"
                             >进入直播间</el-button
@@ -603,8 +609,8 @@
                       <span v-show="items.studyDuration">
                         {{
                           $tools.secondToDate(items.studyDuration) +
-                          "/" +
-                          $tools.secondToDate(items.durationTime)
+                            "/" +
+                            $tools.secondToDate(items.durationTime)
                         }}
                       </span>
                     </el-col>
@@ -650,8 +656,8 @@
                         type="text"
                         v-if="
                           items.studyDuration > 0 &&
-                          items.durationTime > 0 &&
-                          items.studyDuration == items.durationTime
+                            items.durationTime > 0 &&
+                            items.studyDuration == items.durationTime
                         "
                         @click="studyFunc(item, items)"
                         >再次学习</el-button
@@ -662,8 +668,8 @@
                         size="mini"
                         v-else-if="
                           items.studyDuration > 0 &&
-                          items.durationTime > 0 &&
-                          items.studyDuration != items.durationTime
+                            items.durationTime > 0 &&
+                            items.studyDuration != items.durationTime
                         "
                         @click="studyFunc(item, items)"
                         >继续学习</el-button
@@ -708,7 +714,7 @@
                         type="primary"
                         v-else-if="
                           items.liveEndTime > sysTime &&
-                          items.liveStartTime < sysTime
+                            items.liveStartTime < sysTime
                         "
                         @click="studyFunc(item, items)"
                         >进入直播间</el-button
@@ -804,11 +810,11 @@ export default {
       teaIndex: 0,
       States: { 0: 0 },
       sectionExamList: [], //节试卷集合
-      sectionExam: [], //节试卷集合
+      sectionExam: [] //节试卷集合
     };
   },
   computed: {
-    ...mapGetters(["userInfo"]),
+    ...mapGetters(["userInfo"])
   },
   mounted() {
     this.getRecord();
@@ -816,11 +822,11 @@ export default {
   },
   methods: {
     //判断是否外链
-    outerChain(){
-      if(this.goodsData.externalLinkStatus){
-        return true
+    outerChain() {
+      if (this.goodsData.externalLinkStatus) {
+        return true;
       }
-      return false
+      return false;
     },
     comeStyle(courseItem, item) {
       this.$router.push({
@@ -836,8 +842,8 @@ export default {
           liveUrl: item.liveUrl,
           sectionType: item.sectionType,
           liveStartTime: item.liveStartTime,
-          liveEndTime: item.liveEndTime,
-        },
+          liveEndTime: item.liveEndTime
+        }
       });
     },
     changeCourse() {
@@ -856,7 +862,7 @@ export default {
     uniqueFunc(arr, uniId) {
       const res = new Map();
       return arr.filter(
-        (item) => !res.has(item[uniId]) && res.set(item[uniId], 1)
+        item => !res.has(item[uniId]) && res.set(item[uniId], 1)
       );
     },
     /**
@@ -867,37 +873,37 @@ export default {
         this.$request
           .courseCourseList({
             goodsId: item.goodsId,
-            gradeId: item.gradeId,
+            gradeId: item.gradeId
           })
-          .then((res) => {
+          .then(res => {
             console.log(res, "res");
             var array = [];
-            res.rows.forEach((element) => {
+            res.rows.forEach(element => {
               element.showStatus = false;
               element.children = [];
               array.push({
                 id: element.subjectId,
-                name: element.subjectName,
+                name: element.subjectName
               });
             });
             //获取商品双师资模板
             this.$request
               .courseTeacherList({
-                goodsId: item.goodsId,
+                goodsId: item.goodsId
               })
-              .then((res1) => {
+              .then(res1 => {
                 // console.log(res1,'res1');
                 if (res1.data && res1.data.length > 0) {
                   //课程老师模板
                   let teacherTel = res1.data;
                   //商品课程
                   let courses = res.rows;
-                  teacherTel.forEach((tea) => {
+                  teacherTel.forEach(tea => {
                     let dataList = [];
                     let teacherList = [];
-                    courses.forEach((item) => {
+                    courses.forEach(item => {
                       let courseData = tea.courseList.filter(
-                        (x) => x.courseId == item.courseId
+                        x => x.courseId == item.courseId
                       );
                       if (courseData && courseData.length > 0) {
                         dataList.push(item);
@@ -906,23 +912,23 @@ export default {
                     });
                     let result = {
                       teaList: teacherList,
-                      courseList: dataList,
+                      courseList: dataList
                     };
                     this.goodsTeacher.push(result);
                   });
                   if (this.goodsTeacher && this.goodsTeacher.length > 0) {
                     let courseIds = [];
-                    this.goodsTeacher.forEach((item) => {
-                      item.courseList.forEach((course) => {
+                    this.goodsTeacher.forEach(item => {
+                      item.courseList.forEach(course => {
                         courseIds.push(course.courseId);
                       });
                     });
                     if (courseIds.length > 0) {
-                      courses.forEach((item) => {
+                      courses.forEach(item => {
                         if (!courseIds.includes(item.courseId)) {
                           let data = {
                             teaList: [],
-                            courseList: [],
+                            courseList: []
                           };
                           data.courseList.push(item);
                           this.goodsTeacher.push(data);
@@ -930,18 +936,18 @@ export default {
                       });
                     }
                   }
-                  this.goodsTeacher.forEach((item) => {
+                  this.goodsTeacher.forEach(item => {
                     if (item.courseList && item.courseList.length > 0) {
                       item.courseList[0].show = 1;
                     }
                   });
                 } else {
                   //没有双师资模板
-                  res.rows.forEach((item) => {
+                  res.rows.forEach(item => {
                     item.show = 1;
                     let data = {
                       teaList: [],
-                      courseList: [],
+                      courseList: []
                     };
                     data.courseList.push(item);
                     this.goodsTeacher.push(data);
@@ -954,10 +960,10 @@ export default {
             array = this.uniqueFunc(array, "id");
             array.unshift({
               id: "",
-              name: "全部",
+              name: "全部"
             });
             // this.subjectList = array;
-            this.subjectList = array.filter((item) => item.name);
+            this.subjectList = array.filter(item => item.name);
             this.newActiveSubjectId = "";
 
             resolve();
@@ -968,7 +974,7 @@ export default {
       });
     },
     //进入外链
-    jumpExternalLink(){
+    jumpExternalLink() {
       window.open(this.goodsData.externalLink, "_blank");
     },
     //切换老师
@@ -979,7 +985,7 @@ export default {
       this.teaIndex = index;
       this.goodsTeacher.forEach((item, index) => {
         if (item.teaList && item.teaList.length > 0) {
-          let list = item.teaList.filter((x) => x.courseId == data.courseId);
+          let list = item.teaList.filter(x => x.courseId == data.courseId);
           if (list && list.length > 0) {
             item.courseList.forEach((course, courseIndex) => {
               if (course.courseId == data.courseId) {
@@ -1007,7 +1013,7 @@ export default {
       return new Promise((resolve, reject) => {
         this.$request
           .courseGoodsList({ orderGoodsId: res.data.orderGoodsId })
-          .then(async (result) => {
+          .then(async result => {
             if (result.rows.length == 0) {
               this.resultCourseGoodsList();
             } else {
@@ -1025,7 +1031,7 @@ export default {
      * 获取学习记录
      */
     getRecord(item) {
-      this.$request.studyrecordgetUserStudyLast().then(async (res) => {
+      this.$request.studyrecordgetUserStudyLast().then(async res => {
         // if (res.data && res.data.sectionId) {
         await this.getGoodsData(res);
         var stop = false;
@@ -1164,7 +1170,7 @@ export default {
       });
     },
     resultCourseGoodsList() {
-      this.$request.courseGoodsList({ pageNum: 1, pageSize: 1 }).then((res) => {
+      this.$request.courseGoodsList({ pageNum: 1, pageSize: 1 }).then(res => {
         if (res.rows && res.rows.length > 0) {
           this.backData(res.rows[0]);
         }
@@ -1185,19 +1191,19 @@ export default {
           .reSectionExamList({
             chapterId: 0,
             courseId: item.courseId,
-            gradeId: item.gradeId,
+            gradeId: item.gradeId
           })
-          .then((res) => {
+          .then(res => {
             this.sectionExamList = res.data;
           });
         this.$request
           .reMenuList({
             courseId: item.courseId,
             gradeId: item.gradeId,
-            orderGoodsId: this.goodsData.orderGoodsId,
+            orderGoodsId: this.goodsData.orderGoodsId
           })
-          .then((res) => {
-            res.rows.forEach((items) => {
+          .then(res => {
+            res.rows.forEach(items => {
               if (items.type != 3) {
                 items.showStatus = false;
                 items.children = [];
@@ -1232,10 +1238,10 @@ export default {
           .reChapterList({
             moduleId: item.menuId,
             gradeId: item.gradeId,
-            courseId: item.courseId,
+            courseId: item.courseId
           })
-          .then((res) => {
-            res.data.forEach((items) => {
+          .then(res => {
+            res.data.forEach(items => {
               items.children = [];
               items.showStatus = false;
             });
@@ -1268,9 +1274,9 @@ export default {
           .reSectionExamList({
             chapterId: type === 1 ? item.menuId : item.chapterId,
             courseId: item.courseId,
-            gradeId: item.gradeId,
+            gradeId: item.gradeId
           })
-          .then((res) => {
+          .then(res => {
             this.sectionExam = res.data;
           });
         this.$request
@@ -1279,9 +1285,9 @@ export default {
             gradeId: item.gradeId,
             courseId: item.courseId,
             moduleId: item.moduleId || 0,
-            orderGoodsId: this.goodsData.orderGoodsId,
+            orderGoodsId: this.goodsData.orderGoodsId
           })
-          .then((res) => {
+          .then(res => {
             // let newArr = res.data.filter((item) => {
             //   return item.type != 2;
             // });
@@ -1327,7 +1333,7 @@ export default {
         classEndTime,
         classStatus,
         learningStatus,
-        learningTimeStart,
+        learningTimeStart
       } = this.goodsData;
       console.log(interfaceAccountId, learnStatus, "xzx");
       if (interfaceAccountId > 0) {
@@ -1336,7 +1342,7 @@ export default {
           : this.$message({
               type: "warning",
               message:
-                "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
+                "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!"
             });
         return false;
       }
@@ -1346,8 +1352,8 @@ export default {
           (classEndTime && time >= classEndTime),
         learningStatus == 2,
         classStatus == 0,
-        learningStatus == 3 && time < learningTimeStart,
-      ].findIndex((e) => e);
+        learningStatus == 3 && time < learningTimeStart
+      ].findIndex(e => e);
       if (index !== -1) {
         this.$message({
           type: "warning",
@@ -1357,8 +1363,8 @@ export default {
               "不在班级有效期",
               "开放学习时间待定",
               "尚未开班",
-              "不在开放学习时间,",
-            ][index] + ",不能进入学习",
+              "不在开放学习时间,"
+            ][index] + ",不能进入学习"
         });
       }
       return index === -1;
@@ -1373,7 +1379,7 @@ export default {
       ) {
         this.$message({
           type: "warning",
-          message: "请按顺序学习视频课程",
+          message: "请按顺序学习视频课程"
         });
         return false;
       }
@@ -1416,25 +1422,25 @@ export default {
       this.$request
         .lockLockStatus({
           action: "jxjy",
-          uuid: sessionStorage.getItem("uuid"),
+          uuid: sessionStorage.getItem("uuid")
         })
-        .then((res) => {
+        .then(res => {
           //有其他端在操作,不能学习
           this.$message({
             type: "warning",
-            message: res.msg,
+            message: res.msg
           });
         })
-        .catch((err) => {
+        .catch(err => {
           //可以学习
           this.$request
             .courseCourseList({
               pageNum: 1,
               pageSize: 1,
               goodsId: item.goodsId,
-              gradeId: item.gradeId,
+              gradeId: item.gradeId
             })
-            .then(async (res) => {
+            .then(async res => {
               //学习次数是否上限---start
               let learnNum = await this.goodsTodayStudySectionNum(courseItem);
               let hasLearn = await this.gradeCheckGoodsStudy(courseItem, items);
@@ -1444,7 +1450,7 @@ export default {
                   this.clickLock = false;
                   this.$message({
                     type: "warning",
-                    message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
+                    message: `每天最多学习${this.goodsData.sectionMaxNum}节`
                   });
                   return;
                 }
@@ -1467,7 +1473,7 @@ export default {
               } else {
                 this.$message({
                   type: "warning",
-                  message: "课程内暂无可以学习的科目",
+                  message: "课程内暂无可以学习的科目"
                 });
               }
             });
@@ -1477,7 +1483,7 @@ export default {
       if (type == 3) {
         //节卷
         let data = this.sectionExamList.filter(
-          (x) => x.sectionId == section.menuId
+          x => x.sectionId == section.menuId
         );
         if (data && data.length > 0) {
           section = data[0];
@@ -1485,7 +1491,7 @@ export default {
       } else if (type == 2) {
         //节卷
         let data = this.sectionExam.filter(
-          (x) => x.sectionId == section.sectionId
+          x => x.sectionId == section.sectionId
         );
 
         if (data && data.length > 0) {
@@ -1503,8 +1509,8 @@ export default {
           learning: section.learning,
           type: type,
           chapterId: section.chapterId || 0,
-          orderGoodsId: this.goodsData.orderGoodsId,
-        },
+          orderGoodsId: this.goodsData.orderGoodsId
+        }
       });
     },
     async orderTopTobottom(courseLists, section, type) {
@@ -1515,7 +1521,7 @@ export default {
       // 课程顺序
       if (this.courseList.length > 1) {
         let index = this.courseList.findIndex(
-          (e) => e.courseId == courseLists.courseId
+          e => e.courseId == courseLists.courseId
         );
 
         if (index) {
@@ -1538,7 +1544,7 @@ export default {
       );
       if (type == 99) {
         if (parentId >= 0 && menuId >= 0) {
-          var index = list.findIndex((e) => {
+          var index = list.findIndex(e => {
             return parentId
               ? e.moduleId == moduleId &&
                   e.chapterId == chapterId &&
@@ -1547,7 +1553,7 @@ export default {
           });
         } else {
           var index = list.findIndex(
-            (e) =>
+            e =>
               e.moduleId == moduleId &&
               e.chapterId == chapterId &&
               e.id == section.sectionId
@@ -1557,10 +1563,10 @@ export default {
         list = list.slice(0, index);
       } else if (type != 3) {
         list = list.filter(
-          (e) => e.moduleId == moduleId && e.chapterId == chapterId
+          e => e.moduleId == moduleId && e.chapterId == chapterId
         );
       }
-      return list.every((item) => item.studyStatus == 1);
+      return list.every(item => item.studyStatus == 1);
     },
     async exceedLearnNum(courseLists, section) {
       let learnNum = await this.goodsTodayStudySectionNum(section);
@@ -1570,7 +1576,7 @@ export default {
         if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
           this.$message({
             type: "warning",
-            message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
+            message: `每天最多学习${this.goodsData.sectionMaxNum}节`
           });
           return false;
         }
@@ -1578,6 +1584,20 @@ export default {
       return true;
     },
     async getResource(courseLists, section, type) {
+      let item = this.goodsData;
+      var confirmDetail = true;
+      if (item.educationName == "继续教育") {
+        if (
+          item.officialName &&
+          item.businessName == "二级" &&
+          item.projectName == "建造师"
+        ) {
+          confirmDetail = await this.userConfirmInfoDetail();
+        }
+      }
+      if (!confirmDetail) {
+        return;
+      }
       //type:1章卷,2节卷,3模考卷,4习题
       // if (!this.checkCanLearn()) {
       //   return false;
@@ -1612,8 +1632,8 @@ export default {
             learning: section.learning,
             type: type,
             chapterId: section.chapterId || 0,
-            orderGoodsId: this.goodsData.orderGoodsId,
-          },
+            orderGoodsId: this.goodsData.orderGoodsId
+          }
         });
         //没有答题次数限制
       } else if (section.answerNum == 0) {
@@ -1628,13 +1648,13 @@ export default {
             learning: section.learning,
             type: type,
             chapterId: section.chapterId || 0,
-            orderGoodsId: this.goodsData.orderGoodsId,
-          },
+            orderGoodsId: this.goodsData.orderGoodsId
+          }
         });
       } else {
         this.$message({
           type: "warning",
-          message: "该试卷只能答题" + section.answerNum + "次",
+          message: "该试卷只能答题" + section.answerNum + "次"
         });
 
         return;
@@ -1652,7 +1672,7 @@ export default {
       if (_data.length == 0) {
         return false;
       }
-      return _data.some((section) => section.sectionId == sectionId);
+      return _data.some(section => section.sectionId == sectionId);
     },
     // 新增用户视频学习日志
     studyLog(moduleId, chapterId, sectionId, courseLists) {
@@ -1667,9 +1687,9 @@ export default {
           sectionId: sectionId || 0,
           fromPlat: 2, //来源平台 1小程序 2PC网站
           goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
-          orderGoodsId: this.goodsData.orderGoodsId,
-        },
-      }).then((res) => {
+          orderGoodsId: this.goodsData.orderGoodsId
+        }
+      }).then(res => {
         console.log("直播的用户学习日志:", res);
       });
     },
@@ -1677,12 +1697,12 @@ export default {
      * 获取培训项目详情
      */
     courseBusiness() {
-      this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
+      this.$request.courseBusiness(this.goodsData.businessId).then(res => {
         this.businessData = res.data;
       });
     },
     bankRecordDoNum(courseLists, section) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .bankRecordDoNum({
             goodsId: this.goodsData.goodsId,
@@ -1690,63 +1710,63 @@ export default {
             chapterId: section.chapterId,
             courseId: courseLists.courseId,
             moduleId: 0,
-            examId: section.typeId,
+            examId: section.typeId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
     },
 
     studyRecordMenuAllList(courseLists) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .studyRecordMenuAllList({
             courseId: courseLists.courseId,
             gradeId: this.goodsData.gradeId,
-            goodsId: this.goodsData.goodsId,
+            goodsId: this.goodsData.goodsId
           })
-          .then((res) => {
-            res.data = res.data.filter((e) => e.sectionType != 2);
+          .then(res => {
+            res.data = res.data.filter(e => e.sectionType != 2);
             resolve(res.data);
           });
       });
     },
     gradeCheckGoodsStudy(courseItem, option) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .gradeCheckGoodsStudy({
             goodsId: this.goodsData.goodsId,
             gradeId: courseItem.gradeId,
             moduleId: option.moduleId || 0,
             chapterId: option.chapterId || 0,
-            sectionId: option.sectionId || option.menuId,
+            sectionId: option.sectionId || option.menuId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
     },
     goodsTodayStudySectionNum(option) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .goodsTodayStudySectionNum({
             goodsId: this.goodsData.goodsId,
-            gradeId: option.gradeId,
+            gradeId: option.gradeId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
     },
 
     userConfirmInfoDetail() {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .userConfirmInfoDetail({
-            orderGoodsId: this.goodsData.orderGoodsId,
+            orderGoodsId: this.goodsData.orderGoodsId
           })
-          .then((res) => {
+          .then(res => {
             if (!res.data) {
               clearInterval(this.confirmTimer);
               this.confirmCount = 10;
@@ -1771,11 +1791,11 @@ export default {
                     closeOnPressEscape: false,
                     distinguishCancelAndClose: false,
                     showClose: false,
-                    showCancelButton: false,
+                    showCancelButton: false
                   }
                 )
-                  .then((_) => {})
-                  .catch((_) => {});
+                  .then(_ => {})
+                  .catch(_ => {});
                 resolve(false);
               }
             }
@@ -1792,14 +1812,14 @@ export default {
       let infoJson = {
         realname: this.userInfo.realname,
         idCard: this.userInfo.idCard,
-        telphone: this.userInfo.telphone,
+        telphone: this.userInfo.telphone
       };
       this.$request
         .userConfirminfo({
           infoJson: JSON.stringify(infoJson),
-          orderGoodsId: this.goodsData.orderGoodsId,
+          orderGoodsId: this.goodsData.orderGoodsId
         })
-        .then((res) => {
+        .then(res => {
           if (res.data.pushInfo) {
             this.$message.success("提交成功");
           } else {
@@ -1812,11 +1832,11 @@ export default {
                 closeOnPressEscape: false,
                 distinguishCancelAndClose: false,
                 showClose: false,
-                showCancelButton: false,
+                showCancelButton: false
               }
             )
-              .then((_) => {})
-              .catch((_) => {});
+              .then(_ => {})
+              .catch(_ => {});
           }
           this.showConfirm = false;
           this.confirmLoading = false;
@@ -1827,13 +1847,13 @@ export default {
      * 查询商品重修状态
      */
     courseGoodsRebuildStatus(goodsId, gradeId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .courseGoodsRebuildStatus({
             goodsId: goodsId,
-            gradeId: gradeId,
+            gradeId: gradeId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
@@ -1848,11 +1868,11 @@ export default {
           courseId: section.courseId,
           chapterId: section.chapterId,
           moduleId: section.moduleId,
-          sectionId: section.sectionId || section.menuId,
-        },
+          sectionId: section.sectionId || section.menuId
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 2 - 1
src/store/index.js

@@ -116,7 +116,8 @@ export default new Vuex.Store({
     }) {
       return new Promise(resolve => {
         var urlReg = /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/;  
-        var urls=urlReg.exec(location.origin); 
+        var urls=urlReg.exec(location.origin)[0];
+        console.log(urls) 
         if (location.origin.includes("192.168.1") || location.origin.includes("120.79.166.78")) {
           urls = "web.xyyxt.net"
         }

Vissa filer visades inte eftersom för många filer har ändrats