Kaynağa Gözat

关联试卷

xuqiaoying 3 yıl önce
ebeveyn
işleme
b344250b39

+ 1 - 0
src/axios.js

@@ -5,6 +5,7 @@ import { Message } from 'element-ui'
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://192.168.1.7:5055'    //dev
+// export const BASE_URL = 'http://192.168.1.24:5055'    //dev
 export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //测试

+ 6 - 6
src/pages/course-exam/index.vue

@@ -1095,12 +1095,14 @@ export default {
       isTaking: true, //是否正在拍照
       stream: null,
       loading: false,
+      type:0,//type:1章卷,2节卷,3模考卷
       bankType: 0,
     };
   },
   async mounted() {
     this.goodsId = this.$route.params.goodsId;
     this.examId = this.$route.query.examId;
+    this.type = this.$route.query.type;
     this.courseId = this.$route.query.courseId;
     this.gradeId = this.$route.query.gradeId;
     this.moduleId = this.$route.query.moduleId;
@@ -1570,17 +1572,17 @@ export default {
         // } else {
         // 	questionList = this.questionList.length;
         // }
-
         this.$request
           .bankRecord({
             chapterExamId: this.chapterId || 0,
             moduleExamId: this.moduleId || 0,
-            examId: this.examId,
             goodsId: this.goodsId,
+            examId: this.examId,
+            type: this.type,
             gradeId: this.gradeId,
             totalQuestionNum: questionList,
             allQuestionNum: this.questionList.length,
-          })
+        })
           .then((res) => {
             this.recordId = res.data;
 
@@ -2256,6 +2258,7 @@ export default {
           chapterId: this.chapterId || 0,
           gradeId: this.gradeId,
           examId: this.examId,
+          type: this.type,
           goodsId: this.goodsId,
           reportStatus: reportStatus,
           recordId: this.recordId,
@@ -2293,9 +2296,6 @@ export default {
             this.setExamResult(result);
             this.$router.replace({
               path: "/course-report",
-              query: {
-                examId: this.examId,
-              }
             });
           }, 1000);
         })

+ 54 - 8
src/pages/person-center/my-course/index.vue

@@ -100,9 +100,47 @@
                   :key="k"
                   style="padding-left: 20px"
                 >
+                   <div
+                    v-if="i.type == 2"
+                    class="sectionStyle hoverStyleSection"
+                    style="padding-left: 20px"
+                  >
+                    <!-- 模考试卷 -->
+                      <el-row style="display: flex; align-items: center">
+                        <el-col :span="12">
+                          <span class="iconStyles">•</span>
+                          <span class="upStudyStyle sizeStyle">{{
+                              i.doType == 1
+                              ? "练习"
+                              : i.doType != 1
+                              ? "考试"
+                              : ""
+                          }}</span>
+                          <span class="span_style">{{ i.name }}</span>
+                        </el-col>
+                        <el-col :span="2" :offset="1">
+                          <el-button
+                            size="mini"
+                            style="width: 886px !important"
+                            type="text"
+                            v-if="i.doType == 1"  
+                            @click="getResource(item, i,3)"
+                            >进入学习</el-button
+                          ><el-button
+                            size="mini"
+                            style="width: 90px !important"
+                            type="text"
+                            v-else
+                            @click="getResource(item, i,3)"
+                            >进入考试</el-button
+                          >
+                        </el-col>
+                      </el-row>
+                  </div>
                   <div
+                    v-else
                     class="chapterStyle hoverStyle"
-                    @click="changeChapterStatus(teacherIndex, 2, i, index, indexs, k)"
+                    @click="changeChapterStatus(teacherIndex,2, i, index, indexs, k)"
                   >
                     <!-- <span class="iconStyle">章</span> -->
                     {{ i.name }}
@@ -170,14 +208,14 @@
                             style="width: 90px !important"
                             type="text"
                             v-if="is.doType == 1"
-                            @click="getResource(item, is)"
+                            @click="getResource(item, is, 3)"
                             >进入学习</el-button
                           ><el-button
                             size="mini"
                             style="width: 90px !important"
                             type="text"
                             v-else
-                            @click="getResource(item, is)"
+                            @click="getResource(item, is, 3)"
                             >进入考试</el-button
                           >
                         </el-col>
@@ -334,14 +372,14 @@
                         style="width: 90px !important"
                         type="text"
                         v-if="i.doType == 1"
-                        @click="getResource(item, i)"
+                        @click="getResource(item, i, 1)"
                         >进入学习</el-button
                       ><el-button
                         size="mini"
                         style="width: 90px !important"
                         type="text"
                         v-else
-                        @click="getResource(item, i)"
+                        @click="getResource(item, i, 1)"
                         >进入考试</el-button
                       >
                     </el-col>
@@ -480,14 +518,14 @@
                     style="width: 90px !important"
                     type="text"
                     v-if="items.doType == 1"
-                    @click="getResource(item, items)"
+                    @click="getResource(item, items,2)"
                     >进入学习</el-button
                   ><el-button
                     size="mini"
                     style="width: 90px !important"
                     type="text"
                     v-else
-                    @click="getResource(item, items)"
+                    @click="getResource(item, items,2)"
                     >进入考试</el-button
                   >
                 </el-col>
@@ -1279,7 +1317,8 @@ export default {
             });
         });
     },
-    async getResource(courseLists, section) {
+    async getResource(courseLists, section,type) {
+      //type:1章卷,2节卷,3模考卷
       console.log(section);
       if (section.type == 2) {
         //试卷
@@ -1297,6 +1336,7 @@ export default {
             return;
           }
         }
+        console.log(this.businessData,'this.businessData');
         if (this.businessData.goodsLearningOrder == 1) {
           if (section.canLearn) {
             let num = await this.bankRecordDoNum(courseLists, section);
@@ -1310,6 +1350,7 @@ export default {
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
                   examId: section.typeId,
+                  type: type,
                   chapterId: section.chapterId || 0,
                   orderGoodsId: this.goodsData.orderGoodsId,
                 },
@@ -1324,6 +1365,7 @@ export default {
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
                   examId: section.typeId,
+                  type: type,
                   chapterId: section.chapterId || 0,
                   orderGoodsId: this.goodsData.orderGoodsId,
                 },
@@ -1396,6 +1438,7 @@ export default {
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
                   examId: section.typeId,
+                  type: type,
                   chapterId: section.chapterId || 0,
                   orderGoodsId: this.goodsData.orderGoodsId,
                 },
@@ -1409,6 +1452,7 @@ export default {
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
                   examId: section.typeId,
+                  type: type,
                   chapterId: section.chapterId || 0,
                   orderGoodsId: this.goodsData.orderGoodsId,
                 },
@@ -1445,6 +1489,7 @@ export default {
                 gradeId: this.goodsData.gradeId,
                 moduleId: section.moduleId || 0,
                 examId: section.typeId,
+                type: type,
                 chapterId: section.chapterId || 0,
                 orderGoodsId: this.goodsData.orderGoodsId,
               },
@@ -1459,6 +1504,7 @@ export default {
                 gradeId: this.goodsData.gradeId,
                 moduleId: section.moduleId || 0,
                 examId: section.typeId,
+                type: type,
                 chapterId: section.chapterId || 0,
                 orderGoodsId: this.goodsData.orderGoodsId,
               },