Browse Source

修复了一个分类练习取题目的bug

zhangyujun 3 năm trước cách đây
mục cha
commit
599a2b66e3

+ 9 - 0
src/api/modules/exam.js

@@ -124,6 +124,15 @@ const exam = {
 			method: "DELETE",
 			data
 		})
+	},
+	//根据ids获取多个问题
+	studentQuestionInfoGetQuestionInfoByIds(params) {
+		return request({
+			url: "student/question/info/getQuestionInfoByIds",
+			method: "GET",
+			params
+		})
+
 	}
 }
 

+ 5 - 1
src/components/m-checkbox/m-checkbox.vue

@@ -10,7 +10,7 @@
       >{{ name }}</view
     >
     <view :data-item="item" style="width: 8px"></view>
-    <text style="font-weight:600" :data-item="item">{{ item.value }}</text>
+    <text style="font-weight: 600" :data-item="item">{{ item.value }}</text>
   </view>
 </template>
 
@@ -34,6 +34,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    value: {
+      type: String,
+      default: "",
+    },
     name: {
       type: String,
       default: "",

+ 429 - 30
src/components/m-do-topic/m-do-topic.vue

@@ -15,7 +15,10 @@
     <!-- #ifdef MP-WEIXIN -->
     <!-- 单项选择 -->
     <view
-      v-if="problemList[problemListIndex].questionType < 3"
+      v-if="
+        problemList[problemListIndex].questionType < 3 &&
+        !problemList[problemListIndex].isCompleted
+      "
       class="problem-ops"
     >
       <van-radio-group
@@ -44,10 +47,50 @@
         </van-radio>
       </van-radio-group>
     </view>
+    <view
+      v-if="
+        problemList[problemListIndex].questionType < 3 &&
+        problemList[problemListIndex].isCompleted
+      "
+    >
+      <view
+        v-for="(item, index) in problemList[problemListIndex].optsArr"
+        :key="index"
+        class="problem-select"
+      >
+        <icon
+          v-if="item.isAnswer && item.selected"
+          class="icon-box-img"
+          type="success"
+          color="#06c05f"
+          size="37"
+        ></icon>
+        <icon
+          v-if="!item.isAnswer && item.selected"
+          class="icon-box-img"
+          type="clear"
+          color="red"
+          size="37"
+        ></icon>
+        <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
+          numberToLetter(index)
+        }}</text>
+        <text
+          v-if="item.isAnswer && !item.selected"
+          class="problem-op problem-op_green"
+          >{{ numberToLetter(index) }}</text
+        >
+        <view style="width: 8px"></view>
+        <text class="problem-opAnswer">{{ item.value }}</text>
+      </view>
+    </view>
 
     <!-- 多项选择 -->
     <view
-      v-if="problemList[problemListIndex].questionType == 3"
+      v-if="
+        problemList[problemListIndex].questionType == 3 &&
+        !problemList[problemListIndex].isCompleted
+      "
       class="problem-ops"
     >
       <van-checkbox-group
@@ -74,14 +117,120 @@
           >
         </van-checkbox>
       </van-checkbox-group>
+      <view class="flex-center mt30">
+        <van-button
+          @click="confirmMult"
+          color="#498ef5"
+          round
+          custom-style="width:600rpx"
+          type="primary"
+          >确定</van-button
+        >
+      </view>
+    </view>
+    <view
+      v-if="
+        problemList[problemListIndex].questionType == 3 &&
+        problemList[problemListIndex].isCompleted
+      "
+    >
+      <view
+        v-for="(item, index) in problemList[problemListIndex].optsArr"
+        :key="index"
+        class="problem-select"
+      >
+        <icon
+          v-if="item.isAnswer && item.selected"
+          class="icon-box-img"
+          type="success"
+          color="#06c05f"
+          size="37"
+        ></icon>
+        <icon
+          v-if="!item.isAnswer && item.selected"
+          class="icon-box-img"
+          type="clear"
+          size="37"
+          color="red"
+        ></icon>
+        <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
+          numberToLetter(index)
+        }}</text>
+        <text
+          v-if="item.isAnswer && !item.selected"
+          class="problem-op problem-op_green"
+          >{{ numberToLetter(index) }}</text
+        >
+        <view style="width: 8px"></view>
+        <text class="problem-opAnswer">{{ item.value }}</text>
+      </view>
     </view>
     <!-- #endif -->
 
-    <!-- 单选 -->
     <!-- #ifdef MP-TOUTIAO -->
+    <!-- 判断 -->
     <view
       v-if="
-        problemList[problemListIndex].questionType < 3 &&
+        problemList[problemListIndex].questionType == 1 &&
+        !problemList[problemListIndex].isCompleted
+      "
+      class="problem-ops"
+    >
+      <m-radio-group
+        @change="changeRadioGroup"
+        :value.sync="problemList[problemListIndex].userAnswer"
+      >
+        <m-radio
+          :value="judgMap[item.value]"
+          :item="item"
+          :useIconSlot="true"
+          :key="index"
+          :name="numberToLetter(index)"
+          v-for="(item, index) in problemList[problemListIndex].optsArr"
+        >
+        </m-radio>
+      </m-radio-group>
+    </view>
+    <view
+      v-if="
+        problemList[problemListIndex].questionType == 1 &&
+        problemList[problemListIndex].isCompleted
+      "
+    >
+      <view
+        v-for="(item, index) in problemList[problemListIndex].optsArr"
+        :key="index"
+        class="problem-select"
+      >
+        <icon
+          v-if="item.isAnswer && item.selected"
+          class="icon-box-img"
+          type="success"
+          color="#06c05f"
+          size="37"
+        ></icon>
+        <icon
+          v-if="!item.isAnswer && item.selected"
+          class="icon-box-img"
+          type="clear"
+          size="37"
+        ></icon>
+        <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
+          numberToLetter(index)
+        }}</text>
+        <text
+          v-if="item.isAnswer && !item.selected"
+          class="problem-op problem-op_green"
+          >{{ numberToLetter(index) }}</text
+        >
+        <view style="width: 8px"></view>
+        <text class="problem-opAnswer">{{ judgMap[item.value] }}</text>
+      </view>
+    </view>
+    <!-- 单选 -->
+    <view
+      v-if="
+        problemList[problemListIndex].questionType == 2 &&
         !problemList[problemListIndex].isCompleted
       "
       class="problem-ops"
@@ -103,7 +252,7 @@
     </view>
     <view
       v-if="
-        problemList[problemListIndex].questionType < 3 &&
+        problemList[problemListIndex].questionType == 2 &&
         problemList[problemListIndex].isCompleted
       "
     >
@@ -213,8 +362,8 @@
     </view>
 
     <!-- #endif -->
-    <view class="function-list">
-      <div class="function-item">
+    <view v-if="!hiddenFunction" class="function-list">
+      <div @click="collectTopics" class="function-item">
         <van-icon name="star-o" size="25px" />
         <span>收藏</span>
       </div>
@@ -250,14 +399,171 @@ import mRadio from "@/components/m-radio/m-radio.vue";
 import mRadioGroup from "@/components/m-radio-group/m-radio-group.vue";
 import mCheckbox from "@/components/m-checkbox/m-checkbox.vue";
 import mCheckboxGroup from "@/components/m-checkbox-group/m-checkbox-group.vue";
+import api from "@/api/index";
 export default {
-  created() {},
   data() {
     return {
-      problemList: [],
+      //topic
+      problemList: [
+        {
+          questionType: 2,
+          answer: "×",
+          answerkeyword: "",
+          answermp3:
+            "https://t1-1305573081.file.myqcloud.com/kt/answer_mp3/answer1389.mp3",
+          classIssue: "54",
+          classIssueName: "车内开关/装置",
+          classSort: 16,
+          createTime: "2022-04-21 13:33:46",
+          excellIssue: "23",
+          excellIssueName: "必学题三",
+          excellSort: 4,
+          explainGif:
+            "https://t1-1305573081.file.myqcloud.com/kt/explain_gif/explain1389.gif",
+          explainJq:
+            "看图答题:红色圆圈套在杆子中间.答对;不在中间或没有圆圈的.答错。",
+          explainJs:
+            "图中所示为左右转向灯开关转向灯操作:上提是右转向灯亮起,下压是左转向灯。",
+          explainMp3:
+            "https://t1-1305573081.file.myqcloud.com/kt/explain_mp3/explain1389.mp3",
+          explainjsmp3:
+            "https://t1-1305573081.file.myqcloud.com/kt/explain_js_mp3/explainJS1389.mp3",
+          id: 831,
+          idKt: 1389,
+          idYdt: 950,
+          image:
+            "https://t1-1305573081.file.myqcloud.com/kt/image/image1389.png",
+          imageYdt:
+            "https://t1-1305573081.file.myqcloud.com/kt/image_ydt/5eb4d75agw1e291vmniovj.jpg",
+          issue: "将转向灯开关向上提,左转向灯亮。",
+          issuemp3:
+            "https://t1-1305573081.file.myqcloud.com/kt/issue_mp3/issue1389.mp3",
+          liceBus: "1",
+          liceCar: "1",
+          liceMoto: null,
+          liceTruck: "1",
+          number: 831,
+          opts: "√-×",
+          optsArr: ["√", "×"],
+          placeIssue: null,
+          placeIssueName: null,
+          placeSort: null,
+          questionType: 1,
+          sequeIssue: "7",
+          sequeIssueName: "机械仪表",
+          sequeSort: 25,
+          skillkeyword: "没有圆圈-答错",
+          subject: 1,
+          titlekeyword: "",
+          updateTime: "2022-04-22 13:43:07",
+          userAnswer: [],
+        },
+      ],
+      judgMap: {
+        "√": "正确",
+        "×": "错误",
+      },
+      gsMap: {
+        xc: "小车",
+        hc: "货车",
+        mtc: "摩托车",
+        kc: "客车",
+      },
     };
   },
+  watch: {
+    query(newValue, oldValue) {
+      let that = this;
+      console.log(this.type);
+      if (this.type == "wrong") {
+        api.exam
+          .studentQuestionInfoGetQuestionInfoByIds({
+            ids: newValue.questionIds,
+          })
+          .then((res) => {
+            res.rows.forEach((element) => {
+              element.optsArr = [];
+              element.opts.split("-").forEach((item, index) => {
+                if (element.questionType == 3) {
+                  element.optsArr.push({
+                    selected: false,
+                    value: item,
+                    index: index,
+                    isAnswer: element.answer.split("-").includes(item),
+                  });
+                } else {
+                  element.optsArr.push({
+                    selected: false,
+                    value: item,
+                    index: index,
+                    isAnswer: item === element.answer,
+                  });
+                }
+              });
+              element.isCompleted = false;
+              element.userAnswer = [];
+            });
+            that.problemListTotal = res.total;
+            that.problemList = res.rows;
+            that.$emit("update:problemListTotal", res.total);
+          });
+      } else {
+        api.exam
+          .studentQuestionInfoList({
+            ...this.query,
+          })
+          .then((res) => {
+            res.rows.forEach((element) => {
+              element.optsArr = [];
+              element.opts.split("-").forEach((item, index) => {
+                if (element.questionType == 3) {
+                  element.optsArr.push({
+                    selected: false,
+                    value: item,
+                    index: index,
+                    isAnswer: element.answer.split("-").includes(item),
+                  });
+                } else {
+                  element.optsArr.push({
+                    selected: false,
+                    value: item,
+                    index: index,
+                    isAnswer: item === element.answer,
+                  });
+                }
+              });
+              element.isCompleted = false;
+              element.userAnswer = [];
+            });
+            that.problemListTotal = res.total;
+            that.problemList = res.rows;
+            that.$emit("update:problemListTotal", res.total);
+          });
+      }
+    },
+  },
   methods: {
+    collectTopics(e) {
+      api.exam
+        .studentQuestionCollection({
+          questionId: this.problemList[this.problemListIndex].id,
+          carType: this.gsMap[this.query.gs],
+          km: this.query.subject === "4" ? "科目四" : "科目一",
+        })
+        .then((res) => {
+          uni.showToast({
+            title: "收藏成功",
+          });
+        });
+    },
+    readQuestion(e) {
+      let globalAudio = utils.wxUtils.getGlobAudio();
+      if (globalAudio) {
+        globalAudio.src = e;
+        globalAudio.stop();
+        globalAudio.play();
+      }
+    },
     numberToLetter(index) {
       index = Number(index);
       return String.fromCharCode(index + 65);
@@ -273,8 +579,10 @@ export default {
         )
       ) {
         this.trueNum++;
+        this.$emit("update:trueNum", this.trueNum);
       } else {
         this.falseNum++;
+        this.$emit("update:falseNum", this.falseNum);
         api.exam.studentQuestionWrong({
           questionId: this.problemList[this.problemListIndex].id,
           carType: this.gsMap[this.query.gs],
@@ -324,36 +632,50 @@ export default {
         }
       });
       //#endif
-      if (
-        this.problemList[this.problemListIndex].answer
-          .split("-")
-          .sort()
-          .toString() ===
-        this.problemList[this.problemListIndex].userAnswer.sort().toString()
-      ) {
-        this.trueNum = this.trueNum + 1;
-      } else {
-        this.falseNum = this.falseNum + 1;
-      }
+      // if (
+      //   this.problemList[this.problemListIndex].answer
+      //     .split("-")
+      //     .sort()
+      //     .toString() ===
+      //   this.problemList[this.problemListIndex].userAnswer.sort().toString()
+      // ) {
+      //   this.trueNum = this.trueNum + 1;
+      //   this.$emit("update:trueNum", this.trueNum);
+      // } else {
+      //   this.falseNum = this.falseNum + 1;
+      //   this.$emit("update:falseNum", this.falseNum);
+      // }
     },
     changeRadioGroup(e) {
       console.log(e, "changeRadioGroup");
       // #ifdef MP-WEIXIN
       this.$set(this.problemList[this.problemListIndex], "isCompleted", true);
+      if (e.detail == this.problemList[this.problemListIndex].answer) {
+        this.trueNum = this.trueNum + 1;
+        this.$emit("update:trueNum", this.trueNum);
+      } else {
+        this.falseNum = this.falseNum + 1;
+        api.exam.studentQuestionWrong({
+          questionId: this.problemList[this.problemListIndex].id,
+          carType: this.gsMap[this.query.gs],
+          km: this.query.subject === "4" ? "科目四" : "科目一",
+        });
+        this.$emit("update:falseNum", this.falseNum);
+      }
       this.$set(
         this.problemList[this.problemListIndex],
         "userAnswer",
-        e.detail.value
-      );
-      e.detail.selected = true;
-      this.$set(
-        this.problemList[this.problemListIndex].optsArr,
-        e.detail.index,
         e.detail
       );
-      e.detail.value === this.problemList[this.problemListIndex].answer
-        ? (this.trueNum = this.trueNum + 1)
-        : (this.falseNum = this.falseNum + 1);
+      this.optsArr = this.problemList[this.problemListIndex].optsArr.map(
+        (item) => {
+          item.selected = item.value == e.detail;
+        }
+      );
+
+      // e.detail.value === this.problemList[this.problemListIndex].answer
+      //   ? (this.trueNum = this.trueNum + 1)
+      //   : (this.falseNum = this.falseNum + 1);
       //#endif
 
       // #ifdef MP-TOUTIAO
@@ -380,10 +702,13 @@ export default {
           );
         }
       });
-      if (e.detail.value === this.problemList[this.problemListIndex].answer) {
+      console.log(e, "组件");
+      if (e.detail === this.problemList[this.problemListIndex].answer) {
         this.trueNum = this.trueNum + 1;
+        this.$emit("update:trueNum", this.trueNum);
       } else {
         this.falseNum = this.falseNum + 1;
+        this.$emit("update:falseNum", this.falseNum);
         api.exam.studentQuestionWrong({
           questionId: this.problemList[this.problemListIndex].id,
           carType: this.gsMap[this.query.gs],
@@ -394,6 +719,26 @@ export default {
       //#endif
     },
   },
+  filters: {
+    questionType: function (value) {
+      let question = "";
+      switch (value) {
+        case 1:
+        case "1":
+          question = "判断题";
+          break;
+        case 2:
+        case "2":
+          question = "单选题";
+          break;
+        case 3:
+        case "3":
+          question = "多选题";
+          break;
+      }
+      return question;
+    },
+  },
   components: {
     mRadio,
     mRadioGroup,
@@ -402,17 +747,48 @@ export default {
   },
 
   props: {
+    hiddenFunction: {
+      type: Boolean,
+      default: false,
+    },
+    problemListTotal: {
+      type: Number,
+      default: 0,
+    },
     query: {
       type: Object,
       default: () => {
         return {};
       },
     },
+    type: {
+      type: String,
+      default: "",
+    },
+    trueNum: {
+      type: Number,
+      default: 0,
+    },
+    falseNum: {
+      type: Number,
+      default: 0,
+    },
+    problemListIndex: {
+      type: Number,
+      default: 0,
+    },
   },
 };
 </script>
 
 <style lang="scss" scoped>
+.mt30 {
+  margin-top: 30rpx;
+}
+.flex-center {
+  display: flex;
+  justify-content: center;
+}
 .problem-box {
   padding: 15rpx;
   background: #fff;
@@ -449,6 +825,7 @@ export default {
     padding-left: 30rpx;
     .problem-checkbox {
       height: 100rpx;
+      margin-bottom: 30rpx;
     }
   }
   .problem-op {
@@ -485,4 +862,26 @@ export default {
     }
   }
 }
+.function-list {
+  width: 100%;
+  font-size: 13px;
+  display: flex;
+  justify-content: space-around;
+  flex-wrap: wrap;
+  padding: 15px;
+  box-sizing: border-box;
+  .function-item {
+    margin-bottom: 20px;
+    width: 30%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    font-size: 13px;
+    font-weight: 400;
+    color: #8a9099;
+    span {
+      margin-top: 5px;
+    }
+  }
+}
 </style>

+ 5 - 1
src/components/m-radio/m-radio.vue

@@ -10,7 +10,7 @@
       >{{ name }}</view
     >
     <view :data-item="item" style="width: 8px"></view>
-    <text style="font-weight:600" :data-item="item">{{ item.value }}</text>
+    <text style="font-weight: 600" :data-item="item">{{ value }}</text>
   </view>
 </template>
 
@@ -38,6 +38,10 @@ export default {
       type: String,
       default: "",
     },
+    value: {
+      type: String,
+      default: "",
+    },
     item: {
       type: Object,
       default: () => {

+ 2 - 2
src/otherPages/classifyKind/index.vue

@@ -10,8 +10,8 @@
       "
       is-link
       @click="goExercise({
-        classIssueName:item.classIssueName
-
+        classIssueName:item.classIssueName,
+        classIssue:item.classIssue
       })"
       center
       v-for="(item, index) in classData"

+ 50 - 11
src/otherPages/collection/index.vue

@@ -4,7 +4,7 @@
       <img class="collectionHeader" mode="widthFix" :src="collectionHeader" />
     </div>
     <div class="choose">
-      <div class="choose-img">
+      <div class="choose-img" @click="goSpecifyExercise('wrong')">
         <span class="choose-text1"> 做错题 </span>
         <span class="choose-text2"> 共 {{ wrongList.length }} 题 </span>
         <image mode="widthFix" class="bg" :src="wrongBg" />
@@ -17,7 +17,7 @@
           清空错题
         </button>
       </div>
-      <div class="choose-img">
+      <div class="choose-img" @click="goSpecifyExercise('collection')">
         <span class="choose-text1">收藏题</span>
         <span class="choose-text2"> 共 {{ collectionList.length }} 题 </span>
         <image mode="widthFix" class="bg" :src="collectionBg" />
@@ -48,6 +48,7 @@ import wrongBg from "@/assets/img/wrongBg.png";
 import collectionBottomBg from "@/assets/img/collectionBottomBg.png";
 import goArrow from "@/assets/img/goArrow.png";
 import api from "@/api/index";
+import utils from "@/utils/index";
 export default {
   data() {
     return {
@@ -56,7 +57,9 @@ export default {
       goArrow,
       collectionBg,
       collectionHeader,
-      query: {},
+      query: {
+        questionIds: "",
+      },
       gsMap: {
         xc: "小车",
         hc: "货车",
@@ -79,16 +82,52 @@ export default {
       .then((res) => {
         this.wrongList = res.rows;
       });
-    api.exam.studentQuestionCollectionList({
-      carType: this.gsMap[query.gs],
-      km: query.subject === "1" ? "科目一" : "科目四",
-      pageNum: 1,
-      pageSize: 10000,
-    }).then(res=>{
-      this.collectionList = res.rows
-    })
+    api.exam
+      .studentQuestionCollectionList({
+        carType: this.gsMap[query.gs],
+        km: query.subject === "1" ? "科目一" : "科目四",
+        pageNum: 1,
+        pageSize: 10000,
+      })
+      .then((res) => {
+        this.collectionList = res.rows;
+      });
   },
   methods: {
+    goSpecifyExercise(type) {
+      let query = Object.assign({}, this.query);
+      if (type == "wrong" && this.wrongList.length == 0) {
+        uni.showToast({
+          title: "没有题目了",
+          icon: "error",
+        });
+        return;
+      }
+      if (type == "collection" && this.collectionList.length == 0) {
+        uni.showToast({
+          title: "没有题目了",
+          icon: "error",
+        });
+        return;
+      }
+
+      if (type == "wrong") {
+        query.questionIds = this.wrongList
+          .map((item) => {
+            return item.questionId;
+          })
+          .join(",");
+      } else if (type === "collection") {
+        query.questionIds = this.collectionList
+          .map((item) => {
+            return item.questionId;
+          })
+          .join(",");
+      }
+      uni.navigateTo({
+        url: "/otherPages/specifyExercise/index?" + utils.mapToUrlQuery(query),
+      });
+    },
     clearTopics(type) {
       let that = this;
       if (type === "wrong") {

+ 39 - 363
src/otherPages/exercise/index.vue

@@ -5,346 +5,20 @@
       <van-count-down :time="time"></van-count-down>
     </view> -->
     <view class="divider"></view>
-    <view class="problem-box">
-      <span class="problem-type">{{
-        problemList[problemListIndex].questionType | questionType
-      }}</span>
-      <!-- <text>{{ problemListIndex + 1 }}、</text> -->
-      <text class="problem-issue"
-        >{{ problemListIndex + 1 }}.{{
-          problemList[problemListIndex].issue
-        }}</text
+    <m-do-topic :trueNum.sync="trueNum" :falseNum.sync="falseNum" :query="query" :problemListIndex="problemListIndex"></m-do-topic>
+    <!-- <view class="function-list">
+      <div class="function-item">
+        <van-icon name="star-o" size="25px" />
+        <span>收藏</span>
+      </div>
+      <div
+        @click="readQuestion(problemList[problemListIndex].issuemp3)"
+        class="function-item"
       >
-      <view v-if="problemList[problemListIndex].image" class="problem-img">
-        <image
-          mode="widthFix"
-          :src="problemList[problemListIndex].image"
-        ></image>
-      </view>
-      <!-- 单选 -->
-      <!-- #ifdef MP-WEIXIN -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <van-radio-group
-          @change="changeRadioGroup"
-          :value="problemList[problemListIndex].userAnswer"
-        >
-          <van-radio
-            @change="changeCheckbox"
-            :value="item.value"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="item"
-          >
-            <text>{{ item.value }}</text>
-            <view
-              class="problem-op"
-              :class="{
-                'problem-op_selected': item.selected,
-              }"
-              slot="icon"
-              name="icon"
-              >{{ numberToLetter(index) }}</view
-            >
-          </van-radio>
-        </van-radio-group>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            size="75rpx"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="cancel"
-            size="75rpx"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-      <!-- 多选 -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <van-checkbox-group
-          @change="changeCheckboxGroup"
-          :value="problemList[problemListIndex].userAnswer"
-          :max="4"
-        >
-          <van-checkbox
-            @change="changeCheckbox"
-            :value="item.selected"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="item.value"
-          >
-            <text>{{ item.value }}</text>
-            <view
-              class="problem-op"
-              :class="{
-                'problem-op_selected': problemList[
-                  problemListIndex
-                ].userAnswer.includes(item.value),
-              }"
-              slot="icon"
-              name="icon"
-              >{{ numberToLetter(index) }}</view
-            >
-          </van-checkbox>
-        </van-checkbox-group>
-        <view class="flex-center">
-          <van-button
-            @click="confirmMult"
-            color="#498ef5"
-            round
-            custom-style="width:600rpx"
-            type="primary"
-            >确定</van-button
-          >
-        </view>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            size="75rpx"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="cancel"
-            size="75rpx"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-      <!-- #endif -->
-
-      <!-- 单选 -->
-      <!-- #ifdef MP-TOUTIAO -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <m-radio-group
-          @change="changeRadioGroup"
-          :value.sync="problemList[problemListIndex].userAnswer"
-        >
-          <m-radio
-            :value="item.value"
-            :item="item"
-            :useIconSlot="true"
-            :key="index"
-            :name="numberToLetter(index)"
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-          >
-          </m-radio>
-        </m-radio-group>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            color="#06c05f"
-            size="37"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="clear"
-            size="37"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-
-      <!-- #endif -->
-
-      <!-- 多选 -->
-      <!-- #ifdef MP-TOUTIAO -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <m-checkbox-group
-          @change="changeCheckboxGroup"
-          :value="problemList[problemListIndex].userAnswer"
-          :max="4"
-        >
-          <m-checkbox
-            @change="changeCheckbox"
-            :item="item"
-            :value="item.value"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="numberToLetter(index)"
-          >
-          </m-checkbox>
-        </m-checkbox-group>
-        <view class="flex-center">
-          <van-button
-            @click="confirmMult"
-            color="#498ef5"
-            round
-            custom-style="width:600rpx"
-            type="primary"
-            >确定</van-button
-          >
-        </view>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            color="#06c05f"
-            size="37"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="clear"
-            size="37"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green problem-op "
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-
-      <!-- #endif -->
-      <view class="function-list">
-        <div class="function-item">
-          <van-icon name="star-o" size="25px" />
-          <span>收藏</span>
-        </div>
-        <!-- <div class="function-item" @click="answerAudioPlay">
-      <m-icon type="a-dtda" size="25px" />
-      <span>读题+答案</span>
-    </div> -->
-        <div
-          @click="readQuestion(problemList[problemListIndex].issuemp3)"
-          class="function-item"
-        >
-          <van-icon name="bullhorn-o" size="25px" />
-          <span>读题</span>
-        </div>
-        <!-- <div class="function-item" @click="currentAnswerIndexBack">
-      <m-icon type="shangyiti" size="25px" />
-      <span>上一题</span>
-    </div>
-    <div class="function-item" @click="skillsShow = true">
-      <m-icon type="zongtishu" size="25px" />
-      <span>1/100</span>
-    </div>
-    <div class="function-item" @click="currentAnswerIndexGo">
-      <m-icon type="xiayiti" size="25px" />
-      <span>下一题</span>
-    </div> -->
-      </view>
-      <view
-        v-if="problemList[problemListIndex].isCompleted"
-        class="look-answer"
-      >
-        <view>答案是:{{ problemList[problemListIndex].answer }}</view>
-      </view>
-    </view>
+        <van-icon name="bullhorn-o" size="25px" />
+        <span>读题</span>
+      </div>
+    </view> -->
     <explainJs
       @close="
         () => {
@@ -469,6 +143,7 @@ import mRadio from "@/components/m-radio/m-radio.vue";
 import mRadioGroup from "@/components/m-radio-group/m-radio-group.vue";
 import mCheckbox from "@/components/m-checkbox/m-checkbox.vue";
 import mCheckboxGroup from "@/components/m-checkbox-group/m-checkbox-group.vue";
+import mDoTopic from "@/components/m-do-topic/m-do-topic.vue";
 export default {
   data() {
     return {
@@ -777,7 +452,6 @@ export default {
         this.trueNum = this.trueNum + 1;
       } else {
         this.falseNum = this.falseNum + 1;
-      
       }
     },
     changeRadioGroup(e) {
@@ -838,6 +512,7 @@ export default {
       //#endif
     },
     changeCheckbox(e) {
+      //specify
       // console.log(e);
     },
     numberToLetter(index) {
@@ -899,6 +574,7 @@ export default {
   },
 
   components: {
+    mDoTopic,
     navBar,
     explainJs,
     tabbar,
@@ -930,7 +606,28 @@ export default {
   justify-content: center;
   width: 100%;
 }
-
+.function-list {
+  width: 100%;
+  font-size: 13px;
+  display: flex;
+  justify-content: space-around;
+  flex-wrap: wrap;
+  padding: 15px;
+  box-sizing: border-box;
+  .function-item {
+    margin-bottom: 20px;
+    width: 30%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    font-size: 13px;
+    font-weight: 400;
+    color: #8a9099;
+    span {
+      margin-top: 5px;
+    }
+  }
+}
 .box {
   width: 100%;
   height: 100vh;
@@ -945,28 +642,7 @@ export default {
   .last-subject {
     transform: rotate(90deg);
   }
-  .function-list {
-    width: 100%;
-    font-size: 13px;
-    display: flex;
-    justify-content: space-around;
-    flex-wrap: wrap;
-    padding: 15px;
-    box-sizing: border-box;
-    .function-item {
-      margin-bottom: 20px;
-      width: 30%;
-      display: flex;
-      flex-direction: column;
-      align-items: center;
-      font-size: 13px;
-      font-weight: 400;
-      color: #8a9099;
-      span {
-        margin-top: 5px;
-      }
-    }
-  }
+
   .problem-select {
     display: flex;
     align-content: center;

+ 8 - 269
src/otherPages/mockExam/index.vue

@@ -5,255 +5,13 @@
       <van-count-down :time="time"></van-count-down>
     </view>
     <view class="divider"></view>
-    <view class="problem-box">
-      <span class="problem-type">{{
-        problemList[problemListIndex].questionType | questionType
-      }}</span>
-      <!-- <text>{{ problemListIndex + 1 }}、</text> -->
-      <text class="problem-issue"
-        >{{ problemListIndex + 1 }}.{{
-          problemList[problemListIndex].issue
-        }}</text
-      >
-      <view v-if="problemList[problemListIndex].image" class="problem-img">
-        <image
-          mode="widthFix"
-          :src="problemList[problemListIndex].image"
-        ></image>
-      </view>
-      <!-- #ifdef MP-WEIXIN -->
-      <!-- 单项选择 -->
-      <view
-        v-if="problemList[problemListIndex].questionType < 3"
-        class="problem-ops"
-      >
-        <van-radio-group
-          :value="problemList[problemListIndex].userAnswer"
-          :max="1"
-          @change="changeRadioGroup"
-        >
-          <van-radio
-            :value="problemList[problemListIndex].userAnswer === item.value"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="item.value"
-          >
-            <text>{{ item.value }}</text>
-            <view
-              class="problem-op"
-              :class="{
-                'problem-op_selected':
-                  problemList[problemListIndex].userAnswer === item.value,
-              }"
-              slot="icon"
-              >{{ numberToLetter(index) }}</view
-            >
-          </van-radio>
-        </van-radio-group>
-      </view>
-
-      <!-- 多项选择 -->
-      <view
-        v-if="problemList[problemListIndex].questionType == 3"
-        class="problem-ops"
-      >
-        <van-checkbox-group
-          :value="problemList[problemListIndex].userAnswer"
-          :max="4"
-          @change="changeCheckboxGroup"
-        >
-          <van-checkbox
-            :value="
-              problemList[problemListIndex].userAnswer.includes(item.value)
-            "
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="item.value"
-          >
-            <text>{{ item.value }}</text>
-            <view
-              class="problem-op"
-              :class="{
-                'problem-op_selected': item.selected,
-              }"
-              slot="icon"
-              >{{ numberToLetter(index) }}</view
-            >
-          </van-checkbox>
-        </van-checkbox-group>
-      </view>
-      <!-- #endif -->
-
-      <!-- 单选 -->
-      <!-- #ifdef MP-TOUTIAO -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <m-radio-group
-          @change="changeRadioGroup"
-          :value.sync="problemList[problemListIndex].userAnswer"
-        >
-          <m-radio
-            :value="item.value"
-            :item="item"
-            :useIconSlot="true"
-            :key="index"
-            :name="numberToLetter(index)"
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-          >
-          </m-radio>
-        </m-radio-group>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            color="#06c05f"
-            size="37"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="clear"
-            size="37"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <view style="width: 8px"></view>
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-
-      <!-- 多选 -->
-
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <m-checkbox-group
-          @change="changeCheckboxGroup"
-          :value="problemList[problemListIndex].userAnswer"
-          :max="4"
-        >
-          <m-checkbox
-            @change="changeCheckbox"
-            :item="item"
-            :value="item.value"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="numberToLetter(index)"
-          >
-          </m-checkbox>
-        </m-checkbox-group>
-        <view class="flex-center">
-          <van-button
-            @click="confirmMult"
-            color="#498ef5"
-            round
-            custom-style="width:600rpx"
-            type="primary"
-            >确定</van-button
-          >
-        </view>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            color="#06c05f"
-            size="37"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="clear"
-            size="37"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <view style="width: 8px"></view>
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-
-      <!-- #endif -->
-      <view class="function-list">
-        <div class="function-item">
-          <van-icon name="star-o" size="25px" />
-          <span>收藏</span>
-        </div>
-        <!-- <div class="function-item" @click="answerAudioPlay">
-      <m-icon type="a-dtda" size="25px" />
-      <span>读题+答案</span>
-    </div> -->
-        <div
-          @click="readQuestion(problemList[problemListIndex].issuemp3)"
-          class="function-item"
-        >
-          <van-icon name="bullhorn-o" size="25px" />
-          <span>读题</span>
-        </div>
-        <!-- <div class="function-item" @click="currentAnswerIndexBack">
-      <m-icon type="shangyiti" size="25px" />
-      <span>上一题</span>
-    </div>
-    <div class="function-item" @click="skillsShow = true">
-      <m-icon type="zongtishu" size="25px" />
-      <span>1/100</span>
-    </div>
-    <div class="function-item" @click="currentAnswerIndexGo">
-      <m-icon type="xiayiti" size="25px" />
-      <span>下一题</span>
-    </div> -->
-      </view>
-    </view>
+    <m-do-topic
+      :hiddenFunction="true"
+      :trueNum.sync="trueNum"
+      :falseNum.sync="falseNum"
+      :query="query"
+      :problemListIndex="problemListIndex"
+    ></m-do-topic>
     <!-- #ifdef MP-WEIXIN -->
     <van-tabbar>
       <van-tabbar-item @click="goBeforeTopics"
@@ -497,26 +255,7 @@ export default {
       let that = this;
       let scorePerQuestion = 0;
       query.subject === "4" ? (scorePerQuestion = 2) : (scorePerQuestion = 1);
-      this.problemList.forEach((item, index) => {
-        if (
-          typeof item.userAnswer == "object" &&
-          Array.isArray(item.userAnswer)
-        ) {
-          let answerArr = item.answer.split("-");
-          answerArr = answerArr.sort();
-          let userAnswer = item.userAnswer.sort();
-          if (index > 39) {
-            console.log(answerArr, userAnswer);
-          }
-          if (answerArr.join("-") === userAnswer.join("-")) {
-            score = score + scorePerQuestion;
-          }
-        } else if (typeof item.userAnswer == "string") {
-          item.answer === item.userAnswer
-            ? (score = score + scorePerQuestion)
-            : "";
-        }
-      });
+      score = this.trueNum*scorePerQuestion
       uni.showModal({
         title: "是否交卷",
         content: "交卷后不可再修改了",

+ 0 - 42
src/otherPages/specifyExercise/components/m-checkbox-group.vue

@@ -1,42 +0,0 @@
-<template>
-  <view class="checkboxGroup">
-    <view @tap.native="changeCheckboxGroup">
-      <slot></slot>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  data() {
-    return {};
-  },
-  methods: {
-    changeCheckboxGroup(e) {
-      console.log(e);
-      e.detail = e.target.dataset.item;
-      this.$emit("update:value", e.target.dataset.value);
-      this.$emit("change", e);
-    },
-  },
-  props: {
-    useIconSlot: {
-      type: Boolean,
-      default: false,
-    },
-    name: {
-      type: String,
-      default: "",
-    },
-    value: {
-      type: String,
-      default: "",
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.checkboxGroup {
-}
-</style>

+ 0 - 62
src/otherPages/specifyExercise/components/m-checkbox.vue

@@ -1,62 +0,0 @@
-<template>
-  <view @tap.native="clickCheckbox" :data-item="item" class="checkbox">
-    <view :data-item="item" class="custom-icon" v-if="useIconSlot">{{
-      name
-    }}</view>
-    <view :data-item="item" style="width: 8px"></view>
-    <text :data-item="item">{{ item.value }}</text>
-  </view>
-</template>
-
-<script>
-export default {
-  data() {
-    return {};
-  },
-  methods: {
-    stopClick(e) {
-      e.stopPropagation();
-    },
-    clickCheckbox(e) {
-      console.log(e);
-      this.$emit("clickcheckbox", e);
-      e.stopPropagation();
-    },
-  },
-  props: {
-    useIconSlot: {
-      type: Boolean,
-      default: false,
-    },
-    name: {
-      type: String,
-      default: "",
-    },
-    item: {
-      type: Object,
-      default: () => {
-        return {};
-      },
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.checkbox {
-  display: flex;
-  align-content: center;
-  align-items: center;
-  padding: 8px 0;
-}
-.custom-icon {
-  width: 75rpx;
-  height: 75rpx;
-  line-height: 75rpx;
-  border-radius: 50%;
-  text-align: center;
-  overflow: hidden;
-  background: #fff;
-  box-shadow: 0px 4rpx 12rpx rgba(0, 0, 0, 0.16);
-}
-</style>

+ 0 - 42
src/otherPages/specifyExercise/components/m-radio-group.vue

@@ -1,42 +0,0 @@
-<template>
-  <view class="radioGroup">
-    <view @tap.native="changeRadioGroup">
-      <slot></slot>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  data() {
-    return {};
-  },
-  methods: {
-    changeRadioGroup(e) {
-      console.log(e);
-      e.detail = e.target.dataset.item;
-      this.$emit("update:value", e.target.dataset.value);
-      this.$emit("change", e);
-    },
-  },
-  props: {
-    useIconSlot: {
-      type: Boolean,
-      default: false,
-    },
-    name: {
-      type: String,
-      default: "",
-    },
-    value: {
-      type: String,
-      default: "",
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.radioGroup {
-}
-</style>

+ 0 - 62
src/otherPages/specifyExercise/components/m-radio.vue

@@ -1,62 +0,0 @@
-<template>
-  <view @tap.native="clickRadio" :data-item="item" class="radio">
-    <view :data-item="item" class="custom-icon" v-if="useIconSlot">{{
-      name
-    }}</view>
-    <view :data-item="item" style="width: 8px"></view>
-    <text :data-item="item">{{ item.value }}</text>
-  </view>
-</template>
-
-<script>
-export default {
-  data() {
-    return {};
-  },
-  methods: {
-    stopClick(e) {
-      e.stopPropagation();
-    },
-    clickRadio(e) {
-      console.log(e);
-      this.$emit("clickRadio", e);
-      e.stopPropagation();
-    },
-  },
-  props: {
-    useIconSlot: {
-      type: Boolean,
-      default: false,
-    },
-    name: {
-      type: String,
-      default: "",
-    },
-    item: {
-      type: Object,
-      default: () => {
-        return {};
-      },
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.radio {
-  display: flex;
-  align-content: center;
-  align-items: center;
-  padding: 8px 0;
-}
-.custom-icon {
-  width: 75rpx;
-  height: 75rpx;
-  line-height: 75rpx;
-  border-radius: 50%;
-  text-align: center;
-  overflow: hidden;
-  background: #fff;
-  box-shadow: 0px 4rpx 12rpx rgba(0, 0, 0, 0.16);
-}
-</style>

+ 37 - 404
src/otherPages/specifyExercise/index.vue

@@ -5,346 +5,15 @@
       <van-count-down :time="time"></van-count-down>
     </view> -->
     <view class="divider"></view>
-    <view class="problem-box">
-      <span class="problem-type">{{
-        problemList[problemListIndex].questionType | questionType
-      }}</span>
-      <!-- <text>{{ problemListIndex + 1 }}、</text> -->
-      <text class="problem-issue"
-        >{{ problemListIndex + 1 }}.{{
-          problemList[problemListIndex].issue
-        }}</text
-      >
-      <view v-if="problemList[problemListIndex].image" class="problem-img">
-        <image
-          mode="widthFix"
-          :src="problemList[problemListIndex].image"
-        ></image>
-      </view>
-      <!-- 单选 -->
-      <!-- #ifdef MP-WEIXIN -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <van-radio-group
-          @change="changeRadioGroup"
-          :value="problemList[problemListIndex].userAnswer"
-        >
-          <van-radio
-            @change="changeCheckbox"
-            :value="item.value"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="item"
-          >
-            <text>{{ item.value }}</text>
-            <view
-              class="problem-op"
-              :class="{
-                'problem-op_selected': item.selected,
-              }"
-              slot="icon"
-              name="icon"
-              >{{ numberToLetter(index) }}</view
-            >
-          </van-radio>
-        </van-radio-group>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            size="75rpx"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="cancel"
-            size="75rpx"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-      <!-- 多选 -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <van-checkbox-group
-          @change="changeCheckboxGroup"
-          :value="problemList[problemListIndex].userAnswer"
-          :max="4"
-        >
-          <van-checkbox
-            @change="changeCheckbox"
-            :value="item.selected"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="item.value"
-          >
-            <text>{{ item.value }}</text>
-            <view
-              class="problem-op"
-              :class="{
-                'problem-op_selected': problemList[
-                  problemListIndex
-                ].userAnswer.includes(item.value),
-              }"
-              slot="icon"
-              name="icon"
-              >{{ numberToLetter(index) }}</view
-            >
-          </van-checkbox>
-        </van-checkbox-group>
-        <view class="flex-center">
-          <van-button
-            @click="confirmMult"
-            color="#498ef5"
-            round
-            custom-style="width:600rpx"
-            type="primary"
-            >确定</van-button
-          >
-        </view>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            size="75rpx"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="cancel"
-            size="75rpx"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-      <!-- #endif -->
-
-      <!-- 单选 -->
-      <!-- #ifdef MP-TOUTIAO -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <m-radio-group
-          @change="changeRadioGroup"
-          :value.sync="problemList[problemListIndex].userAnswer"
-        >
-          <m-radio
-            :value="item.value"
-            :item="item"
-            :useIconSlot="true"
-            :key="index"
-            :name="numberToLetter(index)"
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-          >
-          </m-radio>
-        </m-radio-group>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType < 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            color="#06c05f"
-            size="37"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="clear"
-            size="37"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green"
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-
-      <!-- #endif -->
+    <m-do-topic
+      type="wrong"
+      :trueNum.sync="trueNum"
+      :falseNum.sync="falseNum"
+      :query="query"
+      :problemListTotal.sync="problemListTotal"
+      :problemListIndex="problemListIndex"
+    ></m-do-topic>
 
-      <!-- 多选 -->
-      <!-- #ifdef MP-TOUTIAO -->
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          !problemList[problemListIndex].isCompleted
-        "
-        class="problem-ops"
-      >
-        <m-checkbox-group
-          @change="changeCheckboxGroup"
-          :value="problemList[problemListIndex].userAnswer"
-          :max="4"
-        >
-          <m-checkbox
-            @change="changeCheckbox"
-            :item="item"
-            :value="item.value"
-            class="problem-checkbox"
-            use-icon-slot
-            v-for="(item, index) in problemList[problemListIndex].optsArr"
-            :key="index"
-            :name="numberToLetter(index)"
-          >
-          </m-checkbox>
-        </m-checkbox-group>
-        <view class="flex-center">
-          <van-button
-            @click="confirmMult"
-            color="#498ef5"
-            round
-            custom-style="width:600rpx"
-            type="primary"
-            >确定</van-button
-          >
-        </view>
-      </view>
-      <view
-        v-if="
-          problemList[problemListIndex].questionType == 3 &&
-          problemList[problemListIndex].isCompleted
-        "
-      >
-        <view
-          v-for="(item, index) in problemList[problemListIndex].optsArr"
-          :key="index"
-          class="problem-select"
-        >
-          <icon
-            v-if="item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="success"
-            color="#06c05f"
-            size="37"
-          ></icon>
-          <icon
-            v-if="!item.isAnswer && item.selected"
-            class="icon-box-img"
-            type="clear"
-            size="37"
-          ></icon>
-          <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
-            numberToLetter(index)
-          }}</text>
-          <text
-            v-if="item.isAnswer && !item.selected"
-            class="problem-op_green problem-op "
-            >{{ numberToLetter(index) }}</text
-          >
-          <text class="problem-opAnswer">{{ item.value }}</text>
-        </view>
-      </view>
-
-      <!-- #endif -->
-      <view class="function-list">
-        <div class="function-item">
-          <van-icon name="star-o" size="25px" />
-          <span>收藏</span>
-        </div>
-        <!-- <div class="function-item" @click="answerAudioPlay">
-      <m-icon type="a-dtda" size="25px" />
-      <span>读题+答案</span>
-    </div> -->
-        <div
-          @click="readQuestion(problemList[problemListIndex].issuemp3)"
-          class="function-item"
-        >
-          <van-icon name="bullhorn-o" size="25px" />
-          <span>读题</span>
-        </div>
-        <!-- <div class="function-item" @click="currentAnswerIndexBack">
-      <m-icon type="shangyiti" size="25px" />
-      <span>上一题</span>
-    </div>
-    <div class="function-item" @click="skillsShow = true">
-      <m-icon type="zongtishu" size="25px" />
-      <span>1/100</span>
-    </div>
-    <div class="function-item" @click="currentAnswerIndexGo">
-      <m-icon type="xiayiti" size="25px" />
-      <span>下一题</span>
-    </div> -->
-      </view>
-      <view
-        v-if="problemList[problemListIndex].isCompleted"
-        class="look-answer"
-      >
-        <view>答案是:{{ problemList[problemListIndex].answer }}</view>
-      </view>
-    </view>
     <explainJs
       @close="
         () => {
@@ -465,10 +134,7 @@ import api from "@/api/index";
 import utils from "@/utils/index";
 import explainJs from "./components/explainJs.vue";
 import tabbar from "./components/tabbar.vue";
-import mRadio from "@/components/m-radio/m-radio.vue";
-import mRadioGroup from "@/components/m-radio-group/m-radio-group.vue";
-import mCheckbox from "@/components/m-checkbox/m-checkbox.vue";
-import mCheckboxGroup from "@/components/m-checkbox-group/m-checkbox-group.vue";
+import mDoTopic from "@/components/m-do-topic/m-do-topic.vue";
 export default {
   data() {
     return {
@@ -580,7 +246,6 @@ export default {
   methods: {
     touchStart(e) {
       var that = this;
-
       (this.touchx = e.changedTouches[0].clientX),
         (this.touchy = e.changedTouches[0].clientY);
     },
@@ -688,7 +353,7 @@ export default {
       this.problemListIndex = this.problemListIndex - 1;
     },
     goNextTopics() {
-      if (this.problemListIndex >= this.problemList.length - 1) {
+      if (this.problemListIndex >= this.problemListTotal-1) {
         uni.showToast({
           title: "到底了",
           icon: "none",
@@ -777,7 +442,6 @@ export default {
         this.trueNum = this.trueNum + 1;
       } else {
         this.falseNum = this.falseNum + 1;
-      
       }
     },
     changeRadioGroup(e) {
@@ -838,6 +502,7 @@ export default {
       //#endif
     },
     changeCheckbox(e) {
+      //specify
       // console.log(e);
     },
     numberToLetter(index) {
@@ -848,36 +513,7 @@ export default {
   onLoad(query) {
     let that = this;
     this.query = query;
-    api.exam
-      .studentQuestionInfoList({
-        ...this.query,
-      })
-      .then((res) => {
-        res.rows.forEach((element) => {
-          element.optsArr = [];
-          element.opts.split("-").forEach((item, index) => {
-            if (element.questionType == 3) {
-              element.optsArr.push({
-                selected: false,
-                value: item,
-                index: index,
-                isAnswer: element.answer.split("-").includes(item),
-              });
-            } else {
-              element.optsArr.push({
-                selected: false,
-                value: item,
-                index: index,
-                isAnswer: item === element.answer,
-              });
-            }
-          });
-          element.isCompleted = false;
-          element.userAnswer = [];
-        });
-        that.problemListTotal = res.total;
-        that.problemList = res.rows;
-      });
+
   },
   computed: {
     //liceCar=1&liceTruck=&liceBus=&liceMoto=&name=科目一&cert=C1/C2/C3&vehicle=轿车&subject=1&title=顺序练习&sort=3
@@ -887,7 +523,7 @@ export default {
         this.query.classIssueName ||
         this.query.placeIssueName ||
         this.query.excellIssueName ||
-        this.query.sequeIssueName
+        this.query.sequeIssueName||""
       }`;
     },
   },
@@ -899,13 +535,10 @@ export default {
   },
 
   components: {
+    mDoTopic,
     navBar,
     explainJs,
     tabbar,
-    mRadio,
-    mRadioGroup,
-    mCheckbox,
-    mCheckboxGroup,
   },
 };
 </script>
@@ -930,7 +563,28 @@ export default {
   justify-content: center;
   width: 100%;
 }
-
+.function-list {
+  width: 100%;
+  font-size: 13px;
+  display: flex;
+  justify-content: space-around;
+  flex-wrap: wrap;
+  padding: 15px;
+  box-sizing: border-box;
+  .function-item {
+    margin-bottom: 20px;
+    width: 30%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    font-size: 13px;
+    font-weight: 400;
+    color: #8a9099;
+    span {
+      margin-top: 5px;
+    }
+  }
+}
 .box {
   width: 100%;
   height: 100vh;
@@ -945,28 +599,7 @@ export default {
   .last-subject {
     transform: rotate(90deg);
   }
-  .function-list {
-    width: 100%;
-    font-size: 13px;
-    display: flex;
-    justify-content: space-around;
-    flex-wrap: wrap;
-    padding: 15px;
-    box-sizing: border-box;
-    .function-item {
-      margin-bottom: 20px;
-      width: 30%;
-      display: flex;
-      flex-direction: column;
-      align-items: center;
-      font-size: 13px;
-      font-weight: 400;
-      color: #8a9099;
-      span {
-        margin-top: 5px;
-      }
-    }
-  }
+
   .problem-select {
     display: flex;
     align-content: center;

+ 10 - 0
src/pages.json

@@ -163,6 +163,10 @@
           "path": "marked/index",
           "styles": {}
         },
+        {
+          "path": "specifyExercise/index",
+          "styles": {}
+        },
         {
           "path": "code/index",
           "styles": {}
@@ -376,6 +380,12 @@
         "name": "练习",
         "path": "otherPages/exercise/index",
         "query": "liceCar=1&liceTruck=&liceBus=&liceMoto=&name=科目一&cert=C1/C2/C3&vehicle=轿车&subject=4&title=顺序练习&sort=3&excellIssueName=新增题库"
+      },
+      {
+        "name":"指定的练习",
+        "path": "otherPages/specifyExercise/index",
+        "query":"liceCar=1&liceTruck=&liceBus=&liceMoto=&name=%E7%A7%91%E7%9B%AE%E4%B8%80&gs=xc&cert=C1%2FC2%2FC3&vehicle=%E8%BD%BF%E8%BD%A6&subject=1&title=%E7%B2%BE%E9%80%89%E8%80%83%E9%A2%98&sort=3&__id__=1"
+
       }
     ]
   }