Parcourir la source

ui完成部分

xiejiebiao il y a 2 ans
Parent
commit
84dd661ec4

+ 0 - 1
src/main.js

@@ -17,7 +17,6 @@ import vueEsign from 'vue-esign'
 import axios from './axios.js'
 import 'moment/locale/zh-cn'
 
-console.dir(Vue,'Vue')
 Vue.config.productionTip = false
 Vue.prototype.$store = store
 Vue.prototype.$request = request

+ 3 - 1
src/pages/person-center/my-bank/bank-detail/index.vue

@@ -1304,7 +1304,7 @@ export default {
                   font-weight: bold;
                   color: #333333;
                 }
-
+                
                 .content {
                   border-top: 1px solid #eee;
                   .left {
@@ -1341,6 +1341,8 @@ export default {
             }
           }
         }
+
+        
       }
 
       .right-box {

+ 161 - 236
src/pages/person-center/my-bank/bank-detailCopy/index.vue

@@ -4,79 +4,76 @@
       <div class="section__body">
         <div class="left-box">
           <el-tabs v-model="activeName" @tab-click="goodsBank">
-            <el-tab-pane
-              v-for="tab in newList"
-              :key="tab.paperId"
-              :label="tab.paperName"
-              :name="tab.paperId + ''"
-            >
-              <div class="goods-menu">
+            <el-tab-pane v-for="tab in newList" :key="tab.paperId" :label="tab.paperName" :name="tab.paperId + ''">
+              <div v-if="tab.paperName == '每日一练'">
+                <div class="day-box">
+                  <div>
+                    <p>打卡任务</p>
+                    <p>白金卷每日一练</p>
+                  </div>
+                  <div>打卡进度超过了85%的学员,快来打卡呀~</div>
+                  <div>快来打卡</div>
+                </div>
+                <div class="clock-in-box">
+                  <p>累计打卡1天</p>
+                  <el-calendar>
+                    <template slot="dateCell" slot-scope="{date, data}">
+                      <p :class="data.isSelected ? 'is-selected' : ''" style="text-align: center;">
+                        {{ data.day.split('-').slice(2).join('-') }}
+                      </p>
+                      <div style="text-align: center;"> {{ data.isSelected ? '✔️' : '✔️' }}</div>
+                    </template>
+                  </el-calendar>
+                </div>
+
+              </div>
+              <div v-else-if="tab.paperName == '随机练习'">
+                <div class="day-box">
+                  <p>试卷情况:</p>
+                  <p>已做/总题:100/1000</p>
+                  <p>已完成练习10%的题目,加油,希望就在前方~</p>
+                </div>
+                <div>
+                  <p>做题数量</p>
+                  <div v-for="val in 6" :key="val">
+                    <div>{{val}}</div>
+                  </div>
+                  <div>开始做题</div>
+                </div>
+              </div>
+              <div class="goods-menu" v-else>
                 <div class="goods-menu__body">
-                  <div
-                    class="item"
-                    v-for="(item, index) in bankList"
-                    :key="index"
-                  >
+                  <div class="item" v-for="(item, index) in bankList" :key="index">
                     <template v-if="item.type == 1">
                       <div class="item__title" @click="moduleExam(item)">
                         {{ item.name }}
-                        <span
-                          style="float: right; color: #99a0a7; font-weight: 400"
-                          >{{ item.showList ? "收起∧" : "展开∨" }}
+                        <span style="float: right; color: #99a0a7; font-weight: 400">{{ item.showList ? "收起∧" : "展开∨" }}
                         </span>
                       </div>
                       <div class="item__content" v-if="item.showList">
                         <div class="bank-chapter">
-                          <div
-                            class="bank-chapter__item"
-                            v-for="(chapter, chapterIndex) in item.list"
-                            :key="chapterIndex"
-                          >
-                            <div
-                              class="bank-chapter__item__text"
-                              @click="chapterExam(chapter, item.majorId)"
-                            >
-                              <span
-                                style="
+                          <div class="bank-chapter__item" v-for="(chapter, chapterIndex) in item.list"
+                            :key="chapterIndex">
+                            <div class="bank-chapter__item__text" @click="chapterExam(chapter, item.majorId)">
+                              <span style="
                                   margin-left: 21px;
                                   margin-right: 8px;
                                   color: #a7b0b8;
-                                "
-                                ><span v-if="chapterIndex + 1 < 10"
-                                  >0{{ chapterIndex + 1 }}</span
-                                ><span v-else>
+                                "><span v-if="chapterIndex + 1 < 10">0{{ chapterIndex + 1 }}</span><span v-else>
                                   {{ chapterIndex + 1 }}
-                                </span></span
-                              >{{ chapter.name }}
-                              <i
-                                v-if="chapter.showList"
-                                class="el-icon-arrow-up"
-                                style="float: right; margin-right: 20px"
-                              ></i>
-                              <i
-                                v-else
-                                class="el-icon-arrow-down"
-                                style="float: right; margin-right: 20px"
-                              ></i>
+                                </span></span>{{ chapter.name }}
+                              <i v-if="chapter.showList" class="el-icon-arrow-up"
+                                style="float: right; margin-right: 20px"></i>
+                              <i v-else class="el-icon-arrow-down" style="float: right; margin-right: 20px"></i>
                             </div>
 
                             <div class="bank-section" v-if="chapter.showList">
-                              <div
-                                class="bank-section__item"
-                                v-for="(section, sectionIndex) in chapter.list"
-                                :key="sectionIndex"
-                              >
+                              <div class="bank-section__item" v-for="(section, sectionIndex) in chapter.list"
+                                :key="sectionIndex">
                                 <div class="bank-section__item__text">
-                                  <span
-                                    style="margin-right: 8px; color: #a7b0b8"
-                                    >●</span
-                                  >
+                                  <span style="margin-right: 8px; color: #a7b0b8">●</span>
                                   {{ section.examName }}
-                                  <span
-                                    v-if="section.newRecordStatus"
-                                    class="upStudyStyle"
-                                    >上次做到</span
-                                  >
+                                  <span v-if="section.newRecordStatus" class="upStudyStyle">上次做到</span>
                                 </div>
                                 <div class="btn_div">
                                   <!-- 正确率
@@ -88,64 +85,44 @@
                                       )
                                     }}%</span
                                   > -->
-                                  <span style="margin-left: 6px">题目数: </span
-                                  ><span style="color: blue">{{
-                                    section.doQuestionNum || 0
+                                  <span style="margin-left: 6px">题目数: </span><span style="color: blue">{{
+                                      section.doQuestionNum || 0
                                   }}</span>
                                   /
                                   {{ section.questionNum || 0 }}
                                 </div>
-                                <el-button
-                                  v-if="section.recordStatus == -1"
-                                  type="primary"
-                                  @click="
-                                    toDo(
-                                      section,
-                                      chapter.chapterExamId,
-                                      item.majorId
-                                    )
-                                  "
-                                  class="btn"
-                                  >开始做题</el-button
-                                >
-                                <el-button
-                                  v-if="
-                                    section.recordStatus == 0 &&
-                                    section.doType == 1
-                                  "
-                                  type="primary"
-                                  @click="
-                                    continueDo(
-                                      section,
-                                      chapter.chapterExamId,
-                                      item.majorId
-                                    )
-                                  "
-                                  class="btn"
-                                  >继续做题</el-button
-                                >
-
-                                <el-button
-                                  v-if="
-                                    section.recordStatus == 1 ||
-                                    (section.recordStatus == 0 &&
-                                      section.doType == 2)
-                                  "
-                                  :disabled="
-                                    section.answerNum > 0 &&
-                                    section.doNum >= section.answerNum
-                                  "
-                                  type="primary"
-                                  @click="
-                                    doRepeat(
-                                      section,
-                                      chapter.chapterExamId,
-                                      item.majorId
-                                    )
-                                  "
-                                  class="btn"
-                                  >重新做题</el-button
-                                >
+                                <el-button v-if="section.recordStatus == -1" type="primary" @click="
+                                  toDo(
+                                    section,
+                                    chapter.chapterExamId,
+                                    item.majorId
+                                  )
+                                " class="btn">开始做题</el-button>
+                                <el-button v-if="
+                                  section.recordStatus == 0 &&
+                                  section.doType == 1
+                                " type="primary" @click="
+  continueDo(
+    section,
+    chapter.chapterExamId,
+    item.majorId
+  )
+" class="btn">继续做题</el-button>
+
+                                <el-button v-if="
+                                  section.recordStatus == 1 ||
+                                  (section.recordStatus == 0 &&
+                                    section.doType == 2)
+                                " :disabled="
+  section.answerNum > 0 &&
+  section.doNum >= section.answerNum
+" type="primary" @click="
+  doRepeat(
+    section,
+    chapter.chapterExamId,
+    item.majorId
+  )
+" class="btn">重新做题</el-button>
                               </div>
                             </div>
                           </div>
@@ -157,57 +134,29 @@
                       <div class="item__content">
                         <div class="bank-chapter">
                           <div class="bank-chapter__item">
-                            <div
-                              class="bank-chapter__item__text"
-                              @click="chapterExam(item, 0)"
-                            >
-                              <span
-                                style="
+                            <div class="bank-chapter__item__text" @click="chapterExam(item, 0)">
+                              <span style="
                                   margin-left: 21px;
                                   margin-right: 8px;
                                   color: #a7b0b8;
-                                "
-                              >
-                                <span v-if="index + 1 < 10"
-                                  >0{{ index + 1 }}</span
-                                ><span v-else>
+                                ">
+                                <span v-if="index + 1 < 10">0{{ index + 1 }}</span><span v-else>
                                   {{ index + 1 }}
-                                </span> </span
-                              >{{ item.name }}
-                              <i
-                                v-if="item.showList"
-                                class="el-icon-arrow-up"
-                                style="float: right; margin-right: 20px"
-                              ></i>
-                              <i
-                                v-else
-                                class="el-icon-arrow-down"
-                                style="float: right; margin-right: 20px"
-                              ></i>
+                                </span> </span>{{ item.name }}
+                              <i v-if="item.showList" class="el-icon-arrow-up"
+                                style="float: right; margin-right: 20px"></i>
+                              <i v-else class="el-icon-arrow-down" style="float: right; margin-right: 20px"></i>
                             </div>
 
                             <div class="bank-section" v-if="item.showList">
-                              <div
-                                class="bank-section__item"
-                                v-for="(section, sectionIndex) in item.list"
-                                :key="sectionIndex"
-                              >
+                              <div class="bank-section__item" v-for="(section, sectionIndex) in item.list"
+                                :key="sectionIndex">
                                 <div class="bank-section__item__text">
-                                  <span
-                                    style="margin-right: 8px; color: #a7b0b8"
-                                    >●</span
-                                  >
+                                  <span style="margin-right: 8px; color: #a7b0b8">●</span>
                                   {{ section.examName }}
-                                  <span
-                                    v-if="section.newRecordStatus"
-                                    class="upStudyStyle"
-                                    >上次做到</span
-                                  >
+                                  <span v-if="section.newRecordStatus" class="upStudyStyle">上次做到</span>
                                 </div>
-                                <div
-                                  style="width: auto; padding: 0px 14px"
-                                  class="btn_div"
-                                >
+                                <div style="width: auto; padding: 0px 14px" class="btn_div">
                                   <!-- 正确率
                                   <span style="color: rgb(52, 216, 71)"
                                     >{{
@@ -217,46 +166,29 @@
                                       )
                                     }}%</span
                                   > -->
-                                  <span style="margin-left: 6px">题目数: </span
-                                  ><span style="color: blue">{{
-                                    section.doQuestionNum || 0
+                                  <span style="margin-left: 6px">题目数: </span><span style="color: blue">{{
+                                      section.doQuestionNum || 0
                                   }}</span>
                                   /
                                   {{ section.questionNum || 0 }}
                                 </div>
-                                <el-button
-                                  v-if="section.recordStatus == -1"
-                                  type="primary"
-                                  @click="toDo(section, item.majorId, 0)"
-                                  class="btn"
-                                  >开始做题</el-button
-                                >
-                                <el-button
-                                  v-if="
-                                    section.recordStatus == 0 &&
-                                    section.doType == 1
-                                  "
-                                  type="primary"
-                                  @click="continueDo(section, item.majorId, 0)"
-                                  class="btn"
-                                  >继续做题</el-button
-                                >
-
-                                <el-button
-                                  v-if="
-                                    section.recordStatus == 1 ||
-                                    (section.recordStatus == 0 &&
-                                      section.doType == 2)
-                                  "
-                                  :disabled="
-                                    section.answerNum > 0 &&
-                                    section.doNum >= section.answerNum
-                                  "
-                                  type="primary"
-                                  @click="doRepeat(section, item.majorId, 0)"
-                                  class="btn"
-                                  >重新做题</el-button
-                                >
+                                <el-button v-if="section.recordStatus == -1" type="primary"
+                                  @click="toDo(section, item.majorId, 0)" class="btn">开始做题</el-button>
+                                <el-button v-if="
+                                  section.recordStatus == 0 &&
+                                  section.doType == 1
+                                " type="primary" @click="continueDo(section, item.majorId, 0)" class="btn">继续做题
+                                </el-button>
+
+                                <el-button v-if="
+                                  section.recordStatus == 1 ||
+                                  (section.recordStatus == 0 &&
+                                    section.doType == 2)
+                                " :disabled="
+  section.answerNum > 0 &&
+  section.doNum >= section.answerNum
+" type="primary" @click="doRepeat(section, item.majorId, 0)" class="btn">重新做题
+                                </el-button>
                               </div>
                             </div>
                           </div>
@@ -269,20 +201,11 @@
                         <div class="bank-section">
                           <div class="bank-section__item">
                             <div class="bank-section__item__text">
-                              <span style="margin-right: 8px; color: #a7b0b8"
-                                >●</span
-                              >
+                              <span style="margin-right: 8px; color: #a7b0b8">●</span>
                               {{ item.name }}
-                              <span
-                                v-if="item.newRecordStatus"
-                                class="upStudyStyle"
-                                >上次做到</span
-                              >
+                              <span v-if="item.newRecordStatus" class="upStudyStyle">上次做到</span>
                             </div>
-                            <div
-                              style="width: auto; padding: 0px 14px"
-                              class="btn_div"
-                            >
+                            <div style="width: auto; padding: 0px 14px" class="btn_div">
                               <!-- 正确率
                               <span style="color: rgb(52, 216, 71)"
                                 >{{
@@ -292,41 +215,23 @@
                                   )
                                 }}%</span
                               > -->
-                              <span style="margin-left: 6px">题目数: </span
-                              ><span style="color: blue">{{
-                                item.doQuestionNum || 0
+                              <span style="margin-left: 6px">题目数: </span><span style="color: blue">{{
+                                  item.doQuestionNum || 0
                               }}</span>
                               / {{ item.questionNum || 0 }}
                             </div>
-                            <el-button
-                              v-if="item.recordStatus == -1"
-                              type="primary"
-                              @click="toDo(item, 0, 0)"
-                              class="btn"
-                              >开始做题</el-button
-                            >
-                            <el-button
-                              v-if="item.recordStatus == 0 && item.doType == 1"
-                              type="primary"
-                              @click="continueDo(item, 0, 0)"
-                              class="btn"
-                              >继续做题</el-button
-                            >
-
-                            <el-button
-                              v-if="
-                                item.recordStatus == 1 ||
-                                (item.recordStatus == 0 && item.doType == 2)
-                              "
-                              :disabled="
-                                item.answerNum > 0 &&
-                                item.doNum >= item.answerNum
-                              "
-                              type="primary"
-                              @click="doRepeat(item, 0, 0)"
-                              class="btn"
-                              >重新做题</el-button
-                            >
+                            <el-button v-if="item.recordStatus == -1" type="primary" @click="toDo(item, 0, 0)"
+                              class="btn">开始做题</el-button>
+                            <el-button v-if="item.recordStatus == 0 && item.doType == 1" type="primary"
+                              @click="continueDo(item, 0, 0)" class="btn">继续做题</el-button>
+
+                            <el-button v-if="
+                              item.recordStatus == 1 ||
+                              (item.recordStatus == 0 && item.doType == 2)
+                            " :disabled="
+  item.answerNum > 0 &&
+  item.doNum >= item.answerNum
+" type="primary" @click="doRepeat(item, 0, 0)" class="btn">重新做题</el-button>
                           </div>
                         </div>
                       </div>
@@ -351,7 +256,7 @@ export default {
   },
   data() {
     return {
-      newList: [],
+      newList: [{ paperId: 12, paperName: "每日一练" }, { paperId: 14, paperName: "随机练习" }],
       examListNew: [],
       orderGoodsId: "",
       activeName: "0",
@@ -373,7 +278,7 @@ export default {
       recordItem: null,
     };
   },
-  mounted() {},
+  mounted() { },
   computed: {
     compyRecommend: function () {
       return function (array) {
@@ -404,7 +309,7 @@ export default {
       this.orderGoodsId = data.orderGoodsId;
       this.goodsId = data.goodsId;
       this.activeName = "0";
-      await this.getExamType(data.goodsId);
+      // await this.getExamType(data.goodsId);
       if (this.recordItem) {
         this.getRecordItem();
       } else {
@@ -565,7 +470,8 @@ export default {
     getExamType(id) {
       return new Promise((resolve, reject) => {
         this.$request.exampapergoodsExamPaper(id).then((res) => {
-          this.newList = [{ paperId: 0, paperName: "全部" }, ...res.data];
+          let data = [{ paperId: 12, paperName: "每日一练" }, { paperId: 14, paperName: "随机练习" }]
+          this.newList = [{ paperId: 0, paperName: "全部" }, ...res.data, ...data];
           // if (parseInt(this.activeName) > 0) {
           //   this.tabChange({ name: this.activeName });
           // }
@@ -948,6 +854,7 @@ export default {
   padding: 3px 4px;
   border-radius: 4px;
 }
+
 .btn_div {
   user-select: none;
   color: #666666;
@@ -956,6 +863,7 @@ export default {
   height: 32px;
   line-height: 32px;
 }
+
 .bank-detail {
   .section {
     &__header {
@@ -969,11 +877,20 @@ export default {
       .left-box {
         // float: left;
         // width: 768px;
-
+        .day-box{
+          height: 100px;
+          display: flex;
+        }
+        /deep/ {
+          .el-calendar-day{
+            height: 60px;
+          }
+        }
         /deep/.el-tabs__item {
           height: 98px;
           line-height: 98px;
         }
+        
         .goods-menu {
           // padding: 0 16px 16px;
           // border-radius: 10px;
@@ -983,6 +900,7 @@ export default {
             display: flex;
             padding-right: 8px;
             align-items: center;
+
             .title {
               padding: 10px 0;
               font-size: 16px;
@@ -1058,6 +976,7 @@ export default {
                 .bank-section {
                   margin-left: 25px;
                   color: #99a0a7;
+
                   &__item {
                     padding-top: 20px;
                     padding-bottom: 20px;
@@ -1091,6 +1010,7 @@ export default {
             .selects {
               display: flex;
               justify-content: space-between;
+
               &__item {
                 width: 360px;
                 height: 40px;
@@ -1133,6 +1053,7 @@ export default {
 
             .list {
               overflow: hidden;
+
               &__item {
                 margin-top: 16px;
                 height: 98px;
@@ -1150,6 +1071,7 @@ export default {
 
                 .content {
                   border-top: 1px solid #eee;
+
                   .left {
                     float: left;
                     margin-left: 16px;
@@ -1170,6 +1092,7 @@ export default {
                     float: right;
                     margin-right: 16px;
                     margin-top: 10px;
+
                     .btn {
                       width: 88px;
                       height: 32px;
@@ -1188,6 +1111,7 @@ export default {
     }
   }
 }
+
 ._content {
   margin-top: 6px;
   background: #fff;
@@ -1211,6 +1135,7 @@ export default {
   .bank-section {
     margin-left: 25px;
     color: #99a0a7;
+
     &__item {
       padding-bottom: 6px;
       // border-bottom: 1px solid #eeeeee;