Browse Source

知识库页面

chenxiaochao 1 month ago
parent
commit
3aab680cca

BIN
.cursor/kong.png


BIN
src/assets/exam.png


BIN
src/assets/kong.png


BIN
src/assets/searchimgs.png


+ 0 - 0
src/pages/knowledge/exam/examcontent/components/popup.vue


+ 92 - 0
src/pages/knowledge/exam/examcontent/components/submit.vue

@@ -0,0 +1,92 @@
1
+<script setup lang="ts">
2
+const handleClick = () => {
3
+  uni.navigateTo({
4
+    url: '/pages/knowledge/exam/index',
5
+  })
6
+}
7
+</script>
8
+
9
+<template>
10
+  <view class="submit-success">
11
+    <view class="success-icon">
12
+      <view class="icon-circle">
13
+        <text class="icon-check">✓</text>
14
+      </view>
15
+    </view>
16
+    <view class="success-title">交卷成功</view>
17
+    <view class="success-message">
18
+      请稍后在【我的考试-已考试】中查看成绩。
19
+    </view>
20
+    <view class="success-button">
21
+      <view class="button" @click="handleClick">查看我的考试</view>
22
+    </view>
23
+  </view>
24
+</template>
25
+
26
+<style scoped lang="scss">
27
+.submit-success {
28
+  display: flex;
29
+  flex-direction: column;
30
+  align-items: center;
31
+  justify-content: center;
32
+  min-height: 80vh;
33
+  padding: 40rpx;
34
+
35
+  .success-icon {
36
+    margin-bottom: 64rpx;
37
+    .icon-circle {
38
+      width: 160rpx;
39
+      height: 160rpx;
40
+      border-radius: 50%;
41
+      background-color: #52c41a;
42
+      display: flex;
43
+      align-items: center;
44
+      justify-content: center;
45
+
46
+      .icon-check {
47
+        font-size: 96rpx;
48
+        color: #ffffff;
49
+        font-weight: bold;
50
+      }
51
+    }
52
+  }
53
+
54
+  .success-title {
55
+     font-size: 36rpx;
56
+    font-weight: 500;
57
+    color: #31373d;
58
+    margin-bottom: 32rpx;
59
+  }
60
+
61
+  .success-message {
62
+    font-size: 28rpx;
63
+    color: #86909c;
64
+    text-align: center;
65
+    margin-bottom: 80rpx;
66
+    line-height: 1.5;
67
+  }
68
+
69
+  .success-button {
70
+    width: 100%;
71
+    max-width: 400rpx;
72
+
73
+    .button {
74
+      width: 100%;
75
+      height: 88rpx;
76
+      border: 1px solid #d4d6d9;
77
+      border-radius: 8rpx;
78
+      display: flex;
79
+      align-items: center;
80
+      justify-content: center;
81
+      font-size: 32rpx;
82
+      color: #31373d;
83
+      background-color: #ffffff;
84
+      transition: all 0.3s ease;
85
+
86
+      &:active {
87
+        background-color: #f5f5f5;
88
+      }
89
+    }
90
+  }
91
+}
92
+</style>

+ 278 - 40
src/pages/knowledge/exam/examcontent/index.vue

@@ -1,11 +1,59 @@
1 1
 <script setup lang="ts">
2
-import { ref, computed } from 'vue'
2
+import { ref, computed, onMounted, onUnmounted } from 'vue'
3 3
 import oipimg from '@/assets/OIP-C.jpg'
4
+import { useMessage } from 'wot-design-uni'
5
+const message = useMessage()
4 6
 const show = ref(false)
5 7
 const handleClose = () => {
6 8
   console.log('关闭弹窗')
7 9
   //   show.value = false
8 10
 }
11
+
12
+// 30分钟定时器
13
+const remainingTime = ref(30 * 60)
14
+const timer = ref(null)
15
+
16
+// 格式化时间为 HH:MM:SS 格式
17
+const formatTime = (seconds) => {
18
+  const hours = Math.floor(seconds / 3600)
19
+  const minutes = Math.floor((seconds % 3600) / 60)
20
+  const secs = seconds % 60
21
+  return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`
22
+}
23
+
24
+// 开始定时器
25
+const startTimer = () => {
26
+  if (timer.value) return
27
+
28
+  timer.value = setInterval(() => {
29
+    if (remainingTime.value > 0) {
30
+      remainingTime.value--
31
+    } else {
32
+      clearInterval(timer.value)
33
+      timer.value = null
34
+      handleSubmit()
35
+    }
36
+  }, 1000)
37
+}
38
+
39
+// 停止定时器
40
+const stopTimer = () => {
41
+  if (timer.value) {
42
+    clearInterval(timer.value)
43
+    timer.value = null
44
+  }
45
+}
46
+
47
+// 组件挂载时启动定时器
48
+onMounted(() => {
49
+  startTimer()
50
+})
51
+
52
+// 组件卸载时清除定时器
53
+onUnmounted(() => {
54
+  stopTimer()
55
+})
56
+
9 57
 const list = ref([
10 58
   {
11 59
     type: '第一题 单选题',
@@ -471,6 +519,38 @@ const handleActive = (value, index) => {
471 519
   activeIndex.value = `${value.type}-${index}`
472 520
 }
473 521
 
522
+const isDone = (item: any) => {
523
+  if (!item) return false
524
+  // single choice / 判断题 may write selected value to `item.value`
525
+  if (item.value !== undefined && item.value !== null && item.value !== '')
526
+    return true
527
+  // 简答题
528
+  if (item.answer && item.answer !== '') return true
529
+  // fallback for other naming
530
+  if (item.userAnswer && item.userAnswer !== '') return true
531
+  // 填空题 blanks
532
+  if (item.blanks && Array.isArray(item.blanks)) {
533
+    if (
534
+      item.blanks.some((b: any) => b && b.value !== undefined && b.value !== '')
535
+    )
536
+      return true
537
+  }
538
+  // 多选题 / options may toggle option.value to boolean when bound incorrectly
539
+  if (item.options && Array.isArray(item.options)) {
540
+    if (
541
+      item.options.some(
542
+        (o: any) =>
543
+          o &&
544
+          (o.checked === true ||
545
+            o.selected === true ||
546
+            (typeof o.value === 'boolean' && o.value === true))
547
+      )
548
+    )
549
+      return true
550
+  }
551
+  return false
552
+}
553
+
474 554
 const isFirstQuestion = computed(() => {
475 555
   const currentIndex = activeIndex.value.split('-')[1]
476 556
   return Number(currentIndex) === 0
@@ -499,14 +579,40 @@ const handleNext = () => {
499 579
     activeIndex.value = `${currentType}-${Number(currentIndex) + 1}`
500 580
   }
501 581
 }
582
+const handleSubmit = () => {
583
+  message
584
+    .confirm({
585
+      msg: '交卷后将无法撤回操作,确认交卷?',
586
+      title: '提示',
587
+      cancelButtonProps: {
588
+        type: 'default',
589
+        customClass: 'cancel-button',
590
+      },
591
+      confirmButtonProps: {
592
+        type: 'success',
593
+        customClass: 'custom-shadow',
594
+      },
595
+    })
596
+    .then(() => {
597
+      uni.navigateTo({
598
+        url: '/pages/knowledge/exam/examcontent/components/submit',
599
+      })
600
+    })
601
+    .catch((error) => {
602
+      console.log('点击了取消')
603
+    })
604
+}
605
+const clickclose = ()=>{
606
+  show.value = false
607
+}
502 608
 </script>
503 609
 <template>
504 610
   <view class="examcontent_box">
505 611
     <view class="examcontent_remainingtime_submit">
506 612
       <view class="examcontent_remainingtime">
507
-        剩余时间:<span>00:00:00</span>
613
+        剩余时间:<span>{{ formatTime(remainingTime) }}</span>
508 614
       </view>
509
-      <view class="examcontent_submit"> 提交考试 </view>
615
+      <view class="examcontent_submit" @tap="handleSubmit"> 提交考试 </view>
510 616
     </view>
511 617
     <view class="examcontent_title">
512 618
       {{ currentTitle.MainTitle }}
@@ -515,20 +621,25 @@ const handleNext = () => {
515 621
       <view class="examcontent_question_title">
516 622
         {{ currentTitle.SubTitle.title }}</view
517 623
       >
624
+      <view
625
+        class="examcontent_question_imgs"
626
+        v-if="currentTitle?.SubTitle?.isimgs"
627
+      >
628
+        <image
629
+          :src="currentTitle?.SubTitle?.isimgs"
630
+          class="examcontent_question_imgs_img"
631
+        ></image>
632
+      </view>
518 633
       <view class="examcontent_question_item">
519
-        <view
520
-          class="examcontent_question_imgs"
521
-          v-if="currentTitle?.SubTitle?.isimgs"
522
-        >
523
-          <image
524
-            :src="currentTitle?.SubTitle?.isimgs"
525
-            class="examcontent_question_imgs_img"
526
-          ></image>
527
-        </view>
528 634
         <view class="examcontent_question_items">
529 635
           <template v-if="currentTitle.MainTitle?.includes('单选题')">
530 636
             <wd-radio-group
531
-              style="display: flex; flex-direction: column;gap: 80rpx"
637
+              style="
638
+                display: flex;
639
+                flex-direction: column;
640
+                gap: 80rpx;
641
+                align-items: flex-start;
642
+              "
532 643
               v-model="currentTitle.SubTitle['value']"
533 644
               shape="dot"
534 645
               inline
@@ -541,7 +652,7 @@ const handleNext = () => {
541 652
               </wd-radio>
542 653
             </wd-radio-group>
543 654
           </template>
544
-          <template v-if="currentTitle.MainTitle?.includes('多选题')">
655
+          <template v-else-if="currentTitle.MainTitle?.includes('多选题')">
545 656
             <wd-checkbox
546 657
               v-model="value.value"
547 658
               shape="square"
@@ -553,6 +664,55 @@ const handleNext = () => {
553 664
               }}</span>
554 665
             </wd-checkbox>
555 666
           </template>
667
+          <template v-else-if="currentTitle.MainTitle?.includes('判断题')">
668
+            <wd-radio-group
669
+              style="
670
+                display: flex;
671
+                flex-direction: column;
672
+                gap: 80rpx;
673
+                align-items: flex-start;
674
+              "
675
+              v-model="currentTitle.SubTitle['value']"
676
+              shape="dot"
677
+              inline
678
+            >
679
+              <wd-radio
680
+                v-for="value in currentTitle.SubTitle.options"
681
+                :value="value.value"
682
+              >
683
+                {{ value.label }}
684
+              </wd-radio>
685
+            </wd-radio-group>
686
+          </template>
687
+          <template v-else-if="currentTitle.MainTitle?.includes('填空题')">
688
+            <view class="examcontent_question_blanks">
689
+              <view
690
+                class="examcontent_question_blank_item"
691
+                v-for="(blank, index) in currentTitle.SubTitle.blanks"
692
+                :key="index"
693
+              >
694
+                <text class="examcontent_question_blank_label">{{
695
+                  `填空${index + 1}: `
696
+                }}</text>
697
+                <wd-input
698
+                  v-model="blank.value"
699
+                  :placeholder="blank.placeholder"
700
+                  class="examcontent_question_blank_input"
701
+                />
702
+              </view>
703
+            </view>
704
+          </template>
705
+          <template v-else-if="currentTitle.MainTitle?.includes('简答题')">
706
+            <view class="examcontent_question_answer">
707
+              <text class="examcontent_question_answer_title">请作答:</text>
708
+              <wd-textarea
709
+                v-model="currentTitle.SubTitle.answer"
710
+                placeholder="请输入答案"
711
+                rows="4"
712
+                class="examcontent_question_answer_textarea"
713
+              />
714
+            </view>
715
+          </template>
556 716
         </view>
557 717
       </view>
558 718
     </view>
@@ -585,7 +745,7 @@ const handleNext = () => {
585 745
     >
586 746
       <view class="popup-header">
587 747
         <text class="popup-title">题目总览</text>
588
-        <view class="popup-close" @click="handleClose">
748
+        <view class="popup-close" @click="clickclose">
589 749
           <view class="close-icon"></view>
590 750
         </view>
591 751
       </view>
@@ -605,8 +765,11 @@ const handleNext = () => {
605 765
           </view>
606 766
           <view class="question-numbers">
607 767
             <view
608
-              class="question-number active"
609
-              :class="{ tapactive: activeIndex === `${value.type}-${index}` }"
768
+              class="question-number"
769
+              :class="{
770
+                tapactive: activeIndex === `${value.type}-${index}`,
771
+                done: isDone(item),
772
+              }"
610 773
               v-for="(item, index) in value.titlelist"
611 774
               @tap="handleActive(value, index)"
612 775
               :key="index"
@@ -629,8 +792,11 @@ const handleNext = () => {
629 792
           </view>
630 793
           <view class="question-numbers">
631 794
             <view
632
-              class="question-number active"
633
-              :class="{ tapactive: activeIndex === `${value.type}-${index}` }"
795
+              class="question-number"
796
+              :class="{
797
+                tapactive: activeIndex === `${value.type}-${index}`,
798
+                done: isDone(item),
799
+              }"
634 800
               v-for="(item, index) in value.titlelist"
635 801
               @tap="handleActive(value, index)"
636 802
               :key="index"
@@ -653,8 +819,11 @@ const handleNext = () => {
653 819
           </view>
654 820
           <view class="question-numbers">
655 821
             <view
656
-              class="question-number active"
657
-              :class="{ tapactive: activeIndex === `${value.type}-${index}` }"
822
+              class="question-number"
823
+              :class="{
824
+                tapactive: activeIndex === `${value.type}-${index}`,
825
+                done: isDone(item),
826
+              }"
658 827
               v-for="(item, index) in value.titlelist"
659 828
               @tap="handleActive(value, index)"
660 829
               :key="index"
@@ -677,8 +846,11 @@ const handleNext = () => {
677 846
           </view>
678 847
           <view class="question-numbers">
679 848
             <view
680
-              class="question-number active"
681
-              :class="{ tapactive: activeIndex === `${value.type}-${index}` }"
849
+              class="question-number"
850
+              :class="{
851
+                tapactive: activeIndex === `${value.type}-${index}`,
852
+                done: isDone(item),
853
+              }"
682 854
               v-for="(item, index) in value.titlelist"
683 855
               @tap="handleActive(value, index)"
684 856
               :key="index"
@@ -701,8 +873,11 @@ const handleNext = () => {
701 873
           </view>
702 874
           <view class="question-numbers">
703 875
             <view
704
-              class="question-number active"
705
-              :class="{ tapactive: activeIndex === `${value.type}-${index}` }"
876
+              class="question-number"
877
+              :class="{
878
+                tapactive: activeIndex === `${value.type}-${index}`,
879
+                done: isDone(item),
880
+              }"
706 881
               v-for="(item, index) in value.titlelist"
707 882
               @tap="handleActive(value, index)"
708 883
               :key="index"
@@ -712,6 +887,7 @@ const handleNext = () => {
712 887
         </view>
713 888
       </view>
714 889
     </wd-popup>
890
+    <wd-message-box></wd-message-box>
715 891
   </view>
716 892
 </template>
717 893
 <style scoped lang="scss">
@@ -719,6 +895,21 @@ html,
719 895
 body {
720 896
   overflow: hidden;
721 897
 }
898
+:deep() {
899
+  .wd-message-box {
900
+    .custom-shadow {
901
+      border-radius: 8rpx;
902
+      background-color: #215acd;
903
+      color: #ffffff;
904
+    }
905
+    .cancel-button {
906
+      border-radius: 8rpx;
907
+      background-color: #ffffff;
908
+      color: #31373d;
909
+      border: 1px solid #d4d6d9;
910
+    }
911
+  }
912
+}
722 913
 .examcontent_box {
723 914
   height: calc(100vh - 88rpx);
724 915
   display: flex;
@@ -766,7 +957,7 @@ body {
766 957
     width: 100%;
767 958
     display: flex;
768 959
     flex-direction: column;
769
-    gap: 104rpx;
960
+    gap: 98rpx;
770 961
     .examcontent_question_title {
771 962
       font-weight: 400;
772 963
       font-style: 55 Regular;
@@ -774,18 +965,19 @@ body {
774 965
       leading-trim: NONE;
775 966
       color: #31373d;
776 967
     }
777
-    .examcontent_question_item {
968
+    .examcontent_question_imgs {
778 969
       width: 100%;
779
-      .examcontent_question_imgs {
970
+      height: 260rpx;
971
+      // margin-bottom: 32rpx;
972
+      .examcontent_question_imgs_img {
780 973
         width: 100%;
781
-        height: 350rpx;
782
-        margin-bottom: 32rpx;
783
-        .examcontent_question_imgs_img {
784
-          width: 100%;
785
-          height: 100%;
786
-          object-fit: cover;
787
-        }
974
+        height: 100%;
975
+        object-fit: cover;
788 976
       }
977
+    }
978
+    .examcontent_question_item {
979
+      width: 100%;
980
+
789 981
       .examcontent_question_items {
790 982
         display: flex;
791 983
         flex-direction: column;
@@ -796,6 +988,52 @@ body {
796 988
           font-size: 28rpx;
797 989
           color: #1f1f1f;
798 990
         }
991
+        .examcontent_question_blanks {
992
+          display: flex;
993
+          flex-direction: column;
994
+          gap: 40rpx;
995
+          .examcontent_question_blank_item {
996
+            display: flex;
997
+            align-items: center;
998
+            gap: 20rpx;
999
+            .examcontent_question_blank_label {
1000
+              font-size: 28rpx;
1001
+              color: #31373d;
1002
+              white-space: nowrap;
1003
+              margin-right: 20rpx;
1004
+            }
1005
+            .examcontent_question_blank_input {
1006
+              height: 64rpx;
1007
+              flex: 1;
1008
+              border: 1px solid #d4d6d9;
1009
+              border-radius: 8rpx;
1010
+              padding: 20rpx;
1011
+              font-size: 28rpx;
1012
+              box-sizing: border-box;
1013
+              display: flex;
1014
+              align-items: center;
1015
+            }
1016
+          }
1017
+        }
1018
+        .examcontent_question_answer {
1019
+          width: 100%;
1020
+          .examcontent_question_answer_title {
1021
+            font-weight: 400;
1022
+            font-style: 55 Regular;
1023
+            font-size: 28rpx;
1024
+            color: #1f1f1f;
1025
+          }
1026
+          .examcontent_question_answer_textarea {
1027
+            margin-top: 18rpx;
1028
+            width: 94%;
1029
+            border: 1px solid #d4d6d9;
1030
+            border-radius: 8rpx;
1031
+            padding: 20rpx;
1032
+            font-size: 28rpx;
1033
+            min-height: 200rpx;
1034
+            resize: vertical;
1035
+          }
1036
+        }
799 1037
       }
800 1038
     }
801 1039
   }
@@ -928,11 +1166,11 @@ body {
928 1166
           align-items: center;
929 1167
           font-size: 33.6rpx;
930 1168
           color: #000000;
931
-          //   &.active {
932
-          //     background-color: #215acd;
933
-          //     color: #ffffff;
934
-          //     border-color: #215acd;
935
-          //   }
1169
+          &.done {
1170
+            background-color: #215acd;
1171
+            color: #ffffff;
1172
+            border-color: #215acd;
1173
+          }
936 1174
         }
937 1175
         .tapactive {
938 1176
           background-color: #ebf3ff;

+ 508 - 0
src/pages/knowledge/exam/examresults/index.vue

@@ -0,0 +1,508 @@
1
+<script setup lang="ts">
2
+import { ref } from 'vue'
3
+const list = ref([
4
+  {
5
+    type: 'single',
6
+    title: '第一题单选题(本题分值1分)',
7
+    score: 1,
8
+    list: [
9
+      {
10
+        title: '这是本题的题目,请选择',
11
+        answer: [
12
+          {
13
+            title: 'A.答案1',
14
+            isRight: true,
15
+          },
16
+          {
17
+            title: 'B.答案2',
18
+            isRight: false,
19
+          },
20
+          {
21
+            title: 'B.答案3',
22
+            isRight: '',
23
+          },
24
+          {
25
+            title: 'B.答案4',
26
+            isRight: '',
27
+          },
28
+        ],
29
+        AnswerExplanation:
30
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
31
+      },
32
+      {
33
+        title: '这是本题的题目,请选择',
34
+        answer: [
35
+          {
36
+            title: 'A.答案1',
37
+            isRight: '',
38
+          },
39
+          {
40
+            title: 'B.答案2',
41
+            isRight: true,
42
+          },
43
+          {
44
+            title: 'B.答案3',
45
+            isRight: '',
46
+          },
47
+          {
48
+            title: 'B.答案4',
49
+            isRight: false,
50
+          },
51
+        ],
52
+        AnswerExplanation:
53
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
54
+      },
55
+    ],
56
+  },
57
+  {
58
+    type: 'single',
59
+    title: '第二题多选题(本题分值1分)',
60
+    score: 1,
61
+    list: [
62
+      {
63
+        title: '这是本题的题目,请选择',
64
+        answer: [
65
+          {
66
+            title: 'A.答案1',
67
+            isRight: true,
68
+          },
69
+          {
70
+            title: 'B.答案2',
71
+            isRight: true,
72
+          },
73
+          {
74
+            title: 'B.答案3',
75
+            isRight: true,
76
+          },
77
+          {
78
+            title: 'B.答案4',
79
+            isRight: false,
80
+          },
81
+        ],
82
+        AnswerExplanation:
83
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
84
+      },
85
+      {
86
+        title: '这是本题的题目,请选择',
87
+        answer: [
88
+          {
89
+            title: 'A.答案1',
90
+            isRight: false,
91
+          },
92
+          {
93
+            title: 'B.答案2',
94
+            isRight: true,
95
+          },
96
+          {
97
+            title: 'B.答案3',
98
+            isRight: false,
99
+          },
100
+          {
101
+            title: 'B.答案4',
102
+            isRight: true,
103
+          },
104
+        ],
105
+        AnswerExplanation:
106
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
107
+      },
108
+    ],
109
+  },
110
+  {
111
+    type: 'single',
112
+    title: '第三题判断题(本题分值1分)',
113
+    score: 1,
114
+    list: [
115
+      {
116
+        title: '这是本题的题目,请选择',
117
+        answer: [
118
+          {
119
+            title: 'A.答案1',
120
+            isRight: true,
121
+          },
122
+          {
123
+            title: 'B.答案2',
124
+            isRight: false,
125
+          },
126
+        ],
127
+        AnswerExplanation:
128
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
129
+      },
130
+      {
131
+        title: '这是本题的题目,请选择',
132
+        answer: [
133
+          {
134
+            title: 'A.答案1',
135
+            isRight: false,
136
+          },
137
+          {
138
+            title: 'B.答案2',
139
+            isRight: true,
140
+          },
141
+        ],
142
+        AnswerExplanation:
143
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
144
+      },
145
+    ],
146
+  },
147
+  {
148
+    type: 'single',
149
+    title: '第四题填空题(本题分值1分)',
150
+    score: 1,
151
+    list: [
152
+      {
153
+        title: '1.这是本题的题目(),(),()',
154
+        answer: [
155
+          {
156
+            title: 'A.填空',
157
+            answertext: '考生输入的答案1',
158
+            isRight: true,
159
+          },
160
+          {
161
+            title: 'B.填空',
162
+            answertext: '考生输入的答案2',
163
+            isRight: true,
164
+          },
165
+          {
166
+            title: 'C.填空',
167
+            answertext: '考生输入的答案3',
168
+            isRight: false,
169
+          },
170
+        ],
171
+        AnswerExplanation:
172
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
173
+      },
174
+      {
175
+        title: '2.这是本题的题目(),(),()',
176
+        answer: [
177
+          {
178
+            title: 'A.填空',
179
+            answertext: '考生输入的答案1',
180
+            isRight: true,
181
+          },
182
+          {
183
+            title: 'B.填空',
184
+            answertext: '考生输入的答案2',
185
+            isRight: false,
186
+          },
187
+        ],
188
+        AnswerExplanation:
189
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
190
+      },
191
+    ],
192
+  },
193
+  {
194
+    type: 'single',
195
+    title: '第五题简答题(本题分值1分)',
196
+    score: 1,
197
+    list: [
198
+      {
199
+        title: '1.这是本题的题目。',
200
+        answer: [
201
+          {
202
+            title: '这是一个简答题',
203
+            answertext:
204
+              '考生输入的答案考生输入的答案考生输入的答案考生输入的答案考生输入的答案考生输入的答案',
205
+            Correctanswer: '正确答案正确答案正确答案正确答案正确答案正确答案',
206
+            isRight: true,
207
+          },
208
+        ],
209
+        AnswerExplanation:
210
+          '解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析解析',
211
+      },
212
+    ],
213
+  },
214
+]) as any
215
+</script>
216
+<template>
217
+  <view class="knowledgebase_exam_explanation">
218
+    <view class="knowledgebase_exam_explanation_title">
219
+      考试名称考试名称考试名称考试考试名称考试名称考试名称
220
+    </view>
221
+    <view class="knowledgebase_exam_explanation_content">
222
+      <view class="knowledgebase_exam_explanation_content_title">
223
+        考试说明
224
+      </view>
225
+      <view class="knowledgebase_exam_explanation_content_text">
226
+        考试说明考试说明考试说明考试说明考试说明考试说明考试说明。
227
+      </view>
228
+    </view>
229
+    <view class="knowledgebase_exam_explanation_float">
230
+      <view class="knowledgebase_exam_explanation_float_title">
231
+        考试总分
232
+        <span class="knowledgebase_exam_explanation_float_title_score"
233
+          >100分</span
234
+        ></view
235
+      >
236
+      <view class="knowledgebase_exam_explanation_float_title">
237
+        及格分数
238
+        <span class="knowledgebase_exam_explanation_float_title_score"
239
+          >60分</span
240
+        ></view
241
+      >
242
+      <view class="knowledgebase_exam_explanation_float_title">
243
+        考试时长
244
+        <span class="knowledgebase_exam_explanation_float_title_score"
245
+          >90分钟</span
246
+        ></view
247
+      >
248
+      <view class="knowledgebase_exam_explanation_float_title">
249
+        考生得分
250
+        <span
251
+          class="knowledgebase_exam_explanation_float_title_score"
252
+          style="color: #215acd"
253
+          >80分</span
254
+        ></view
255
+      >
256
+      <view class="knowledgebase_exam_explanation_float_title">
257
+        考试结果
258
+        <span
259
+          class="knowledgebase_exam_explanation_float_title_score"
260
+          style="color: #38b865"
261
+          >及格</span
262
+        ></view
263
+      >
264
+    </view>
265
+    <view class="AnswerDetails">
266
+      <view class="AnswerDetails_title">答题详情</view>
267
+      <view class="AnswerDetails_content" v-for="value in list">
268
+        <view class="AnswerDetails_content_box">
269
+          <view class="AnswerDetails_content_title">{{ value.title }}</view>
270
+          <view class="AnswerDetails_content_item" v-for="items in value.list">
271
+            <view class="Thisquestiontitle">
272
+              <view class="AnswerDetails_content_item_title">
273
+                {{ items.title }}
274
+              </view>
275
+              <view class="AnswerDetails_content_item_answer">
276
+                <text
277
+                  :style="
278
+                    values.isRight === true
279
+                      ? 'color: #38B865'
280
+                      : values.isRight === false
281
+                        ? 'color: #EB5E12'
282
+                        : ''
283
+                  "
284
+                  v-for="values in items?.answer"
285
+                  :key="values.title"
286
+                >
287
+                  <text
288
+                    v-if="
289
+                      value.title.includes('单选题') ||
290
+                      value.title.includes('多选题') ||
291
+                      value.title.includes('判断题')
292
+                    "
293
+                    >{{ values.title }}</text
294
+                  >
295
+                  <text v-else-if="value.title.includes('填空题')">{{
296
+                    ` ${values.title}: ${values.answertext}`
297
+                  }}</text>
298
+                  <text v-else-if="value.title.includes('简答题')">{{
299
+                    ` ${values.title}: ${values.answertext}`
300
+                  }}</text>
301
+                  <wd-icon
302
+                    v-if="values.isRight"
303
+                    style="
304
+                      color: #38b865;
305
+                      text-align: center;
306
+                      margin-left: 20rpx;
307
+                    "
308
+                    name="check-circle-filled"
309
+                    size="16px"
310
+                  ></wd-icon>
311
+                  <wd-icon
312
+                    v-else-if="values.isRight === false"
313
+                    style="
314
+                      color: #eb5e12;
315
+                      text-align: center;
316
+                      margin-left: 20rpx;
317
+                    "
318
+                    name="close-circle-filled"
319
+                    size="16px"
320
+                  ></wd-icon>
321
+                </text>
322
+              </view>
323
+            </view>
324
+            <view class="AnswerExplanation_box">
325
+              <view class="Correctanswer" style="margin-bottom: 48rpx">
326
+                <text class="Correctanswer_title">正确答案 : </text>
327
+                <text
328
+                  v-if="value.title.includes('简答题')"
329
+                  class="Correctanswer_title Content"
330
+                  v-for="values in items?.answer.filter((a) => a.isRight)"
331
+                  :key="values.title"
332
+                >
333
+                  {{ `${values.Correctanswer};` }}
334
+                </text>
335
+                <text
336
+                  v-else
337
+                  class="Correctanswer_title Content"
338
+                  v-for="values in items?.answer.filter((a) => a.isRight)"
339
+                  :key="values.title"
340
+                >
341
+                  {{ `${values.title};` }}
342
+                </text>
343
+              </view>
344
+              <view class="AnswerExplanation">
345
+                <view class="Correctanswer_title" style="margin-bottom: 32rpx"
346
+                  >答案解析:</view
347
+                >
348
+                <text class="Correctanswer_Content">{{
349
+                  items.AnswerExplanation
350
+                }}</text>
351
+              </view>
352
+            </view>
353
+          </view>
354
+        </view>
355
+      </view>
356
+    </view>
357
+  </view>
358
+</template>
359
+<style scoped lang="scss">
360
+html,
361
+body {
362
+  overflow: hidden;
363
+}
364
+.knowledgebase_exam_explanation {
365
+  height: calc(100vh - 88rpx);
366
+  display: flex;
367
+  flex-direction: column;
368
+  padding: 24rpx;
369
+  box-sizing: border-box;
370
+}
371
+.knowledgebase_exam_explanation_title {
372
+  font-family: Alibaba PuHuiTi 2;
373
+  font-weight: 500;
374
+  font-style: 65 Medium;
375
+  font-size: 48rpx;
376
+  leading-trim: NONE;
377
+  line-height: 48rpx;
378
+  letter-spacing: 0px;
379
+  color: #31373d;
380
+}
381
+.knowledgebase_exam_explanation_content {
382
+  margin-top: 80rpx;
383
+  width: 100%;
384
+  display: flex;
385
+  flex-direction: column;
386
+  gap: 32rpx;
387
+  .knowledgebase_exam_explanation_content_title {
388
+    font-weight: 500;
389
+    font-style: 65 Medium;
390
+    font-size: 36rpx;
391
+    leading-trim: NONE;
392
+    letter-spacing: 0px;
393
+    color: #31373d;
394
+  }
395
+  .knowledgebase_exam_explanation_content_text {
396
+    font-weight: 400;
397
+    font-style: 55 Regular;
398
+    font-size: 28rpx;
399
+    line-height: 48rpx;
400
+    letter-spacing: 0px;
401
+    color: #4e5969;
402
+  }
403
+}
404
+.knowledgebase_exam_explanation_float {
405
+  margin-top: 48rpx;
406
+  margin-bottom: 48rpx;
407
+  border-top: 1rpx solid #eeeeee;
408
+  border-bottom: 1rpx solid #eeeeee;
409
+  padding-top: 48rpx;
410
+  padding-bottom: 48rpx;
411
+  box-sizing: border-box;
412
+  display: flex;
413
+  flex-direction: column;
414
+  gap: 32rpx;
415
+  .knowledgebase_exam_explanation_float_title {
416
+    font-weight: 400;
417
+    font-style: 55 Regular;
418
+    font-size: 28rpx;
419
+    letter-spacing: 0px;
420
+    color: #4e5969;
421
+    .knowledgebase_exam_explanation_float_title_score {
422
+      margin-left: 48rpx;
423
+      color: #31373d;
424
+    }
425
+  }
426
+}
427
+.AnswerDetails {
428
+  flex: 1;
429
+  overflow-y: auto;
430
+  .AnswerDetails_title {
431
+    font-weight: 500;
432
+    font-style: 65 Medium;
433
+    font-size: 36rpx;
434
+    leading-trim: NONE;
435
+    letter-spacing: 0px;
436
+    color: #31373d;
437
+    margin-bottom: 48rpx;
438
+  }
439
+  .AnswerDetails_content {
440
+    // width: 100%;
441
+    // display: flex;
442
+    // flex-direction: column;
443
+    // gap: 24rpx;
444
+    margin-bottom: 24rpx;
445
+    .AnswerDetails_content_box {
446
+      display: flex;
447
+      flex-direction: column;
448
+      gap: 24rpx;
449
+    }
450
+    .AnswerDetails_content_title {
451
+      width: 100%;
452
+      height: 96rpx;
453
+      background-color: #f7f9fa;
454
+      padding-left: 32rpx;
455
+      box-sizing: border-box;
456
+      line-height: 88rpx;
457
+
458
+      font-weight: 500;
459
+      font-size: 32rpx;
460
+      color: #31373d;
461
+    }
462
+    .AnswerDetails_content_item {
463
+      box-sizing: border-box;
464
+      padding: 32rpx;
465
+      width: 100%;
466
+      background-color: #f7f9fa;
467
+      .Thisquestiontitle {
468
+        border-bottom: 1rpx solid #e6e8eb;
469
+        box-sizing: border-box;
470
+        padding-bottom: 48rpx;
471
+        margin-bottom: 48rpx;
472
+        .AnswerDetails_content_item_title {
473
+          margin-bottom: 48rpx;
474
+          font-weight: 400;
475
+          font-size: 32rpx;
476
+          color: #31373d;
477
+        }
478
+        .AnswerDetails_content_item_answer {
479
+          display: flex;
480
+          flex-direction: column;
481
+          gap: 52rpx;
482
+
483
+          font-weight: 400;
484
+          font-size: 28rpx;
485
+          color: #31373d;
486
+        }
487
+      }
488
+      .AnswerExplanation_box {
489
+        .Correctanswer_title {
490
+          font-weight: 400;
491
+          font-size: 28rpx;
492
+          color: #31373d;
493
+        }
494
+        .Content {
495
+          color: #38b865;
496
+          margin-right: 10rpx;
497
+        }
498
+        .Correctanswer_Content {
499
+          font-weight: 400;
500
+          font-size: 32rpx;
501
+          color: #4e5969;
502
+          line-height: 56rpx;
503
+        }
504
+      }
505
+    }
506
+  }
507
+}
508
+</style>

+ 86 - 0
src/pages/knowledge/exam/examresults/scoresnotreleased.vue

@@ -0,0 +1,86 @@
1
+<script setup lang="ts">
2
+import kong from '@/assets/kong.png'
3
+const handleClick = () => {
4
+  uni.navigateTo({
5
+    url: '/pages/knowledge/exam/index',
6
+  })
7
+}
8
+</script>
9
+
10
+<template>
11
+  <view class="submit-success">
12
+    <view class="success-icon">
13
+      <view class="icon-circle">
14
+        <image style="width: 100%; height: 100%;" :src="kong" alt="loading" />
15
+        <!-- <text class="icon-check">✓</text> -->
16
+      </view>
17
+    </view>
18
+    <view class="success-title">正在批改......</view>
19
+    <view class="success-message">
20
+      请稍后在【我的考试-已考试】中查看成绩。
21
+    </view>
22
+    <view class="success-button">
23
+      <view class="button" @click="handleClick">查看我的考试</view>
24
+    </view>
25
+  </view>
26
+</template>
27
+
28
+<style scoped lang="scss">
29
+.submit-success {
30
+  display: flex;
31
+  flex-direction: column;
32
+  align-items: center;
33
+  justify-content: center;
34
+  min-height: 80vh;
35
+  padding: 40rpx;
36
+
37
+  .success-icon {
38
+    margin-bottom: 64rpx;
39
+    .icon-circle {
40
+      width: 500rpx;
41
+      height: 300rpx;
42
+      display: flex;
43
+      align-items: center;
44
+      justify-content: center;
45
+    }
46
+  }
47
+
48
+  .success-title {
49
+    font-size: 36rpx;
50
+    font-weight: 500;
51
+    color: #31373d;
52
+    margin-bottom: 32rpx;
53
+  }
54
+
55
+  .success-message {
56
+    font-size: 28rpx;
57
+    color: #86909c;
58
+    text-align: center;
59
+    margin-bottom: 80rpx;
60
+    line-height: 1.5;
61
+  }
62
+
63
+  .success-button {
64
+    width: 100%;
65
+    max-width: 400rpx;
66
+
67
+    .button {
68
+      width: 100%;
69
+      height: 88rpx;
70
+      border: 1px solid #d4d6d9;
71
+      border-radius: 8rpx;
72
+      display: flex;
73
+      align-items: center;
74
+      justify-content: center;
75
+      font-size: 32rpx;
76
+      color: #31373d;
77
+      background-color: #ffffff;
78
+      transition: all 0.3s ease;
79
+
80
+      &:active {
81
+        background-color: #f5f5f5;
82
+      }
83
+    }
84
+  }
85
+}
86
+</style>

+ 20 - 0
src/pages/knowledge/exam/explanation/index.vue

@@ -1,3 +1,4 @@
1
+<script setup lang="ts"></script>
1 2
 <template>
2 3
   <view class="knowledgebase_exam_explanation">
3 4
     <view class="knowledgebase_exam_explanation_title">
@@ -31,12 +32,24 @@
31 32
         ></view
32 33
       >
33 34
     </view>
35
+    <wd-button class="knowledgebase_exam_explanation_float_button"
36
+      >开始考试</wd-button
37
+    >
38
+    <!-- <wd-button disabled class="knowledgebase_exam_explanation_float_button"
39
+      >考试将于2026-2-1 19:00开始</wd-button
40
+    > -->
34 41
   </view>
35 42
 </template>
36 43
 <style scoped lang="scss">
44
+html,
45
+body {
46
+  overflow: hidden;
47
+}
37 48
 .knowledgebase_exam_explanation {
49
+  height: calc(100vh - 88rpx);
38 50
   display: flex;
39 51
   flex-direction: column;
52
+  // justify-content: space-between;
40 53
   padding: 24rpx;
41 54
   box-sizing: border-box;
42 55
 }
@@ -93,4 +106,11 @@
93 106
     }
94 107
   }
95 108
 }
109
+.knowledgebase_exam_explanation_float_button {
110
+  margin-top: auto;
111
+  width: 100%;
112
+  background-color: #215acd !important;
113
+  height: 80rpx !important;
114
+  border-radius: 8rpx !important;
115
+}
96 116
 </style>

+ 51 - 14
src/pages/knowledge/exam/index.vue

@@ -42,19 +42,23 @@ const Examtaken = ref([
42 42
     id: 1,
43 43
     name: '考试6',
44 44
     examTime: '2023-08-01 10:00:00',
45
-    Status: '进行中',
45
+    Status: '已出分',
46
+    Result: '及格',
47
+    Score: '80分',
46 48
   },
47 49
   {
48 50
     id: 2,
49 51
     name: '考试8',
50 52
     examTime: '2023-08-01 10:00:00',
51
-    Status: '未开始',
53
+    Status: '已出分',
54
+    Result: '不及格',
55
+    Score: '880分',
52 56
   },
53 57
   {
54 58
     id: 3,
55 59
     name: '考试9',
56 60
     examTime: '2023-08-01 10:00:00',
57
-    Status: '缺考',
61
+    Status: '待出分',
58 62
   },
59 63
   {
60 64
     id: 4,
@@ -67,16 +71,30 @@ const statusColorMap = {
67 71
   进行中: '#EB5E12',
68 72
   未开始: '#215ACD',
69 73
   缺考: '#A4AAB2',
74
+  已出分: '#38B865',
75
+  待出分: '#215ACD',
70 76
 }
71
-const toExamDetail = (id) => {
72
-  uni.navigateTo({
73
-    url: '/pages/knowledge/exam/examcontent/index',
74
-  })
77
+const toExamDetail = (data) => {
78
+  if (data.Status === '未开始') {
79
+    uni.navigateTo({
80
+      url: '/pages/knowledge/exam/explanation/index',
81
+    })
82
+  } else if (data.Status === '进行中') {
83
+    uni.navigateTo({
84
+      url: '/pages/knowledge/exam/examcontent/index',
85
+    })
86
+  }
75 87
 }
76
-const ExamtakenDetail = (id) => {
77
-  uni.navigateTo({
78
-    url: '/pages/knowledge/exam/explanation/index',
79
-  })
88
+const ExamtakenDetail = (data) => {
89
+  if (data.Status === '待出分') {
90
+    uni.navigateTo({
91
+      url: '/pages/knowledge/exam/examresults/scoresnotreleased',
92
+    })
93
+  } else if (data.Status === '已出分') {
94
+    uni.navigateTo({
95
+      url: '/pages/knowledge/exam/examresults/index',
96
+    })
97
+  }
80 98
 }
81 99
 </script>
82 100
 <template>
@@ -97,7 +115,7 @@ const ExamtakenDetail = (id) => {
97 115
         v-if="activeId === 1"
98 116
         class="content_item"
99 117
         v-for="(item, index) in waitingForTheExam"
100
-        @click="toExamDetail(item.id)"
118
+        @click="toExamDetail(item)"
101 119
         :key="index"
102 120
       >
103 121
         <view class="content_item_title">
@@ -114,7 +132,7 @@ const ExamtakenDetail = (id) => {
114 132
         v-else
115 133
         class="content_item"
116 134
         v-for="(item, index) in Examtaken"
117
-        @click="ExamtakenDetail(item.id)"
135
+        @click="ExamtakenDetail(item)"
118 136
         :key="'else-' + index"
119 137
       >
120 138
         <view class="content_item_title">
@@ -125,6 +143,17 @@ const ExamtakenDetail = (id) => {
125 143
             >{{ item.Status }}</span
126 144
           >
127 145
         </view>
146
+        <view class="content_item_result_score" v-if="item.Status === '已出分'">
147
+          <view class="content_item_result"
148
+            >考试结果:<text
149
+              :style="{ color: item.Result === '及格' ? '#38B865' : '#EB5E12' }"
150
+              >{{ item.Result }}</text
151
+            ></view
152
+          >
153
+          <view class="content_item_score"
154
+            >分数:<text>{{ item.Score }}</text></view
155
+          >
156
+        </view>
128 157
         <view class="content_item_time">{{ item.examTime }}</view>
129 158
       </view>
130 159
     </view>
@@ -174,11 +203,13 @@ body {
174 203
   gap: 24rpx;
175 204
   margin-top: 46rpx;
176 205
   .content_item {
177
-    height: 150rpx;
206
+    // height: 150rpx;
178 207
     border-bottom: 1px solid #eeeeee;
179 208
     display: flex;
180 209
     flex-direction: column;
181 210
     gap: 30rpx;
211
+    padding-bottom: 24rpx;
212
+    box-sizing: border-box;
182 213
     // justify-content: center;
183 214
     // gap: 12rpx;
184 215
     .content_item_title {
@@ -208,6 +239,12 @@ body {
208 239
         white-space: nowrap;
209 240
       }
210 241
     }
242
+    .content_item_result_score {
243
+      display: flex;
244
+      gap: 24rpx;
245
+      color: #31373d;
246
+      font-size: 28rpx;
247
+    }
211 248
     .content_item_time {
212 249
       font-size: 28rpx;
213 250
       font-weight: 400;

+ 86 - 8
src/pages/knowledge/index.vue

@@ -1,6 +1,56 @@
1 1
 <script setup lang="ts">
2 2
 import { ref } from 'vue'
3
-
3
+import searchimg from '@/assets/searchimgs.png'
4
+const list = ref([
5
+  {
6
+    backcolor: '#215ACD',
7
+  },
8
+  {
9
+    backcolor: '#38B865',
10
+  },
11
+  {
12
+    backcolor: '#EB5E12',
13
+  },
14
+  {
15
+    backcolor: '#215ACD',
16
+  },
17
+  {
18
+    backcolor: '#215ACD',
19
+  },
20
+  {
21
+    backcolor: '#38B865',
22
+  },
23
+  {
24
+    backcolor: '#215ACD',
25
+  },
26
+  {
27
+    backcolor: '#38B865',
28
+  },
29
+  {
30
+    backcolor: '#EB5E12',
31
+  },
32
+  {
33
+    backcolor: '#8848D7',
34
+  },
35
+  {
36
+    backcolor: '#EB5E12',
37
+  },
38
+  {
39
+    backcolor: '#8848D7',
40
+  },
41
+  {
42
+    backcolor: '#38B865',
43
+  },
44
+  {
45
+    backcolor: '#EB5E12',
46
+  },
47
+  {
48
+    backcolor: '#8848D7',
49
+  },
50
+  {
51
+    backcolor: '#8848D7',
52
+  },
53
+])
4 54
 const handleKnowledgeSearch = () => {
5 55
   uni.navigateTo({
6 56
     url: '/pages/knowledge/search/index',
@@ -14,7 +64,7 @@ const handleMyExamination = () => {
14 64
 </script>
15 65
 <template>
16 66
   <view class="knowledge">
17
-    <view class="header_nav">{{ $t('tabbar.knowledgebase') }}</view>
67
+    <view class="header_nav">知识学院</view>
18 68
     <view class="header_nav_item">
19 69
       <view class="header_nav_item_items" @tap="handleKnowledgeSearch">
20 70
         <span>知识搜索</span>
@@ -27,8 +77,17 @@ const handleMyExamination = () => {
27 77
     </view>
28 78
     <view class="main_list">
29 79
       <view class="main_list_title">最近查看</view>
30
-      <view class="main_list_items" v-for="(item, index) in 50">
31
-        <view class="main_list_items_icon"></view>
80
+      <view class="main_list_items" v-for="(item, index) in list" :key="index">
81
+        <view
82
+          class="main_list_items_icon"
83
+          :style="{ background: item.backcolor }"
84
+        >
85
+          <view
86
+            class="main_list_items_icon_line"
87
+            v-for="(line, lineIndex) in 3"
88
+            :key="lineIndex"
89
+          ></view>
90
+        </view>
32 91
         <view class="main_list_items_text">
33 92
           <span>我的文件</span>
34 93
           <span>文档介绍</span>
@@ -83,10 +142,16 @@ body {
83 142
       display: flex;
84 143
       justify-content: space-between;
85 144
       .left_items {
86
-        background-color: #79a6ff;
145
+        background-image: url('../../assets/searchimgs.png');
146
+        background-size: contain;
147
+        background-position: center bottom;
148
+        background-repeat: no-repeat;
87 149
       }
88 150
       .right_items {
89
-        background-color: #aee1ca;
151
+        background-image: url('../../assets/exam.png');
152
+        background-size: contain;
153
+        background-position: center bottom;
154
+        background-repeat: no-repeat;
90 155
       }
91 156
       .header_nav_item_items_icon {
92 157
         width: 96rpx;
@@ -155,8 +220,21 @@ body {
155 220
       .main_list_items_icon {
156 221
         width: 74rpx;
157 222
         height: 86rpx;
158
-        background-color: #79a6ff;
159
-        border-radius: 12rpx;
223
+        border-radius: 20rpx;
224
+        padding: 20rpx;
225
+        box-sizing: border-box;
226
+        display: flex;
227
+        flex-direction: column;
228
+        justify-content: space-between;
229
+        .main_list_items_icon_line {
230
+          width: 100%;
231
+          height: 6rpx;
232
+          border-radius: 4rpx;
233
+          background-color: #ffffff;
234
+          &:nth-child(1) {
235
+            width: 60%;
236
+          }
237
+        }
160 238
       }
161 239
     }
162 240
   }

+ 77 - 4
src/pages/knowledge/search/index.vue

@@ -1,4 +1,55 @@
1 1
 <script setup lang="ts">
2
+import { ref } from 'vue'
3
+const list = ref([
4
+  {
5
+    backcolor: '#215ACD',
6
+  },
7
+  {
8
+    backcolor: '#38B865',
9
+  },
10
+  {
11
+    backcolor: '#EB5E12',
12
+  },
13
+  {
14
+    backcolor: '#215ACD',
15
+  },
16
+  {
17
+    backcolor: '#215ACD',
18
+  },
19
+  {
20
+    backcolor: '#38B865',
21
+  },
22
+  {
23
+    backcolor: '#215ACD',
24
+  },
25
+  {
26
+    backcolor: '#38B865',
27
+  },
28
+  {
29
+    backcolor: '#EB5E12',
30
+  },
31
+  {
32
+    backcolor: '#8848D7',
33
+  },
34
+  {
35
+    backcolor: '#EB5E12',
36
+  },
37
+  {
38
+    backcolor: '#8848D7',
39
+  },
40
+  {
41
+    backcolor: '#38B865',
42
+  },
43
+  {
44
+    backcolor: '#EB5E12',
45
+  },
46
+  {
47
+    backcolor: '#8848D7',
48
+  },
49
+  {
50
+    backcolor: '#8848D7',
51
+  },
52
+])
2 53
 const itemClick = (index: number) => {
3 54
   uni.navigateTo({
4 55
     url: '/pages/knowledge/search/details/index',
@@ -13,10 +64,19 @@ const itemClick = (index: number) => {
13 64
     <view class="main_list">
14 65
       <view
15 66
         class="main_list_items"
16
-        v-for="(item, index) in 50"
67
+        v-for="(item, index) in list"
17 68
         @tap="itemClick(index)"
18 69
       >
19
-        <view class="main_list_items_icon"></view>
70
+        <view
71
+          class="main_list_items_icon"
72
+          :style="{ background: item.backcolor }"
73
+        >
74
+          <view
75
+            class="main_list_items_icon_line"
76
+            v-for="(line, lineIndex) in 3"
77
+            :key="lineIndex"
78
+          ></view>
79
+        </view>
20 80
         <view class="main_list_items_text">
21 81
           <span>我的文件</span>
22 82
           <span>文档介绍</span>
@@ -102,8 +162,21 @@ body {
102 162
       .main_list_items_icon {
103 163
         width: 74rpx;
104 164
         height: 86rpx;
105
-        background-color: #79a6ff;
106
-        border-radius: 12rpx;
165
+        border-radius: 20rpx;
166
+        padding: 20rpx;
167
+        box-sizing: border-box;
168
+        display: flex;
169
+        flex-direction: column;
170
+        justify-content: space-between;
171
+        .main_list_items_icon_line {
172
+          width: 100%;
173
+          height: 6rpx;
174
+          border-radius: 4rpx;
175
+          background-color: #ffffff;
176
+          &:nth-child(1) {
177
+            width: 60%;
178
+          }
179
+        }
107 180
       }
108 181
     }
109 182
   }