瀏覽代碼

add:新增需求+fix:bug修复

Tang 3 年之前
父節點
當前提交
2e03ba94d8

+ 9 - 1
src/apis/bank.js

@@ -291,6 +291,14 @@ export default {
 			params: data
 		})
 	},
-
+	//查询用户拥有免费+自购题库商品
+	bankquestionlistUserFreeUnionBuyGoodsList(data) {
+		return request({
+			url: '/bank/question/listUserFreeUnionBuyGoodsList',
+			method: 'get',
+			params: data
+		})
+	},
+	
 
 }

二進制
src/assets/ggFirst.png


+ 2 - 2
src/axios.js

@@ -3,8 +3,8 @@ import store from './store'
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-// export const BASE_URL = 'http://192.168.1.24:5055'    //dev
-export const BASE_URL = 'http://120.79.166.78:19012'    //外网
+export const BASE_URL = 'http://192.168.1.24:5055'    //dev
+// export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
 export const tenantId = '867735392558919680'
 
 

+ 2 - 7
src/components/toolbar/index.vue

@@ -1,23 +1,18 @@
 <template>
   <div class="toolBar">
-
     <div class="item">
       <el-popover placement="left" width="170" trigger="hover">
         <div>
+          <div style="text-align: center;font-weight:bold;color:#222;" class="text">扫码进入小程序</div>
           <img
             style="width: 150px; height: 150px"
             src="@/assets/xcxqrcode.jpg"
             alt=""
           />
-          <div style="text-align: center" class="text">移动学习就是这么便捷</div>
         </div>
         <div slot="reference">
           <img src="@/assets/qr.png" class="img" alt="" />
-          <div class="text">
-            小程序
-            <div></div>
-            二维码
-          </div>
+          <div class="text">手机端</div>
         </div>
       </el-popover>
     </div>

+ 225 - 134
src/pages/course-detail/index.vue

@@ -1449,123 +1449,92 @@
                                     </el-pagination>
                                   </div> -->
                                 </div>
-                                <div
-                                  class="right-box"
-                                  v-if="courseHandoutsData"
-                                >
-                                  <div class="lecture-list">
-                                    <div class="lecture-list__header">
-                                      讲义
-
-                                      <div
-                                        class="slide-btn"
-                                        @click="lectureShow = !lectureShow"
-                                      >
-                                        收起
-                                      </div>
-                                    </div>
-                                    <div
-                                      class="lecture-list__body"
-                                      v-if="lectureShow"
-                                    >
-                                      <div class="list">
-                                        <div class="list__item">
-                                          <div class="title">
-                                            {{
-                                              courseHandoutsData.handoutsName
-                                            }}
-                                          </div>
-                                          <div class="btns">
-                                            <div
-                                              class="btn"
-                                              @click="
-                                                previvew(
-                                                  $tools.splitImgHost(
-                                                    courseHandoutsData.handoutsUrl
-                                                  )
-                                                )
-                                              "
-                                            >
-                                              预览
-                                            </div>
-                                            <div
-                                              v-if="
-                                                courseHandoutsData.canDownload ==
-                                                1
-                                                  ? true
-                                                  : false
-                                              "
-                                              class="btn"
-                                              @click="
-                                                printView(
-                                                  $tools.splitImgHost(
-                                                    courseHandoutsData.handoutsUrl
-                                                  )
-                                                )
-                                              "
-                                            >
-                                              打印
-                                            </div>
-                                            <div
-                                              v-if="
-                                                courseHandoutsData.canDownload ==
-                                                1
-                                                  ? true
-                                                  : false
-                                              "
-                                              class="btn"
-                                              @click="
-                                                download(
-                                                  $tools.splitImgHost(
-                                                    courseHandoutsData.handoutsUrl
-                                                  ),
-                                                  courseHandoutsData.urlName
-                                                )
-                                              "
-                                            >
-                                              下载
-                                            </div>
-                                          </div>
-                                        </div>
-                                      </div>
-                                    </div>
+                              </div>
+                            </div>
+                          </template>
+                          <template v-if="tab.name == '5'">
+                            <div class="lecture-notesjy">
+                              <div class="listItem">
+                                <div class="titles">
+                                  {{ courseHandoutsData.handoutsName }}
+                                </div>
+                                <div class="btns">
+                                  <div
+                                    class="btn"
+                                    @click="
+                                      previvew(
+                                        $tools.splitImgHost(
+                                          courseHandoutsData.handoutsUrl
+                                        )
+                                      )
+                                    "
+                                  >
+                                    预览
                                   </div>
                                   <div
-                                    class="lecture-list__footer"
-                                    v-if="showPdf"
+                                    v-if="
+                                      courseHandoutsData.canDownload == 1
+                                        ? true
+                                        : false
+                                    "
+                                    class="btn"
+                                    @click="
+                                      printView(
+                                        $tools.splitImgHost(
+                                          courseHandoutsData.handoutsUrl
+                                        )
+                                      )
+                                    "
                                   >
-                                    <div class="lecture-scan">
-                                      <div class="lecture-scan__header">
-                                        {{ courseHandoutsData.urlName }}
-                                      </div>
-                                      <div class="lecture-scan__body">
-                                        <pdf
-                                          class="iframe"
-                                          :src="
-                                            $tools.splitImgHost(
-                                              courseHandoutsData.handoutsUrl
-                                            )
-                                          "
-                                          v-for="i in numPages"
-                                          :key="i"
-                                          :page="i"
-                                          ref="pdf"
-                                        ></pdf>
-                                        <iframe
-                                          id="printIframe"
-                                          :src="
-                                            $tools.splitImgHost(
-                                              courseHandoutsData.handoutsUrl
-                                            )
-                                          "
-                                          frameborder="0"
-                                          style="display: none"
-                                        ></iframe>
-                                      </div>
-                                    </div>
+                                    打印
+                                  </div>
+                                  <div
+                                    v-if="
+                                      courseHandoutsData.canDownload == 1
+                                        ? true
+                                        : false
+                                    "
+                                    class="btn"
+                                    @click="
+                                      download(
+                                        $tools.splitImgHost(
+                                          courseHandoutsData.handoutsUrl
+                                        ),
+                                        courseHandoutsData.urlName
+                                      )
+                                    "
+                                  >
+                                    下载
                                   </div>
                                 </div>
                               </div>
+                              <div class="lecture-listFooter" v-if="showPdf">
+                                  <div style="color:#fff;">
+                                    {{ courseHandoutsData.urlName }}
+                                  </div>
+                                  <pdf
+                                      class="iframe"
+                                      :src="
+                                        $tools.splitImgHost(
+                                          courseHandoutsData.handoutsUrl
+                                        )
+                                      "
+                                      v-for="i in numPages"
+                                      :key="i"
+                                      :page="i"
+                                      ref="pdf"
+                                    ></pdf>
+                                    <iframe
+                                      id="printIframe"
+                                      :src="
+                                        $tools.splitImgHost(
+                                          courseHandoutsData.handoutsUrl
+                                        )
+                                      "
+                                      frameborder="0"
+                                      style="display: none"
+                                    ></iframe>
+                              </div>
                             </div>
                           </template>
                         </el-tab-pane>
@@ -2618,19 +2587,30 @@
         >
       </span>
     </el-dialog>
-    <el-dialog title="切换科目" :visible.sync="dialogVisible" width="500px">
-      <el-radio-group v-model="activeRadio">
-        <el-radio
+    <el-dialog title="切换课程" :visible.sync="dialogVisible" width="800px">
+      <div class="topstyle">
+        <p>当前课程</p>
+        <div class="list_styleHeader">
+          <span style="font-weight: bold; font-size: 16px">{{getCourseName(courseId)}}</span>
+        </div>
+      </div>
+      <div class="height_style">
+        <div
           v-for="(item, index) in courseList"
           :key="index"
-          :label="item.courseId"
-          >{{ item.courseName }}</el-radio
+          class="list_style"
+          :style="
+            index % 2 != 1
+              ? 'background-color:#F8F8F9;'
+              : 'background-color:#fff;'
+          "
+          @click="activeFunc(item.courseId)"
         >
-      </el-radio-group>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="activeFunc">确 定</el-button>
-      </span>
+          <span style="font-weight: bold; font-size: 16px">{{
+            item.courseName
+          }}</span>
+        </div>
+      </div>
     </el-dialog>
     <div id="printTable"></div>
     <!-- <ToolBar></ToolBar> -->
@@ -2659,7 +2639,6 @@ export default {
   },
   data() {
     return {
-      activeRadio: "", //当前选中课程Id
       dialogVisible: false, //选择课程弹窗
       liveDuration: 0,
       numPages: 0,
@@ -3021,6 +3000,18 @@ export default {
         return aryName;
       };
     },
+    getCourseName:function(){
+      return function(id){
+        var courseName = ""
+        for (let i = 0; i < this.courseList.length; i++) {
+          if(this.courseList[i].courseId == id){
+            courseName = this.courseList[i].courseName
+            break
+          }
+        }
+        return courseName
+      }
+    }
   },
   async mounted() {
     this.courseId = +this.$route.query.courseId || "";
@@ -3158,11 +3149,13 @@ export default {
     ...mapMutations(["getCartCount"]),
     ...mapActions(["getUserInfo"]),
     openChangeCourseBoxs() {
-      this.activeRadio = this.courseId;
       this.dialogVisible = true;
     },
-    activeFunc() {
-      this.courseId = this.activeRadio;
+    /**
+     * 确定选中
+     */
+    activeFunc(item) {
+      this.courseId = item;
       this.courseChange();
       this.dialogVisible = false;
     },
@@ -5081,7 +5074,16 @@ export default {
      */
     async getResource(section) {
       //逻辑
-
+      if(section.sectionType === 2){
+        if(section.liveStartTime > this.nowTime){
+          this.$message.warning("直播待开播")
+          return
+        }
+        if(section.liveStartTime < this.nowTime){
+          this.$message.warning("直播已结束")
+          return
+        }
+      }
       if (section.type == 2) {
         //试卷
         console.log("试卷");
@@ -5618,7 +5620,7 @@ export default {
           })
           .then((res) => {
             resolve(res.data);
-          });
+          })
       });
     },
     loadPlayerzb() {
@@ -5814,7 +5816,7 @@ export default {
           self.photoList = [];
           for (let i = 0; i < res.data.length; i++) {
             //-2存储随机拍照数组
-            if (res.data[i].photoIndex == -2) {
+            if (res.data[i].photoIndex == -2 && res.data[i].timeInterval) {
               self.photoList = res.data[i].timeInterval.split(",");
             } else {
               self.photoHistoryList.push(res.data[i].photoIndex);
@@ -6228,7 +6230,11 @@ export default {
                   },
                   {
                     name: "4",
-                    label: "笔记讲义",
+                    label: "笔记",
+                  },
+                  {
+                    name: "5",
+                    label: "讲义",
                   },
                 ];
                 this.courseTabIndex = "1";
@@ -6333,7 +6339,11 @@ export default {
                   },
                   {
                     name: "4",
-                    label: "笔记讲义",
+                    label: "笔记",
+                  },
+                  {
+                    name: "5",
+                    label: "讲义",
                   },
                 ];
                 this.courseTabIndex = "1";
@@ -6454,7 +6464,11 @@ export default {
                   },
                   {
                     name: "4",
-                    label: "笔记讲义",
+                    label: "笔记",
+                  },
+                  {
+                    name: "5",
+                    label: "讲义",
                   },
                 ];
                 this.courseTabIndex = "1";
@@ -6585,7 +6599,7 @@ export default {
                 res.rows[i].menuId == this.sectionItem.chapterId &&
                 (!this.sectionItem.moduleId || this.sectionItem.moduleId == 0)
               ) {
-                console.log("噢噢噢")
+                console.log("噢噢噢");
                 this.menuIndex = [i];
                 // this.needOpen = false;
                 this.openChapter(this.menuList[i]);
@@ -6683,7 +6697,11 @@ export default {
               },
               {
                 name: "4",
-                label: "笔记讲义",
+                label: "笔记",
+              },
+              {
+                name: "5",
+                label: "讲义",
               },
             ];
 
@@ -6703,7 +6721,11 @@ export default {
               },
               {
                 name: "4",
-                label: "笔记讲义",
+                label: "笔记",
+              },
+              {
+                name: "5",
+                label: "讲义",
               },
             ];
             this.courseTabIndex = "1";
@@ -7142,6 +7164,7 @@ export default {
 
                     .bank-section {
                       &__item {
+                        user-select: none;
                         color: #fff;
                         font-size: 14px;
                         display: flex;
@@ -8296,4 +8319,72 @@ export default {
   color: #999;
   background: transparent;
 }
+.lecture-notesjy {
+  display: flex;
+  flex-direction: column;
+  max-height: 416px;
+.listItem {
+  padding-bottom: 14px;
+  margin-bottom: 10px;
+  border-bottom: 1px solid #eee;
+  .titles {
+    color: #fff;
+    font-weight: bold;
+    text-align: center;
+    padding: 10px;
+  }
+  .btns {
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    .btn {
+      border-radius: 8px;
+      background-color: #fff;
+      padding: 6px 16px;
+      user-select: none;
+      cursor: pointer;
+      transition: all 0.2s;
+      &:hover {
+        background-color: #f2f7ff;
+        color: #3f8dfd;
+      }
+    }
+  }
+}
+.lecture-listFooter{
+  flex: 1;
+  overflow: auto;
+}
+}
+.topstyle {
+  border-bottom: 2px solid #eee;
+  margin-bottom: 16px;
+  p {
+    background-color: #f8f8f9;
+    font-size: 14px;
+    color: #3f8dfd;
+    padding: 5px 12px;
+  }
+}
+.height_style {
+  max-height: 600px;
+  overflow-y: auto;
+}
+.list_style {
+  height: 60px;
+  color: #222;
+  line-height: 58px;
+  padding: 0px 16px;
+  cursor: pointer;
+  transition: all 0.2s;
+  &:hover {
+    background-color: rgba(63, 141, 253, 0.3) !important;
+  }
+}
+.list_styleHeader {
+  height: 60px;
+  color: #3f8dfd;
+  line-height: 58px;
+  padding: 0px 16px;
+}
 </style>

+ 10 - 14
src/pages/person-center/index.vue

@@ -20,11 +20,13 @@
             <div class="desc">你好</div>
           </div>
           <div class="float_right_top">
-            <img src="@/assets/xcxqrcode.jpg" alt="" />
+            <!-- <img src="@/assets/xcxqrcode.jpg" alt="" />
             <div class="cla_s">
               <h2>手机刷题学习</h2>
               <h2 class="link_two">随时随地提升分数</h2>
-            </div>
+            </div> -->
+            <img src="@/assets/ggFirst.png" alt="" />
+            
           </div>
         </div>
 
@@ -86,9 +88,9 @@
                 <router-link to="/person-center/my-bank">
                   <div class="item">开始做题</div>
                 </router-link>
-                <router-link to="/person-center/free-bank">
+                <!-- <router-link to="/person-center/free-bank">
                   <div class="item">赠送题卷</div>
-                </router-link>
+                </router-link> -->
                 <router-link to="/person-center/bank-record">
                   <div class="item">做题记录</div>
                 </router-link>
@@ -236,17 +238,11 @@ export default {
         }
       }
       .float_right_top {
-        display: flex;
-        align-items: center;
-        background-color: #fff;
-        margin-right: 24px;
-        border-radius: 8px;
-        border: 1px solid #000;
-        overflow: hidden;
-        padding: 2px;
+        width: 456px;
+        height: 138px;
         & > img {
-          width: 110px;
-          height: 110px;
+          width: 100%;
+          height: 100%;
         }
         & > .cla_s {
           margin: 0px 20px;

+ 53 - 33
src/pages/person-center/my-bank/bank-detailCopy/index.vue

@@ -15,6 +15,10 @@
                     <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>
                       </div>
                       <div class="item__content" v-if="item.showList">
                         <div class="bank-chapter">
@@ -39,6 +43,16 @@
                                   {{ 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>
                             </div>
 
                             <div class="bank-section" v-if="chapter.showList">
@@ -53,12 +67,10 @@
                                     >●</span
                                   >
                                   {{ section.examName }}
-                                  <el-button
-                                    size="mini"
-                                    type="primary"
-                                    plain
+                                  <span
                                     v-if="section.newRecordStatus"
-                                    >上次做到</el-button
+                                    class="upStudyStyle"
+                                    >上次做到</span
                                   >
                                 </div>
                                 <div class="btn_div">
@@ -150,12 +162,23 @@
                                   margin-right: 8px;
                                   color: #a7b0b8;
                                 "
-                                ><span v-if="index + 1 < 10"
+                              >
+                                <span v-if="index + 1 < 10"
                                   >0{{ index + 1 }}</span
                                 ><span v-else>
                                   {{ index + 1 }}
-                                </span></span
+                                </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">
@@ -170,12 +193,10 @@
                                     >●</span
                                   >
                                   {{ section.examName }}
-                                  <el-button
-                                    size="mini"
-                                    type="primary"
-                                    plain
+                                  <span
                                     v-if="section.newRecordStatus"
-                                    >上次做到</el-button
+                                    class="upStudyStyle"
+                                    >上次做到</span
                                   >
                                 </div>
                                 <div
@@ -247,12 +268,10 @@
                                 >●</span
                               >
                               {{ item.name }}
-                              <el-button
-                                size="mini"
-                                type="primary"
-                                plain
+                              <span
                                 v-if="item.newRecordStatus"
-                                >上次做到</el-button
+                                class="upStudyStyle"
+                                >上次做到</span
                               >
                             </div>
                             <div
@@ -327,12 +346,8 @@
                     <div class="bank-section__item__text">
                       <span style="margin-right: 8px; color: #a7b0b8">●</span>
                       {{ item.examName }}
-                      <el-button
-                        size="mini"
-                        type="primary"
-                        plain
-                        v-if="item.newRecordStatus"
-                        >上次做到</el-button
+                      <span v-if="item.newRecordStatus" class="upStudyStyle"
+                        >上次做到</span
                       >
                     </div>
                     <div style="width: auto; padding: 0px 14px" class="btn_div">
@@ -820,6 +835,7 @@ export default {
       }
       this.getDetail();
       this.examaperList();
+      this.activeName = "0";
     },
     getRecordItem() {
       this.$request
@@ -869,8 +885,7 @@ export default {
           });
           if (DW != -1) {
             if (this.bankList[DW].type == 1) {
-              
-              console.log(1)
+              console.log(1);
               this.$request
                 .goodsChapterList({
                   orderGoodsId: this.orderGoodsId,
@@ -931,7 +946,7 @@ export default {
                   }
                 });
             } else if (this.bankList[DW].type == 2) {
-              console.log(2)
+              console.log(2);
               this.$request
                 .bankExamExamList({
                   orderGoodsId: this.orderGoodsId,
@@ -960,12 +975,11 @@ export default {
                   }
                 });
             } else if (this.bankList[DW].type == 3) {
-              console.log(3)
+              console.log(3);
               this.$set(this.bankList[DW], "newRecordStatus", true);
             }
           }
-          console.log("DW", DW,this.bankList);
-          
+          console.log("DW", DW, this.bankList);
         });
     },
     getExamType(id) {
@@ -1292,7 +1306,6 @@ export default {
           res.rows.forEach((item) => {
             total += item.wrongQuestionNum;
           });
-
           this.wrongTotal = total;
         });
     },
@@ -1373,7 +1386,6 @@ export default {
             orderGoodsId: this.orderGoodsId,
           })
           .then((res) => {
-            console.log(res, "resssssss");
             this.examListNew = res.data;
           });
       }
@@ -1383,10 +1395,11 @@ export default {
 
       this.hasClickList.push(e.name);
 
-      if (e.name == "2") {
+      if (e.name == "-1") {
         //收藏集
         this.getCollectData();
-      } else if (e.name == "3") {
+      } else if (e.name == "-2") {
+        console.log(123123123)
         //错题集
         this.getWrongData();
       }
@@ -1397,6 +1410,13 @@ export default {
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style scoped lang="scss">
+.upStudyStyle {
+  background-color: #f2f7ff;
+  border: 1px solid #3f8dfd;
+  color: #3f8dfd;
+  padding: 3px 4px;
+  border-radius: 4px;
+}
 .btn_div {
   user-select: none;
   color: #666666;

+ 123 - 22
src/pages/person-center/my-bank/index/index.vue

@@ -3,7 +3,7 @@
     <div class="no-data" v-if="!bankData.goodsName">暂无可以学习的题库哦~</div>
     <div v-else>
       <h4 class="headerTitle">
-        <span v-if="bankData.subjectNames">【{{ bankData.subjectNames }}】</span
+        <span v-if="bankData.subjectNames" style="font-size:20px;">【{{ bankData.subjectNames }}】</span
         >{{ bankData.goodsName
         }}<el-button
           size="mini"
@@ -17,19 +17,70 @@
       </h4>
       <bank-detail-copy ref="bankDetailCopy" />
     </div>
-    <el-dialog title="切换题库" :visible.sync="dialogVisible" width="500px">
-      <el-radio-group v-model="activeRadio">
-        <el-radio
+    <el-dialog title="切换题库" :visible.sync="dialogVisible" width="900px">
+      <div class="topstyle">
+        <p>当前试题</p>
+        <div class="list_styleHeader">
+          <span
+            class="btn_style"
+            :style="
+              bankData.goodsType == 5
+                ? 'background-color:#00D6B9;'
+                : 'background-color:#3F8DFD;'
+            "
+            >{{ bankData.goodsType == 5 ? "赠送" : "自购" }}</span
+          >
+          <span style="font-weight: bold; font-size: 18px">{{
+            bankData.goodsName
+          }}</span>
+        </div>
+      </div>
+      <div class="height_style">
+        <div
           v-for="(item, index) in list"
           :key="index"
-          :label="item.goodsId"
-          >{{ item.goodsName }}</el-radio
+          class="list_style"
+          :style="
+            index % 2 != 1
+              ? 'background-color:#F8F8F9;'
+              : 'background-color:#fff;'
+          "
+          @click="activeFunc(item)"
         >
-      </el-radio-group>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="activeFunc">确 定</el-button>
-      </span>
+          <span
+            class="btn_style"
+            :style="
+              item.goodsType == 5
+                ? 'background-color:#00D6B9;'
+                : 'background-color:#3F8DFD;'
+            "
+            >{{ item.goodsType == 5 ? "赠送" : "自购" }}</span
+          >
+          <span style="font-weight: bold; font-size: 18px">{{
+            item.goodsName
+          }}</span>
+          <span
+            v-if="
+              item.validityStartTime &&
+              item.validityEndTime &&
+              item.goodsType != 5
+            "
+            style="float: right; color: #999; font-size: 14px"
+            >{{ $tools.timestampToTime(item.validityStartTime) }} -
+            {{ $tools.timestampToTime(item.validityEndTime) }}
+            <span
+              style="color: #3f8dfd; font-size: 14px"
+              v-if="getNewTime() < item.validityStartTime ? true : false"
+              >/未开始</span
+            >
+            <span
+              style="color: #999; font-size: 14px"
+              v-if="getNewTime() > item.validityEndTime ? true : false"
+              >/已过期</span
+            ></span
+          >
+        </div>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -44,13 +95,16 @@ export default {
       bankData: {},
       dialogVisible: false,
       list: [],
-      activeRadio: "",
     };
   },
   mounted() {
     this.getList();
   },
   methods: {
+    getNewTime() {
+      console.log(parseInt(new Date().getTime() / 1000));
+      return parseInt(new Date().getTime() / 1000);
+    },
     getInfoData(data) {
       return new Promise((resolve, reject) => {
         this.$request.goodsDetail(data.goodsId).then((res) => {
@@ -61,11 +115,11 @@ export default {
     },
     getList() {
       this.$request.examrecordgetUserDoLast().then(async (res) => {
-        if (res.data.goodsId) {
+        if (res.data && res.data.goodsId) {
           const result = await this.getInfoData(res.data);
           this.bankData = result;
           this.$nextTick(() => {
-            this.$refs.bankDetailCopy.initData(this.bankData,res.data);
+            this.$refs.bankDetailCopy.initData(this.bankData, res.data);
           });
         } else {
           this.$request
@@ -85,8 +139,7 @@ export default {
      * 切换题库
      */
     changeBank() {
-      this.activeRadio = this.bankData.goodsId || "";
-      this.$request.listGoodsUserQuestion().then((res) => {
+      this.$request.bankquestionlistUserFreeUnionBuyGoodsList().then((res) => {
         this.list = res.rows;
         this.dialogVisible = true;
       });
@@ -94,14 +147,22 @@ export default {
     /**
      * 确定选中
      */
-    activeFunc() {
-      for (let i = 0; i < this.list.length; i++) {
-        if (this.list[i].goodsId == this.activeRadio) {
-          this.$refs.bankDetailCopy.initData(this.list[i]);
-          this.bankData = this.list[i];
-          this.dialogVisible = false;
+    activeFunc(item) {
+      const Times = parseInt(new Date().getTime() / 1000);
+      if (item.goodsType != 5) {
+        if (Times < item.validityStartTime || Times > item.validityEndTime) {
+          if (Times < item.validityStartTime) {
+            this.$message.warning("题卷学习时间未开始");
+            return;
+          } else if (Times > item.validityEndTime) {
+            this.$message.warning("题卷学习时间已过期");
+            return;
+          }
         }
       }
+      this.$refs.bankDetailCopy.initData(item);
+      this.bankData = item;
+      this.dialogVisible = false;
     },
   },
 };
@@ -114,4 +175,44 @@ export default {
   font-weight: bold;
   color: #222;
 }
+/deep/ .el-dialog__wrapper .el-dialog {
+  margin-top: 5vh !important;
+}
+.topstyle {
+  border-bottom: 2px solid #eee;
+  margin-bottom: 16px;
+  p {
+    background-color: #f8f8f9;
+    font-size: 14px;
+    color: #3f8dfd;
+    padding: 5px 12px;
+  }
+}
+.height_style {
+  max-height: 600px;
+  overflow-y: auto;
+}
+.list_style {
+  height: 60px;
+  color: #222;
+  line-height: 58px;
+  padding: 0px 16px;
+  cursor: pointer;
+  transition: all 0.2s;
+  &:hover {
+    background-color: rgba(63, 141, 253, 0.3) !important;
+  }
+}
+.list_styleHeader {
+  height: 60px;
+  color: #3f8dfd;
+  line-height: 58px;
+  padding: 0px 16px;
+}
+.btn_style {
+  padding: 0px 3px;
+  color: #fff;
+  margin-right: 8px;
+  border-radius: 2px;
+}
 </style>

+ 596 - 8
src/pages/person-center/my-course/courseData.vue

@@ -1,6 +1,401 @@
 <template>
   <div id="courseData">
     <el-dialog title="切换科目" :visible.sync="dialogVisible" width="1100px">
+        <div class="headerStyle">
+            <p class="title">当前科目</p>
+            <div
+              class="course-items"
+            >
+              <div class="course-items__header">
+                <div
+                  class="time"
+                  v-if="activeItem.serviceStartTime && activeItem.serviceEndTime"
+                >
+                  学习服务期:{{
+                    $tools.timestampToTime(activeItem.serviceStartTime, false)
+                  }}
+                  至
+                  {{ $tools.timestampToTime(activeItem.serviceEndTime, false) }}
+                </div>
+
+                <div class="state">
+                  <template
+                    v-if="
+                      activeItem.serviceStartTime &&
+                      (sysTime < activeItem.serviceStartTime ||
+                        sysTime > activeItem.serviceEndTime)
+                    "
+                  >
+                    <div class="red">不在学习服务期,不可以学习了哦</div>
+                  </template>
+
+                  <template v-else>
+                    <template
+                      v-if="
+                        !(activeItem.classEndTime && activeItem.classEndTime < sysTime) &&
+                        !(activeItem.classStartTime && activeItem.classStartTime > sysTime)
+                      "
+                    >
+                      <template
+                        v-if="activeItem.periodStatus == -1 || activeItem.periodStatus == 2"
+                      >
+                        <template
+                          v-if="
+                            activeItem.classStatus == 1 || activeItem.classStatus === null
+                          "
+                        >
+                          <template
+                            v-if="
+                              sysTime >= activeItem.serviceStartTime &&
+                              sysTime <= activeItem.serviceEndTime
+                            "
+                          >
+                            学习状态:
+                            <div
+                              class="note"
+                              v-if="activeItem.stuAllNum + activeItem.recordNum == 0"
+                            >
+                              未学习
+                            </div>
+                            <div
+                              class="note note--yellow"
+                              v-else-if="
+                                activeItem.stuAllNum + activeItem.recordNum > 0 &&
+                                activeItem.stuAllNum + activeItem.recordNum <
+                                  activeItem.secAllNum + activeItem.examNum
+                              "
+                            >
+                              学习中
+                            </div>
+                            <div
+                              class="note note--green"
+                              v-else-if="
+                                activeItem.stuAllNum + activeItem.recordNum >=
+                                activeItem.secAllNum + activeItem.examNum
+                              "
+                            >
+                              已学完
+                            </div>
+                          </template>
+
+                          <template v-else>
+                            <span class="red" v-if="activeItem.serviceStartTime">
+                              已过学习服务期,不可以学习了哦!</span
+                            >
+                          </template>
+                        </template>
+
+                        <!-- <template v-if="activeItem.profileTpStatus == 1">
+                      资料审核状态:
+                      <div class="note" v-if="activeItem.profileStatus == null">
+                        未提交资料
+                      </div>
+                      <div
+                        class="note note--green"
+                        v-else-if="activeItem.profileStatus == 1"
+                      >
+                        已通过
+                      </div>
+                      <div
+                        class="note note--yellow"
+                        v-else-if="activeItem.profileStatus == 2"
+                      >
+                        审核中
+                      </div>
+                      <div
+                        class="note note--yellow"
+                        v-else-if="activeItem.profileStatus == 3"
+                      >
+                        待完善
+                      </div>
+                    </template> -->
+                      </template>
+
+                      <!-- 学时审核状态可以审核 -->
+                      <template v-if="activeItem.periodStatus != -1">
+                        <template v-if="activeItem.periodStatus == 0"
+                          >机构审核:
+                          <div class="note">学时审核不通过</div>
+                        </template>
+                        <!-- <template v-else-if="activeItem.periodStatus == 2"
+                      >机构审核:
+                      <div class="note note--yellow">学时待审核</div></template
+                    > -->
+                        <template v-else-if="activeItem.periodStatus == 1">
+                          <template v-if="activeItem.periodPlush > 0"
+                            ><div class="note note--green">
+                              学时已上报注册中心
+                            </div></template
+                          >
+                          <template v-else
+                            >机构审核:
+                            <div class="note note--green">
+                              学时审核通过
+                            </div></template
+                          >
+                        </template>
+                        <template
+                          v-if="
+                            activeItem.subscribeId != null && activeItem.periodStatus == 1
+                          "
+                        >
+                          <template v-if="activeItem.subExamStatus === null">
+                            待预约考试
+                          </template>
+
+                          <template
+                            v-else-if="
+                              activeItem.subExamStatus === 0 &&
+                              sysTime <
+                                $tools.TimeTotimestamp(
+                                  $tools.timestampToTime(
+                                    activeItem.subApplySiteExamTime,
+                                    true
+                                  ) +
+                                    ' ' +
+                                    activeItem.subApplySiteStartTime
+                                )
+                            "
+                          >
+                            待考试,考试时间:{{
+                              $tools.timestampToTime(
+                                activeItem.subApplySiteExamTime,
+                                true
+                              ) +
+                              " " +
+                              activeItem.subApplySiteStartTime
+                            }}
+                            -
+                            {{
+                              $tools.timestampToTime(
+                                activeItem.subApplySiteExamTime,
+                                true
+                              ) +
+                              " " +
+                              activeItem.subApplySiteEndTime
+                            }}
+                          </template>
+                          <template v-else-if="activeItem.subExamStatus === 0"
+                            >待出考试结果</template
+                          >
+                          <template v-else-if="activeItem.subExamStatus === 1">
+                            <span v-if="activeItem.subResult === null"
+                              >待出考试结果</span
+                            >
+                            <span v-if="activeItem.subResult === 0"
+                              >考试结果:不通过,需补考</span
+                            >
+                            <span v-else-if="activeItem.subResult === 1"
+                              >考试结果:通过,考试成绩为{{
+                                activeItem.subPerformance
+                              }}</span
+                            >
+                          </template>
+                          <template v-else-if="activeItem.subExamStatus === 2">
+                            缺考,无成绩,需补考
+                          </template>
+                          <template v-else-if="activeItem.subExamStatus === 3">
+                            作弊,无成绩,需补考
+                          </template>
+                          <template v-else-if="activeItem.subExamStatus === 4">
+                            替考,无成绩,需补考
+                          </template>
+                        </template>
+                      </template>
+                    </template>
+                  </template>
+                </div>
+              </div>
+              <div class="course-items__body clearfix">
+                <div class="img">
+                  <img :src="$tools.splitImgHost(activeItem.coverUrl, true)" alt="" />
+                </div>
+                <div class="text">
+                  <div class="title">
+                    {{ activeItem.goodsName }}
+                    <div class="note">
+                      {{ activeItem.courseNum }}课程
+                      {{ activeItem.secAllNum + activeItem.examNum }}节
+                      {{ activeItem.classHours }}学时
+                    </div>
+                  </div>
+                  <div class="progress">
+                    学习进度
+                    <el-progress
+                      class="progress-line"
+                      :stroke-width="16"
+                      :format="progressText(activeItem)"
+                      :percentage="
+                        ((activeItem.stuAllNum + activeItem.recordNum) /
+                          (activeItem.secAllNum + activeItem.examNum) || 0) * 100
+                      "
+                    ></el-progress>
+                  </div>
+                </div>
+                <div class="btns-wrap">
+                  <div class="btns">
+                    <el-button
+                      type="primary"
+                      class="btn btn--normal"
+                      :class="{
+                        disabled:
+                          (activeItem.serviceStartTime &&
+                            (sysTime <= activeItem.serviceStartTime ||
+                              sysTime >= activeItem.serviceEndTime)) ||
+                          (activeItem.classStartTime &&
+                            sysTime <= activeItem.classStartTime) ||
+                          (activeItem.classEndTime && sysTime >= activeItem.classEndTime) ||
+                          activeItem.learningStatus == 2 ||
+                          activeItem.classStatus == 0 ||
+                          (activeItem.learningStatus == 3 &&
+                            sysTime < activeItem.learningTimeStart),
+                      }"
+                      @click="goCourseDetail(activeItem)"
+                      >进入学习</el-button
+                    >
+
+                    <el-button
+                      type="primary"
+                      class="btn"
+                      @click="appointment(activeItem)"
+                      v-if="
+                        activeItem.applyStatus === 1 &&
+                        !(
+                          sysTime <= activeItem.serviceStartTime ||
+                          sysTime >= activeItem.serviceEndTime ||
+                          (activeItem.classStartTime &&
+                            sysTime <= activeItem.classStartTime) ||
+                          (activeItem.classEndTime && sysTime >= activeItem.classEndTime) ||
+                          activeItem.learningStatus == 2 ||
+                          activeItem.classStatus == 0 ||
+                          (activeItem.learningStatus == 3 &&
+                            sysTime < activeItem.learningTimeStart)
+                        )
+                      "
+                      >预约考试</el-button
+                    >
+
+                    <el-button
+                      type="danger"
+                      class="btn btn--warm"
+                      @click="selectClass(activeItem)"
+                      v-if="
+                        activeItem.gradeStatus == 1 &&
+                        activeItem.status == 1 &&
+                        activeItem.serviceEndTime > sysTime &&
+                        activeItem.serviceStartTime < sysTime &&
+                        activeItem.classEndTime &&
+                        activeItem.classEndTime < sysTime &&
+                        (activeItem.periodStatus == 0 || activeItem.periodStatus == -1) &&
+                        activeItem.studyCount > 0
+                      "
+                    >
+                      选班重学
+                    </el-button>
+                    <el-button
+                      type="primary"
+                      class="btn"
+                      v-if="
+                        activeItem.beforeStatus === 1 &&
+                        !(
+                          sysTime <= activeItem.serviceStartTime ||
+                          sysTime >= activeItem.serviceEndTime ||
+                          (activeItem.classStartTime &&
+                            sysTime <= activeItem.classStartTime) ||
+                          (activeItem.classEndTime && sysTime >= activeItem.classEndTime) ||
+                          activeItem.learningStatus == 2 ||
+                          activeItem.classStatus == 0 ||
+                          (activeItem.learningStatus == 3 &&
+                            sysTime < activeItem.learningTimeStart)
+                        )
+                      "
+                      @click="appBeforeAddress(activeItem)"
+                      >进入刷题</el-button
+                    >
+                  </div>
+                </div>
+              </div>
+              <template
+                v-if="
+                  !(
+                    sysTime < activeItem.serviceStartTime ||
+                    sysTime > activeItem.serviceEndTime
+                  )
+                "
+              >
+                <div
+                  class="course-items__footer"
+                  v-if="activeItem.classEndTime && activeItem.classEndTime < sysTime"
+                >
+                  <span class="text"
+                    >班级有效期:{{
+                      $tools.timestampToTime(activeItem.classStartTime, true, true)
+                    }}
+                    -
+                    {{
+                      $tools.timestampToTime(activeItem.classEndTime, true, true)
+                    }}</span
+                  >
+                  <span class="text text--red"
+                    >班级状态:已过期,有疑问请联系020-87085982</span
+                  >
+                </div>
+
+                <div
+                  class="course-items__footer"
+                  v-else-if="
+                    activeItem.classStartTime && activeItem.classStartTime > sysTime
+                  "
+                >
+                  <span class="text"
+                    >班级有效期:{{
+                      $tools.timestampToTime(activeItem.classStartTime, true, true)
+                    }}
+                    -
+                    {{
+                      $tools.timestampToTime(activeItem.classEndTime, true, true)
+                    }}</span
+                  >
+                  <span class="text"
+                    >班级状态:未到学习时间,有疑问请联系 020-87085982</span
+                  >
+                </div>
+
+                <template v-else>
+                  <div
+                    class="course-items__footer"
+                    v-if="
+                      activeItem.gradeId != 0 &&
+                      activeItem.gradeStatus == 1 &&
+                      activeItem.classStatus != null
+                    "
+                  >
+                    <span class="text"
+                      >班级状态:
+                      {{
+                        activeItem.classStatus == 1
+                          ? "已开班"
+                          : activeItem.classStatus == 0
+                          ? "未开班"
+                          : ""
+                      }}
+                    </span>
+                    <span class="text"
+                      >班级有效期:{{
+                        $tools.timestampToTime(activeItem.classStartTime, true, true)
+                      }}-{{
+                        $tools.timestampToTime(activeItem.classEndTime, true, true)
+                      }}</span
+                    >
+                  </div>
+                  <div class="course-items__footer" v-if="activeItem.classStatus == 0">
+                    <span class="text">教务处正在为您开通班级,请耐心等待</span>
+                  </div>
+                </template>
+              </template>
+            </div>
+          
+        </div>
       <div class="my-course">
         <div class="my-course__header">
           <el-tabs :value="activeName" @tab-click="tabChange">
@@ -563,7 +958,8 @@ export default {
   methods: {
     ...mapActions(["getUserInfo"]),
     openBoxs(data) {
-        console.log(data)
+      console.log(data);
+      this.activeItem = data
       this.dialogVisible = true;
     },
     activeFunc() {},
@@ -642,6 +1038,9 @@ export default {
       this.courseGoodsList();
     },
     async goCourseDetail(item) {
+      this.$emit("backData", item);
+      this.dialogVisible = false;
+      return;
       this.activeItem = item;
       if (item.interfaceAccountId > 0) {
         //学习账号已开通
@@ -787,9 +1186,9 @@ export default {
                 //     });
                 //   });
                 // } else {
-                    this.$emit("backData",item)
-                    this.dialogVisible = false
-                    return
+                this.$emit("backData", item);
+                this.dialogVisible = false;
+                return;
                 this.$router.push({
                   path: `/my-course-detail/${item.goodsId}`,
                   query: {
@@ -983,12 +1382,12 @@ export default {
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style scoped lang="scss">
-/deep/ .el-dialog{
-    margin-top: 6vh!important;
+/deep/ .el-dialog {
+  margin-top: 6vh !important;
 }
 .my-course {
-    max-height: 80vh;
-    overflow: auto;
+  max-height: 50vh;
+  overflow: auto;
   &__header {
     /deep/ .el-tabs__header {
       margin-bottom: 0;
@@ -1206,4 +1605,193 @@ export default {
     }
   }
 }
+.headerStyle{
+    .title{
+        padding: 6px 12px;
+        color: #3f8dfd;
+        background-color: #F8F8F9;
+
+    }
+}
+.course-items {
+        margin-top: 10px;
+        background: #fafbfc;
+        border-radius: 8px;
+        overflow: hidden;
+        padding-bottom: 24px;
+        margin-bottom: 24px;
+        border-bottom: 2px solid #eee;
+        &__header {
+          height: 40px;
+          border-bottom: 1px solid #eee;
+          padding: 0 18px;
+
+          .state {
+            margin-top: 8px;
+            float: left;
+            font-size: 14px;
+            font-family: Microsoft YaHei;
+            font-weight: 400;
+            color: #666666;
+
+            .red {
+              color: #ff3b30;
+            }
+
+            .note {
+              vertical-align: middle;
+              display: inline-block;
+              padding: 0 10px;
+              height: 24px;
+              background: #ffeceb;
+              border: 1px solid #ff3b30;
+              border-radius: 12px;
+              font-size: 14px;
+              font-family: Microsoft YaHei;
+              font-weight: 400;
+              color: #ff3b30;
+              text-align: center;
+              line-height: 24px;
+              margin-right: 10px;
+
+              &--yellow {
+                border-color: #ffb001;
+                color: #ffb001;
+                background: #fff8e8;
+              }
+
+              &--green {
+                border-color: #56dc68;
+                color: #56dc68;
+                background: #e6feea;
+              }
+            }
+          }
+
+          .time {
+            float: right;
+            line-height: 40px;
+            text-align: right;
+            font-size: 12px;
+            font-family: Microsoft YaHei;
+            font-weight: 400;
+            color: #666666;
+
+            &--red {
+              color: #ff3b30;
+            }
+          }
+        }
+
+        &__body {
+          .img {
+            float: left;
+            width: 160px;
+            height: 90px;
+
+            img {
+              max-width: 100%;
+              max-height: 100%;
+            }
+          }
+
+          .text {
+            float: left;
+            margin-left: 12px;
+            .title {
+              margin-top: 10px;
+              font-size: 16px;
+              font-family: Microsoft YaHei;
+              font-weight: bold;
+              color: #333333;
+              .note {
+                display: inline-block;
+                vertical-align: middle;
+                border: 1px solid #333333;
+                border-radius: 4px;
+                font-size: 12px;
+                font-family: Microsoft YaHei;
+                font-weight: 400;
+                color: #333333;
+                padding: 2px 5px;
+                margin-left: 12px;
+              }
+            }
+
+            .progress {
+              margin-top: 30px;
+
+              font-size: 14px;
+              font-family: Microsoft YaHei;
+              font-weight: 400;
+              color: #333333;
+
+              &-line {
+                width: 220px;
+                display: inline-block;
+              }
+
+              /deep/ .el-progress-bar {
+                padding-right: 70px;
+                margin-right: -70px;
+              }
+            }
+          }
+
+          .btns-wrap {
+            display: table;
+            float: right;
+            height: 90px;
+            width: 130px;
+
+            .btns {
+              display: table-cell;
+              vertical-align: middle;
+              text-align: center;
+
+              .btn {
+                cursor: pointer;
+                margin: 2px 0;
+                width: 122px;
+                height: 32px;
+                padding: 0;
+                border-radius: 16px;
+                display: inline-block;
+                text-align: center;
+                line-height: 32px;
+                color: #fff;
+
+                &--normal {
+                  &.disabled {
+                    background: rgb(101, 164, 253);
+                    border-color: rgb(101, 164, 253);
+                  }
+                }
+
+                &--warm {
+                  background: #ff3b30;
+
+                  &:hover {
+                    background: #f56c6c;
+                  }
+                }
+              }
+            }
+          }
+        }
+
+        &__footer {
+          padding: 20px 18px;
+          font-size: 14px;
+          color: #333;
+
+          .text {
+            margin-right: 20px;
+
+            &--red {
+              color: #ff3b30;
+            }
+          }
+        }
+      }
 </style>

+ 383 - 48
src/pages/person-center/my-course/index.vue

@@ -2,7 +2,7 @@
   <div class="my-course">
     <div>
       <h4 class="headerTitle">
-        <span v-if="goodsData.subjectNames"
+        <span v-if="goodsData.subjectNames" style="font-size: 20px"
           >【{{ goodsData.subjectNames }}】</span
         >{{ goodsData.goodsName
         }}<el-button
@@ -16,10 +16,10 @@
         >
       </h4>
       <div v-for="(item, index) in courseList" :key="index">
-        <p class="firstTop">
+        <p class="firstTop" @click="changeStatus(item)">
           <span class="iconStyle">课</span
           ><span class="titles">{{ item.courseName }}</span
-          ><span class="showHide" @click="changeStatus(item)"
+          ><span class="showHide"
             ><span v-if="item.showStatus">收起∧</span
             ><span v-else>展开∨</span></span
           >
@@ -29,11 +29,12 @@
         >
           <template v-for="(items, indexs) in item.children">
             <div v-if="items.type === 1" :key="indexs">
-              <p class="moduleStyle">
+              <p
+                class="moduleStyle"
+                @click="changeModuleStatus(items, index, indexs)"
+              >
                 {{ items.menuName }}
-                <span
-                  class="showHide"
-                  @click="changeModuleStatus(items, index, indexs)"
+                <span class="showHide"
                   ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
                   <i v-else class="el-icon-arrow-down"></i
                 ></span>
@@ -50,12 +51,13 @@
                   :key="k"
                   style="padding-left: 20px"
                 >
-                  <div class="chapterStyle">
+                  <div
+                    class="chapterStyle"
+                    @click="changeChapterStatus(2, i, index, indexs, k)"
+                  >
                     <span class="iconStyle">章</span>
                     {{ i.name }}
-                    <span
-                      class="showHide"
-                      @click="changeChapterStatus(2, i, index, indexs, k)"
+                    <span class="showHide"
                       ><i v-if="i.showStatus" class="el-icon-arrow-up"></i>
                       <i v-else class="el-icon-arrow-down"></i
                     ></span>
@@ -71,12 +73,8 @@
                         <el-col :span="12">
                           <span class="iconStyles">•</span>
                           {{ is.name }}
-                          <el-button
-                            size="mini"
-                            type="primary"
-                            plain
-                            v-if="is.recordStatus"
-                            >上次学到</el-button
+                          <span v-if="is.recordStatus" class="upStudyStyle"
+                            >上次学到</span
                           >
                         </el-col>
                         <el-col :span="4">
@@ -86,7 +84,7 @@
                         </el-col>
                         <el-col :span="3">
                           <el-progress
-                            v-if="is.studyDuration"
+                            v-if="is.studyDuration && is.durationTime"
                             :show-text="false"
                             :percentage="
                               (is.studyDuration / is.durationTime) * 100
@@ -127,6 +125,7 @@
                           >
                           <el-button
                             size="mini"
+                            type="primary"
                             plain
                             v-else-if="
                               is.studyDuration == 0 && is.durationTime > 0
@@ -142,12 +141,13 @@
               </template>
             </div>
             <div v-if="items.type === 2" :key="indexs">
-              <div class="chapterStyle">
+              <div
+                class="chapterStyle"
+                @click="changeChapterStatus(1, items, index, indexs)"
+              >
                 <span class="iconStyle">章</span>
                 {{ items.menuName }}
-                <span
-                  class="showHide"
-                  @click="changeChapterStatus(1, items, index, indexs)"
+                <span class="showHide"
                   ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
                   <i v-else class="el-icon-arrow-down"></i
                 ></span>
@@ -163,12 +163,8 @@
                     <el-col :span="12">
                       <span class="iconStyles">•</span>
                       {{ i.name }}
-                      <el-button
-                        size="mini"
-                        type="primary"
-                        plain
-                        v-if="i.recordStatus"
-                        >上次学到</el-button
+                      <span v-if="i.recordStatus" class="upStudyStyle"
+                        >上次学到</span
                       >
                     </el-col>
                     <el-col :span="4">
@@ -178,7 +174,7 @@
                     </el-col>
                     <el-col :span="3">
                       <el-progress
-                        v-if="i.studyDuration"
+                        v-if="i.studyDuration && i.durationTime"
                         :show-text="false"
                         :percentage="(i.studyDuration / i.durationTime) * 100"
                       ></el-progress>
@@ -218,6 +214,7 @@
                       <el-button
                         size="mini"
                         plain
+                        type="primary"
                         v-else-if="i.studyDuration == 0 && i.durationTime > 0"
                         @click="studyFunc(item, i)"
                         >未开始</el-button
@@ -232,12 +229,8 @@
                 <el-col :span="12">
                   <span class="iconStyles">•</span>
                   {{ items.menuName }}
-                  <el-button
-                    size="mini"
-                    type="primary"
-                    plain
-                    v-if="items.recordStatus"
-                    >上次学到</el-button
+                  <span v-if="items.recordStatus" class="upStudyStyle"
+                    >上次学到</span
                   >
                 </el-col>
                 <el-col :span="4">
@@ -247,7 +240,7 @@
                 </el-col>
                 <el-col :span="3">
                   <el-progress
-                    v-if="items.studyDuration"
+                    v-if="items.studyDuration && items.durationTime"
                     :show-text="false"
                     :percentage="
                       (items.studyDuration / items.durationTime) * 100
@@ -289,6 +282,7 @@
                   <el-button
                     plain
                     size="mini"
+                    type="primary"
                     v-else-if="
                       items.studyDuration == 0 && items.durationTime > 0
                     "
@@ -303,25 +297,83 @@
       </div>
     </div>
     <courseData ref="courseData" @backData="backData" />
+    <el-dialog
+      title="实名验证确认"
+      :visible.sync="showConfirm"
+      width="600px"
+      class="showconfirm"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :show-close="false"
+    >
+      <div class="showconfirm__content">
+        <div class="text">
+          为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
+        </div>
+        <el-descriptions :column="1">
+          <el-descriptions-item label="姓名">{{
+            userInfo && userInfo.realname
+          }}</el-descriptions-item>
+          <el-descriptions-item label="手机号">{{
+            userInfo && userInfo.telphone
+          }}</el-descriptions-item>
+          <el-descriptions-item label="身份证号">{{
+            userInfo && userInfo.idCard
+          }}</el-descriptions-item>
+        </el-descriptions>
+
+        <div class="">
+          <el-checkbox v-model="confirmChecked">确认个人信息无误</el-checkbox>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="showConfirm = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="confirmUser"
+          :disabled="confirmCount > 0"
+          :loading="confirmLoading"
+          >{{
+            confirmCount > 0 ? "确 定(" + confirmCount + ")" : "确 定"
+          }}</el-button
+        >
+      </span>
+    </el-dialog>
+    <RebuildModal
+      ref="rebuildModal"
+      @rebuildSubmit="rebuildSubmit($event)"
+    ></RebuildModal>
   </div>
 </template>
 
 <script>
+import { mapGetters, mapActions } from "vuex";
 import courseData from "./courseData.vue";
+import RebuildModal from "@/components/rebuildModal";
 export default {
   name: "MyCourse",
-  components: { courseData },
+  components: { courseData, RebuildModal },
   data() {
     return {
       goodsData: {},
       courseList: [],
+      sysTime: 0,
+      showConfirm: false,
+      confirmCount: 10,
+      confirmChecked: false,
+      confirmTimer: null,
+      confirmLoading: false,
     };
   },
+  computed: {
+    ...mapGetters(["userInfo"]),
+  },
   mounted() {
     this.getRecord();
+    this.sysTime = this.$tools.timest();
   },
   methods: {
-    studyFunc(courseItem, item) {
+    comeStyle(courseItem, item) {
       this.$router.push({
         path: `/my-course-detail/${this.goodsData.goodsId}`,
         query: {
@@ -332,7 +384,7 @@ export default {
           moduleId: item.moduleId,
           sectionId: item.sectionId || item.menuId,
           recordingUrl: item.recordingUrl,
-          sectionType:item.sectionType
+          sectionType: item.sectionType,
         },
       });
     },
@@ -368,12 +420,19 @@ export default {
     },
     getGoodsData(res) {
       return new Promise((resolve, reject) => {
-        this.$request.goodsDetail(res.data.goodsId).then(async (result) => {
-          result.data.orderGoodsId = res.data.orderGoodsId
-          this.goodsData = result.data;
-          await this.getGoodsCourseList(result.data);
-          resolve();
-        });
+        this.$request
+          .courseGoodsList({ orderGoodsId: res.data.orderGoodsId })
+          .then(async (result) => {
+            if(result.rows.length == 0){
+              this.resultCourseGoodsList()
+            }else{
+            let array = result.rows[0];
+            array.orderGoodsId = res.data.orderGoodsId;
+            this.goodsData = array;
+            await this.getGoodsCourseList(array);
+            resolve();
+            }
+          });
       });
     },
     /**
@@ -381,8 +440,8 @@ export default {
      */
     getRecord(item) {
       this.$request.studyrecordgetUserWatchLast().then(async (res) => {
-        await this.getGoodsData(res);
-        if (res.data.sectionId) {
+        if (res.data && res.data.sectionId) {
+          await this.getGoodsData(res);
           var stop = false;
           for (let i = 0; i < this.courseList.length; i++) {
             if (stop) {
@@ -490,10 +549,20 @@ export default {
               }
             }
           }
+        } else {
+          this.resultCourseGoodsList()
         }
-        console.log(res, "recordTime");
       });
     },
+    resultCourseGoodsList(){
+      this.$request
+            .courseGoodsList({ pageNum: 1, pageSize: 1 })
+            .then((res) => {
+              if (res.rows && res.rows.length > 0) {
+                this.backData(res.rows[0]);
+              }
+            });
+    },
     /**
      * 展开获取课程详情列表
      */
@@ -600,6 +669,265 @@ export default {
           });
       });
     },
+    async studyFunc(courseItem, items) {
+      this.sysTime = this.$tools.timest();
+      let item = this.goodsData;
+      if (item.interfaceAccountId > 0) {
+        //学习账号已开通
+
+        if (item.learnStatus == 1) {
+          //跳转第三方h5
+
+          this.$router.push({
+            path: `/my-course-detail/${item.goodsId}`,
+            query: {
+              gradeId: item.gradeId,
+              orderGoodsId: item.orderGoodsId,
+              isOther: 1,
+            },
+          });
+          return;
+        } else {
+          this.$message({
+            type: "warning",
+            message:
+              "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
+          });
+          return;
+        }
+      }
+      if (
+        (item.serviceStartTime && this.sysTime <= item.serviceStartTime) ||
+        (item.serviceEndTime && this.sysTime >= item.serviceEndTime)
+      ) {
+        this.$message({
+          type: "warning",
+          message: "不在学习服务期,不能进入学习",
+        });
+        return;
+      }
+
+      if (
+        (item.classStartTime && this.sysTime <= item.classStartTime) ||
+        (item.classEndTime && this.sysTime >= item.classEndTime)
+      ) {
+        this.$message({
+          type: "warning",
+          message: "不在班级有效期,不能进入学习",
+        });
+        return;
+      }
+
+      if (item.learningStatus == 2) {
+        this.$message({
+          type: "warning",
+          message: "开放学习时间待定,不能进入学习",
+        });
+        return;
+      }
+
+      if (item.classStatus == 0) {
+        this.$message({
+          type: "warning",
+          message: "尚未开班,不能进入学习",
+        });
+        return;
+      }
+      if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
+        this.$message({
+          type: "warning",
+          message: "不在开放学习时间,不能进入学习",
+        });
+        return;
+      }
+
+      var confirmDetail = true;
+      if (item.educationName == "继续教育") {
+        if (
+          item.officialName &&
+          item.businessName == "二级" &&
+          item.projectName == "建造师"
+        ) {
+          confirmDetail = await this.userConfirmInfoDetail();
+        }
+      }
+
+      // //内部系统
+      // if (item.interfacePushId > 0 && item.officialStatus != 1) {
+      //   this.$message({
+      //     type: "warning",
+      //     message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
+      //   });
+      //   return;
+      // }
+
+      if (!confirmDetail) {
+        return;
+      }
+
+      let rebuildStatus = await this.courseGoodsRebuildStatus(
+        item.goodsId,
+        item.gradeId
+      );
+
+      if (rebuildStatus == 0) {
+        this.$refs.rebuildModal.showModal(item);
+        return;
+      }
+
+      // if (item.educationName == "继续教育") {
+      this.$request
+        .lockLockStatus({
+          action: "jxjy",
+          uuid: sessionStorage.getItem("uuid"),
+        })
+        .then((res) => {
+          //有其他端在操作,不能学习
+          this.$message({
+            type: "warning",
+            message: res.msg,
+          });
+        })
+        .catch((err) => {
+          //可以学习
+          this.$request
+            .courseCourseList({
+              pageNum: 1,
+              pageSize: 1,
+              goodsId: item.goodsId,
+              gradeId: item.gradeId,
+            })
+            .then((res) => {
+              if (res.rows.length) {
+                // this.$emit("backData", item);
+                // this.dialogVisible = false;
+                this.comeStyle(courseItem, items);
+                // this.$router.push({
+                //   path: `/my-course-detail/${item.goodsId}`,
+                //   query: {
+                //     gradeId: item.gradeId,
+                //     orderGoodsId: item.orderGoodsId,
+                //     courseId: res.rows[0].courseId || "",
+                //   },
+                // });
+                // }
+              } else {
+                this.$message({
+                  type: "warning",
+                  message: "课程内暂无可以学习的科目",
+                });
+              }
+            });
+        });
+    },
+    userConfirmInfoDetail() {
+      return new Promise((resolve) => {
+        this.$request
+          .userConfirmInfoDetail({
+            orderGoodsId: this.goodsData.orderGoodsId,
+          })
+          .then((res) => {
+            if (!res.data) {
+              clearInterval(this.confirmTimer);
+              this.confirmCount = 10;
+              this.showConfirm = true;
+              this.confirmTimer = setInterval(() => {
+                if (this.confirmCount > 0) {
+                  this.confirmCount--;
+                } else {
+                  clearInterval(this.confirmTimer);
+                }
+              }, 1000);
+            } else {
+              if (res.data.pushInfo) {
+                resolve(true);
+              } else {
+                this.$confirm(
+                  "开通信息推送不成功,无法进入学习,请联系020-87085982!",
+                  "提示",
+                  {
+                    confirmButtonText: "确定",
+                    closeOnClickModal: false,
+                    closeOnPressEscape: false,
+                    distinguishCancelAndClose: false,
+                    showClose: false,
+                    showCancelButton: false,
+                  }
+                )
+                  .then((_) => {})
+                  .catch((_) => {});
+                resolve(false);
+              }
+            }
+          });
+      });
+    },
+
+    confirmUser() {
+      if (!this.confirmChecked) {
+        this.$message.warning("请勾选确认个人信息无误");
+        return;
+      }
+      this.confirmLoading = true;
+      let infoJson = {
+        realname: this.userInfo.realname,
+        idCard: this.userInfo.idCard,
+        telphone: this.userInfo.telphone,
+      };
+      this.$request
+        .userConfirminfo({
+          infoJson: JSON.stringify(infoJson),
+          orderGoodsId: this.goodsData.orderGoodsId,
+        })
+        .then((res) => {
+          if (res.data.pushInfo) {
+            this.$message.success("提交成功");
+          } else {
+            this.$confirm(
+              "开通信息推送不成功,无法进入学习,请联系020-87085982!",
+              "提示",
+              {
+                confirmButtonText: "确定",
+                closeOnClickModal: false,
+                closeOnPressEscape: false,
+                distinguishCancelAndClose: false,
+                showClose: false,
+                showCancelButton: false,
+              }
+            )
+              .then((_) => {})
+              .catch((_) => {});
+          }
+          this.showConfirm = false;
+          this.confirmLoading = false;
+        });
+    },
+    /**
+     * @param {Object} goodsId 商品id
+     * 查询商品重修状态
+     */
+    courseGoodsRebuildStatus(goodsId, gradeId) {
+      return new Promise((resolve) => {
+        this.$request
+          .courseGoodsRebuildStatus({
+            goodsId: goodsId,
+            gradeId: gradeId,
+          })
+          .then((res) => {
+            resolve(res.data);
+          });
+      });
+    },
+    rebuildSubmit(item) {
+      this.$router.push({
+        path: `/my-course-detail/${item.goodsId}`,
+        query: {
+          gradeId: item.gradeId,
+          orderGoodsId: item.orderGoodsId,
+          rebuild: 1,
+        },
+      });
+    },
   },
 };
 </script>
@@ -680,4 +1008,11 @@ export default {
     padding: 0px 2px;
   }
 }
+.upStudyStyle {
+  background-color: #f2f7ff;
+  border: 1px solid #3f8dfd;
+  color: #3f8dfd;
+  padding: 3px 4px;
+  border-radius: 4px;
+}
 </style>

+ 1 - 0
src/pages/person-center/play-record/index.vue

@@ -167,6 +167,7 @@ export default {
         })
         .then(async (res) => {
           let item = res.data;
+          console.log(item,"item")
           // if (item.interfacePushId > 0 && item.officialStatus != 1) {
           //   this.$message({
           //     type: "warning",