Ver código fonte

add:新需求改动

Tang 3 anos atrás
pai
commit
a7f3b3b685

+ 1 - 1
src/components/goodsItem/index.vue

@@ -56,8 +56,8 @@ export default {
      * 查看商品详情
      */
     goodsDetail(item) {
+      console.log(item, "items");
       this.getGoodsDetail(item.goodsId).then((res) => {
-        console.log(res);
         if (res.goodsType === 1) {
           this.$router.push({
             path: "/course-detail/" + res.goodsId,

+ 40 - 3
src/components/toolbar/index.vue

@@ -3,7 +3,12 @@
     <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>
+          <div
+            style="text-align: center; font-weight: bold; color: #222"
+            class="text"
+          >
+            扫码进入小程序
+          </div>
           <img
             style="width: 150px; height: 150px"
             src="@/assets/xcxqrcode.jpg"
@@ -22,8 +27,31 @@
         <div class="text">购物车</div>
       </el-badge>
     </div>
-
     <div class="item">
+      <el-popover placement="left" width="180" trigger="hover">
+        <div>
+          <h2 style="font-size:16px;color:#000;">报名咨询</h2>
+          <p style="color:#999;">{{ header.serviceTel.time }}</p>
+          <div
+            v-for="(item, index) in getTel(header.serviceTel.tel)"
+            :key="index"
+            style="margin-top: 16px"
+          >
+            <i
+              class="el-icon-phone"
+              style="border-radius: 50%; border: 1px solid #000; padding: 2px;margin-right:8px;"
+            ></i>
+            {{ item }}
+          </div>
+          <!-- {{header.serviceTel}} -->
+        </div>
+        <div slot="reference">
+          <img src="@/assets/contact.png" class="img" alt="" />
+          <div class="text">报名咨询</div>
+        </div>
+      </el-popover>
+    </div>
+    <div v-if="false" class="item">
       <el-popover placement="left" width="180" trigger="hover">
         <div style="height: 100px; text-align: center">
           <img
@@ -73,7 +101,16 @@ import { mapGetters, mapMutations } from "vuex";
 export default {
   name: "ToolBar",
   computed: {
-    ...mapGetters(["userInfo", "cartCount"]),
+    ...mapGetters(["userInfo", "cartCount", "header"]),
+    getTel: function () {
+      return function (tel) {
+        if (tel) {
+          return tel.split(";");
+        } else {
+          return [];
+        }
+      };
+    },
   },
   data() {
     return {

+ 1 - 1
src/components/wxLogin/index.vue

@@ -10,7 +10,7 @@
       :before-close="beforeClose"
     >
       <div class="dis_flex">
-        <img :src="imgUrl ? imgUrl : require('@/assets/qrcode.png')" alt="" />
+        <img :src="imgUrl && !scanningStatus ? imgUrl : require('@/assets/qrcode.png')" alt="" />
         <p v-if="scanningStatus" style="color: red">小程序已扫码</p>
         <p class="headerTitle">使用微信扫一扫快捷登录</p>
         <p class="clickFuncStyle">

+ 4 - 2
src/pages/bank-list/index.vue

@@ -173,7 +173,8 @@ export default {
     };
   },
   mounted() {
-    this.params.searchKey = this.$route.query.searchKey || "";
+    this.params.goodsName = this.$route.query.searchKey || "";
+    // this.params.searchKey = this.$route.query.searchKey || "";
     this.params.educationTypeId = this.$route.query.educationId || "";
     this.params.projectId = this.$route.query.projectId || "";
     this.params.businessId = this.$route.query.businessId || "";
@@ -186,7 +187,8 @@ export default {
   methods: {
     ...mapMutations(["getCartCount"]),
     search(key) {
-      this.params.searchKey = key || "";
+      this.params.goodsName = key || "";
+      // this.params.searchKey = key || "";
       this.params.projectId = "";
       this.params.educationTypeId = "";
       this.params.businessId = "";

+ 105 - 90
src/pages/course-detail/index.vue

@@ -214,7 +214,7 @@
                                               <template
                                                 v-if="
                                                   section.liveStartTime &&
-                                                  section.sectionType != 3
+                                                  section.sectionType == 2
                                                 "
                                               >
                                                 <div
@@ -427,7 +427,7 @@
                                               <template
                                                 v-if="
                                                   section.liveStartTime &&
-                                                  section.sectionType != 3
+                                                  section.sectionType == 2
                                                 "
                                               >
                                                 <div
@@ -604,7 +604,7 @@
                                         <template
                                           v-if="
                                             menu.liveStartTime &&
-                                            menu.sectionType != 3
+                                            menu.sectionType == 2
                                           "
                                         >
                                           <div
@@ -784,7 +784,7 @@
                                               <template
                                                 v-if="
                                                   section.liveStartTime &&
-                                                  section.sectionType != 3
+                                                  section.sectionType == 2
                                                 "
                                               >
                                                 <div
@@ -997,7 +997,7 @@
                                               <template
                                                 v-if="
                                                   section.liveStartTime &&
-                                                  section.sectionType != 3
+                                                  section.sectionType == 2
                                                 "
                                               >
                                                 <div
@@ -1174,7 +1174,7 @@
                                         <template
                                           v-if="
                                             menu.liveStartTime &&
-                                            menu.sectionType != 3
+                                            menu.sectionType == 2
                                           "
                                         >
                                           <div
@@ -1285,6 +1285,7 @@
                                         </div>
                                         <div
                                           class="del"
+                                          style="color: red"
                                           @click="del(item)"
                                           v-if="item.userId === userInfo.userId"
                                         >
@@ -1332,7 +1333,7 @@
                                                   items.assignRealname
                                                 }}</span
                                               >
-                                              {{ items.answerText }}
+                                              <span style="color:#ccc;">{{ items.answerText }}</span>
                                             </div>
                                             <div class="time">
                                               {{
@@ -1343,6 +1344,7 @@
                                               }}
                                               <div
                                                 class="del"
+                                                style="color: red"
                                                 @click="del(items)"
                                                 v-if="
                                                   items.userId ===
@@ -1509,31 +1511,31 @@
                                 </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 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>
@@ -2591,7 +2593,9 @@
       <div class="topstyle">
         <p>当前课程</p>
         <div class="list_styleHeader">
-          <span style="font-weight: bold; font-size: 16px">{{getCourseName(courseId)}}</span>
+          <span style="font-weight: bold; font-size: 16px">{{
+            getCourseName(courseId)
+          }}</span>
         </div>
       </div>
       <div class="height_style">
@@ -3000,18 +3004,18 @@ export default {
         return aryName;
       };
     },
-    getCourseName:function(){
-      return function(id){
-        var courseName = ""
+    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
+          if (this.courseList[i].courseId == id) {
+            courseName = this.courseList[i].courseName;
+            break;
           }
         }
-        return courseName
-      }
-    }
+        return courseName;
+      };
+    },
   },
   async mounted() {
     this.courseId = +this.$route.query.courseId || "";
@@ -3416,10 +3420,7 @@ export default {
       if (fileList.length == 1) {
         fileList.splice(0, 1);
       }
-
-      let res = await this.faceCertificationIDCardOCR(1, file);
-
-      console.log(res.data.IdImgPath, "res.data.IdImgPath");
+      let res = await this.faceCertificationIDCardOCR(1, file)
 
       if (res.code == 500) {
         this.$message.warning("请上传正确清晰的身份证人像面照片");
@@ -3912,6 +3913,7 @@ export default {
                     this.getUserInfo();
                     this.$message.success("提交成功");
                     this.showInfoDetailModal = false;
+                    this.showAgreementModal = false;
                   })
                   .catch((err) => {
                     this.$message.warning(err.msg);
@@ -3947,6 +3949,7 @@ export default {
                     this.getUserInfo();
                     this.$message.success("提交成功");
                     this.showInfoDetailModal = false;
+                    this.showAgreementModal = false;
                   })
                   .catch((err) => {
                     this.$message.warning(err.msg);
@@ -4015,6 +4018,7 @@ export default {
             this.getUserInfo();
             this.$message.success("提交成功");
             this.showInfoDetailModal = false;
+            this.showAgreementModal = false;
           })
           .catch((err) => {
             this.$message.warning(err.msg);
@@ -4050,6 +4054,7 @@ export default {
             this.getUserInfo();
             this.$message.success("提交成功");
             this.showInfoDetailModal = false;
+            this.showAgreementModal = false;
           })
           .catch((err) => {
             this.$message.warning(err.msg);
@@ -5074,14 +5079,14 @@ export default {
      */
     async getResource(section) {
       //逻辑
-      if(section.sectionType === 2){
-        if(section.liveStartTime > this.nowTime){
-          this.$message.warning("直播待开播")
-          return
+      if (section.sectionType === 2 && section.liveStartTime && section.liveEndTime) {
+        if (section.liveStartTime > this.nowTime) {
+          this.$message.warning("直播待开播");
+          return;
         }
-        if(section.liveStartTime < this.nowTime){
-          this.$message.warning("直播已结束")
-          return
+        if (section.liveEndTime < this.nowTime) {
+          this.$message.warning("直播已结束");
+          return;
         }
       }
       if (section.type == 2) {
@@ -5323,10 +5328,12 @@ export default {
               });
             }
           } else {
+            console.log(section,"sectionsectionsectionsectionsectionsection")
             //第一章第一节
             this.initVideo(section);
           }
         } else {
+          console.log(section,"sectionsection")
           this.initVideo(section);
         }
       }
@@ -5470,7 +5477,10 @@ export default {
           .then((res) => {
             console.log(res, "channel");
             resolve(res.data);
-          });
+          }).catch(err => {
+            this.clickLock = false;
+            this.$message.error(err.msg)
+          })
       });
     },
     /**
@@ -5620,7 +5630,7 @@ export default {
           })
           .then((res) => {
             resolve(res.data);
-          })
+          });
       });
     },
     loadPlayerzb() {
@@ -5805,7 +5815,7 @@ export default {
           sectionId: parseInt(self.playSectionId),
           goodsId: parseInt(self.goodsId),
           courseId: parseInt(self.courseId),
-          gradeId: parseInt(self.gradeId),
+          gradeId: self.gradeId,
           chapterId: parseInt(self.chapterId),
           moduleId: parseInt(self.moduleId),
         };
@@ -6566,9 +6576,10 @@ export default {
             item.parent = this.menuList;
           }
           self.menuList = res.rows;
-          if (this.sectionItem.recordingUrl && this.needOpenNew) {
+          if ((this.sectionItem.recordingUrl||this.sectionItem.liveUrl) && this.needOpenNew) {
             this.needOpenNew = false;
             if (this.sectionItem.sectionType == 1) {
+              console.log("录播")
               //录播
               this.chapterId = this.sectionItem.chapterId;
               this.moduleId = this.sectionItem.moduleId;
@@ -6576,8 +6587,10 @@ export default {
               this.vid = this.sectionItem.recordingUrl;
               this.playVideo(this.sectionItem);
             } else if (this.sectionItem.sectionType == 2) {
+              console.log("直播")
+              this.getResource(this.sectionItem)
               //直播
-              this.studyRecordGetLastLive();
+              // this.studyRecordGetLastLive();
             } else if (this.sectionItem.sectionType == 3) {
               //回放
               this.chapterId = this.sectionItem.chapterId;
@@ -7480,7 +7493,7 @@ export default {
                       font-size: 14px;
                       font-family: Microsoft YaHei;
                       font-weight: bold;
-                      color: #333333;
+                      color: #fff;
                       line-height: 24px;
                     }
 
@@ -7561,7 +7574,7 @@ export default {
                             font-size: 14px;
                             font-family: Microsoft YaHei;
                             font-weight: bold;
-                            color: #333333;
+                            color: #fff;
                             line-height: 24px;
                           }
 
@@ -8043,6 +8056,8 @@ export default {
                 display: table-cell;
                 border-radius: 50%;
                 text-align: center;
+                border-radius: 50%;
+                overflow: hidden;
 
                 img {
                   display: inline-block;
@@ -8061,7 +8076,7 @@ export default {
                   font-size: 14px;
                   font-family: Microsoft YaHei;
                   font-weight: bold;
-                  color: #333333;
+                  color: #f5f5f5;
                   line-height: 24px;
                 }
 
@@ -8323,38 +8338,38 @@ export default {
   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;
+  .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;
-}
+  .lecture-listFooter {
+    flex: 1;
+    overflow: auto;
+  }
 }
 .topstyle {
   border-bottom: 2px solid #eee;

+ 4 - 2
src/pages/course-list/index.vue

@@ -173,7 +173,8 @@ export default {
     };
   },
   mounted() {
-    this.params.searchKey = this.$route.query.searchKey || "";
+    this.params.goodsName = this.$route.query.searchKey || "";
+    // this.params.searchKey = this.$route.query.searchKey || "";
     this.params.educationTypeId = this.$route.query.educationId || "";
     this.params.projectId = this.$route.query.projectId || "";
     this.params.businessId = this.$route.query.businessId || "";
@@ -185,7 +186,8 @@ export default {
   methods: {
     ...mapMutations(["getCartCount"]),
     search(key) {
-      this.params.searchKey = key || "";
+      this.params.goodsName = key || "";
+      // this.params.searchKey = key || "";
       this.params.projectId = "";
       this.params.educationTypeId = "";
       this.params.businessId = "";

+ 22 - 7
src/pages/goods-detail/course-detail.vue

@@ -571,16 +571,22 @@ export default {
     };
   },
   beforeDestroy() {
+    if(this.player){
     this.player.destroy();
+    }
+  },
+  watch: {
+    "$route.params.goodsId": {
+      handler(newVal, oldVal) {
+        this.getInit();
+        console.log(newVal, oldVal, "你好");
+        //判断newVal有没有值监听路由变化
+      },
+      deep: true,
+    },
   },
   mounted() {
-    this.goodsId = this.$route.params.goodsId;
-    this.getGoodsDetail();
-    this.goodsCourseList();
-    this.appCommonGoodsCourseModuleFreeExamList();
-    if (this.$tools.isLogin()) {
-      this.getProvinceList();
-    }
+    this.getInit();
   },
   computed: {
     compyRecommend: function () {
@@ -601,6 +607,15 @@ export default {
   },
   methods: {
     ...mapMutations(["setCurrentRouter", "getCartCount"]),
+    getInit() {
+      this.goodsId = this.$route.params.goodsId;
+      this.getGoodsDetail();
+      this.goodsCourseList();
+      this.appCommonGoodsCourseModuleFreeExamList();
+      if (this.$tools.isLogin()) {
+        this.getProvinceList();
+      }
+    },
     videoModalClose() {
       this.videoModalShow = false;
       this.player.destroy();

+ 1 - 1
src/pages/home/index.vue

@@ -59,7 +59,7 @@
               >搜索</el-button
             >
           </div>
-          <div class="contact" v-if="header.serviceTel.status == 1">
+          <div class="contact" v-show="false" v-if="header.serviceTel.status == 1">
             <div class="contact__phone">{{ header.serviceTel.tel }}</div>
             <div class="contact__time">
               {{ header.serviceTel.time }}

+ 4 - 2
src/pages/live-list/index.vue

@@ -173,7 +173,8 @@ export default {
     };
   },
   mounted() {
-    this.params.searchKey = this.$route.query.searchKey || "";
+    this.params.goodsName = this.$route.query.searchKey || "";
+    // this.params.searchKey = this.$route.query.searchKey || "";
     this.params.educationTypeId = this.$route.query.educationId || "";
     this.params.projectId = this.$route.query.projectId || "";
     this.params.businessId = this.$route.query.businessId || "";
@@ -186,7 +187,8 @@ export default {
   methods: {
     ...mapMutations(["getCartCount"]),
     search(key) {
-      this.params.searchKey = key || "";
+      this.params.goodsName = key || "";
+      // this.params.searchKey = key || "";
       this.params.projectId = "";
       this.params.educationTypeId = "";
       this.params.businessId = "";

+ 12 - 1
src/pages/living-room/index.vue

@@ -9,7 +9,7 @@
           type="primary"
           size="small"
           round
-          @click="$router.back(-1)"
+          @click="$router.go(backNum)"
           >返回</el-button
         >
       </div>
@@ -175,11 +175,22 @@ export default {
       timer: null,
       liveLast: null,
       isFirst: true,
+      backNum: -1, //返回页面数
     };
   },
   computed: {
     ...mapGetters(["userInfo"]),
   },
+  beforeRouteEnter(to, from, next) {
+    console.log(to,from)
+    next((vm) => {
+      if (from.path.includes("my-course-detail")) {
+        vm.backNum = -2;
+      } else {
+        vm.backNum = -1;
+      }
+    });
+  },
   mounted() {
     this.sectionId = this.$route.query.sectionId;
     this.goodsId = this.$route.query.goodsId;

+ 254 - 34
src/pages/person-center/my-course/index.vue

@@ -16,7 +16,7 @@
         >
       </h4>
       <div v-for="(item, index) in courseList" :key="index">
-        <p class="firstTop" @click="changeStatus(item)">
+        <p class="firstTop hoverStyle" @click="changeStatus(item)">
           <span class="iconStyle">课</span
           ><span class="titles">{{ item.courseName }}</span
           ><span class="showHide"
@@ -30,7 +30,7 @@
           <template v-for="(items, indexs) in item.children">
             <div v-if="items.type === 1" :key="indexs">
               <p
-                class="moduleStyle"
+                class="moduleStyle hoverStyle"
                 @click="changeModuleStatus(items, index, indexs)"
               >
                 {{ items.menuName }}
@@ -52,10 +52,10 @@
                   style="padding-left: 20px"
                 >
                   <div
-                    class="chapterStyle"
+                    class="chapterStyle hoverStyle"
                     @click="changeChapterStatus(2, i, index, indexs, k)"
                   >
-                    <span class="iconStyle">章</span>
+                    <!-- <span class="iconStyle">章</span> -->
                     {{ i.name }}
                     <span class="showHide"
                       ><i v-if="i.showStatus" class="el-icon-arrow-up"></i>
@@ -65,14 +65,23 @@
                   <template v-if="i.showStatus && i.children.length > 0">
                     <div
                       v-for="(is, ks) in i.children"
-                      class="sectionStyle"
+                      class="sectionStyle hoverStyleSection"
                       :key="ks"
                       style="padding-left: 20px"
                     >
                       <el-row style="display: flex; align-items: center">
                         <el-col :span="12">
                           <span class="iconStyles">•</span>
-                          {{ is.name }}
+                          <span class="upStudyStyle sizeStyle">{{
+                            is.sectionType === 1
+                              ? "录播"
+                              : is.sectionType === 2
+                              ? "直播"
+                              : is.sectionType === 3
+                              ? "回放"
+                              : "练习"
+                          }}</span>
+                          <span class="span_style">{{ is.name }}</span>
                           <span v-if="is.recordStatus" class="upStudyStyle"
                             >上次学到</span
                           >
@@ -100,10 +109,15 @@
                             }}
                           </span>
                         </el-col>
-                        <el-col :span="2" :offset="1">
+                        <el-col
+                          :span="2"
+                          :offset="1"
+                          v-if="is.sectionType != 2"
+                        >
                           <el-button
                             size="mini"
                             type="text"
+                            style="width: 90px !important"
                             v-if="
                               is.studyDuration > 0 &&
                               is.durationTime > 0 &&
@@ -115,6 +129,7 @@
                           <el-button
                             type="primary"
                             size="mini"
+                            style="width: 90px !important"
                             v-else-if="
                               is.studyDuration > 0 &&
                               is.durationTime > 0 &&
@@ -126,12 +141,46 @@
                           <el-button
                             size="mini"
                             type="primary"
+                            style="width: 90px !important"
                             plain
                             v-else-if="
                               is.studyDuration == 0 && is.durationTime > 0
                             "
                             @click="studyFunc(item, is)"
                             >未开始</el-button
+                          > </el-col
+                        ><el-col :span="2" :offset="1" v-else>
+                          <el-button
+                            size="mini"
+                            plain
+                            disabled
+                            type="success"
+                            style="width: 90px !important"
+                            v-if="is.liveStartTime > sysTime"
+                            @click="studyFunc(item, is)"
+                            >未开播</el-button
+                          >
+                          <el-button
+                            size="mini"
+                            plain
+                            disabled
+                            type="danger"
+                            style="width: 90px !important"
+                            v-else-if="is.liveEndTime < sysTime"
+                            @click="studyFunc(item, is)"
+                            >已结束</el-button
+                          >
+                          <el-button
+                            size="mini"
+                            plain
+                            type="primary"
+                            style="width: 90px !important;text-align:center;"
+                            v-else-if="
+                              is.liveEndTime > sysTime &&
+                              is.liveStartTime < sysTime
+                            "
+                            @click="studyFunc(item, is)"
+                            >进入直播间</el-button
                           >
                         </el-col>
                       </el-row>
@@ -142,10 +191,10 @@
             </div>
             <div v-if="items.type === 2" :key="indexs">
               <div
-                class="chapterStyle"
+                class="chapterStyle hoverStyle"
                 @click="changeChapterStatus(1, items, index, indexs)"
               >
-                <span class="iconStyle">章</span>
+                <!-- <span class="iconStyle">章</span> -->
                 {{ items.menuName }}
                 <span class="showHide"
                   ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
@@ -155,14 +204,25 @@
               <template v-if="items.showStatus && items.children.length > 0">
                 <div
                   v-for="(i, k) in items.children"
-                  class="sectionStyle"
+                  class="sectionStyle hoverStyleSection"
                   :key="k"
                   style="padding-left: 20px"
                 >
                   <el-row style="display: flex; align-items: center">
                     <el-col :span="12">
                       <span class="iconStyles">•</span>
-                      {{ i.name }}
+                      <span class="upStudyStyle sizeStyle">{{
+                        i.sectionType === 1
+                          ? "录播"
+                          : i.sectionType === 2
+                          ? "直播"
+                          : i.sectionType === 3
+                          ? "回放"
+                          : "练习"
+                      }}</span>
+                      <span class="span_style">
+                        {{ i.name }}
+                      </span>
                       <span v-if="i.recordStatus" class="upStudyStyle"
                         >上次学到</span
                       >
@@ -188,10 +248,11 @@
                         }}
                       </span>
                     </el-col>
-                    <el-col :span="2" :offset="1">
+                    <el-col :span="2" :offset="1" v-if="i.sectionType != 2">
                       <el-button
                         size="mini"
                         type="text"
+                        style="width: 90px !important"
                         v-if="
                           i.studyDuration > 0 &&
                           i.durationTime > 0 &&
@@ -203,6 +264,7 @@
                       <el-button
                         type="primary"
                         size="mini"
+                        style="width: 90px !important"
                         v-else-if="
                           i.studyDuration > 0 &&
                           i.durationTime > 0 &&
@@ -215,20 +277,69 @@
                         size="mini"
                         plain
                         type="primary"
+                        style="width: 90px !important"
                         v-else-if="i.studyDuration == 0 && i.durationTime > 0"
                         @click="studyFunc(item, i)"
                         >未开始</el-button
                       >
                     </el-col>
+                    <el-col :span="2" :offset="1" v-else>
+                      <el-button
+                        size="mini"
+                        style="width: 90px !important"
+                        plain
+                        disabled
+                        type="success"
+                        v-if="i.liveStartTime > sysTime"
+                        @click="studyFunc(item, i)"
+                        >未开播</el-button
+                      >
+                      <el-button
+                        size="mini"
+                        style="width: 90px !important"
+                        plain
+                        disabled
+                        type="danger"
+                        v-else-if="i.liveEndTime < sysTime"
+                        @click="studyFunc(item, i)"
+                        >已结束</el-button
+                      >
+                      <el-button
+                        size="mini"
+                        style="width: 90px !important;text-align:center;"
+                        plain
+                        type="primary"
+                        v-else-if="
+                          i.liveEndTime > sysTime && i.liveStartTime < sysTime
+                        "
+                        @click="studyFunc(item, i)"
+                        >进入直播间</el-button
+                      >
+                    </el-col>
                   </el-row>
                 </div>
               </template>
             </div>
-            <div v-if="items.type === 3" :key="indexs" class="sectionStyle">
+            <div
+              v-if="items.type === 3"
+              :key="indexs"
+              class="sectionStyle hoverStyle"
+            >
               <el-row style="display: flex; align-items: center">
                 <el-col :span="12">
                   <span class="iconStyles">•</span>
-                  {{ items.menuName }}
+                  <span class="upStudyStyle sizeStyle">{{
+                    items.sectionType === 1
+                      ? "录播"
+                      : items.sectionType === 2
+                      ? "直播"
+                      : items.sectionType === 3
+                      ? "回放"
+                      : "练习"
+                  }}</span>
+                  <span class="span_style">
+                    {{ items.menuName }}
+                  </span>
                   <span v-if="items.recordStatus" class="upStudyStyle"
                     >上次学到</span
                   >
@@ -256,9 +367,10 @@
                     }}
                   </span>
                 </el-col>
-                <el-col :span="2" :offset="1">
+                <el-col :span="2" :offset="1" v-if="items.sectionType != 2">
                   <el-button
                     size="mini"
+                    style="width: 90px !important"
                     type="text"
                     v-if="
                       items.studyDuration > 0 &&
@@ -270,6 +382,7 @@
                   >
                   <el-button
                     type="primary"
+                    style="width: 90px !important"
                     size="mini"
                     v-else-if="
                       items.studyDuration > 0 &&
@@ -280,6 +393,7 @@
                     >继续学习</el-button
                   >
                   <el-button
+                    style="width: 90px !important"
                     plain
                     size="mini"
                     type="primary"
@@ -290,6 +404,40 @@
                     >未开始</el-button
                   >
                 </el-col>
+                <el-col :span="2" :offset="1" v-else>
+                  <el-button
+                    size="mini"
+                    style="width: 90px !important"
+                    plain
+                    disabled
+                    type="success"
+                    v-if="items.liveStartTime > sysTime"
+                    @click="studyFunc(item, items)"
+                    >未开播</el-button
+                  >
+                  <el-button
+                    size="mini"
+                    style="width: 90px !important"
+                    plain
+                    disabled
+                    type="danger"
+                    v-else-if="items.liveEndTime < sysTime"
+                    @click="studyFunc(item, items)"
+                    >已结束</el-button
+                  >
+                  <el-button
+                    size="mini"
+                    style="width: 90px !important;text-align:center;"
+                    plain
+                    type="primary"
+                    v-else-if="
+                      items.liveEndTime > sysTime &&
+                      items.liveStartTime < sysTime
+                    "
+                    @click="studyFunc(item, items)"
+                    >进入直播间</el-button
+                  >
+                </el-col>
               </el-row>
             </div>
           </template>
@@ -374,6 +522,7 @@ export default {
   },
   methods: {
     comeStyle(courseItem, item) {
+      console.log(item,"itemitem")
       this.$router.push({
         path: `/my-course-detail/${this.goodsData.goodsId}`,
         query: {
@@ -384,7 +533,10 @@ export default {
           moduleId: item.moduleId,
           sectionId: item.sectionId || item.menuId,
           recordingUrl: item.recordingUrl,
+          liveUrl:item.liveUrl,
           sectionType: item.sectionType,
+          liveStartTime:item.liveStartTime,
+          liveEndTime:item.liveEndTime,
         },
       });
     },
@@ -423,14 +575,14 @@ export default {
         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();
+            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();
             }
           });
       });
@@ -550,18 +702,16 @@ export default {
             }
           }
         } else {
-          this.resultCourseGoodsList()
+          this.resultCourseGoodsList();
         }
       });
     },
-    resultCourseGoodsList(){
-      this.$request
-            .courseGoodsList({ pageNum: 1, pageSize: 1 })
-            .then((res) => {
-              if (res.rows && res.rows.length > 0) {
-                this.backData(res.rows[0]);
-              }
-            });
+    resultCourseGoodsList() {
+      this.$request.courseGoodsList({ pageNum: 1, pageSize: 1 }).then((res) => {
+        if (res.rows && res.rows.length > 0) {
+          this.backData(res.rows[0]);
+        }
+      });
     },
     /**
      * 展开获取课程详情列表
@@ -672,6 +822,7 @@ export default {
     async studyFunc(courseItem, items) {
       this.sysTime = this.$tools.timest();
       let item = this.goodsData;
+      console.log(item,"学习服务期")
       if (item.interfaceAccountId > 0) {
         //学习账号已开通
 
@@ -797,7 +948,22 @@ export default {
               goodsId: item.goodsId,
               gradeId: item.gradeId,
             })
-            .then((res) => {
+            .then(async (res) => {
+              //学习次数是否上限---start
+              let learnNum = await this.goodsTodayStudySectionNum(courseItem);
+              let hasLearn = await this.gradeCheckGoodsStudy(courseItem, items);
+              console.log(learnNum, hasLearn);
+              if (this.goodsData.sectionMaxNum > 0) {
+                if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
+                  this.clickLock = false;
+                  this.$message({
+                    type: "warning",
+                    message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
+                  });
+                  return;
+                }
+              }
+              //学习次数是否上限---end
               if (res.rows.length) {
                 // this.$emit("backData", item);
                 // this.dialogVisible = false;
@@ -820,6 +986,35 @@ export default {
             });
         });
     },
+
+    gradeCheckGoodsStudy(courseItem, option) {
+      return new Promise((resolve) => {
+        this.$request
+          .gradeCheckGoodsStudy({
+            goodsId: this.goodsData.goodsId,
+            gradeId: courseItem.gradeId,
+            moduleId: option.moduleId || 0,
+            chapterId: option.chapterId || 0,
+            sectionId: option.sectionId || option.menuId,
+          })
+          .then((res) => {
+            resolve(res.data);
+          });
+      });
+    },
+    goodsTodayStudySectionNum(option) {
+      return new Promise((resolve) => {
+        this.$request
+          .goodsTodayStudySectionNum({
+            goodsId: this.goodsData.goodsId,
+            gradeId: option.gradeId,
+          })
+          .then((res) => {
+            resolve(res.data);
+          });
+      });
+    },
+
     userConfirmInfoDetail() {
       return new Promise((resolve) => {
         this.$request
@@ -942,7 +1137,8 @@ export default {
   border-bottom: 1px solid #eee;
 }
 .firstTop {
-  margin: 24px 0px;
+  padding: 24px 0px;
+  // margin: 24px 0px;
   .iconStyle {
     background-color: #3f8dfd;
     color: #fff;
@@ -1015,4 +1211,28 @@ export default {
   padding: 3px 4px;
   border-radius: 4px;
 }
+.sizeStyle {
+  background-color: #fff !important;
+  border-color: #979ea5 !important;
+  color: #979ea5 !important;
+  padding: 2px 3px !important;
+}
+.hoverStyle {
+  cursor: pointer;
+  transition: all 0.2s;
+  &:hover {
+    background-color: #eaf3ff;
+  }
+}
+.hoverStyleSection {
+  transition: all 0.2s;
+  &:hover {
+    background-color: #eaf3ff;
+  }
+}
+.span_style {
+  max-width: 400px;
+  display: inline-block;
+  vertical-align: middle;
+}
 </style>

+ 23 - 7
src/pages/person-center/play-record/index.vue

@@ -167,7 +167,7 @@ export default {
         })
         .then(async (res) => {
           let item = res.data;
-          console.log(item,"item")
+          console.log(item, "item");
           // if (item.interfacePushId > 0 && item.officialStatus != 1) {
           //   this.$message({
           //     type: "warning",
@@ -177,8 +177,8 @@ export default {
           //   return;
           // }
           if (
-            this.sysTime <= item.serviceStartTime ||
-            this.sysTime >= item.serviceEndTime
+            (item.serviceStartTime && this.sysTime <= item.serviceStartTime) ||
+            (item.serviceEndTime && this.sysTime >= item.serviceEndTime)
           ) {
             this.$message({
               type: "warning",
@@ -259,10 +259,26 @@ export default {
                 })
                 .then((res) => {
                   if (res.rows.length) {
-                    this.go("/my-course-detail/" + sectionItem.goodsId, {
-                      gradeId: sectionItem.gradeId,
-                      orderGoodsId: sectionItem.orderGoodsId,
-                      courseId: sectionItem.courseId,
+                    // this.go("/my-course-detail/" + sectionItem.goodsId, {
+                    //   gradeId: sectionItem.gradeId,
+                    //   orderGoodsId: sectionItem.orderGoodsId,
+                    //   courseId: sectionItem.courseId,
+                    // });
+                    this.$router.push({
+                      path: `/my-course-detail/${sectionItem.goodsId}`,
+                      query: {
+                        gradeId: sectionItem.gradeId,
+                        orderGoodsId: sectionItem.orderGoodsId,
+                        courseId: sectionItem.courseId,
+                        chapterId: sectionItem.chapterId,
+                        moduleId: sectionItem.moduleId,
+                        sectionId: sectionItem.sectionId,
+                        recordingUrl: sectionItem.recordingUrl,
+                        liveUrl: sectionItem.liveUrl,
+                        sectionType: sectionItem.sectionType,
+                        liveStartTime: sectionItem.liveStartTime,
+                        liveEndTime: sectionItem.liveEndTime,
+                      },
                     });
                   } else {
                     this.$message({