浏览代码

优化问题

lex 1 年之前
父节点
当前提交
165ccc51cf

+ 53 - 30
src/views/exercise-record/exercis-detail.module.less

@@ -7,7 +7,7 @@
   padding-bottom: 12px;
 
   .topInfo {
-    padding: 34px 15px 30px;
+    padding: 34px 15px 18px;
     display: flex;
     flex-direction: row;
     align-items: center;
@@ -15,7 +15,7 @@
     flex-wrap: nowrap;
 
     .topInfoLeft {
-      width: 50%;
+      width: 100%;
       display: flex;
       flex-direction: row;
       align-items: center;
@@ -29,12 +29,17 @@
         margin-right: 15px;
       }
 
+
       .headerImg {
         width: 60px;
         height: 60px;
       }
 
       .infoMsg {
+        display: flex;
+        align-items: flex-start;
+        flex-direction: column;
+
         p {
           display: inline-block;
           width: 90px;
@@ -63,41 +68,59 @@
       }
     }
 
-    .topInfoRight {
-      // width: 50%;
-      display: flex;
-      flex-direction: row;
-      align-items: center;
-      justify-content: flex-end;
 
-      .infoDay {
-        margin-right: 20px;
-      }
+  }
 
-      .infoDayMain {
-        font-size: 25px;
-        color: #333333;
-        line-height: 28px;
-        margin-bottom: 7px;
-        font-family: DINAlternate-Bold, DINAlternate;
-        font-weight: 600;
-        text-align: center;
-
-        span {
-          margin-left: 2px;
-          font-size: 12px;
-          font-weight: 400;
-          color: #333333;
-          line-height: 17px;
-        }
-      }
+  .topInfoRight {
+    // width: 50%;
+    margin-bottom: 18px;
+    padding: 0 10%;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: center;
+
+    .infoDay,
+    .infoTime {
+      width: 50%;
+    }
+
+    .infoDay {
+      margin-right: 20px;
+    }
 
-      .infoDaysub {
+    .infoDayMain {
+      font-size: 24px;
+      color: #333333;
+      line-height: 28px;
+      margin-bottom: 7px;
+      font-family: DINAlternate-Bold, DINAlternate;
+      font-weight: 600;
+      text-align: center;
+
+      span {
+        margin-left: 2px;
         font-size: 12px;
         font-weight: 400;
         color: #333333;
         line-height: 17px;
-        text-align: center;
+      }
+    }
+
+    .infoDaysub {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-size: 12px;
+      font-weight: 400;
+      color: #333333;
+      line-height: 17px;
+      text-align: center;
+
+      img {
+        width: 14px;
+        height: 14px;
+        margin-right: 3px;
       }
     }
   }

+ 27 - 19
src/views/exercise-record/exercis-detail.tsx

@@ -15,6 +15,8 @@ import { useRect } from '@vant/use';
 import { formatterDatePicker } from '@/helpers/utils';
 import { useEventListener, useWindowScroll } from '@vueuse/core';
 import { state as baseState } from '@/state';
+import iconClock from './images/icon-clock.png';
+import iconDays from './images/icon-days.png';
 
 export default defineComponent({
   name: 'exercis-detail',
@@ -160,26 +162,32 @@ export default defineComponent({
                   </div>
                 </div>
               </div>
-              <div class={styles.topInfoRight}>
-                <div class={styles.infoDay}>
-                  <p class={styles.infoDayMain}>
-                    {infoDetail.value.practiceDays
-                      ? infoDetail.value.practiceDays
-                      : 0}
-                    {/* <span>天</span> */}
-                  </p>
-                  <p class={styles.infoDaysub}>练习天数(天)</p>
-                </div>
-                <div class={styles.infoTime}>
-                  <p class={styles.infoDayMain}>
-                    {infoDetail.value.practiceTimes
-                      ? Math.floor(infoDetail.value.practiceTimes / 60)
-                      : 0}
+            </div>
+            <div class={styles.topInfoRight}>
+              <div class={styles.infoDay}>
+                <p class={styles.infoDayMain}>
+                  {infoDetail.value.practiceDays
+                    ? infoDetail.value.practiceDays
+                    : 0}
+                  {/* <span>天</span> */}
+                </p>
+                <p class={styles.infoDaysub}>
+                  <img src={iconDays} />
+                  练习天数(天)
+                </p>
+              </div>
+              <div class={styles.infoTime}>
+                <p class={styles.infoDayMain}>
+                  {infoDetail.value.practiceTimes
+                    ? Math.floor(infoDetail.value.practiceTimes / 60)
+                    : 0}
 
-                    {/* <span>分钟</span> */}
-                  </p>
-                  <p class={styles.infoDaysub}>练习时长(分钟)</p>
-                </div>
+                  {/* <span>分钟</span> */}
+                </p>
+                <p class={styles.infoDaysub}>
+                  <img src={iconClock} />
+                  练习时长(分钟)
+                </p>
               </div>
             </div>
             <CellGroup inset>

二进制
src/views/exercise-record/images/icon-clock.png


二进制
src/views/exercise-record/images/icon-days.png


+ 4 - 0
src/views/exercise-record/modals/detail-item.module.less

@@ -20,6 +20,10 @@
         color: #333333;
         line-height: 22px;
         margin-bottom: 6px;
+        max-width: 160px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
       }
 
       .itemTopSub {

+ 9 - 3
src/views/knowledge-library/error-question-mode/index.tsx

@@ -41,7 +41,7 @@ export default defineComponent({
       currentIndex: 0,
       questionList: [] as any,
       page: 1,
-      rows: 50,
+      rows: 10,
       total: 0,
       isFinish: false, // 是否完成加载
       visiableInfo: {
@@ -146,8 +146,7 @@ export default defineComponent({
         await request.get('/edu-app/studentExaminationErrorEdition/del', {
           hideLoading: false,
           params: {
-            studentExaminationErrorEditionId:
-              state.visiableInfo.graspItem.studentExaminationErrorEditionId
+            questionId: state.visiableInfo.graspItem.id
           }
         });
         state.visiableInfo.graspItem.grasp = true;
@@ -680,6 +679,7 @@ export default defineComponent({
                 color: '#EAEAEA'
               }
             ]}
+            isFinish={state.isFinish}
             onSelect={(item: any) => {
               // 跳转,并且跳过动画
               swipeRef.value?.swipeTo(item, {
@@ -687,6 +687,12 @@ export default defineComponent({
               });
               state.visiableAnswer = false;
             }}
+            onLoadMore={() => {
+              const lastQuestion =
+                state.questionList[state.questionList.length - 1];
+              state.page = state.page + 1;
+              getExamDetails(lastQuestion.id);
+            }}
           />
         </ActionSheet>
 

+ 11 - 0
src/views/knowledge-library/index.module.less

@@ -83,6 +83,10 @@
       overflow: hidden;
       background-color: #fff;
       padding: 15px;
+
+      img {
+        width: 100% !important;
+      }
     }
   }
 
@@ -90,6 +94,12 @@
     .van-collapse {
       border-radius: 20px;
       overflow: hidden;
+      background-color: #fff;
+    }
+
+    .van-collapse-item {
+      border-radius: 20px !important;
+      overflow: hidden;
     }
 
     .van-cell {
@@ -98,6 +108,7 @@
 
     .van-collapse-item__content {
       padding: 0 15px 12px;
+      border-radius: 20px;
     }
 
     .van-cell__title {

+ 17 - 12
src/views/knowledge-library/index.tsx

@@ -10,6 +10,7 @@ import library2 from './images/library-2.png';
 import library3 from './images/library-3.png';
 import { useEventListener, useWindowScroll } from '@vueuse/core';
 import KnowledgeGuide from '@/custom-plugins/guide-page/knowledge-guide';
+import MEmpty from '@/components/m-empty';
 export default defineComponent({
   name: 'knowledge-ligrary',
   setup() {
@@ -19,7 +20,9 @@ export default defineComponent({
     const forms = reactive({
       cid: route.query.cid,
       list: [] as any,
-      activeNames: null,
+      activeNames: sessionStorage.getItem('knowledge-ligrary-key')
+        ? Number(sessionStorage.getItem('knowledge-ligrary-key'))
+        : 0,
       background: 'transparent',
       color: '#fff'
     });
@@ -36,9 +39,6 @@ export default defineComponent({
           }
         );
         forms.list = data;
-        if (data && data.length > 0) {
-          forms.activeNames = data[0].lessonCoursewareDetailId;
-        }
       } catch {
         //
       }
@@ -134,16 +134,18 @@ export default defineComponent({
         </div>
 
         <div class={[styles.containerSection, styles.librarySection]}>
-          <Collapse v-model={forms.activeNames} accordion border={false}>
-            {forms.list.map((item: any) => (
+          <Collapse
+            v-model={forms.activeNames}
+            accordion
+            border={false}
+            onChange={(val: any) => {
+              sessionStorage.setItem('knowledge-ligrary-key', val);
+            }}>
+            {forms.list.map((item: any, index: number) => (
               <CollapseItem
                 title={item.lessonCoursewareDetailName}
-                name={item.lessonCoursewareDetailId}
-                value={
-                  forms.activeNames === item.lessonCoursewareDetailId
-                    ? '收起'
-                    : '展开'
-                }
+                name={index}
+                value={forms.activeNames === index ? '收起' : '展开'}
                 border={false}>
                 {item.knowledgeDetails &&
                   item.knowledgeDetails.map((detail: any, index: number) => (
@@ -168,6 +170,9 @@ export default defineComponent({
                       </p>
                     </div>
                   ))}
+                {item.knowledgeDetails && item.knowledgeDetails.length <= 0 && (
+                  <MEmpty description="暂无章节" />
+                )}
               </CollapseItem>
             ))}
           </Collapse>

+ 5 - 1
src/views/knowledge-library/model/answer-list/index.module.less

@@ -66,4 +66,8 @@
       color: #fff;
     }
   }
-}
+
+  .more {
+    font-size: 14px !important;
+  }
+}

+ 12 - 1
src/views/knowledge-library/model/answer-list/index.tsx

@@ -34,9 +34,14 @@ export default defineComponent({
     answerResult: {
       type: Array,
       default: () => []
+    },
+    /** 是否加载完 */
+    isFinish: {
+      type: Boolean,
+      default: false
     }
   },
-  emits: ['select'],
+  emits: ['select', 'loadMore'],
   setup(props, { emit }) {
     /**
      * @description 检查用户是否答对
@@ -96,6 +101,12 @@ export default defineComponent({
                 </span>
               </GridItem>
             ))}
+            {!props.isFinish && (
+              <GridItem onClick={() => emit('loadMore')}>
+                {/* 判断是否答题了 */}
+                <span class={[styles.answered, styles.more]}>更多</span>
+              </GridItem>
+            )}
           </Grid>
         </div>
       </div>

+ 15 - 0
src/views/knowledge-library/practice-mode/index.tsx

@@ -532,6 +532,21 @@ export default defineComponent({
           safeAreaInsetBottom>
           <AnswerList
             value={state.questionList}
+            statusList={[
+              {
+                text: '答对',
+                color: '#1CACF1'
+              },
+              {
+                text: '答错',
+                color: '#FF8486'
+              },
+              {
+                text: '未答',
+                color: '#EAEAEA'
+              }
+            ]}
+            lookType={'PRACTICE'}
             // lookType={'ANSWER'}
             onSelect={(item: any) => {
               // 跳转,并且跳过动画

+ 1 - 0
src/views/student-register/index.module.less

@@ -326,6 +326,7 @@
   border-radius: 22px;
   margin: 0 12px 12px;
   width: calc(100% - 24px);
+  border: none;
 
   :global {
     .van-icon {

+ 1 - 1
src/views/student-register/index.tsx

@@ -512,7 +512,7 @@ export default defineComponent({
         />
 
         {/* 是否在微信中打开 */}
-        <OWxTip />
+        {/* <OWxTip /> */}
       </div>
     );
   }

+ 1 - 1
src/views/student-register/shop-mall/modal/add-goods-cart/index.module.less

@@ -142,7 +142,7 @@
       background-color: #FFFAF4;
       background: #FFFAF4;
       border-radius: 6px;
-      border: 1px solid #FFCF7C;
+      // border: 1px solid #FFCF7C;
       color: #F39F11;
     }
 

+ 9 - 4
src/views/student-register/shop-mall/modal/goods-filter-list/index.module.less

@@ -30,6 +30,7 @@
 .radio {
   margin-right: 10px;
   margin-bottom: 8px;
+  overflow: visible;
 
   :global {
     .van-radio__icon {
@@ -37,14 +38,14 @@
     }
 
     .van-tag {
-      box-sizing: border-box;
+      // box-sizing: border-box;
       font-size: 14px;
       display: flex;
       align-items: center;
       justify-content: center;
       border-radius: 16px;
       padding: 6px 12px;
-      border: 1px solid transparent;
+      // border: 1px solid transparent;
       height: 32px;
       line-height: 32px;
       min-width: 80px;
@@ -53,11 +54,15 @@
     .van-tag--default {
       background-color: #f7f8f9;
       color: #999999;
+
+      &::before {
+        border-color: #f7f8f9 !important;
+      }
     }
 
     .van-tag--primary {
       background-color: #f7f8f9;
-      border: 1px solid var(--van-primary);
+      // border: 1px solid var(--van-primary);
       color: var(--van-primary);
     }
 
@@ -84,4 +89,4 @@
       color: #5B2C03 !important;
     }
   }
-}
+}

+ 2 - 0
src/views/student-register/shop-mall/modal/goods-filter-list/index.tsx

@@ -110,6 +110,7 @@ export default defineComponent({
                         onClick={() => {}}>
                         <Tag
                           size="large"
+                          plain
                           type={
                             index === this.params.productAttributeCategoryList
                               ? 'primary'
@@ -141,6 +142,7 @@ export default defineComponent({
                       onClick={() => {}}>
                       <Tag
                         size="large"
+                        plain
                         type={
                           index === this.params.brandList
                             ? 'primary'