|
@@ -928,6 +928,7 @@ export default {
|
|
|
// stream: null,
|
|
|
faceUrl: "",
|
|
|
erJianErZao: false,
|
|
|
+ jjShiGongYuan: false,
|
|
|
pauseTime: 0,
|
|
|
pauseTimer: null,
|
|
|
barTimer: null,
|
|
@@ -981,7 +982,7 @@ export default {
|
|
|
this.courseId = Number(option.id) || "";
|
|
|
this.goodsId = Number(option.goodsId);
|
|
|
this.orderGoodsId = Number(option.orderGoodsId) || "";
|
|
|
- this.gradeId = option.gradeId;
|
|
|
+ this.gradeId = Number(option.gradeId);
|
|
|
this.option = option;
|
|
|
// 公众号模板消息的数据埋点
|
|
|
option.informId && this.clickOfficial(option.informId);
|
|
@@ -997,6 +998,7 @@ export default {
|
|
|
if (this.$method.isGoLogin()) {
|
|
|
return;
|
|
|
}
|
|
|
+ this.option.isQ !== "" && (await this.qCheckIsCanLearn());
|
|
|
!this.userInfo && this.$api.refreshUserInfo();
|
|
|
this.closePhoto();
|
|
|
this.courseCourseList();
|
|
@@ -1013,6 +1015,35 @@ export default {
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
...mapMutations(["updateChapterOpen", "updateLiveLast"]),
|
|
|
+ // 七大员是否能进入学习
|
|
|
+ async qCheckIsCanLearn() {
|
|
|
+ let res = await this.$api.qCheckIsCanLearn(this.orderGoodsId);
|
|
|
+ if (res.data.code !== 200) {
|
|
|
+ uni.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ title: "提示",
|
|
|
+ content: res.data.msg,
|
|
|
+ success: (resultst) => {
|
|
|
+ uni.navigateBack();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return Promise.reject();
|
|
|
+ }
|
|
|
+ let res1 = await this.$api.syncSevenPublicClass({
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
+ if (res1.data.code !== 200) {
|
|
|
+ uni.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ title: "提示",
|
|
|
+ content: "无法进入学习!",
|
|
|
+ success: (resultst) => {
|
|
|
+ uni.navigateBack();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return Promise.reject();
|
|
|
+ }
|
|
|
+ },
|
|
|
// 新增微信公众号模板消息点击数据
|
|
|
clickOfficial(informId) {
|
|
|
this.$http({
|
|
@@ -1666,11 +1697,10 @@ export default {
|
|
|
let { data } = res.data;
|
|
|
if (!data.sectionId) {
|
|
|
data = this.menuAllList[0];
|
|
|
- } else {
|
|
|
- if (data.learning == 1 && this.orderNum == 2) {
|
|
|
- let next = this.menuAllList.find((e) => e.studyStatus != 1);
|
|
|
- next && (data = next);
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (data.learning == 1 && this.orderNum == 2) {
|
|
|
+ let next = this.menuAllList.find((e) => e.studyStatus != 1);
|
|
|
+ next && (data = next);
|
|
|
}
|
|
|
this.initPlayVideo(data);
|
|
|
});
|
|
@@ -1909,6 +1939,7 @@ export default {
|
|
|
courseId: this.courseId,
|
|
|
gradeId: this.gradeId,
|
|
|
goodsId: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
@@ -2251,7 +2282,6 @@ export default {
|
|
|
self.photoHistoryList.push(res.data.data[i].photoIndex);
|
|
|
}
|
|
|
}
|
|
|
- // console.log('7777', this.photoHistoryList, this.photoList);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -2325,7 +2355,6 @@ export default {
|
|
|
totalVideoTime = polyvPlayerContext.j2s_getDuration();
|
|
|
duration = polyvPlayerContext.j2s_getCurrentTime();
|
|
|
// #endif
|
|
|
- let photoNum = this.photoNum;
|
|
|
if (!this.photoConfig) {
|
|
|
this.photoConfig = true;
|
|
|
if (this.erJianErZao) {
|
|
@@ -2333,44 +2362,11 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
//没有历史拍照间隔数据
|
|
|
- if (this.photoList.length == 0) {
|
|
|
- if (totalVideoTime >= 900) {
|
|
|
- //大于15分钟
|
|
|
- if (photoNum == 1) {
|
|
|
- //开头拍1张
|
|
|
- this.photoList.push(0);
|
|
|
- } else if (photoNum == 3) {
|
|
|
- //拍3张
|
|
|
- this.photoList.push(0); //开头拍一张
|
|
|
- let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
|
|
|
- let centerMinTime = centerTime - 300; //前后5分钟
|
|
|
- let centerMaxTime = centerTime + 300;
|
|
|
- let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
|
|
|
- this.photoList.push(centerTakeTime); //中间拍一张
|
|
|
- let endMaxTime = totalVideoTime - 60;
|
|
|
- let endMinTime = totalVideoTime - 300;
|
|
|
- let endTakeTime = this.randomNum(endMinTime, endMaxTime);
|
|
|
- this.photoList.push(endTakeTime); //最后拍一张
|
|
|
- }
|
|
|
- } else {
|
|
|
- //小于15分钟,只拍前后各一张
|
|
|
- if (photoNum == 1) {
|
|
|
- //开头拍1张
|
|
|
- this.photoList.push(0);
|
|
|
- } else if (photoNum == 3) {
|
|
|
- this.photoList.push(1);
|
|
|
- let centerTime = this.randomNum(
|
|
|
- (1 / 3) * totalVideoTime,
|
|
|
- (2 / 3) * totalVideoTime
|
|
|
- );
|
|
|
- this.photoList.push(centerTime);
|
|
|
- let endTakeTime = this.randomNum(
|
|
|
- (2 / 3) * totalVideoTime,
|
|
|
- totalVideoTime
|
|
|
- );
|
|
|
- this.photoList.push(endTakeTime);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (!this.photoList || this.photoList.length == 0) {
|
|
|
+ this.photoList = this.commonConfig(
|
|
|
+ totalVideoTime,
|
|
|
+ this.jjShiGongYuan ? 46 * 60 : undefined
|
|
|
+ );
|
|
|
this.postCoursePhotoRecord(true); //提交随机拍照时间数组
|
|
|
}
|
|
|
//兼容已有观看历史
|
|
@@ -2389,7 +2385,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // 随机拍摄时间
|
|
|
+ // 二建随机拍摄时间
|
|
|
randomConfig(totalVideoTime, duration) {
|
|
|
this.photoHistoryList = [];
|
|
|
let photoList = [duration];
|
|
@@ -2405,6 +2401,46 @@ export default {
|
|
|
}
|
|
|
return photoList;
|
|
|
},
|
|
|
+ // 随机前后五分钟
|
|
|
+ commonConfig(totalVideoTime, fixS) {
|
|
|
+ console.log("🚀 ~ file: detail.vue:2407 ~ commonConfig ~ fixS:", fixS);
|
|
|
+ let photoList = [0];
|
|
|
+ // 固定间隔时间取
|
|
|
+ if (fixS) {
|
|
|
+ let num = Math.ceil(totalVideoTime / fixS);
|
|
|
+ for (let i = 1; i < num; i++) {
|
|
|
+ photoList.push(i * fixS);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.photoNum == 3) {
|
|
|
+ if (totalVideoTime >= 900) {
|
|
|
+ //大于15分钟
|
|
|
+ let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
|
|
|
+ let centerMinTime = centerTime - 300; //前后5分钟
|
|
|
+ let centerMaxTime = centerTime + 300;
|
|
|
+ let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
|
|
|
+ photoList.push(centerTakeTime); //中间拍一张
|
|
|
+ let endMaxTime = totalVideoTime - 60;
|
|
|
+ let endMinTime = totalVideoTime - 300;
|
|
|
+ let endTakeTime = this.randomNum(endMinTime, endMaxTime);
|
|
|
+ photoList.push(endTakeTime); //最后拍一张
|
|
|
+ } else {
|
|
|
+ //小于15分钟
|
|
|
+ let centerTime = this.randomNum(
|
|
|
+ (1 / 3) * totalVideoTime,
|
|
|
+ (2 / 3) * totalVideoTime
|
|
|
+ );
|
|
|
+ photoList.push(centerTime);
|
|
|
+ let endTakeTime = this.randomNum(
|
|
|
+ (2 / 3) * totalVideoTime,
|
|
|
+ totalVideoTime
|
|
|
+ );
|
|
|
+ photoList.push(endTakeTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return photoList;
|
|
|
+ },
|
|
|
getLiveUid(channelId) {
|
|
|
let self = this;
|
|
|
return new Promise((resolve) => {
|
|
@@ -2609,6 +2645,9 @@ export default {
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
};
|
|
|
this.$api.recordLast(data).then((res) => {
|
|
|
+ if (res.data.data.videoCurrentTime > 3) {
|
|
|
+ res.data.data.videoCurrentTime -= 3;
|
|
|
+ }
|
|
|
resolve(res.data.data);
|
|
|
});
|
|
|
});
|
|
@@ -3129,6 +3168,7 @@ export default {
|
|
|
}
|
|
|
if (this.needSeek) {
|
|
|
// var polyvPlayerContext = this.selectComponent("#playerVideo");
|
|
|
+
|
|
|
if (this.recordObj.videoCurrentTime) {
|
|
|
polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
|
|
|
this.seekTime = this.$method.secondToDate(
|
|
@@ -3150,7 +3190,10 @@ export default {
|
|
|
}
|
|
|
//开始播放
|
|
|
this.timer && clearInterval(this.timer);
|
|
|
- if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
|
|
|
+ if (
|
|
|
+ this.playSecIsLearn &&
|
|
|
+ (this.erJianErZao || this.jjShiGongYuan || this.photoNum > 0)
|
|
|
+ ) {
|
|
|
this.clearPauseTimer();
|
|
|
this.isReach = false;
|
|
|
this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
@@ -3314,7 +3357,7 @@ export default {
|
|
|
video: {
|
|
|
width: 400,
|
|
|
height: 300,
|
|
|
- facingMode:'user',
|
|
|
+ facingMode: "user",
|
|
|
},
|
|
|
},
|
|
|
this.photographSuccess,
|
|
@@ -3472,7 +3515,7 @@ export default {
|
|
|
video: {
|
|
|
width: 400,
|
|
|
height: 300,
|
|
|
- facingMode:'user',
|
|
|
+ facingMode: "user",
|
|
|
},
|
|
|
},
|
|
|
this.photographSuccess,
|
|
@@ -3567,8 +3610,9 @@ export default {
|
|
|
if (self.goodsData.buyNote) {
|
|
|
this.baseHandoutTipList();
|
|
|
}
|
|
|
- self.gradeId = self.goodsData.gradeId;
|
|
|
+ !self.gradeId && (self.gradeId = self.goodsData.gradeId);
|
|
|
self.erJianErZao = self.goodsData.erJianErZao;
|
|
|
+ self.jjShiGongYuan = self.goodsData.jjShiGongYuan;
|
|
|
this.courseBusiness(this.goodsData.businessId);
|
|
|
self.getMenuList();
|
|
|
self.getReMenuList(); //获取重修目录
|
|
@@ -3900,7 +3944,10 @@ export default {
|
|
|
}
|
|
|
//开始播放
|
|
|
this.timer && clearInterval(this.timer);
|
|
|
- if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
|
|
|
+ if (
|
|
|
+ this.playSecIsLearn &&
|
|
|
+ (this.erJianErZao || this.jjShiGongYuan || this.photoNum > 0)
|
|
|
+ ) {
|
|
|
this.clearPauseTimer();
|
|
|
this.isReach = false;
|
|
|
this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
@@ -4004,6 +4051,7 @@ export default {
|
|
|
content:
|
|
|
"课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
|
|
|
cancelText: "取消",
|
|
|
+ showCancel: false,
|
|
|
confirmText: "确定",
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|