|
@@ -920,6 +920,7 @@ export default {
|
|
|
H5isAllowSeek: "off",
|
|
|
// stream: null,
|
|
|
faceUrl: "",
|
|
|
+ erJianErZao: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -2209,16 +2210,10 @@ export default {
|
|
|
let photoNum = this.photoNum;
|
|
|
if (!this.photoConfig) {
|
|
|
this.photoConfig = true;
|
|
|
- // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
|
|
|
- // if(spaceTime<5){//区间小于5秒
|
|
|
- // photoNum = Math.floor(totalVideoTime/5)
|
|
|
- // spaceTime = 5
|
|
|
- // }
|
|
|
- // if(photoNum<1){
|
|
|
- // photoNum = 1 //只要设置,至少拍一次
|
|
|
- // spaceTime = totalVideoTime
|
|
|
- // }
|
|
|
- // let initSpace = 0
|
|
|
+ if (this.erJianErZao) {
|
|
|
+ this.photoList = this.randomConfig(totalVideoTime, duration);
|
|
|
+ return;
|
|
|
+ }
|
|
|
//没有历史拍照间隔数据
|
|
|
if (this.photoList.length == 0) {
|
|
|
if (totalVideoTime >= 900) {
|
|
@@ -2258,21 +2253,8 @@ export default {
|
|
|
this.photoList.push(endTakeTime);
|
|
|
}
|
|
|
}
|
|
|
- // for(let i=0;i<photoNum;i++){
|
|
|
- // let s = this.randomNum(initSpace,initSpace+spaceTime)
|
|
|
- // if(s>totalVideoTime){
|
|
|
- // s = totalVideoTime-1
|
|
|
- // }
|
|
|
- // if(s<=5){
|
|
|
- // s =5 //避免出现5秒内拍照时间
|
|
|
- // }
|
|
|
- // this.photoList.push(s)
|
|
|
- // initSpace+=spaceTime
|
|
|
- // }
|
|
|
- // console.log(this.photoList, "随机拍照时间数组11", photoNum);
|
|
|
this.postCoursePhotoRecord(true); //提交随机拍照时间数组
|
|
|
}
|
|
|
-
|
|
|
//兼容已有观看历史
|
|
|
for (let i = 0; i < this.photoList.length - 1; i++) {
|
|
|
if (
|
|
@@ -2287,9 +2269,23 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- // console.log(this.photoList, "随机拍照时间数组11", photoNum);
|
|
|
}
|
|
|
},
|
|
|
+ // 随机拍摄时间
|
|
|
+ randomConfig(totalVideoTime, duration) {
|
|
|
+ let photoList = [duration];
|
|
|
+ let pre = duration;
|
|
|
+ if (totalVideoTime > 300) {
|
|
|
+ while (pre <= totalVideoTime) {
|
|
|
+ pre += this.randomNum(360, 900);
|
|
|
+ pre <= totalVideoTime && photoList.push(pre);
|
|
|
+ }
|
|
|
+ if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
|
|
|
+ photoList.push(this.randomNum(totalVideoTime - 300, totalVideoTime));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return photoList;
|
|
|
+ },
|
|
|
getLiveUid(channelId) {
|
|
|
let self = this;
|
|
|
return new Promise((resolve) => {
|
|
@@ -2871,14 +2867,6 @@ export default {
|
|
|
self.ossAvatarUrl = ossToken.dir;
|
|
|
console.log("statusCode:", this.ossAvatarUrl);
|
|
|
resolve();
|
|
|
- // } else {
|
|
|
- // uni.showToast({
|
|
|
- // title: "上传失败",
|
|
|
- // icon: "none",
|
|
|
- // });
|
|
|
- // this.openPhoto();
|
|
|
- // return;
|
|
|
- // }
|
|
|
},
|
|
|
fail: (error) => {
|
|
|
uni.showToast({
|
|
@@ -2957,61 +2945,45 @@ export default {
|
|
|
// #ifdef H5
|
|
|
this.playTime = polyvPlayerContext.j2s_getCurrentTime();
|
|
|
// #endif
|
|
|
- console.log(
|
|
|
- 789,
|
|
|
- this.photoHistoryList,
|
|
|
- "this.photoList:",
|
|
|
- this.photoList,
|
|
|
- "photoNum:",
|
|
|
- this.photoNum,
|
|
|
- "playTime:",
|
|
|
- this.playTime
|
|
|
- );
|
|
|
- //判断是否需要拍照
|
|
|
- if (this.photoNum > 0) {
|
|
|
- this.configPhoto();
|
|
|
- let photoTime = 0; //获取拍照秒数
|
|
|
- for (let i = 0; i < this.photoList.length; i++) {
|
|
|
- photoTime = Number(this.photoList[i]); //获取拍照秒数
|
|
|
- console.log(
|
|
|
- "photoTime:",
|
|
|
- photoTime,
|
|
|
- "this.sectionItem.learning",
|
|
|
- this.sectionItem.learning
|
|
|
- );
|
|
|
- if (photoTime < this.playTime && photoTime > this.playTime - 8) {
|
|
|
- //3秒区间内才触发拍照,避免拉动滚动条
|
|
|
+ this.configPhoto();
|
|
|
+ let photoTime = 0; //获取拍照秒数
|
|
|
+ for (let i = 0; i < this.photoList.length; i++) {
|
|
|
+ photoTime = Number(this.photoList[i]); //获取拍照秒数
|
|
|
+ console.log(
|
|
|
+ "photoTime:",
|
|
|
+ photoTime,
|
|
|
+ "this.sectionItem.learning",
|
|
|
+ this.sectionItem.learning
|
|
|
+ );
|
|
|
+ if (photoTime < this.playTime && photoTime > this.playTime - 8) {
|
|
|
+ //3秒区间内才触发拍照,避免拉动滚动条
|
|
|
+ if (this.photoHistoryList.indexOf(i) < 0) {
|
|
|
+ //不存在拍照历史,没有重修过,没有学过,则拍照
|
|
|
+ //启动拍照
|
|
|
+ //暂停
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ polyvPlayerContext.exitFullScreen();
|
|
|
+ polyvPlayerContext.pause();
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ polyvPlayerContext.j2s_pauseVideo();
|
|
|
+ polyvPlayerContext.toggleFullscreen();
|
|
|
+ // #endif
|
|
|
+ this.photoIndex = i;
|
|
|
+ console.log("i:i", i);
|
|
|
if (
|
|
|
- this.photoHistoryList.indexOf(i) < 0 &&
|
|
|
- this.sectionItem.learning != 1
|
|
|
+ uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
|
|
|
+ this.goodsId
|
|
|
) {
|
|
|
- //不存在拍照历史,没有重修过,没有学过,则拍照
|
|
|
- //启动拍照
|
|
|
- //暂停
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- polyvPlayerContext.exitFullScreen();
|
|
|
- polyvPlayerContext.pause();
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
- polyvPlayerContext.j2s_pauseVideo();
|
|
|
- polyvPlayerContext.toggleFullscreen();
|
|
|
- // #endif
|
|
|
- this.photoIndex = i;
|
|
|
- console.log("i:i", i);
|
|
|
- if (
|
|
|
- uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
|
|
|
+ console.log("2222");
|
|
|
+ this.openPhoto();
|
|
|
+ } else {
|
|
|
+ console.log("1111");
|
|
|
+ this.popupPhotoShow = true;
|
|
|
+ uni.setStorageSync(
|
|
|
+ `tabkePhotoShow${this.goodsId}`,
|
|
|
this.goodsId
|
|
|
- ) {
|
|
|
- console.log("2222");
|
|
|
- this.openPhoto();
|
|
|
- } else {
|
|
|
- console.log("1111");
|
|
|
- this.popupPhotoShow = true;
|
|
|
- uni.setStorageSync(
|
|
|
- `tabkePhotoShow${this.goodsId}`,
|
|
|
- this.goodsId
|
|
|
- ); // 本地缓存用来判断是否已经弹出过弹窗
|
|
|
- }
|
|
|
+ ); // 本地缓存用来判断是否已经弹出过弹窗
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3080,10 +3052,13 @@ export default {
|
|
|
// 提交学习记录
|
|
|
}
|
|
|
//开始播放
|
|
|
- if (this.timer) {
|
|
|
- clearInterval(this.timer);
|
|
|
+ this.timer && clearInterval(this.timer);
|
|
|
+ if (
|
|
|
+ this.erJianErZao ||
|
|
|
+ (this.sectionItem.learning != 1 && this.photoNum > 0)
|
|
|
+ ) {
|
|
|
+ this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
|
}
|
|
|
- this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
|
}
|
|
|
if (newstate.detail.newstate == "pause") {
|
|
|
clearInterval(this.timer);
|
|
@@ -3457,7 +3432,6 @@ export default {
|
|
|
if (self.goodsPlayConfig.autoPlay > 0) {
|
|
|
// #ifdef H5
|
|
|
self.autoplay = true;
|
|
|
- console.log("是否自动播放:", self.autoplay);
|
|
|
// #endif
|
|
|
}
|
|
|
if (self.goodsPlayConfig.drag > 0) {
|
|
@@ -3472,13 +3446,13 @@ export default {
|
|
|
self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
|
|
|
}
|
|
|
}
|
|
|
+ self.erJianErZao = self.goodsData.erJianErZao;
|
|
|
if (self.goodsData.goodsPhotographConfig) {
|
|
|
self.goodsPhotographConfig = JSON.parse(
|
|
|
self.goodsData.goodsPhotographConfig
|
|
|
);
|
|
|
if (self.goodsPhotographConfig.photoNum > 0) {
|
|
|
self.photoNum = self.goodsPhotographConfig.photoNum;
|
|
|
- console.log(self.photoNum, 777777);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -3780,9 +3754,15 @@ export default {
|
|
|
// 新增用户视频学习日志
|
|
|
this.studyLog();
|
|
|
}
|
|
|
+ console.log(564646465);
|
|
|
//开始播放
|
|
|
this.timer && clearInterval(this.timer);
|
|
|
- this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
|
+ if (
|
|
|
+ this.erJianErZao ||
|
|
|
+ (this.sectionItem.learning != 1 && this.photoNum > 0)
|
|
|
+ ) {
|
|
|
+ this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
|
+ }
|
|
|
|
|
|
this.studyTimer && clearInterval(this.studyTimer);
|
|
|
this.studyTimer = setInterval(() => {
|