Ver código fonte

新增组卷功能+双重等保+config配置修改

Tang 2 anos atrás
pai
commit
ae5ab36f67

+ 3 - 3
build/webpack.prod.conf.js

@@ -22,8 +22,8 @@ switch (process.env.ENV_ID) {
   case '962':
     env = require('../config/962.env')
     break;
-  case 'prod':
-    env = require('../config/prod.env')
+  case '680':
+    env = require('../config/680.env')
     break;
   case 'test':
     env = require('../config/test.env')
@@ -32,7 +32,7 @@ switch (process.env.ENV_ID) {
     env = require('../config/zz.env')
     break;
   default:
-    env = require('../config/prod.env')
+    env = require('../config/680.env')
     break;
 }
 const webpackConfig = merge(baseWebpackConfig, {

+ 1 - 1
config/prod.env.js → config/680.env.js

@@ -4,7 +4,7 @@ module.exports = {
   BASE_IMG_URL: '"https://file.xyyxt.net/"', //图片上传api
   BASE_URL: '"https://api.xyyxt.net"',
   TENANT_ID: '"867735392558919680"',
-  ENV_ID: '"prod"',//生产环境
+  ENV_ID: '"680"',//生产环境
   WEAPP_LOGO: '"@/assets/xcxqrcode.jpg"', // 微信小程序扫码图片
   WEAPP_STATUS: true,//小程序相关显示
   TENANT_NANE: '"祥粤云学堂"',

+ 2 - 2
config/dev.env.js

@@ -2,8 +2,8 @@
 module.exports = {
   NODE_ENV: '"development"',
   BASE_IMG_URL: '"https://file-dev.xyyxt.net/"', //图片上传api
-  // BASE_URL: '"http://120.79.166.78:19012"',
-  BASE_URL: '"http://192.168.1.24:5055"',
+  BASE_URL: '"http://120.79.166.78:19012"',
+  // BASE_URL: '"http://192.168.1.7:5055"',
   TENANT_ID: '"867735392558919680"',
   WEAPP_LOGO: '"@/assets/xcxqrcode.jpg"', // 微信小程序扫码图片
   TENANT_NANE: '"祥粤云学堂"',

+ 1 - 1
package.json

@@ -12,7 +12,7 @@
     "build:520": "cross-env NODE_ENV=production ENV_ID=520 node build/build.js",
     "build:962": "cross-env NODE_ENV=production ENV_ID=962 node build/build.js",
     "build:test": "cross-env NODE_ENV=production ENV_ID=test node build/build.js",
-    "build:prod": "cross-env NODE_ENV=production ENV_ID=prod node build/build.js",
+    "build:prod": "cross-env NODE_ENV=production ENV_ID=680 node build/build.js",
     "build:zz": "cross-env NODE_ENV=production ENV_ID=zz node build/build.js"
   },
   "dependencies": {

+ 11 - 0
src/apis/login.js

@@ -141,4 +141,15 @@ export default {
 			noToken: true
 		})
 	},
+  /**
+   * 
+   * @returns 获取用户登录是否需要验证码
+   */
+   dualAuth(data) {
+		return request({
+			url: '/app/common/dual_auth',
+			method: 'get',
+      params:data,
+		})
+	},
 }

+ 6 - 0
src/pages/bank-exam/index.vue

@@ -2183,9 +2183,15 @@ export default {
       }
     },
     isCheck(item, index) {
+      if(item.type === 4){
+        if (this.questionList[index].ques && this.questionList[index].ques.length) {
+        return true;
+      }
+      }else{
       if (this.questionList[index].ques) {
         return true;
       }
+      }
     },
     isRight(item, index) {
       //单选

+ 31 - 5
src/pages/home/index.vue

@@ -228,7 +228,7 @@
                         autocomplete="new-password"
                         v-model="loginForm.account"
                         @keyup.enter.native="login"
-                        placeholder="请输入手机号或身份证号"
+                        :placeholder="dualStatus ? '请输入手机号' : '请输入手机号或身份证号' "
                       ></el-input>
                     </el-form-item>
                   </div>
@@ -243,6 +243,21 @@
                       ></el-input>
                     </el-form-item>
                   </div>
+                  <div class="input" v-if="dualStatus">
+                    <el-form-item prop="code">
+                      <el-input
+                        autocomplete="new-password"
+                        v-model="loginForm.code"
+                        placeholder="请输入验证码"
+                      >
+                        <span slot="suffix" @click="getLoginSms(1)" class="btn">{{
+                          countDown == 0
+                            ? "获取验证码"
+                            : `${countDown}秒重新获取`
+                        }}</span>
+                      </el-input>
+                    </el-form-item>
+                  </div>
                   <el-button
                     type="primary"
                     class="submit"
@@ -284,7 +299,7 @@
                         v-model="loginSmsForm.code"
                         placeholder="请输入验证码"
                       >
-                        <span slot="suffix" @click="getLoginSms" class="btn">{{
+                        <span slot="suffix" @click="getLoginSms(2)" class="btn">{{
                           countDown == 0
                             ? "获取验证码"
                             : `${countDown}秒重新获取`
@@ -624,6 +639,7 @@ export default {
   },
   data() {
     return {
+      dualStatus:false,//是否双重校验
       msgShow: false,
       msgData: {},
       showBox: false,
@@ -724,6 +740,13 @@ export default {
     this.courseLists();
   },
   mounted() {
+    //双重校验
+    this.$request.dualAuth().then((res) => {
+      this.dualStatus = res.data === "1" ? true : false;
+      if(this.dualStatus){
+        this.loginRules["account"][0].message = "请输入手机号"
+      }
+    });
     if (this.userInfo) {
       this.getRecord();
       // this.getmsg();
@@ -1418,6 +1441,9 @@ export default {
           let loginForm = JSON.parse(JSON.stringify(this.loginForm));
           loginForm.pwd = this.$tools.encryptor(loginForm.pwd);
           console.log(this.loginForm);
+          if(this.dualStatus){
+            loginForm.tel = loginForm.account
+          }
           this.$request
             .login(loginForm)
             .then((res) => {
@@ -1449,8 +1475,8 @@ export default {
     /**
      * 获取登录短信
      */
-    getLoginSms() {
-      this.$refs.loginSmsForm.validateField("tel", (valid) => {
+    getLoginSms(int) {
+      this.$refs[int === 1 ? 'loginForm' :'loginSmsForm'].validateField(int === 1 ? "account" :"tel", (valid) => {
         if (!valid) {
           if (this.countDown == 0) {
             if (this.getLoginCodeLock) {
@@ -1458,7 +1484,7 @@ export default {
             }
             this.getLoginCodeLock = true;
             this.$request
-              .getLoginSms({ tel: this.loginSmsForm.tel })
+              .getLoginSms({ tel: int === 1 ? this.loginForm.account : this.loginSmsForm.tel })
               .then((res) => {
                 this.getLoginCodeLock = false;
                 this.$message({

+ 56 - 20
src/pages/login/index.vue

@@ -48,7 +48,7 @@
                       <el-form-item prop="account">
                         <el-input
                           autocomplete="new-password"
-                          placeholder="手机号/身份证号"
+                          :placeholder="dualStatus ? '手机号' :'手机号/身份证号'"
                           v-model="loginForm.account"
                           @keyup.enter.native="login"
                         ></el-input>
@@ -71,6 +71,26 @@
                           ></i> </el-input
                       ></el-form-item>
                     </div>
+                    <div class="input" v-if="dualStatus">
+                      <el-form-item prop="code"
+                        ><el-input
+                          autocomplete="new-password"
+                          placeholder="短信验证码"
+                          v-model="loginForm.code"
+                        >
+                          <span
+                            slot="suffix"
+                            @click="getLoginSms(1)"
+                            class="btn"
+                            >{{
+                              countDown == 0
+                                ? "获取验证码"
+                                : `${countDown}秒重新获取`
+                            }}</span
+                          >
+                        </el-input></el-form-item
+                      >
+                    </div>
                     <div class="text">
                       <a @click="state = 2">立即注册</a>
                       <a @click="state = 3">找回密码</a>
@@ -109,7 +129,7 @@
                         >
                           <span
                             slot="suffix"
-                            @click="getLoginSms"
+                            @click="getLoginSms(2)"
                             class="btn"
                             >{{
                               countDown == 0
@@ -202,7 +222,9 @@
                   <div class="checkbox">
                     <el-form-item prop="read">
                       <div>
-                        <el-checkbox v-model="registerForm.read">我已认真阅读并同意</el-checkbox>
+                        <el-checkbox v-model="registerForm.read"
+                          >我已认真阅读并同意</el-checkbox
+                        >
                         <!-- <input type="checkbox" v-model="registerForm.read" /> -->
                       </div>
 
@@ -869,20 +891,20 @@ export default {
     };
     var validateAccept = (rule, value, callback) => {
       if (!value) {
-        callback(new Error('请勾选服务协议'))
+        callback(new Error("请勾选服务协议"));
       } else {
         callback();
       }
-    }
+    };
     return {
       state: 1, //1登录 2注册  3找回密码 4绑定学员身份
       tabIndex: 1,
       loginForm: {},
       loginSmsForm: {},
       registerForm: {
-        tel: '',
-        code: '',
-        pwd: '',
+        tel: "",
+        code: "",
+        pwd: "",
         read: false,
       },
       forgetForm: {},
@@ -932,7 +954,13 @@ export default {
         ],
         code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
         pwd: [{ required: true, trigger: "blur", message: "请输入密码" }],
-        read: [{ required: true, trigger: ["blur", 'change'], validator: validateAccept },],
+        read: [
+          {
+            required: true,
+            trigger: ["blur", "change"],
+            validator: validateAccept,
+          },
+        ],
       },
 
       bindRules: {
@@ -954,6 +982,7 @@ export default {
       registerPwdShow: false,
       forgetPwdShow: false,
       showAgreementModal: false,
+      dualStatus: false, //是否需要双重校验
     };
   },
   computed: {
@@ -961,6 +990,13 @@ export default {
   },
   mounted() {
     this.state = this.$route.query.state || 1;
+    //双重校验
+    this.$request.dualAuth().then((res) => {
+      this.dualStatus = res.data === "1" ? true : false;
+      if(this.dualStatus){
+        this.loginRules["account"][0].message = "请输入手机号"
+      }
+    });
   },
   methods: {
     ...mapMutations(["setUserInfo", "setCurrentRouter"]),
@@ -978,7 +1014,6 @@ export default {
       localStorage.setItem("token", res.data.token);
       this.$tools.setUuid(new Date().valueOf() + "");
       if (res.data.full_info) {
-        
         this.getInfo();
       } else {
         this.user_account = res.data.user_account;
@@ -999,6 +1034,9 @@ export default {
           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
+          }
           this.$request
             .login(loginForm)
             .then((res) => {
@@ -1006,7 +1044,6 @@ export default {
               localStorage.setItem("token", res.data.token);
               this.$tools.setUuid(new Date().valueOf() + "");
               if (res.data.full_info) {
-                
                 this.getInfo();
               } else {
                 this.user_account = res.data.user_account;
@@ -1030,8 +1067,8 @@ export default {
     /**
      * 获取登录短信
      */
-    getLoginSms() {
-      this.$refs.loginSmsForm.validateField("tel", (valid) => {
+    getLoginSms(int) {
+      this.$refs[int === 1 ? 'loginForm' :'loginSmsForm'].validateField(int === 1 ? "account" :"tel", (valid) => {
         if (!valid) {
           if (this.countDown == 0) {
             if (this.getLoginCodeLock) {
@@ -1039,7 +1076,7 @@ export default {
             }
             this.getLoginCodeLock = true;
             this.$request
-              .getLoginSms({ tel: this.loginSmsForm.tel })
+              .getLoginSms({ tel: int === 1 ? this.loginForm.account : this.loginSmsForm.tel })
               .then((res) => {
                 this.getLoginCodeLock = false;
                 this.$message({
@@ -1056,7 +1093,7 @@ export default {
                 }, 1000);
               })
               .catch((err) => {
-                this.$message.error(err.msg)
+                this.$message.error(err.msg);
                 this.getLoginCodeLock = false;
               });
           }
@@ -1116,7 +1153,6 @@ export default {
               localStorage.setItem("token", res.data.token);
               this.$tools.setUuid(new Date().valueOf() + "");
               if (res.data.full_info) {
-                
                 this.getInfo();
               } else {
                 this.user_account = res.data.user_account;
@@ -1140,15 +1176,15 @@ export default {
      */
     getInfo() {
       this.$request
-        .getInfo({fromPlat: 2})
+        .getInfo({ fromPlat: 2 })
         .then((res) => {
           this.isRegister = false;
           this.islogin = false;
           this.isloginSms = false;
           this.setUserInfo(res.data);
-          console.log('=========',this.currentRouter);
+          console.log("=========", this.currentRouter);
           if (JSON.stringify(this.currentRouter) != "{}") {
-            console.log('zhelisafhsdifgsdiufg')
+            console.log("zhelisafhsdifgsdiufg");
             this.$router.push(this.currentRouter);
             this.setCurrentRouter({});
           } else {
@@ -1241,7 +1277,7 @@ export default {
           this.$tools.setUuid(new Date().valueOf() + "");
           if (res.data.full_info) {
             //信息完善,获取用户信息
-            
+
             this.getInfo();
           } else {
             //不完善,跳转完善信息页面

+ 6 - 0
src/pages/mock-countdown/index.vue

@@ -50,6 +50,8 @@ export default {
     return {
       state: 1,
       start: 0,
+      goodsId: "",
+      orderGoodsId: "",
       timer: null,
       timeText: "",
       nowTime: 0,
@@ -70,6 +72,8 @@ export default {
     this.examId = this.$route.query.examId;
     this.timeLimit = +this.$route.query.limit || 0;
     this.start = +this.$route.query.start;
+    this.goodsId = this.$route.query.goodsId;
+    this.orderGoodsId = this.$route.query.orderGoodsId;
     this.examEndTime = this.$route.query.examEndTime;
     this.end = this.timeLimit * 60 + this.start;
     this.timer = setInterval(() => {
@@ -117,6 +121,8 @@ export default {
             subscribeId: this.subscribeId,
             examEndTime: this.examEndTime,
             examStartTime: this.start,
+            goodsId: this.goodsId,
+            orderGoodsId: this.orderGoodsId,
           },
         });
       } else {

+ 10 - 3
src/pages/mock-exam-all-explain/index.vue

@@ -18,6 +18,7 @@
             <div class="explain-record__body clearfix">
               <div class="left-box">
                 <Header-tab-box
+                  :allNum="simulateStatus ? questionList.length : 0"
                   :num="questionOverNum(true)"
                   @prevQuestion="prevQuestion"
                   @nextQuestion="nextQuestion"
@@ -766,7 +767,7 @@ export default {
     Footer,
     Header,
     ToolBar,
-    HeaderTabBox
+    HeaderTabBox,
   },
   data() {
     return {
@@ -811,12 +812,14 @@ export default {
       moduleId: 0,
       chapterId: 0,
       current: 0,
+      simulateStatus: "",
     };
   },
   async mounted() {
     this.recordId = this.$route.params.recordId;
     this.examId = this.$route.query.examId;
-    this.goodsQuestionList();
+    (this.simulateStatus = parseInt(this.$route.query.simulateStatus)),
+      this.goodsQuestionList();
   },
   methods: {
     ...mapMutations(["setExamResult"]),
@@ -843,7 +846,11 @@ export default {
      */
     goodsQuestionList() {
       this.$request.mockReport(this.recordId).then(async (res) => {
-        this.questionList = JSON.parse(res.data.historyExamJson);
+        if (!res.data.historyExamJson) {
+          this.questionList = [];
+        } else {
+          this.questionList = JSON.parse(res.data.historyExamJson);
+        }
       });
     },
 

+ 1 - 0
src/pages/mock-exam-wrong-explain/index.vue

@@ -19,6 +19,7 @@
               <div class="left-box">
                 <Header-tab-box
                   :num="questionOverNum(true)"
+                  :allNum="questionList.length"
                   @prevQuestion="prevQuestion"
                   @nextQuestion="nextQuestion"
                 ></Header-tab-box>

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

@@ -1122,6 +1122,8 @@ export default {
       needPhoto: false,
       lastTime: 0, //剩余考试时长
       allTimes: 0, //总考试时长
+      goodsId:"",
+      orderGoodsId:"",
       lastCount: 0,
       examId: 0,
       current: 0,
@@ -1147,7 +1149,8 @@ export default {
     this.eachExamId = this.$route.query.eachExamId;
     this.subscribeId = this.$route.query.subscribeId || "";
     this.allTimes = this.examEndTime - this.examStartTime || "";
-
+    this.goodsId = this.$route.query.goodsId;
+    this.orderGoodsId = this.$route.query.orderGoodsId;
     await this.setSystemTime();
     await this.bankExam();
     this.goodsQuestionList();
@@ -1331,8 +1334,8 @@ export default {
         })
         .then(async (data) => {
           if(this.doMode==3){
-            this.simulateExamId = data.simulateExamId
-            data = data.questionList
+            this.simulateExamId = data.data.simulateExamId
+            data = data.data.questionList
           }
           if (!data.length) {
             this.$message({
@@ -1522,6 +1525,8 @@ export default {
             examId: this.examId,
             totalQuestionNum: questionList,
             allQuestionNum: this.questionList.length,
+            doMode: this.doMode,
+            simulateExamId: this.simulateExamId,
           })
           .then((res) => {
             this.recordId = res.data;

+ 3 - 0
src/pages/mock-report/index.vue

@@ -503,15 +503,18 @@ export default {
         path: "/mock-exam-wrong-explain/" + reportdata.recordId,
         query: {
           examId: reportdata.examId,
+          simulateStatus:this.examData.simulateStatus,
         },
       });
     },
 
     allExplain(reportdata) {
+      console.log(reportdata)
       this.$router.push({
         path: "/mock-exam-all-explain/" + reportdata.recordId,
         query: {
           examId: reportdata.examId,
+          simulateStatus:this.examData.simulateStatus,
         },
       });
     },

+ 3 - 0
src/pages/person-center/mock-record/index.vue

@@ -65,6 +65,7 @@
                         @click="
                           go('/mock-exam-all-explain/' + record.recordId, {
                             examId: record.examId,
+                            simulateStatus: record.doMode === 3 ? 1 : 0,
                           })
                         "
                       >
@@ -195,6 +196,8 @@ export default {
           examId: section.examId,
           eachExamId: section.eachExamId,
           subscribeId: section.subscribeId,
+          goodsId: section.goodsId,
+          orderGoodsId: section.orderGoodsId,
         },
       });
 

+ 3 - 0
src/pages/person-center/mock-record/record-list/index.vue

@@ -48,6 +48,7 @@
                         @click="
                           go('/mock-exam-all-explain/' + record.recordId, {
                             examId: record.examId,
+                            simulateStatus: record.doMode === 3 ? 1 : 0,
                           })
                         "
                       >
@@ -137,6 +138,8 @@ export default {
           examId: section.examId,
           eachExamId: section.eachExamId,
           subscribeId: section.subscribeId,
+          goodsId: section.goodsId,
+          orderGoodsId: section.orderGoodsId,
         },
       });
 

+ 4 - 0
src/pages/person-center/my-mock/index.vue

@@ -807,6 +807,8 @@ export default {
           limit: item.timeLimit,
           examId: item.examId,
           eachExamId: item.eachExamId,
+          goodsId: item.goodsId,
+          orderGoodsId: item.orderGoodsId,
           examEndTime: this.$tools.TimeTotimestamp(
             this.$tools.timestampToTime(item.applySiteExamTime) +
               " " +
@@ -837,6 +839,8 @@ export default {
           applyId: item.applyId,
           mockMajorSubjectId: item.mockMajorSubjectId,
           eachExamId: item.eachExamId,
+          goodsId: item.goodsId,
+          orderGoodsId: item.orderGoodsId,
           // applySiteExamTime:1653899220,
           // applySiteEndTime:"17:27:54",
           // applySiteStartTime:'16:27:54',

+ 39 - 4
src/pages/person-center/my-order/index.vue

@@ -55,12 +55,14 @@
                       <span class="note">¥{{ items.goodsRealPrice }}</span>
                     </div>
                   </div>
-<div v-if="false">
                   <div
                     class="btn btn--nobg"
                     @click="refund(item.orderSn, items.goodsId)"
                     v-if="
-                      items.refundStatus === 0 &&
+                      items.periodStatus !== 0 &&
+                      items.periodStatus !== 1 &&
+                      items.periodStatus !== 2 &&
+                      items.refundStatus === 0&&
                       (item.orderFrom === 2 || item.orderFrom === 3) &&
                       (item.orderStatus === 1 ||
                         item.orderStatus === 2 ||
@@ -72,8 +74,10 @@
                     "
                   >
                     申请退款
-                  </div></div>
-                  <div class="state" v-if="items.refundStatus == 2">已退款</div>
+                  </div>
+                  <div class="state" v-if="items.periodStatus > -3">
+                    {{ periodStatusName(items.periodStatus) }}
+                  </div>
                 </div>
               </div>
               <div class="price-wrap">
@@ -213,6 +217,37 @@ export default {
       ],
     };
   },
+  computed: {
+    periodStatusName: function () {
+      return function (val) {
+        // ("审批状态 0 待审核 1初审通过 2复审通过待退款  -1初审不通过 -2复审不通过 3已退款")
+        var status = "";
+        switch (val) {
+          case 0:
+            status = "待审核";
+            break;
+          case 1:
+            status = "初审通过";
+            break;
+          case 2:
+            status = "复审通过待退款";
+            break;
+          case -1:
+            status = "初审不通过";
+            break;
+          case -2:
+            status = "复审不通过";
+            break;
+          case 3:
+            status = "已退款";
+            break;
+          default:
+            break;
+        }
+        return status;
+      };
+    },
+  },
   mounted() {
     if (this.$route.query.state) {
       this.activeName = this.$route.query.state;