فهرست منبع

三力测试结构修改7

JXDS18FUJT 1 سال پیش
والد
کامیت
d0fadd961b
3فایلهای تغییر یافته به همراه59 افزوده شده و 18 حذف شده
  1. 49 9
      src/components/m-do-topic/m-do-topic.vue
  2. 8 8
      src/otherPages/collection/index.vue
  3. 2 1
      src/otherPages/exerciseThree/index.vue

+ 49 - 9
src/components/m-do-topic/m-do-topic.vue

@@ -68,26 +68,31 @@
         pb50px: type != 'exam',
       }"
     >
-      <span class="problem-type">{{
+      <!-- <text class="problem-type">{{
         problemList[problemListIndex].questionType | questionType
-      }}</span>
+      }}</text>
       <text
         style="background: #9c5fed"
         v-if="problemList[problemListIndex].isNew"
         class="problem-type"
         >新规题</text
-      >
+      > -->
       <!-- <text>{{ problemListIndex + 1 }}、</text> -->
-      <text class="problem-issue"
+      <rich-text style="font-size: 42rpx; vertical-align: top" :nodes="createProblemTypeHtml(problemList[problemListIndex]) +
+        (problemListIndex + 1) +
+        '、' +
+        problemList[problemListIndex].issue
+        "></rich-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>
+        <image mode="widthFix" v-if="getFileType(problemList[problemListIndex].image) == 'image'"
+          :src="problemList[problemListIndex].image"></image>
+        <video :controls="false" autoplay loop v-if="getFileType(problemList[problemListIndex].image) == 'video'"
+          :src="problemList[problemListIndex].image"></video>
       </view>
       <view v-if="!hiddenFunction" class="funcicon-list">
         <view
@@ -1033,6 +1038,41 @@ export default {
     },
   },
   methods: {
+    getFileType(src) {
+      let suffix = src.substring(src.lastIndexOf(".") + 1);
+      let type = "";
+      switch (suffix) {
+        case "mp4":
+        case "WebM":
+        case "Ogg":
+          type = "video";
+          break;
+        case "png":
+        case "jpg":
+        case "webp":
+          type = "image";
+          break;
+        case "pdf":
+          type = "pdf";
+          break;
+        default:
+          type = "other";
+      }
+      return type;
+    },
+    createProblemTypeHtml(item) {
+      let html = ''
+      //#9c5fed
+      html = item.isNew?'<span style="font-size: 11px;color: #fff;background:#9c5fed;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">新规题</span>':''
+      if (item.questionType == 1) {
+        return html+'<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">判断题</span>';
+      } else if(item.questionType==2){
+        return html+'<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">选择题</span>';
+      }
+      else{
+        return html+'<span style="font-size: 11px;color: #fff;background: #2878ff;padding: 3px 10px;border-radius: 4px;margin-right: 5px;vertical-align: middle;">多选题</span>';
+      }
+    },
     getUseTime(leftTime, useTime) {
       this.useTime = useTime;
     },

+ 8 - 8
src/otherPages/collection/index.vue

@@ -404,11 +404,11 @@ export default {
                   km: 9,
                 })
                 .then((result) => {
-                  let userCollectionIds = result.data.map((item) => {
+                  let userThreeIds = result.data.map((item) => {
                     return item;
                   });
-                  uni.setStorageSync(storageName, userCollectionIds);
-                  this.collectionListCount = userCollectionIds.length;
+                  uni.setStorageSync(storageName, userThreeIds);
+                  this.threeListCount = userThreeIds.length;
                 });
             });
           break;
@@ -427,11 +427,11 @@ export default {
                   km: 9,
                 })
                 .then((result) => {
-                  let userCollectionIds = result.data.map((item) => {
+                  let userThreeIds = result.data.map((item) => {
                     return item;
                   });
-                  uni.setStorageSync(storageName, userCollectionIds);
-                  this.collectionListCount = userCollectionIds.length;
+                  uni.setStorageSync(storageName, userThreeIds);
+                  this.threeListCount = userThreeIds.length;
                 });
             });
           break;
@@ -448,13 +448,13 @@ export default {
                 return item;
               });
               uni.setStorageSync(storageName, userCollectionIds);
-              this.collectionListCount = userCollectionIds.length;
+              this.threeListCount = userThreeIds.length;
             });
           break;
         default:
           break;
       }
-      this.collectSyncShow = false;
+      this.threeSyncShow = false;
 
     },
     syncCollectQuestion(e) {

+ 2 - 1
src/otherPages/exerciseThree/index.vue

@@ -6,9 +6,10 @@
     </view> -->
     <m-do-topic
       v-if="isGetQuery"
+      hiddenMode
       type="three"
       :bottomFunc="['previous', 'next', 'score', 'explain', 'skill']"
-      :midFunc="['collect', 'readQuestion', 'readQuestionAndAnswer']"
+      :midFunc="[]"
       :trueNum.sync="trueNum"
       :falseNum.sync="falseNum"
       :query="query"