Эх сурвалжийг харах

修复了错题的bug,错题改为保存在本地

JXDS18FUJT 2 жил өмнө
parent
commit
7413616954

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 654 - 250
src/components/m-do-topic/m-do-topic.vue


+ 44 - 14
src/otherPages/collection/index.vue

@@ -9,7 +9,7 @@
         style="
           background-image: url('https://ct.zzxcx.net/ctjk/mp-wx/collection/wrongBg1.png');
         "
-        @click="goExercise('wrong')"
+        @tap.stop="goExercise('wrong')"
       >
         <span class="choose-text1"> 做错题 </span>
         <view class="choose-text2"> 共 {{ wrongListCount }} 题 </view>
@@ -18,7 +18,7 @@
         <view
           :hover-stop-propagation="true"
           data-type="wrong"
-          @touchend.stop="clearTopics('wrong')"
+          @tap.stop="clearTopics('wrong')"
           style="color: #498ef5"
           class="clear"
         >
@@ -30,7 +30,7 @@
         style="
           background-image: url('https://ct.zzxcx.net/ctjk/mp-wx/collection/collectionBg1.png');
         "
-        @click="goExercise('collect')"
+        @tap.stop="goExercise('collect')"
       >
         <span class="choose-text1">收藏题</span>
         <span class="choose-text2"> 共 {{ collectionListCount }} 题 </span>
@@ -39,7 +39,7 @@
         <view
           :hover-stop-propagation="true"
           data-type="collect"
-          @touchend.stop="clearTopics('collect')"
+          @tap.stop="clearTopics('collect')"
           style="color: #01c18d"
           class="clear"
         >
@@ -47,6 +47,16 @@
         </view>
       </view>
     </view>
+    <view style="padding-bottom: 20rpx">
+      <view @click="syncWrongQuestion" class="sync">
+        <image
+          style="width: 36rpx;margin-right:15rpx"
+          mode="widthFix"
+          src="https://ct.zzxcx.net/ctjk/mp-wx/collection/syncIcon.png"
+        ></image>
+        <text>同步收藏错题</text>
+      </view>
+    </view>
     <view class="wxad">
       <ad
         :ad-intervals="100"
@@ -94,16 +104,18 @@ export default {
   },
   onLoad(query) {
     this.query = query;
-    api.exam
-      .studentQuestionWrongWrongCountByUser({
-        carType: this.gsMap[query.gs],
-        km: query.subject === "1" ? "科目一" : "科目四",
-        pageNum: 1,
-        pageSize: 10000,
-      })
-      .then((res) => {
-        this.wrongListCount = res.data;
-      });
+    let userWrongIds = uni.getStorageSync("userWrongIds") || [];
+    this.wrongListCount = userWrongIds.length;
+    // api.exam
+    //   .studentQuestionWrongWrongCountByUser({
+    //     carType: this.gsMap[query.gs],
+    //     km: query.subject === "1" ? "科目一" : "科目四",
+    //     pageNum: 1,
+    //     pageSize: 10000,
+    //   })
+    //   .then((res) => {
+    //     this.wrongListCount = res.data;
+    //   });
     api.exam
       .studentQuestionCollectionCollectionCountByUser({
         carType: this.gsMap[query.gs],
@@ -116,6 +128,12 @@ export default {
       });
   },
   methods: {
+    syncWrongQuestion(){
+      api.exam.studentQuestionWrongWrongByUser().then(res=>{
+        console.log(res)
+      })
+
+    },
     goExercise(type) {
       let query = Object.assign({}, this.query);
       if (type == "wrong" && this.wrongListCount == 0) {
@@ -204,6 +222,18 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.sync {
+  width: 690rpx;
+  height: 90rpx;
+  background: #498ef5;
+  border-radius: 80rpx 80rpx 80rpx 80rpx;
+  opacity: 1;
+  display: flex;
+  justify-content: center;
+  align-content: center;
+  align-items: center;
+  color: #fff;
+}
 .bottom {
   bottom: 0;
   image {

+ 1 - 1
src/otherPages/exerciseWrong/index.vue

@@ -13,7 +13,7 @@
       :falseNum.sync="falseNum"
       :query="query"
       :problemListTotal.sync="problemListTotal"
-      :problemListIndex="problemListIndex"
+      :problemListIndex.sync="problemListIndex"
     ></m-do-topic>
 
     <explainJs

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно