Browse Source

调整每周答题、专项答题的样式

huangtao 3 years ago
parent
commit
203d5ccfbe
3 changed files with 525 additions and 504 deletions
  1. 465 422
      package-lock.json
  2. 33 43
      src/views/home/answer/page-answer-special.vue
  3. 27 39
      src/views/home/answer/page-answer-week.vue

File diff suppressed because it is too large
+ 465 - 422
package-lock.json


+ 33 - 43
src/views/home/answer/page-answer-special.vue

@@ -8,24 +8,23 @@
       @load="onLoad()"
     >
       <van-cell
-       class="vanCell"
+        class="vanCell"
         v-for="(item, index) in specialAnswerList"
         :key="index"
       >
         <div slot="default" class="contentItemDiv">
-            <div class="contentItemTitle">
-              {{ item.name }}
+          <div class="contentItemTitle">
+            {{ item.name }}
+          </div>
+          <div class="startAnswerBox" @click="clickAnswer(item)">
+            <!-- 此处的div不可以注释,否则样式会变,只需要注释时间即可 -->
+            <div>
+              {{ formateDatesFun(item.createdTime) }}
             </div>
-            <div class="contentItemDescription">
-              <!-- <span>{{
-                formateDatesFun(item.addedTime)
-              }}</span> -->
-            </div>
-             <div class="startAnswerBox" @click="clickAnswer(item)">
-                <div class="startButtonBox">
-                    <span class="startText">开始答题</span>
-                </div>
+            <div class="startButtonBox">
+              <span class="startText">开始答题</span>
             </div>
+          </div>
         </div>
       </van-cell>
     </van-list>
@@ -49,12 +48,11 @@ export default {
   created() {
     this.getSpecialAnswerList();
   },
-  destroyed () {
-  },
-  activated() {
-  },
+  destroyed() {},
+  activated() {},
   computed: {
     ...mapState({
+      userInfo: state => state.user.userInfo,
       chooseEngneeringWork: state => state.user.chooseEngneeringWork
     })
   },
@@ -65,12 +63,16 @@ export default {
       let params = {
         page: this.specialPage,
         size: this.specialSize,
-        engineertypeid: this.chooseEngneeringWork.id
+        engineertypeid: this.chooseEngneeringWork.id,
+        userName: this.userInfo.userName
       };
       this.$_http
         .get(this.$_API.GET_JTXT_SPECIAL_QUESTIONS, { params })
         .then(res => {
-          this.specialAnswerList = [...this.specialAnswerList, ...res.data.content];
+          this.specialAnswerList = [
+            ...this.specialAnswerList,
+            ...res.data.content
+          ];
           // 不能上拉了就是加载玩了
           this.finished = res.data.last;
           this.specialPage++;
@@ -104,40 +106,28 @@ export default {
 
 <style lang="scss" scoped>
 .contentBody {
-  .vanCell{
-    background-color: #F0F0F0;
-   .contentItemDiv {
-    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
-    background-color: #FFFFFF;
-    height: 80px;
-    border-radius: 2px;
-    padding: 10px;
+  background-color: #f0f0f0;
+  .contentItemDiv {
     .contentItemTitle {
       font-size: 0.65rem;
       font-weight: bold;
     }
-    .contentItemDescription {
-      margin-top: 0.5rem;
-      color: #696969;
-      span {
-        margin-left: 0.5rem;
-      }
-    }
     .startAnswerBox {
-      width:100%;
+      width: 100%;
       display: flex;
-      justify-content: flex-end;
-      .startButtonBox{
-          border-radius: 2px;
-          background-color: #0088E9;
+      justify-content: space-between;
+      align-items: center;
+      color: #696969;
+      margin-top: 0.5rem;
+      .startButtonBox {
+        border-radius: 2px;
+        background-color: #b3a38c;
+        padding: 2px 8px;
       }
-      .startText{
-          margin: 10px 5px;
-          color: #fff;
+      .startText {
+        color: #fff;
       }
     }
-    }
   }
-
 }
 </style>

+ 27 - 39
src/views/home/answer/page-answer-week.vue

@@ -7,24 +7,18 @@
       finished-text="没有更多了"
       @load="onLoad"
     >
-      <van-cell
-        v-for="(item, index) in weekAnswerList"
-        :key="index"
-      >
+      <van-cell v-for="(item, index) in weekAnswerList" :key="index">
         <div slot="default" class="contentItemDiv">
-          <div>
-            <div class="contentItemTitle">
-              {{ item.name}}
-            </div>
-            <div class="contentItemDescription">
-              <!-- <span>{{
-                formateDatesFun(item.addedTime)
-              }}</span> -->
+          <div class="contentItemTitle">
+            {{ item.name }}
+          </div>
+          <div class="startAnswerBox" @click="clickAnswer(item)">
+            <!-- 此处的div不可以注释,否则样式会变,只需要注释时间即可 -->
+            <div>
+              {{ formateDatesFun(item.createdTime) }}
             </div>
-            <div class="startAnswerBox" @click="clickAnswer(item)">
-                <div class="startButtonBox">
-                    <span class="startText">开始答题</span>
-                </div>
+            <div class="startButtonBox">
+              <span class="startText">开始答题</span>
             </div>
           </div>
         </div>
@@ -50,12 +44,11 @@ export default {
   created() {
     this.getWeekAnswerList();
   },
-  destroyed () {
-  },
-  activated() {
-  },
+  destroyed() {},
+  activated() {},
   computed: {
     ...mapState({
+      userInfo: state => state.user.userInfo,
       chooseEngneeringWork: state => state.user.chooseEngneeringWork
     })
   },
@@ -66,7 +59,8 @@ export default {
       let params = {
         page: this.weeklyPage,
         size: this.weeklySize,
-        engineertypeid: this.chooseEngneeringWork.id
+        engineertypeid: this.chooseEngneeringWork.id,
+        username: this.userInfo.userName
       };
       this.$_http
         .get(this.$_API.GET_JTXT_WEEKLY_QUESTIONS, { params })
@@ -100,7 +94,6 @@ export default {
       this.$router.back();
     }
   }
-
 };
 </script>
 
@@ -112,27 +105,22 @@ export default {
       font-size: 0.65rem;
       font-weight: bold;
     }
-    .contentItemDescription {
-      margin-top: 0.5rem;
-      color: #696969;
-      span {
-        margin-left: 0.5rem;
-      }
-    }
-   .startAnswerBox {
-      width:100%;
+    .startAnswerBox {
+      width: 100%;
       display: flex;
-      justify-content: flex-end;
-      .startButtonBox{
-          border-radius: 2px;
-          background-color: #696969;
+      justify-content: space-between;
+      align-items: center;
+      color: #696969;
+      margin-top: 0.5rem;
+      .startButtonBox {
+        border-radius: 2px;
+        background-color: #b3a38c;
+        padding: 2px 8px;
       }
-      .startText{
-          margin: 10px 5px;
-          color: #fff;
+      .startText {
+        color: #fff;
       }
     }
-
   }
 }
 </style>

Some files were not shown because too many files changed in this diff