Explorar el Código

修改BUG,完成需求

yellowtaotao hace 4 años
padre
commit
8f36fe3493

+ 1 - 1
src/styles/vant.scss

@@ -44,7 +44,7 @@
   }
   .van-tabs__line {
     background-color: #0088e9;
-    width: 40% !important; 
+    width: 10% !important; 
   }
 }
 .van-tabs--line .van-tabs__wrap {

+ 15 - 19
src/views/home/answer/page-answer-recruit.vue

@@ -11,9 +11,9 @@
             <div class="exam-question-head-left-txt">
               {{ examQuestionList[answerIndex].typeTxt || "undefind" }}
             </div>
-            <span class="exam-question-head-left-txt"
-              >{{ examQuestionList[answerIndex].grade || "undefind" }} 分</span
-            >
+            <!-- <span class="exam-question-head-left-txt"
+              >{{ examQuestionList[answerIndex].grade || 1 }} 分</span
+            > -->
           </div>
           <div class="exam-question-head-right">
             <span class="exam-question-head-right-now">{{
@@ -163,7 +163,10 @@ export default {
       }
       this.$store.commit("toggleLoading", true);
       let params = {
-        type: this.chooseEngneeringWork.value
+        type:
+          this.chooseEngneeringWork && this.chooseEngneeringWork.value
+            ? this.chooseEngneeringWork.value
+            : "aaa"
       };
       this.$_http
         .post(
@@ -202,14 +205,13 @@ export default {
           httpResultData.push(this.setPersonDataFun(resData));
           if (isLast) {
             // 临时解决多个异步请求进行的问题
-            setTimeout(() => {
-              this.examQuestionList = httpResultData;
-              this.handleExamQuestionItemFun(this.examQuestionList[0], 0); // 设置第一题开始
-              let curTime = new Date();
-              this.answerTime.startTime = curTime; // 赋值开始时间
-              this.isInited = true;
-              this.$store.commit("toggleLoading", false);
-            }, 100);
+            this.examQuestionList = httpResultData;
+            console.log(this.examQuestionList);
+            this.handleExamQuestionItemFun(this.examQuestionList[0], 0); // 设置第一题开始
+            let curTime = new Date();
+            this.answerTime.startTime = curTime; // 赋值开始时间
+            this.isInited = true;
+            this.$store.commit("toggleLoading", false);
           }
         })
         .catch(() => {
@@ -273,13 +275,7 @@ export default {
         case this.questionType.singleChoice:
         case this.questionType.multipleChoice:
           finalAnswer.forEach((item, index) => {
-            this.examQuestionList[this.answerIndex].answers.forEach(
-              (it, ind) => {
-                if (item === it) {
-                  txt = txt + this.formatQuestionIndex(ind);
-                }
-              }
-            );
+            txt = txt + item;
           });
           break;
         case this.questionType.gapFilling:

+ 1 - 3
src/views/home/exam/page-exam-item-detail.vue

@@ -100,10 +100,8 @@ export default {
       border-radius: 4px;
       box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
       .exam-item-detial-title {
-        height: 2rem;
+        padding: 0.5rem 0;
         border-bottom: 1px solid #e4e8eb;
-        line-height: 2rem;
-        text-align: center;
         font-size: 0.7rem;
         font-weight: bold;
         color: #000;

+ 6 - 2
src/views/home/exam/page-exam-item-doing.vue

@@ -36,7 +36,7 @@
               {{ examQuestionList[answerIndex].typeTxt || "undefind" }}
             </div>
             <span class="exam-question-head-left-txt"
-              >{{ examQuestionList[answerIndex].grade || "undefind" }} 分</span
+              >{{ examQuestionList[answerIndex].grade || 1 }} 分</span
             >
           </div>
           <div class="exam-question-head-right">
@@ -207,8 +207,12 @@ export default {
     // 方法:开始考试
     examStartFun() {
       this.$store.commit("toggleLoading", true);
+      console.log(this.chooseEngneeringWork);
       let params = {
-        type: this.chooseEngneeringWork.value
+        type:
+          this.chooseEngneeringWork && this.chooseEngneeringWork.value
+            ? this.chooseEngneeringWork.value
+            : "aaa"
       };
       this.$_http
         .post(

+ 40 - 31
src/views/home/exam/page-exam.vue

@@ -7,20 +7,22 @@
         :key="index"
         @click="handleClickExamItemFun(item)"
       >
-        <div class="exam-item-name">{{ item.name }}</div>
-        <div
-          :class="{
-            'exam-item-states': true,
-            'exam-item-states-yellow':
-              item.examStatus === examStatesType.NOT_START,
-            'exam-item-states-green':
-              item.examStatus === examStatesType.STARTED,
-            'exam-item-states-red':
-              item.examStatus === examStatesType.STARTEXAMING,
-            'exam-item-states-gray': item.examStatus === examStatesType.OVER
-          }"
-        >
-          {{ item.examStatusTxt }}
+        <div class="exam-item-title-row">
+          <div class="exam-item-name">{{ item.name }}</div>
+          <div
+            :class="{
+              'exam-item-states': true,
+              'exam-item-states-yellow':
+                item.examStatus === examStatesType.NOT_START,
+              'exam-item-states-green':
+                item.examStatus === examStatesType.STARTED,
+              'exam-item-states-red':
+                item.examStatus === examStatesType.STARTEXAMING,
+              'exam-item-states-gray': item.examStatus === examStatesType.OVER
+            }"
+          >
+            {{ item.examStatusTxt }}
+          </div>
         </div>
         <div class="exam-item-describe">考试时间:{{ item.startTime }}</div>
         <div class="exam-item-describe">
@@ -158,29 +160,36 @@ export default {
   .exam-list {
     padding: 0.5rem 0.5rem;
     .exam-item {
+      width: 100%;
       padding: 0 0.5rem 0.5rem;
       margin-bottom: 0.7rem;
       background-color: #fff;
       border-radius: 4px;
       box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
-      position: relative;
-      .exam-item-name {
-        height: 2rem;
+      .exam-item-title-row {
+        width: 100%;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
         border-bottom: 1px solid #e4e8eb;
-        line-height: 2rem;
-        text-align: center;
-        font-size: 0.65rem;
-        font-weight: bold;
-        color: #000;
-      }
-      .exam-item-states {
-        height: 2rem;
-        line-height: 2rem;
-        position: absolute;
-        right: 0.5rem;
-        top: 0;
-        font-size: 0.6rem;
-        border-radius: 0.2rem;
+        .exam-item-name {
+          height: 2rem;
+          line-height: 2rem;
+          text-align: center;
+          font-size: 0.65rem;
+          font-weight: bold;
+          color: #000;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+          overflow: hidden;
+        }
+        .exam-item-states {
+          font-size: 0.6rem;
+          border-radius: 0.2rem;
+          margin-left: 0.5rem;
+          flex-wrap: nowrap;
+          white-space: nowrap;
+        }
       }
       .exam-item-states-yellow {
         color: #e6a23c;

+ 1 - 2
src/views/home/index.vue

@@ -115,6 +115,7 @@ export default {
         { text: "桥梁工", value: "QiaoLiangGong" },
         { text: "线路工", value: "XianLuGong" }
       ];
+      this.handleChangeEngneeringWorkFun(this.engineeringWorkList[0].value);
       this.activeTabName = 0;
       this.onChangeTabFun(this.activeTabName);
     },
@@ -132,12 +133,10 @@ export default {
           break;
         }
       }
-      console.log(resultItem);
       this.$store.commit("updateUserItemStore", {
         field: "chooseEngneeringWork",
         value: resultItem
       });
-      console.log("选择的工种信息:", resultItem);
     },
     // 获取所有收藏
     getCollection() {

+ 1 - 1
src/views/home/learn/page-learn-content.vue

@@ -189,7 +189,7 @@ export default {
         if (this.seconds > 0) {
           this.seconds--;
         } else {
-          Toast("学习完成");
+          Toast("学习完成,积分+1");
           if (this.isReadable) {
             this.isReadable = false;
             this.ReadMaterial();

+ 26 - 35
src/views/home/person/rank.vue

@@ -21,7 +21,7 @@
                   contentItemTopRowChild: true,
                   contentItemTopRowOne: index === 0,
                   contentItemTopRowTwo: index === 1,
-                  contentItemTopRowThree: index === 2,
+                  contentItemTopRowThree: index === 2
                 }"
                 v-for="(item, index) in rankListTopThree"
                 :key="index"
@@ -42,12 +42,12 @@
                   </div>
                 </div>
                 <div class="contentItemTopRowChildName">
-                  {{ item.name || "userName" + (index + 1) }}
+                  {{ item.userName || "userName" + (index + 1) }}
                 </div>
                 <span class="contentItemTopRowChildPoints">
-                  {{ item.ponits || "undefind" }}
+                  {{ item.points }}
                 </span>
-                <span class="contentItemTopRowChildSteps">Steps</span>
+                <span class="contentItemTopRowChildSteps">积分</span>
               </div>
             </div>
           </van-cell>
@@ -64,11 +64,11 @@
                     :show-error="true"
                     :error-icon="maleAvatar"
                   />
-                  <div>{{ item.name || "未知" }}</div>
+                  <div>{{ item.userName || "未知" }}</div>
                 </div>
                 <div class="userPonits">
-                  {{ item.points || "undefind" }}
-                  <span>Steps</span>
+                  {{ item.points }}
+                  <span>积分</span>
                 </div>
               </div>
             </div>
@@ -114,41 +114,25 @@ export default {
       this.$_http
         .get(this.$_API.JTXT_GET_LEADERBOARD, { params })
         .then(res => {
-          console.log(res);
+          console.log(res.data);
+          if (res.data && res.data.users) {
+            res.data.users.forEach((item, index) => {
+              if (index < 3) {
+                this.rankListTopThree[index] = item;
+              } else {
+                this.rankListOthers.push(item);
+              }
+            });
+          }
+          console.log(this.rankListTopThree, this.rankListOthers);
           this.finished = true;
           this.loading = false;
+          this.$store.commit("toggleLoading", false);
         })
         .catch(() => {
           this.$store.commit("toggleLoading", false);
         });
     },
-    // 查询:排行榜单条数据ID对应的详情
-    getFavoritesItemDeitalFun(item, index, isLast) {
-      // this.$_http
-      //   .get(this.$pathParams(this.$_API.接口名字, path))
-      //   .then(res => {
-      if (index < 3) {
-        // this.rankListTopThree[index] = res.data;
-        this.rankListTopThree[index] = item;
-      } else {
-        // this.rankListOthers.push(res.data);
-        this.rankListOthers.push(item);
-      }
-      this.rankListOthers = this.rankListTopThree;
-      if (isLast) {
-        console.log(
-          "--collection--",
-          this.rankListTopThree,
-          this.rankListOthers
-        );
-        this.finished = true;
-        this.$store.commit("toggleLoading", false);
-      }
-      // })
-      // .catch(() => {
-      //   this.$store.commit("toggleLoading", false);
-      // });
-    },
     // 操作:返回
     onClickLeft() {
       this.$router.back();
@@ -159,6 +143,13 @@ export default {
 };
 </script>
 
+<style lang="scss">
+.contentBody {
+  .van-tabs__line {
+    background-color: #0088e9;
+  }
+}
+</style>
 <style lang="scss" scoped>
 .contentBody {
   font-size: 0.6rem;