瀏覽代碼

随机练习开发

xiejiebiao 2 年之前
父節點
當前提交
ceac91cc86

+ 14 - 8
src/apis/common.js

@@ -72,11 +72,11 @@ export default {
   },
 
   /**
- * 
- * @param {*} data 
- * @returns 
- * 查询商品课程双师资绑定列表
- */
+   * 
+   * @param {*} data 
+   * @returns 
+   * 查询商品课程双师资绑定列表
+   */
   getGoodsCourseTeacher(data) {
     return request({
       url: '/app/common/course/teacher/list',
@@ -204,7 +204,13 @@ export default {
       noToken: true
     })
   },
-
+  goodsExamRandomList(data) {
+    return request({
+      url: '/bank/exam/temp',
+      method: 'post',
+      data
+    })
+  },
   /**
    * 
    * @param {*} data 
@@ -317,7 +323,7 @@ export default {
 
     })
   },
-  
+
   getWeAppLink(data) {
     return request({
       url: '/app/common/get/small/link',
@@ -327,4 +333,4 @@ export default {
     })
   }
 
-}
+}

+ 7 - 1
src/components/common/CollectionBox.vue

@@ -27,13 +27,14 @@ export default {
   methods: {
     collect() {
       if (this.showT) {
-        let { questionId, goodsId, orderGoodsId, examId } = this.param;
+        let { questionId, goodsId, orderGoodsId, examId, doMode } = this.param;
         this.$request
           .collectQuestion({
             examId,
             questionId,
             goodsId,
             orderGoodsId,
+            doMode
           })
           .then((res) => {
             this.$message.success("收藏成功");
@@ -60,6 +61,7 @@ export default {
   padding: 12px 0;
   border-top: 1px solid #eeeeee;
 }
+
 .col {
   width: 100%;
   display: flex;
@@ -68,6 +70,7 @@ export default {
   border-radius: 4px;
 
   cursor: pointer;
+
   div {
     height: 30px;
     line-height: 30px;
@@ -75,16 +78,19 @@ export default {
     align-items: center;
     font-size: 13px;
   }
+
   img {
     margin-right: 4px;
   }
 }
+
 .tuck {
   width: 68px;
   border: 1px solid #3f8dfd;
   color: #3f8dfd;
   background: #f2f7ff;
 }
+
 .cancel {
   width: 86px;
   color: #ffffff;

+ 11 - 4
src/components/exam/HeaderTabBox.vue

@@ -3,8 +3,7 @@
     <div class="title">{{ examInfo.examName }}</div>
     <div class="tab_box">
       <div class="text">
-        已完成 <span>{{ num }}</span
-        >/{{ allNum || examInfo.questionNum }} 道题
+        已完成 <span>{{ num }}</span>/{{ allNum || examInfo.questionNum }} 道题
       </div>
       <div class="header_btns">
         <div class="btn" @click="$emit('prevQuestion')">上一题</div>
@@ -32,9 +31,10 @@ export default {
     };
   },
   mounted() {
-    if (this.$route.query.examId || this.examId) {
+    console.log(this.examId,8989898)
+    if (this.examId || this.$route.query.examId * 1) {
       this.$request
-        .bankExam(this.$route.query.examId || this.examId)
+        .bankExam(this.examId || this.$route.query.examId)
         .then((res) => {
           this.examInfo = res.data;
         });
@@ -51,21 +51,25 @@ export default {
   display: flex;
   align-items: center;
   justify-content: space-between;
+
   .title {
     font-weight: 500;
     color: #222222;
     font-size: 16px;
   }
+
   .tab_box {
     display: flex;
     align-items: center;
   }
+
   .header_btns {
     display: flex;
     justify-content: space-around;
     align-items: center;
     border: 1px solid #3f8dfd;
     border-radius: 4px;
+
     .btn {
       cursor: pointer;
       width: 66px;
@@ -75,6 +79,7 @@ export default {
       text-align: center;
       color: #3f8dfd;
       border-radius: 4px;
+
       &:nth-of-type(2) {
         background: #3f8dfd;
         color: #ffffff;
@@ -82,9 +87,11 @@ export default {
       }
     }
   }
+
   .text {
     margin-right: 20px;
     font-size: 14px;
+
     span {
       font-family: Microsoft YaHei;
       font-weight: bold;

+ 3 - 0
src/pages/bank-exam-continue/index.vue

@@ -1287,6 +1287,7 @@ export default {
           questionId: this.questionList[current].questionId,
           goodsId: this.goodsId,
           orderGoodsId: this.orderGoodsId,
+          doMode: 1
         })
         .then((res) => {
           this.$set(this.collectList, current, res.data);
@@ -1581,6 +1582,7 @@ export default {
             questionId: this.questionList[index].questionId,
             goodsId: this.goodsId || "",
             orderGoodsId: this.orderGoodsId,
+            doMode:1
           })
           .then((res) => {
             this.$set(this.collectList, index, true);
@@ -1838,6 +1840,7 @@ export default {
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
           type: 1,
+          doMode: this.doMode
         })
         .then((res) => {})
         .catch((err) => {});

文件差異過大導致無法顯示
+ 280 - 558
src/pages/bank-exam/index.vue


+ 3 - 0
src/pages/course-exam/index.vue

@@ -1269,6 +1269,7 @@ export default {
           questionId: this.questionList[current].questionId,
           goodsId: this.goodsId,
           orderGoodsId: this.orderGoodsId,
+          doMode: 1
         })
         .then((res) => {
           this.$set(this.collectList, current, res.data);
@@ -2208,6 +2209,7 @@ export default {
             questionId: this.questionList[index].questionId,
             goodsId: this.goodsId || "",
             orderGoodsId: this.orderGoodsId,
+            doMode:1
           })
           .then((res) => {
             this.$set(this.collectList, index, true);
@@ -2513,6 +2515,7 @@ export default {
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
           type: 2, // 视频课程的传2
+          doMode: this.doMode
         })
         .then((res) => {})
         .catch((err) => {});

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

@@ -1287,6 +1287,7 @@ export default {
           questionId: this.questionList[current].questionId,
           goodsId: this.goodsId,
           orderGoodsId: this.orderGoodsId,
+          doMode: 1
         })
         .then((res) => {
           this.$set(this.collectList, current, res.data);
@@ -2128,6 +2129,7 @@ export default {
             questionId: this.questionList[index].questionId,
             goodsId: this.goodsId || "",
             orderGoodsId: this.orderGoodsId,
+            doMode:1
           })
           .then((res) => {
             this.$set(this.collectList, index, true);
@@ -2609,6 +2611,7 @@ export default {
           examId: this.examId,
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
+          doMode: this.doMode
         })
         .then((res) => {
           this.loading = false;

+ 48 - 8
src/pages/person-center/my-bank/bank-detailCopy/index.vue

@@ -35,10 +35,12 @@
                 </div>
                 <div>
                   <p>做题数量</p>
-                  <div v-for="val in 6" :key="val">
-                    <div>{{val}}</div>
+                  <div class="sle-num-box">
+                    <div :class="activeNum == val ? 'actvie' : ''" v-for="val in numList" :key="val"
+                      @click="handelNum(val)">{{ val
+                      }}</div>
                   </div>
-                  <div>开始做题</div>
+                  <div @click="beginExam">开始做题</div>
                 </div>
               </div>
               <div class="goods-menu" v-else>
@@ -276,6 +278,8 @@ export default {
       wrongTotal: 0,
       needOpen: true, //是否需要打开第一章节
       recordItem: null,
+      numList: [5, 10, 15, 20, 50, 100],
+      activeNum: 5
     };
   },
   mounted() { },
@@ -309,7 +313,7 @@ export default {
       this.orderGoodsId = data.orderGoodsId;
       this.goodsId = data.goodsId;
       this.activeName = "0";
-      // await this.getExamType(data.goodsId);
+      await this.getExamType(data.goodsId);
       if (this.recordItem) {
         this.getRecordItem();
       } else {
@@ -486,7 +490,22 @@ export default {
         query,
       });
     },
-
+    beginExam() {
+      this.$router.push({
+        path: "/bank-exam/" + this.goodsId,
+        query: {
+          orderGoodsId: this.orderGoodsId,
+          number: this.activeNum,
+          moduleId: 0,
+          chapterId: 0,
+          examId: 0
+        },
+      });
+    },
+    handelNum(val) {
+      this.activeNum = val
+      // console.log(val, this.goodsId, this.orderGoodsId)
+    },
     /**
      * 获取课程目录
      */
@@ -875,22 +894,43 @@ export default {
 
     &__body {
       .left-box {
+
         // float: left;
         // width: 768px;
-        .day-box{
+        .day-box {
           height: 100px;
           display: flex;
         }
+
+        .sle-num-box {
+          display: flex;
+          margin-bottom: 30px;
+
+          div {
+            width: 50px;
+            border: 1px solid #ccc;
+            text-align: center;
+            line-height: 40px;
+            cursor: pointer;
+          }
+
+          .actvie {
+            background: #3f8dfd;
+            color: #fff;
+          }
+        }
+
         /deep/ {
-          .el-calendar-day{
+          .el-calendar-day {
             height: 60px;
           }
         }
+
         /deep/.el-tabs__item {
           height: 98px;
           line-height: 98px;
         }
-        
+
         .goods-menu {
           // padding: 0 16px 16px;
           // border-radius: 10px;

+ 2 - 0
src/pages/subject/collect-bank.vue

@@ -1043,6 +1043,7 @@ export default {
           questionId,
           goodsId,
           orderGoodsId,
+          doMode: 1
         })
         .then((res) => {
           this.$set(this.collectList, this.current, res.data);
@@ -1694,6 +1695,7 @@ export default {
             questionId: questionId,
             goodsId: goodsId,
             orderGoodsId: orderGoodsId,
+            doMode:1
           })
           .then((res) => {
             this.$set(this.collectList, _i, true);

部分文件因文件數量過多而無法顯示