JXDS18FUJT 2 سال پیش
والد
کامیت
01967603f7

+ 98 - 20
src/components/m-do-topic/m-do-topic.vue

@@ -49,9 +49,6 @@
         problemList[problemListIndex].issue
       }}</text>
       <view v-if="problemList[problemListIndex].image" class="problem-img">
-        <canvas>
-
-        </canvas>
         <image mode="widthFix" :src="problemList[problemListIndex].image"></image>
       </view>
       <view v-if="!hiddenFunction" class="funcicon-list">
@@ -66,10 +63,12 @@
             name="star" size="10px" />
           <span>收藏</span>
         </view>
-        <view v-if="midFunc.includes('readQuestionAndAnswer')" @click="
-          readQuestionAndAnswer();
-        completeQuestion();
-                                                                      " class="funcicon-item funcicon-item_select">
+        <view v-if="midFunc.includes('readQuestionAndAnswer')"
+          @click="
+            readQuestionAndAnswer();
+          completeQuestion();
+                                                                                                                                                                        "
+          class="funcicon-item funcicon-item_select">
           <m-jp-icon style="margin-right: 8rpx" type="a-dtda" size="10px" />
           <span>读题+答案</span>
         </view>
@@ -117,7 +116,8 @@
           <text v-if="!item.isAnswer && !item.selected" class="problem-op problem-fontsize">{{
             numberToLetter(index)
           }}</text>
-          <text v-if="item.isAnswer && !item.selected" class="problem-op problem-op_green problem-fontsize">{{ numberToLetter(index)
+          <text v-if="item.isAnswer && !item.selected" class="problem-op problem-op_green problem-fontsize">{{
+            numberToLetter(index)
           }}</text>
           <view style="width: 8px"></view>
           <text style="font-weight: 500" class="problem-opAnswer problem-fontsize">{{
@@ -158,7 +158,8 @@
           <text v-if="!item.isAnswer && !item.selected" class="problem-op problem-fontsize">{{
             numberToLetter(index)
           }}</text>
-          <text v-if="item.isAnswer && !item.selected" class="problem-op problem-op_green problem-fontsize">{{ numberToLetter(index)
+          <text v-if="item.isAnswer && !item.selected" class="problem-op problem-op_green problem-fontsize">{{
+            numberToLetter(index)
           }}</text>
           <view style="width: 8px"></view>
           <text class="problem-opAnswer problem-fontsize">{{ item.value }}</text>
@@ -269,10 +270,12 @@
           答案: {{ problemList[problemListIndex].answer }}
         </view>
       </view>
-      <funList :midFunc="midFunc" v-if="!hiddenFunction" @collect="collectTopics" @readQuestionAndAnswer="
-        readQuestionAndAnswer();
-      completeQuestion();
-                                                        " :problemListItem="problemList[problemListIndex]"></funList>
+      <funList :midFunc="midFunc" v-if="!hiddenFunction" @collect="collectTopics"
+        @readQuestionAndAnswer="
+          readQuestionAndAnswer();
+        completeQuestion();
+                                                                                                                                  " :problemListItem="problemList[problemListIndex]">
+      </funList>
 
       <!-- #endif -->
       <view v-if="!hiddenFunction" class="function-list">
@@ -603,6 +606,13 @@ export default {
         audio.src = this.problemList[this.problemListIndex].issuemp3;
         audio.play();
       }
+      if (this.allowMemory) {
+        let key = `${this.query.cert}_${this.query.subject == 1 ? '科目一' : '科目四'}_${this.query.title}_${this.query.classIssueName ||
+          this.query.placeIssueName ||
+          this.query.excellIssueName ||
+          this.query.sequeIssueName}`
+        uni.setStorageSync(key, this.problemListIndex)
+      }
     },
   },
   methods: {
@@ -1012,6 +1022,10 @@ export default {
       type: Boolean,
       default: false,
     },
+    allowMemory: {
+      type: Boolean,
+      default: false,
+    },
     hiddenFunction: {
       type: Boolean,
       default: false,
@@ -1044,6 +1058,25 @@ export default {
     uni.showLoading({
       title: "加载题目中",
     });
+    //记忆题目
+    let key = `${this.query.cert}_${this.query.subject == 1 ? '科目一' : '科目四'}_${this.query.title}_${this.query.classIssueName ||
+      this.query.placeIssueName ||
+      this.query.excellIssueName ||
+      this.query.sequeIssueName}`
+    // if (this.allowMemory && uni.getStorageSync(key)) {
+    //   uni.showModal({
+    //     title:"回到上次的题目",
+    //     content:`你上次做到第${uni.getStorageSync(key)}题,是否前往`,
+    //     success(res){
+    //       if(res.confirm){
+    //         this.problemListIndex = Number(uni.getStorageSync(key))
+    //       }
+    //     }
+    //   })
+
+    // }
+
+
     switch (that.type) {
       case "specify":
         api.exam
@@ -1076,11 +1109,25 @@ export default {
             });
             that.problemListTotal = res.total;
             origProblemList = JSON.parse(JSON.stringify(res.rows));
-
             that.problemList = res.rows;
-
             that.$emit("update:problemListTotal", res.total);
             uni.hideLoading();
+            if (this.allowMemory && uni.getStorageSync(key)) {
+              uni.showModal({
+                title: "回到上次的题目",
+                content: `你上次做到第${uni.getStorageSync(key) + 1}题,是否前往`,
+                success: res => {
+                  if (res.confirm) {
+                    this.$emit("update:problemListIndex", uni.getStorageSync(key));
+
+                  }
+                  else {
+                    uni.setStorageSync(key, 0)
+                  }
+                }
+              })
+
+            }
           });
 
         break;
@@ -1121,6 +1168,21 @@ export default {
 
             that.$emit("update:problemListTotal", res.total);
             uni.hideLoading();
+            if (this.allowMemory && uni.getStorageSync(key)) {
+              uni.showModal({
+                title: "回到上次的题目",
+                content: `你上次做到第${uni.getStorageSync(key) + 1}题,是否前往`,
+                success: res => {
+                  if (res.confirm) {
+                    this.$emit("update:problemListIndex", uni.getStorageSync(key));
+                  }
+                  else {
+                    uni.setStorageSync(key, 0)
+                  }
+                }
+              })
+
+            }
           });
 
         break;
@@ -1310,6 +1372,21 @@ export default {
             origProblemList = JSON.parse(JSON.stringify(res.rows));
             that.$emit("update:problemListTotal", res.total);
             uni.hideLoading();
+            if (this.allowMemory && uni.getStorageSync(key)) {
+              uni.showModal({
+                title: "回到上次的题目",
+                content: `你上次做到第${uni.getStorageSync(key) + 1}题,是否前往`,
+                success: res => {
+                  if (res.confirm) {
+                    this.$emit("update:problemListIndex", uni.getStorageSync(key));
+                  }
+                  else {
+                    uni.setStorageSync(key, 0)
+                  }
+                }
+              })
+
+            }
           });
         break;
     }
@@ -1480,7 +1557,7 @@ export default {
   height: 100vh;
   align-content: flex-end;
   align-items: flex-end;
-  
+
 
 
   .problem-index {
@@ -1490,7 +1567,7 @@ export default {
     border-top-right-radius: 16rpx;
     border-top-left-radius: 16rpx;
     padding-top: 50rpx;
-    -webkit-overflow-scrolling:touch;
+    -webkit-overflow-scrolling: touch;
 
   }
 
@@ -1553,12 +1630,12 @@ export default {
     height: 480rpx;
     padding-top: 30rpx;
     overflow-y: scroll;
-    -webkit-overflow-scrolling:touch;
+    -webkit-overflow-scrolling: touch;
 
     .problem-listBody {
       display: inline-block;
       overflow-y: scroll;
-      -webkit-overflow-scrolling:touch;
+      -webkit-overflow-scrolling: touch;
 
       .problem-listItem {
         display: inline-block;
@@ -1761,4 +1838,5 @@ export default {
       margin-top: 5px;
     }
   }
-}</style>
+}
+</style>

+ 1 - 0
src/otherPages/exercise/index.vue

@@ -11,6 +11,7 @@
       :trueNum.sync="trueNum"
       :falseNum.sync="falseNum"
       :query="query"
+      allowMemory
       :problemListTotal.sync="problemListTotal"
       :problemListIndex.sync="problemListIndex"
       

+ 1 - 0
src/otherPages/exerciseExam/index.vue

@@ -15,6 +15,7 @@
       :trueNum.sync="trueNum"
       :falseNum.sync="falseNum"
       :query="query"
+      :allowMemory="false"
       :problemListIndex.sync="problemListIndex"
       :problemListTotal.sync="problemListTotal"
     ></m-do-topic>

+ 4 - 2
src/pages/carVideo/index.vue

@@ -104,12 +104,14 @@
         <view @click="() => {
           active = 0
         }" class="subject-tabs">
-          科目一
+          <span v-if="active == 0">科目一</span>
+          <span style="color: #498EF5;" v-else>科目一</span>
         </view>
         <view @click="() => {
           active = 1
         }" class="subject-tabs">
-          科目四
+           <span v-if="active == 1">科目四</span>
+          <span style="color: #498EF5;" v-else>科目四</span>
         </view>
       </view>
 

+ 2 - 2
src/pages/user/index.vue

@@ -52,12 +52,12 @@
 
       <!-- #endif -->
       <!-- #ifdef MP-WEIXIN -->
-
+<!-- 
       <van-cell title-class="uni-app-fontsize-paragraph" title="反馈帮助" is-link center url="/pages/extraWeb/index?src=https://support.qq.com/product/359609">
         <template #icon>
           <m-icon type="fkbz" class="cell-icon" />
         </template>
-      </van-cell>
+      </van-cell> -->
 
       <!-- #endif -->
     </div>