فهرست منبع

跳转企业图标+接口api请求+解决商品列表切换数据冲突问题

Tang 2 سال پیش
والد
کامیت
4b70f36ddd

+ 2 - 1
config/test.env.js

@@ -2,7 +2,8 @@
 module.exports = {
     NODE_ENV: '"production"',
     BASE_IMG_URL: '"https://file-dev.xyyxt.net/"', //图片上传api
-    BASE_URL: '"http://120.79.166.78:19012"',
+    BASE_URL: '"https://testapi.xyyxt.net"',
+    // BASE_URL: '"http://120.79.166.78:19012"',
     TENANT_ID: '"867735392558919680"',
     ENV_ID: '"test"',//测试环境
     WEAPP_LOGO: '"@/assets/xcxqrcode.jpg"', // 微信小程序扫码图片

+ 8 - 1
src/apis/common.js

@@ -1,4 +1,7 @@
 import request from '@/axios'
+import axios from 'axios'
+const CancelToken = axios.CancelToken;
+export let cancel;
 export default {
   /**
    * 
@@ -128,7 +131,11 @@ export default {
       url: '/app/common/goods/list',
       method: 'get',
       params: data,
-      noToken: true
+      noToken: true,
+      cancelToken: new CancelToken(function executor(c) {
+        // executor 函数接收一个 cancel 函数作为参数
+        cancel = c;
+      })
     })
   },
 

+ 12 - 7
src/axios.js

@@ -13,17 +13,22 @@ const request = axios.create({
 
 // 错误处理函数
 const err = (error) => {
-  if (error.response) {
-    const data = error.response.data
-    // const token = Vue.ls.get(ACCESS_TOKEN)
-    if (error.response.status === 403) {
+  if (axios.isCancel(error)) {
+    console.log('Request canceled', error.message);
+  } else {
+    // 处理错误
+    if (error.response) {
+      const data = error.response.data
+      // const token = Vue.ls.get(ACCESS_TOKEN)
+      if (error.response.status === 403) {
 
-    }
-    if (error.response.status === 401) {
+      }
+      if (error.response.status === 401) {
 
+      }
     }
+    return Promise.reject(error)
   }
-  return Promise.reject(error)
 }
 
 // request interceptor(请求拦截器)

+ 162 - 113
src/components/header/index.vue

@@ -1,27 +1,67 @@
 <template>
   <header class="header">
-    <div class="container clearfix">
+    <div class="container clearfix dis_play">
       <div class="logo logo--no" v-if="header.companyLogo">
-        <img style="cursor: pointer; width: 162px; height: 33px" :src="$tools.splitImgHost(header.companyLogo)" alt=""
-          @click="go('/')" />
+        <img
+          style="cursor: pointer; max-width: 100%; max-height: 100%"
+          :src="$tools.splitImgHost(header.companyLogo)"
+          alt=""
+          @click="go('/')"
+        />
       </div>
       <h1 class="logo" v-else @click="go('/')"></h1>
       <nav class="nav">
         <ul class="list">
           <li v-for="(item, index) in showNav(header.Nav)" :key="index">
             <a v-if="item.name == '首页'" @click="go('/index')">首页</a>
-            <a v-if="item.name == '走进祥粤'" @click="go('/about')"
-              :style="$route.path === '/about' ? 'color:red;' : ''">走进祥粤</a>
-            <a v-if="item.name == '课程'" @click="go('/course-list')"
-              :style="$route.path === '/course-list' ? 'color:red;' : ''">课程</a>
-            <a v-if="item.name == '直播'" @click="go('/live-list')"
-              :style="$route.path === '/live-list' ? 'color:red;' : ''">直播</a>
-            <a v-if="item.name == '题库'" @click="go('/bank-list')"
-              :style="$route.path === '/bank-list' ? 'color:red;' : ''">题库</a>
+            <a
+              v-if="item.name == '走进祥粤'"
+              @click="go('/about')"
+              :style="$route.path === '/about' ? 'color:red;' : ''"
+              >走进祥粤</a
+            >
+            <a
+              v-if="item.name == '课程'"
+              @click="go('/course-list')"
+              :style="$route.path === '/course-list' ? 'color:red;' : ''"
+              >课程</a
+            >
+            <a
+              v-if="item.name == '直播'"
+              @click="go('/live-list')"
+              :style="$route.path === '/live-list' ? 'color:red;' : ''"
+              >直播</a
+            >
+            <a
+              v-if="item.name == '题库'"
+              @click="go('/bank-list')"
+              :style="$route.path === '/bank-list' ? 'color:red;' : ''"
+              >题库</a
+            >
           </li>
         </ul>
       </nav>
 
+      <div class="search">
+        <div class="search__select">
+          <select v-model="type">
+            <option value="1">课程</option>
+            <option value="2">题库</option>
+            <option value="6">直播</option>
+          </select>
+        </div>
+        <div class="search__input">
+          <input type="text" v-model="searchKey" autocomplete="off" />
+          <input
+            type="password"
+            autocomplete="new-password"
+            style="display: none"
+          />
+        </div>
+        <el-button type="primary" @click="search" class="search__btn"
+          >搜索</el-button
+        >
+      </div>
       <div class="userinfo" v-if="userInfo">
         <!-- <a class="msg" @click="go('/person-center/my-message')">
           <i class="pi" v-if="msgCount > 0"></i>
@@ -30,7 +70,7 @@
             {{ msgData.text }} <el-button style="float:right;" type="text">立即学习</el-button>
           </div>
         </a> -->
-        
+
         <!-- <el-tooltip placement="bottom-end" v-model="msgShow" :hide-after="0" manual popper-class="tooltipStyle">
           <el-badge :is-dot="msgCount > 0 ? true : false" class="item" style="vertical-align: baseline">
             <el-button style="font-size: 20px; padding: 0px" icon="el-icon-message-solid" type="text"
@@ -42,20 +82,35 @@
             <i style="font-size: 18px; cursor: pointer" class="el-icon-close" @click="clearMsg"></i>
           </div>
         </el-tooltip> -->
-        <el-badge :is-dot="msgCount > 0 ? true : false" class="item" style="vertical-align: baseline">
-          <el-button style="font-size: 20px; padding: 0px" icon="el-icon-message-solid" type="text"
-            @click="go('/person-center/my-message')"></el-button>
+        <el-badge
+          :is-dot="msgCount > 0 ? true : false"
+          class="item"
+          style="vertical-align: baseline"
+        >
+          <el-button
+            style="font-size: 20px; padding: 0px"
+            icon="el-icon-message-solid"
+            type="text"
+            @click="go('/person-center/my-message')"
+          ></el-button>
         </el-badge>
         <el-dropdown @command="handleCommand">
-          <span class="el-dropdown-link" @click="go('/person-center/my-course')"
-            style="margin-left: 10px; cursor: pointer">
-            <img style="width: 24px; vertical-align: middle" :src="
-              userInfo
-                ? userInfo.avatar
-                  ? $tools.splitImgHost(userInfo.avatar, true)
-                  : '@/assets/qrcode.png'
-                : ''
-            " alt="" />
+          <span
+            class="el-dropdown-link"
+            @click="go('/person-center/my-course')"
+            style="margin-left: 10px; cursor: pointer"
+          >
+            <img
+              style="width: 24px; vertical-align: middle"
+              :src="
+                userInfo
+                  ? userInfo.avatar
+                    ? $tools.splitImgHost(userInfo.avatar, true)
+                    : '@/assets/qrcode.png'
+                  : ''
+              "
+              alt=""
+            />
             <span>{{ userInfo && userInfo.realname }}</span>
           </span>
           <el-dropdown-menu slot="dropdown">
@@ -72,24 +127,12 @@
           <a @click="go('/login', { state: 2 })">注册</a>
         </div>
       </div>
-
-      <div class="search">
-        <div class="search__select">
-          <select v-model="type">
-            <option value="1">课程</option>
-            <option value="2">题库</option>
-            <option value="6">直播</option>
-          </select>
-        </div>
-        <div class="search__input">
-          <input type="text" v-model="searchKey" autocomplete="off" />
-          <input type="password" autocomplete="new-password" style="display: none" />
-        </div>
-        <el-button type="primary" @click="search" class="search__btn">搜索</el-button>
-      </div>
     </div>
 
-    <RebuildModal ref="rebuildModal" @rebuildSubmit="rebuildSubmit($event)"></RebuildModal>
+    <RebuildModal
+      ref="rebuildModal"
+      @rebuildSubmit="rebuildSubmit($event)"
+    ></RebuildModal>
   </header>
 </template>
 
@@ -99,7 +142,7 @@ import { mapGetters, mapMutations } from "vuex";
 export default {
   name: "Header",
   components: {
-    RebuildModal,
+    RebuildModal
   },
   data() {
     return {
@@ -109,22 +152,22 @@ export default {
       timer: null,
       msgData: {},
       sysTime: 0,
-      msgShow: false,
+      msgShow: false
     };
   },
   computed: {
     ...mapGetters(["header", "userInfo", "msgCount"]),
-    showNav: function () {
-      return function (list) {
+    showNav: function() {
+      return function(list) {
         var newList = [];
         if (list) {
-          newList = list.filter((item) => {
+          newList = list.filter(item => {
             return item.status === 1;
           });
         }
         return newList;
       };
-    },
+    }
   },
   mounted() {
     if (this.$tools.isLogin()) {
@@ -157,13 +200,13 @@ export default {
         query: {
           gradeId: item.gradeId,
           orderGoodsId: item.orderGoodsId,
-          rebuild: 1,
-        },
+          rebuild: 1
+        }
       });
     },
     getGoodsData() {
       return new Promise((resolve, reject) => {
-        this.$request.goodsDetail(this.msgData.goodsId).then((res) => {
+        this.$request.goodsDetail(this.msgData.goodsId).then(res => {
           resolve(res.data);
         });
       });
@@ -175,7 +218,7 @@ export default {
       let ary = {
         userId: this.msgData.userId,
         msgId: this.msgData.id,
-        updateTime: new Date(new Date().toLocaleDateString()).getTime(),
+        updateTime: new Date(new Date().toLocaleDateString()).getTime()
       };
       localStorage.setItem("msg", JSON.stringify(ary));
       this.msgShow = false;
@@ -188,15 +231,15 @@ export default {
       if (item.goodsType == 1) {
         this.sysTime = this.$tools.timest();
         item.orderGoodsId = this.msgData.orderGoodsId;
-        this.canJump(item).then((res) => {
+        this.canJump(item).then(res => {
           this.clearMsg();
           this.$router.push({
             path: `/my-course-detail/${item.goodsId}`,
             query: {
               gradeId: item.gradeId,
               orderGoodsId: item.orderGoodsId,
-              courseId: res.rows[0].courseId || "",
-            },
+              courseId: res.rows[0].courseId || ""
+            }
           });
         });
 
@@ -208,18 +251,18 @@ export default {
         this.$router.push({
           path: "/person-center/my-bank/bank-detail/" + item.goodsId,
           query: {
-            orderGoodsId: item.orderGoodsId,
-          },
+            orderGoodsId: item.orderGoodsId
+          }
         });
       }
     },
     canJump(item) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .orderInfo({
-            orderGoodsId: item.orderGoodsId,
+            orderGoodsId: item.orderGoodsId
           })
-          .then(async (res) => {
+          .then(async res => {
             let items = res.data;
             let currentTime = this.$tools.timest();
             if (items.interfaceAccountId > 0) {
@@ -233,7 +276,7 @@ export default {
                   "1.点击【跳转学习网址】按钮",
                   "2.打开学习网址后,选择【个人用户】进行登录",
                   "(1)账号:您个人的身份证号码",
-                  "(2)密码:身份证号码,再加111111",
+                  "(2)密码:身份证号码,再加111111"
                 ];
                 const newDatas = [];
                 const h = this.$createElement;
@@ -246,19 +289,19 @@ export default {
                   closeOnClickModal: false,
                   closeOnPressEscape: false,
                   distinguishCancelAndClose: false,
-                  showClose: false,
+                  showClose: false
                 })
-                  .then((_) => {
+                  .then(_ => {
                     window.open("http://admin.zhujianpeixun.com/", "_blank");
                   })
-                  .catch((_) => { });
+                  .catch(_ => {});
 
                 return;
               } else {
                 this.$message({
                   type: "warning",
                   message:
-                    "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
+                    "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!"
                 });
                 return;
               }
@@ -279,7 +322,7 @@ export default {
               ) {
                 this.$message({
                   type: "warning",
-                  message: "不在学习服务期,不能进入学习",
+                  message: "不在学习服务期,不能进入学习"
                 });
                 return;
               }
@@ -291,7 +334,7 @@ export default {
               ) {
                 this.$message({
                   type: "warning",
-                  message: "不在班级有效期,不能进入学习",
+                  message: "不在班级有效期,不能进入学习"
                 });
                 return;
               }
@@ -299,7 +342,7 @@ export default {
               if (items.learningStatus == 2) {
                 this.$message({
                   type: "warning",
-                  message: "开放学习时间待定,不能进入学习",
+                  message: "开放学习时间待定,不能进入学习"
                 });
                 return;
               }
@@ -307,7 +350,7 @@ export default {
               if (items.classStatus == 0) {
                 this.$message({
                   type: "warning",
-                  message: "尚未开班,不能进入学习",
+                  message: "尚未开班,不能进入学习"
                 });
                 return;
               }
@@ -317,7 +360,7 @@ export default {
               ) {
                 this.$message({
                   type: "warning",
-                  message: "不在开放学习时间,不能进入学习",
+                  message: "不在开放学习时间,不能进入学习"
                 });
                 return;
               }
@@ -335,31 +378,31 @@ export default {
             // if (item.educationName == "继续教育") {
             this.$request
               .lockLockStatus({
-                action: "jxjy",
+                action: "jxjy"
               })
-              .then((res) => {
+              .then(res => {
                 //有其他端在操作,不能学习
                 this.$message({
                   type: "warning",
-                  message: res.msg,
+                  message: res.msg
                 });
               })
-              .catch((err) => {
+              .catch(err => {
                 //可以学习
                 this.$request
                   .courseCourseList({
                     pageNum: 1,
                     pageSize: 1,
                     goodsId: items.goodsId,
-                    gradeId: items.gradeId,
+                    gradeId: items.gradeId
                   })
-                  .then((res) => {
+                  .then(res => {
                     if (res.rows.length) {
                       resolve(res);
                     } else {
                       this.$message({
                         type: "warning",
-                        message: "课程内暂无可以学习的科目",
+                        message: "课程内暂无可以学习的科目"
                       });
                     }
                   });
@@ -393,13 +436,13 @@ export default {
      * 查询商品重修状态
      */
     courseGoodsRebuildStatus(goodsId, gradeId) {
-      return new Promise((resolve) => {
+      return new Promise(resolve => {
         this.$request
           .courseGoodsRebuildStatus({
             goodsId: goodsId,
-            gradeId: gradeId,
+            gradeId: gradeId
           })
-          .then((res) => {
+          .then(res => {
             resolve(res.data);
           });
       });
@@ -426,13 +469,13 @@ export default {
     go(path, query) {
       if (path === this.$route.path) {
         this.$router.push({
-          path: "refresh", //refresh路由地址和当前要刷新路由地址同级即可
+          path: "refresh" //refresh路由地址和当前要刷新路由地址同级即可
         });
         return;
       }
       this.$router.push({
         path,
-        query,
+        query
       });
     },
 
@@ -441,7 +484,7 @@ export default {
         this.$message({
           type: "warning",
           duration: 2000,
-          message: "请输入搜索内容",
+          message: "请输入搜索内容"
         });
 
         return;
@@ -457,15 +500,15 @@ export default {
           this.$router.push({
             path: "/live-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         } else {
           this.$router.push({
             path: "/course-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         }
       } else if (path == "/course-list") {
@@ -476,15 +519,15 @@ export default {
           this.$router.push({
             path: "/live-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         } else {
           this.$router.push({
             path: "/bank-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         }
       } else if (path == "/live-list") {
@@ -495,15 +538,15 @@ export default {
           this.$router.push({
             path: "/course-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         } else {
           this.$router.push({
             path: "/bank-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         }
       } else {
@@ -513,22 +556,22 @@ export default {
           this.$router.push({
             path: "/course-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         } else if (type == "6") {
           this.$router.push({
             path: "/live-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         } else {
           this.$router.push({
             path: "/bank-list",
             query: {
-              searchKey: this.searchKey,
-            },
+              searchKey: this.searchKey
+            }
           });
         }
       }
@@ -544,8 +587,8 @@ export default {
       this.timer = setTimeout(() => {
         this.showBox = false;
       }, 500);
-    },
-  },
+    }
+  }
 };
 </script>
 
@@ -555,16 +598,22 @@ export default {
   position: relative;
   background: #fff;
   box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.04);
+  .dis_play {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
 
   .container {
     height: 80px;
 
     .logo {
-      margin-top: 23px;
-      float: left;
+      // margin-top: 23px;
+      // float: left;
       cursor: pointer;
-      width: 162px;
-      height: 33px;
+      text-align: center;
+      max-width: 300px;
+      max-height: 61px;
       background: url("~@/assets/logo.png") no-repeat center;
 
       &--no {
@@ -573,11 +622,11 @@ export default {
     }
 
     .nav {
-      float: left;
-      margin-top: 30px;
+      // float: left;
+      // margin-top: 30px;
 
       .list {
-        margin-left: 146px;
+        // margin-left: 146px;
         display: flex;
 
         li {
@@ -595,9 +644,9 @@ export default {
     }
 
     .search {
-      float: right;
-      margin-right: 12px;
-      margin-top: 20px;
+      // float: right;
+      // margin-right: 12px;
+      // margin-top: 20px;
       width: 324px;
       background: #fafbfc;
       border: 1px solid #3f8dfd;
@@ -639,8 +688,8 @@ export default {
     }
 
     .userinfo {
-      margin-top: 30px;
-      float: right;
+      // margin-top: 30px;
+      // float: right;
       white-space: nowrap;
 
       a {

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

@@ -141,6 +141,7 @@
 </template>
 
 <script>
+import { cancel } from "@/apis/common.js";
 import LoadingBox from "@/components/loadingBox/index";
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
@@ -262,6 +263,9 @@ export default {
           this.params.pageNum = 1;
         }
       }
+      if (cancel) {
+        cancel("取消请求");
+      }
       this.loading = true;
       this.$request
         .goodsList(this.params)

+ 78 - 20
src/pages/course-detail/index.vue

@@ -997,6 +997,7 @@ export default {
       stampForm: {
         commitment_seal: ""
       },
+      timer: null,
       infoForm: {
         name: "",
         sex: "",
@@ -1229,9 +1230,34 @@ export default {
       compareFaceData: 0, // 拍照匹配相似度
       rebuildCourseList: [],
       playTabIndex: "",
-      randomConfigStatus: false
+      takeSetInt: null,
+      videoPause: null,
+      confirmStatus: false
     };
   },
+  watch: {
+    takePhotoModal(val, oldVal) {
+      if (val) {
+        this.takeSetInt = setTimeout(() => {
+          this.$confirm("检测拍照停留时间过长,刷新当前页面", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            showCancelButton: false,
+            closeOnClickModal: false,
+            closeOnPressEscape: false,
+            showClose: false,
+            type: "warning"
+          })
+            .then(() => {
+              this.$router.go(0);
+            })
+            .catch(() => {});
+        }, 900000);
+      } else {
+        clearTimeout(this.takeSetInt);
+      }
+    }
+  },
   computed: {
     ...mapGetters(["userInfo"]),
     compyRecommend: function() {
@@ -1331,6 +1357,8 @@ export default {
     document.addEventListener("visibilitychange", this.pauseVideo);
   },
   beforeDestroy() {
+    clearTimeout(this.takeSetInt);
+    clearTimeout(this.videoPause);
     clearInterval(this.answerTimer);
     clearInterval(this.postTimer);
     clearInterval(this.livingTimer);
@@ -1393,6 +1421,9 @@ export default {
       this.loadscroll();
     },
     pauseVideo() {
+      if (this.takePhotoModal || this.confirmStatus) {
+        return;
+      }
       let _p = this.player;
       if (document.visibilityState === "hidden") {
         _p && _p.j2s_pauseVideo();
@@ -3519,7 +3550,6 @@ export default {
             });
           }
         });
-        this.randomConfigStatus = true;
         this.player.HTML5.video.addEventListener("timeupdate", self.timeEvent);
         this.player.on("s2j_onPlayStart", () => {
           //开始播放每5秒提交一次观看时间
@@ -3542,6 +3572,29 @@ export default {
 
         this.player.on("s2j_onVideoPause", () => {
           clearInterval(this.postTimer);
+          if (this.sectionItem.learning != 1) {
+            this.videoPause = setTimeout(() => {
+              if (!this.takePhotoModal) {
+                this.confirmStatus = true;
+                this.$confirm("检测暂停时间过长,刷新当前页面", "提示", {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  showCancelButton: false,
+                  closeOnClickModal: false,
+                  closeOnPressEscape: false,
+                  showClose: false,
+                  type: "warning"
+                })
+                  .then(() => {
+                    this.$router.go(0);
+                    this.confirmStatus = false;
+                  })
+                  .catch(() => {
+                    this.confirmStatus = false;
+                  });
+              }
+            }, 900000);
+          }
         });
 
         this.player.on("s2j_onVideoPlay", () => {
@@ -3550,6 +3603,9 @@ export default {
               this.postStudyRecord(0, this.playSectionId, 5);
             }, 30000);
           }
+          if (this.sectionItem.learning != 1 && this.videoPause) {
+            clearTimeout(this.videoPause);
+          }
         });
 
         this.player.on("s2j_onPlayOver", () => {
@@ -3594,22 +3650,17 @@ export default {
         }
       }
     },
-
     timeEvent() {
       let self = this;
+      this.timer && clearInterval(this.timer);
       var polyvPlayerContext = this.player;
       if (polyvPlayerContext) {
         this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
-        //判断是否需要拍照
-        if (this.photoNum > 0 || this.goodsData.erJianErZao) {
-          if (this.goodsData.erJianErZao && this.randomConfigStatus) {
-            this.photoList = this.randomConfig(
-              polyvPlayerContext.j2s_getDuration(),
-              polyvPlayerContext.j2s_getCurrentTime()
-            );
-          } else {
-            this.configPhoto();
-          }
+        if (
+          this.sectionItem.learning != 1 &&
+          (this.goodsData.erJianErZao || this.photoNum > 0)
+        ) {
+          this.configPhoto();
           let photoTime = 0; //获取拍照秒数
           for (let i = 0; i < this.photoList.length; i++) {
             photoTime = Number(this.photoList[i]); //获取拍照秒数
@@ -3635,6 +3686,9 @@ export default {
     },
 
     getPhotoLastRecord() {
+      if (this.goodsData.erJianErZao) {
+        return;
+      }
       return new Promise(resolve => {
         let self = this;
         this.photoConfig = false;
@@ -3738,7 +3792,6 @@ export default {
 
     //配置随机拍照时间
     configPhoto() {
-      console.log("photoList", this.photoList.length);
       if (this.photoList.length) {
         return;
       }
@@ -3746,9 +3799,12 @@ export default {
       let totalVideoTime = polyvPlayerContext.j2s_getDuration();
       let duration = polyvPlayerContext.j2s_getCurrentTime();
       let photoNum = this.photoNum;
-      console.log("erJianErZao", this.goodsData.erJianErZao, this.photoConfig);
       if (!this.photoConfig) {
         this.photoConfig = true;
+        if (this.goodsData.erJianErZao) {
+          this.photoList = this.randomConfig(totalVideoTime, duration);
+          return;
+        }
         //没有历史拍照间隔数据
         if (this.photoList.length == 0) {
           if (totalVideoTime >= 900) {
@@ -3811,18 +3867,20 @@ export default {
     },
     // 随机拍摄时间
     randomConfig(totalVideoTime, duration) {
-      this.randomConfigStatus = false;
+      this.photoHistoryList = [];
       let photoList = [duration];
       let pre = duration;
       if (totalVideoTime > 300) {
         while (pre <= totalVideoTime) {
-          pre += this.randomNum(360, 900);
+          pre += this.randomNum(780, 900);
           pre <= totalVideoTime && photoList.push(pre);
         }
+        if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
+          photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
+        }
       }
-      let last = photoList.slice(-1)[0];
-      if (totalVideoTime - 300 > last) {
-        photoList.push(this.randomNum(totalVideoTime - 300, totalVideoTime));
+      if (this.recordObj.videoCurrentTime) {
+        photoList[0] = this.recordObj.videoCurrentTime || 0;
       }
       return photoList;
     },

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

@@ -141,6 +141,7 @@
 </template>
 
 <script>
+import { cancel } from "@/apis/common.js";
 import LoadingBox from "@/components/loadingBox/index";
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
@@ -265,6 +266,9 @@ export default {
           this.params.pageNum = 1;
         }
       }
+      if (cancel) {
+        cancel("取消请求");
+      }
       this.loading = true;
       this.$request
         .goodsList(this.params)

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 240 - 201
src/pages/home/index.vue


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

@@ -141,6 +141,7 @@
 </template>
 
 <script>
+import { cancel } from "@/apis/common.js";
 import LoadingBox from "@/components/loadingBox/index";
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
@@ -263,6 +264,9 @@ export default {
           this.params.pageNum = 1;
         }
       }
+      if (cancel) {
+        cancel("取消请求");
+      }
       this.loading = true;
       this.$request
         .goodsList(this.params)

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

@@ -1032,7 +1032,7 @@ export default {
      */
     getRecord(item) {
       this.$request.studyrecordgetUserStudyLast().then(async res => {
-        // if (res.data && res.data.sectionId) {
+        if (res.data && res.data.sectionId) {
         await this.getGoodsData(res);
         var stop = false;
         for (let y = 0; y < this.goodsTeacher.length; y++) {
@@ -1164,9 +1164,9 @@ export default {
           }
         }
 
-        // } else {
-        //   this.resultCourseGoodsList();
-        // }
+        } else {
+          this.resultCourseGoodsList();
+        }
       });
     },
     resultCourseGoodsList() {

+ 5 - 6
src/store/index.js

@@ -26,7 +26,7 @@ export default new Vuex.Store({
     },//页头配置
     footer: [],//页尾配置
     links: null,//友情链接
-    mobile:null,//移动端设置
+    mobile: null,//移动端设置
     sysTime: 0,
     businessItem: null,
     businessList: [],
@@ -121,11 +121,10 @@ export default new Vuex.Store({
       commit
     }) {
       return new Promise(resolve => {
-        var urlReg = /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/;  
-        var urls=urlReg.exec(location.origin)[0];
-        console.log(urls) 
-        if (location.origin.includes("192.168.1") || location.origin.includes("120.79.166.78")) {
-          urls = "web.xyyxt.net"
+        var urlReg = /[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/;
+        var urls = location.origin.includes("localhost") ? '' : urlReg.exec(location.origin)[0];
+        if (location.origin.includes("192.168.1") || location.origin.includes("localhost") || location.origin.includes("120.79.166.78")) {
+          urls = "120.79.166.78:19012"
         }
         axios.get(process.env.BASE_URL + '/app/common/findTenantId?hostPc=' + urls)
           .then(function (response) {

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است