chenxiong 3 年 前
コミット
f316944c8d

+ 1 - 1
src/axios.js

@@ -2,7 +2,7 @@ import axios from 'axios'
 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 = 'http://120.79.166.78:19009'   //预发布
+// export const BASE_URL = 'http://api.xyyxt.net:19009'   //预发布
 export const BASE_URL = 'http://192.168.1.222:5055'    //dev
 export const tenantId = '867735392558919680'
 

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

@@ -16,9 +16,9 @@
             <a v-if="item.name == '首页'" @click="go('/index')">首页</a>
             <a v-if="item.name == '走进祥粤'" @click="go('/about')">走进祥粤</a>
             <a v-if="item.name == '课程'" @click="go('/course-list')">课程</a>
+            <a v-if="item.name == '直播'" @click="go('/live-list')">直播</a>
             <a v-if="item.name == '题库'" @click="go('/bank-list')">题库</a>
           </li>
-          <li><a @click="go('/live-list')">直播</a></li>
         </ul>
       </nav>
 

+ 42 - 45
src/pages/goods-detail/live-detail.vue

@@ -154,13 +154,15 @@
                                               >
                                                 直播时间{{
                                                   $tools.timestampToTime(
-                                                    section.liveStartTime
+                                                    section.liveStartTime,
+                                                    false
                                                   )
                                                 }}
                                                 -
                                                 {{
                                                   $tools.timestampToTime(
-                                                    section.liveEndTime
+                                                    section.liveEndTime,
+                                                    false
                                                   )
                                                 }}
                                               </div>
@@ -224,13 +226,15 @@
                                                 直播时间
                                                 {{
                                                   $tools.timestampToTime(
-                                                    section.liveStartTime
+                                                    section.liveStartTime,
+                                                    false
                                                   )
                                                 }}
                                                 -
                                                 {{
                                                   $tools.timestampToTime(
-                                                    section.liveEndTime
+                                                    section.liveEndTime,
+                                                    false
                                                   )
                                                 }}
                                               </div>
@@ -262,13 +266,15 @@
                                           >
                                             直播时间{{
                                               $tools.timestampToTime(
-                                                item.liveStartTime
+                                                item.liveStartTime,
+                                                false
                                               )
                                             }}
                                             -
                                             {{
                                               $tools.timestampToTime(
-                                                item.liveEndTime
+                                                item.liveEndTime,
+                                                false
                                               )
                                             }}
                                           </div>
@@ -1387,48 +1393,39 @@ export default {
     },
     buyNow() {
       if (this.$tools.isLogin()) {
-        if (this.goodsDetail.templateType) {
-          this.selectClassModal = true;
-        } else {
-          let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
-          selectGoodsList.forEach((item) => {
-            if (item.goodsType == 1) {
-              if (item.templateType == "class") {
-                let goodsInputData = {
-                  type: "class",
-                  gradeId: this.gradeId,
-                  gradeJson: JSON.stringify(
-                    this.gradeList.find(
-                      (grade) => grade.gradeId == this.gradeId
-                    )
-                  ),
-                };
-                item.goodsInputData = goodsInputData;
-              }
-              if (item.templateType == "apply") {
-                let goodsInputData = {
-                  type: "apply",
-                  applyAreasJson: JSON.stringify(this.applyAreas),
-                  examDateJson: JSON.stringify(
-                    this.examineList.find(
-                      (exam) => exam.educationId == this.educationId
-                    )
-                  ),
-                };
-                item.goodsInputData = goodsInputData;
-              }
+        let selectGoodsList = JSON.parse(JSON.stringify([this.goodsDetail]));
+        selectGoodsList.forEach((item) => {
+          if (item.goodsType == 1) {
+            if (item.templateType == "class") {
+              let goodsInputData = {
+                type: "class",
+                gradeId: this.gradeId,
+                gradeJson: JSON.stringify(
+                  this.gradeList.find((grade) => grade.gradeId == this.gradeId)
+                ),
+              };
+              item.goodsInputData = goodsInputData;
             }
-          });
+            if (item.templateType == "apply") {
+              let goodsInputData = {
+                type: "apply",
+                applyAreasJson: JSON.stringify(this.applyAreas),
+                examDateJson: JSON.stringify(
+                  this.examineList.find(
+                    (exam) => exam.educationId == this.educationId
+                  )
+                ),
+              };
+              item.goodsInputData = goodsInputData;
+            }
+          }
+        });
 
-          localStorage.setItem(
-            "checkGoodsList",
-            JSON.stringify(selectGoodsList)
-          );
+        localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
 
-          this.$router.push({
-            path: "/payment",
-          });
-        }
+        this.$router.push({
+          path: "/payment",
+        });
       } else {
         this.setCurrentRouter(this.$route);
         this.$router.push({

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

@@ -97,8 +97,14 @@
               @click="go('/bank-list')"
               >题库</a
             >
+            <a
+              v-if="item.name === '直播'"
+              :key="index"
+              class="tab"
+              @click="go('/live-list')"
+              >直播</a
+            >
           </template>
-          <a class="tab" @click="go('/live-list')">直播</a>
         </div>
       </div>
       <div class="swiper-wrap" :style="{ background: color }">

+ 17 - 2
src/pages/live-detail/index.vue

@@ -26,11 +26,14 @@
                     )})`,
                   }"
                 >
-                  <div v-if="liveLast" class="live-btn">
+                  <div
+                    v-if="liveLast && liveLast.watchStatus == 'live'"
+                    class="live-btn"
+                  >
                     <el-button
                       type="primary"
                       class="btn"
-                      @click="this.playVideo(liveLast)"
+                      @click="playVideo(liveLast)"
                     >
                       进入直播
                     </el-button>
@@ -5037,6 +5040,18 @@ export default {
             type: "warning",
             message: `暂无直播地址数据`,
           });
+          return;
+        }
+
+        let nowTime = +this.$tools.timest();
+
+        if (option.liveStartTime > nowTime) {
+          this.clickLock = false;
+          this.$message({
+            type: "warning",
+            message: `直播未开始`,
+          });
+          return;
         }
 
         this.playVideo(option);

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

@@ -157,7 +157,10 @@ export default {
     this.channelId = this.$route.params.channelId;
     this.playVideo();
   },
-  beforeDestroy() {},
+  beforeDestroy() {
+    this.plv.liveSdk.destroy();
+    clearInterval(this.timer);
+  },
   methods: {
     ...mapMutations(["getCartCount"]),