Pārlūkot izejas kodu

多年份商品v1

Tang 2 gadi atpakaļ
vecāks
revīzija
4c97a4b9da

+ 14 - 2
src/apis/course.js

@@ -247,7 +247,12 @@ export default {
 			params: data
 		})
 	},
-
+	orderstudycheck(data) {
+		return request({
+			url: '/order/study/check/' + data,
+			method: 'get',
+		})
+	},
 	goodsTodayStudySectionNum(data) {
 		return request({
 			url: '/goods/todayStudySectionNum',
@@ -263,7 +268,14 @@ export default {
 			data: data
 		})
 	},
-
+	
+	ordersevenyear(data) {
+		return request({
+			url: '/order/seven/year/' + data,
+			method: 'get',
+		})
+	},
+	
 	faceCertificationCompareFace(data) {
 		return request({
 			url: '/face/certification/CompareFace',

+ 9 - 7
src/axios.js

@@ -1,8 +1,8 @@
 import axios from 'axios'
 import store from './store'
-import { Notification } from 'element-ui'
-// export const BASE_URL = process.env.BASE_URL    //测试-外网
-export const BASE_URL = "http://192.168.1.7:5055"    //测试-外网
+import { Notification, Message } from 'element-ui'
+export const BASE_URL = process.env.BASE_URL    //测试-外网
+// export const BASE_URL = "http://192.168.1.7:5055"    //测试-外网
 export const tenantId = process.env.TENANT_ID
 import tools from './common/tools'
 import router from './router'
@@ -84,10 +84,12 @@ request.interceptors.response.use(async (response) => {
         path: '/login'
       })
     } else if (code == 500) {
-      // Message({
-      //   message: res.msg,
-      //   type: "error",
-      // });
+      if (res.msg !== '无其他端在操作') {
+        Message({
+          message: res.msg,
+          type: "error",
+        });
+      }
       // localStorage.removeItem('user_account')
       // localStorage.removeItem('token')
       // console.log('222222')

+ 9 - 1
src/pages/course-detail/components/CourseTree.vue

@@ -45,6 +45,7 @@
               <div class="MenuNames">
                 {{ menu.menuName }}
               </div>
+              <el-tag v-if="menu.commonSign == 1" size="mini">公共章</el-tag>
               <span
                 class="btn_status"
                 style="height: 20px;line-height: 20px;font-weight: 400;"
@@ -71,6 +72,8 @@
                       }"
                     ></i
                     >{{ chapter.name }}
+
+                    <el-tag v-if="chapter.commonSign == 1" size="mini">公共章</el-tag>
                     <span
                       class="btn_status"
                       :class="
@@ -298,6 +301,8 @@
                       }"
                     ></i
                     >{{ menu.menuName }}
+
+                    <el-tag v-if="menu.commonSign == 1" size="mini">公共章</el-tag>
                     <span
                       class="btn_status"
                       :class="
@@ -1140,7 +1145,10 @@ export default {
               }
             });
           });
-          console.log("rows.filter(e => e)",rows.filter(e => e))
+          console.log(
+            "rows.filter(e => e)",
+            rows.filter(e => e)
+          );
           return Promise.resolve(rows.filter(e => e));
         });
     },

+ 22 - 4
src/pages/course-detail/index.vue

@@ -483,7 +483,8 @@ export default {
       failToRegister: false, //报名是否不通过
       openPhotoStatus: 0,
       readerResult: null,
-      handoutList: []
+      handoutList: [],
+      orderYears: ""
     };
   },
   watch: {
@@ -631,7 +632,9 @@ export default {
         //提交完资料返回判断是否已开班
         await this.getGradeInfo();
         //继教七大员公共课程同步
-        if (this.gradeDetail.sevenYear) {
+        const res = await this.$request.ordersevenyear(this.orderGoodsId);
+        if (res.data) {
+          this.orderYears = res.data;
           await this.sevenCommonCourse();
         }
       }
@@ -1735,7 +1738,7 @@ export default {
         this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
         if (
           this.sectionItem.learning != 1 &&
-          (this.goodsData.erJianErZao || this.photoNum > 0)
+          (this.goodsData.erJianErZao || this.goodsData.jjShiGongYuan && this.orderYears || this.photoNum > 0)
         ) {
           this.configPhoto();
           let photoTime = 0; //获取拍照秒数
@@ -1878,7 +1881,11 @@ export default {
         this.photoConfig = true;
         if (this.goodsData.erJianErZao) {
           this.photoList = this.randomConfig(totalVideoTime, duration);
-          console.log("拍摄时间组:(秒)", this.photoList);
+          return;
+        }
+        if (this.goodsData.jjShiGongYuan && this.orderYears) {
+          console.log(this.orderYears,'orderYears')
+          this.photoList = this.randomConfigJjShiGongYuan(totalVideoTime, duration);
           return;
         }
         //没有历史拍照间隔数据
@@ -1942,6 +1949,17 @@ export default {
         }
       }
     },
+    //施工继教带年份的订单拍照设置
+    randomConfigJjShiGongYuan(totalVideoTime){
+      this.photoHistoryList = [];
+      let time1 = 2701//拍照间隔多久一张 45分钟
+      let num = Math.trunc(totalVideoTime / time1) + 1;//拍照数量
+      let photoList = []
+      for(let i = 0; i < num;i++){
+        photoList.push(i*time1)
+      }
+      return photoList;
+    },
     // 随机拍摄时间
     randomConfig(totalVideoTime, duration) {
       this.photoHistoryList = [];

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

@@ -54,6 +54,9 @@
                     {{ item.secAllNum + item.examNum }}节
                     {{ item.classHours }}学时
                   </div>
+                  <div class="note" v-if="item.orderYear">
+                    {{ item.orderYear }}年
+                  </div>
                 </div>
 
                 <div class="state" style="margin-bottom:14px;">
@@ -770,11 +773,11 @@ export default {
     jumpLink(item) {
       if (item.externalLink == "/outsideChain") {
         this.$router.push({
-          path:"/outsideChain",
-          query:{
-            goodsId:item.goodsId
-          } 
-        })
+          path: "/outsideChain",
+          query: {
+            goodsId: item.goodsId
+          }
+        });
         // window.open(item.externalLink + "?goodsId=" + item.goodsId, "_self");
       } else {
         window.open(item.externalLink, "_blank");
@@ -1147,6 +1150,11 @@ export default {
       });
     },
     async goCourseDetail(item) {
+      //-----------------七大员是否允许学习
+      let so = await this.$request.orderstudycheck(item.orderGoodsId);
+      if (so.code !== 200) {
+        return false;
+      }
       //-----------------学习开通状态
       this.checkFuncA(item);
       //-----------------检测服务期