فهرست منبع

做题模块开发中

zhangyujun 3 سال پیش
والد
کامیت
a6d1afd287
1فایلهای تغییر یافته به همراه14 افزوده شده و 12 حذف شده
  1. 14 12
      src/otherPages/exercise/index.vue

+ 14 - 12
src/otherPages/exercise/index.vue

@@ -27,10 +27,8 @@
       >
         <van-radio-group
           :value="problemList[problemListIndex].userAnswer"
-          :max="1"
-          @change="changeGroup"
         >
-          <van-radio
+                <van-radio
             @change="changeCheckbox"
             :value="
               problemList[problemListIndex].userAnswer.includes(
@@ -43,7 +41,7 @@
             :key="index"
             :name="item"
           >
-            <text class="">{{ item }}</text>
+            <text>{{ item }}</text>
             <view
               class="problem-op"
               :class="{
@@ -67,7 +65,7 @@
           :key="index"
           class="problem-select"
         >
-          <icon class="icon-box-img" type="success" size="75rpx"></icon>
+          <icon class="icon-box-img" type="success" size="70rpx"></icon>
           <text class="problem-opAnswer">{{ numberToLetter(index) }}</text>
         </view>
       </view>
@@ -194,6 +192,7 @@ export default {
         {
           selected: false,
           value: "",
+          isAnswer: false,
         },
       ],
       time: 45 * 60 * 1000,
@@ -359,12 +358,9 @@ export default {
         globalAudio.play();
       }
     },
-    changeGroup(e) {
-      this.$set(
-        this.problemList[this.problemListIndex],
-        "userAnswer",
-        e.detail
-      );
+    changeRadioGroup(e) {
+    //   console.log(e);
+    //   this.$set(this.problemList[this.problemListIndex], "isCompleted", true);
     },
     changeCheckbox(e) {
       console.log(e);
@@ -384,7 +380,7 @@ export default {
       .then((res) => {
         res.rows.forEach((element) => {
           element.optsArr = element.opts.split("-");
-          element.isCompleted = true;
+          element.isCompleted = false;
           element.userAnswer = [];
         });
         that.problemListTotal = res.total;
@@ -403,6 +399,12 @@ export default {
       }`;
     },
   },
+  watch: {
+    problemListIndex: {
+      handler(newValue, oldValue) {},
+      immediate: true,
+    },
+  },
 
   components: {
     navBar,