Browse Source

修改积分样式

aaa 3 years ago
parent
commit
62a9532eb5
2 changed files with 73 additions and 13 deletions
  1. 14 5
      src/views/home/person/exam-history.vue
  2. 59 8
      src/views/home/person/user-manual.vue

+ 14 - 5
src/views/home/person/exam-history.vue

@@ -3,12 +3,13 @@
     <van-nav-bar title="考试" left-arrow @click-left="onClickLeft" />
     <div class="exam-history-div">
       <div class="exam-history-grades-div">
-        <div class="exam-history-description">
-          考试积分
-        </div>
+        <div class="exam-history-name-description">考试积分</div>
         <div class="exam-history-grades">
           {{ this.user.userInfo.examPoints }}
         </div>
+        <div class="exam-history-description" @click="clickExamRule">
+          积分说明
+        </div>
       </div>
 
       <div class="exam-history-list">
@@ -108,7 +109,8 @@ export default {
         .catch(() => {
           this.$store.commit("toggleLoading", false);
         });
-    }
+    },
+    clickExamRule() {}
   }
 };
 </script>
@@ -134,13 +136,20 @@ export default {
         color: #0088e9;
         margin-top: 0.5rem;
       }
-      .exam-history-description {
+      .exam-history-name-description {
         padding: 0.15rem 0.5rem;
         // border: 1px solid #7cc8ff;
         // border-radius: 0.25rem;
         color: #0088e9;
         font-size: 0.75rem;
       }
+      .exam-history-description {
+        margin-top: 0.5rem;
+        padding: 0.15rem 0.5rem;
+        border: 1px solid #7cc8ff;
+        border-radius: 0.25rem;
+        color: #7cc8ff;
+      }
     }
     .exam-history-list {
       padding: 0.5rem 0;

+ 59 - 8
src/views/home/person/user-manual.vue

@@ -3,7 +3,10 @@
     <van-nav-bar title="学习积分" left-arrow @click-left="onClickLeft" />
     <div class="user-manual-div">
       <div class="user-manual-grades-div">
-        <div class="user-manual-grades">{{ this.user.userInfo.points }}</div>
+        <div class="user-manual-name-description">学习积分</div>
+        <div class="user-manual-grades">
+          {{ this.user.userInfo.points }}
+        </div>
         <div class="user-manual-description" @click="clickLearnRule">
           积分说明
         </div>
@@ -37,7 +40,7 @@
                 />
               </div>
               <div class="user-manual-item-left-schedule-text">
-                已获得{{ item.getPoints }}分 / 上限{{ item.totaPonits }}分
+                已获得{{ item.getPoints }}分 / 上限{{ item.totalPonits }}分
               </div>
             </div>
           </div>
@@ -63,22 +66,62 @@ export default {
       loading: false,
       eventList: [
         {
-          name: "今日必答",
+          name: "每日登录",
           type: "DAILY_QUESTIONS",
+          rule: "1分/登录",
+          isFinish: false,
+          getPoints: 0,
+          totalPonits: 1,
+          rightButton: "已完成",
+          router: ""
+        },
+        {
+          name: "阅读文章",
+          type: "LEARNING_COMPLETE",
+          rule: "1分/每阅读一篇非必学文章",
+          isFinish: false,
+          getPoints: 0,
+          totalPonits: 10,
+          rightButton: "去看看",
+          router: ""
+        },
+        {
+          name: "答题",
+          type: "LEARNING_COMPLETE",
+          rule: "1分/每答对一道非今日必答题目",
+          isFinish: false,
+          getPoints: 0,
+          totalPonits: 10,
+          rightButton: "去答题",
+          router: ""
+        },
+        {
+          name: "专项答题",
+          type: "LEARNING_COMPLETE",
+          rule: "1分/每答对一道专项答题",
+          isFinish: false,
+          getPoints: 0,
+          totalPonits: 10,
+          rightButton: "去答题",
+          router: ""
+        },
+        {
+          name: "今日必答",
+          type: "LEARNING_COMPLETE",
           rule: "2分/完成今日必答",
           isFinish: false,
           getPoints: 0,
-          totaPonits: 6,
+          totalPonits: 2,
           rightButton: "去答题",
           router: ""
         },
         {
           name: "今日必读",
-          type: "LEARNING_COMPLETE",
-          rule: "2分/每有效阅读一篇必学文章",
+          type: "DAILY_QUESTIONS",
+          rule: "2分/阅读一篇必答文章",
           isFinish: false,
           getPoints: 0,
-          totaPonits: 6,
+          totalPonits: 1000000000,
           rightButton: "去看看",
           router: ""
         }
@@ -161,7 +204,7 @@ export default {
     },
     // 格式化已获得的积分/总积分的数
     formatePercentageFun(getPoints, totaPonits) {
-      return Math.round((getPoints / totaPonits) * 100);
+      return Math.round((getPoints / totaPonits) * 100) || 0;
     },
     // 操作:返回
     onClickLeft() {
@@ -209,9 +252,17 @@ export default {
       justify-content: center;
       align-items: center;
       padding-top: 1rem;
+      .user-manual-name-description {
+        padding: 0.15rem 0.5rem;
+        // border: 1px solid #7cc8ff;
+        // border-radius: 0.25rem;
+        color: #0088e9;
+        font-size: 0.75rem;
+      }
       .user-manual-grades {
         font-size: 1rem;
         color: #0088e9;
+        margin-top: 0.5rem;
       }
       .user-manual-description {
         margin-top: 0.5rem;