|
@@ -45,7 +45,7 @@
|
|
</view>
|
|
</view>
|
|
<u-line color="#D6D6DB" />
|
|
<u-line color="#D6D6DB" />
|
|
<view style="display: flex;justify-content: center;">
|
|
<view style="display: flex;justify-content: center;">
|
|
- <view><u-tabs :list="list" font-size="24" bar-width="80" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
|
|
|
|
|
|
+ <view><u-tabs :list="list" font-size="24" bar-width="24" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
|
|
</view>
|
|
</view>
|
|
<u-line color="#D6D6DB" />
|
|
<u-line color="#D6D6DB" />
|
|
</view>
|
|
</view>
|
|
@@ -398,6 +398,8 @@ export default {
|
|
uni.$on('getSection', item => {
|
|
uni.$on('getSection', item => {
|
|
//清除直播
|
|
//清除直播
|
|
this.$store.commit('setPlayChannelId', { playChannelId: 0 });
|
|
this.$store.commit('setPlayChannelId', { playChannelId: 0 });
|
|
|
|
+ //获取拍照历史
|
|
|
|
+ this.getPhotoLastRecord()
|
|
this.playVideo(item);
|
|
this.playVideo(item);
|
|
});
|
|
});
|
|
uni.$on('levelId', item => {
|
|
uni.$on('levelId', item => {
|
|
@@ -440,6 +442,7 @@ export default {
|
|
currentTime = polyvPlayerContext.getCurrentTime();
|
|
currentTime = polyvPlayerContext.getCurrentTime();
|
|
}
|
|
}
|
|
let self = this;
|
|
let self = this;
|
|
|
|
+ let photoIndex = self.photoIndex-1
|
|
let data = {
|
|
let data = {
|
|
photo: self.ossAvatarUrl,
|
|
photo: self.ossAvatarUrl,
|
|
sectionId: parseInt(self.playSectionId),
|
|
sectionId: parseInt(self.playSectionId),
|
|
@@ -447,7 +450,7 @@ export default {
|
|
courseId: parseInt(self.courseId),
|
|
courseId: parseInt(self.courseId),
|
|
photoTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
photoTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
gradeId: parseInt(self.gradeId),
|
|
gradeId: parseInt(self.gradeId),
|
|
- photoIndex: parseInt(self.photoIndex-1),//从0算起
|
|
|
|
|
|
+ photoIndex: parseInt(photoIndex),//从0算起
|
|
photoNum:parseInt(self.photoNum)
|
|
photoNum:parseInt(self.photoNum)
|
|
};
|
|
};
|
|
console.log('提交接口', data);
|
|
console.log('提交接口', data);
|
|
@@ -484,25 +487,30 @@ export default {
|
|
this.photoNum = 1 //只要设置,至少拍一次
|
|
this.photoNum = 1 //只要设置,至少拍一次
|
|
spaceTime = totalVideoTime
|
|
spaceTime = totalVideoTime
|
|
}
|
|
}
|
|
- let initSpace = 2
|
|
|
|
|
|
+ let initSpace = 0
|
|
this.photoList = []
|
|
this.photoList = []
|
|
for(let i=0;i<this.photoNum;i++){
|
|
for(let i=0;i<this.photoNum;i++){
|
|
let s = this.randomNum(initSpace,initSpace+spaceTime)
|
|
let s = this.randomNum(initSpace,initSpace+spaceTime)
|
|
if(s>totalVideoTime){
|
|
if(s>totalVideoTime){
|
|
s = totalVideoTime-1
|
|
s = totalVideoTime-1
|
|
}
|
|
}
|
|
|
|
+ if(s<2){
|
|
|
|
+ s =1
|
|
|
|
+ }
|
|
this.photoList.push(s)
|
|
this.photoList.push(s)
|
|
initSpace+=spaceTime
|
|
initSpace+=spaceTime
|
|
}
|
|
}
|
|
- console.log(this.photoList,"随机拍时间数组")
|
|
|
|
|
|
+ console.log(this.photoList,"随机拍时间数组",this.photoNum)
|
|
//兼容已有观看历史
|
|
//兼容已有观看历史
|
|
for(let i=0;i<this.photoList.length-1;i++){
|
|
for(let i=0;i<this.photoList.length-1;i++){
|
|
if(this.photoList[i]<duration&&this.photoList[i+1]>duration){
|
|
if(this.photoList[i]<duration&&this.photoList[i+1]>duration){
|
|
this.photoIndex = i+1
|
|
this.photoIndex = i+1
|
|
|
|
+ console.log("我的修改了photoIndex")
|
|
break
|
|
break
|
|
}
|
|
}
|
|
if(duration>this.photoList[this.photoList.length-1]){
|
|
if(duration>this.photoList[this.photoList.length-1]){
|
|
this.photoIndex = this.photoList.length-1 //取最后一个下标
|
|
this.photoIndex = this.photoList.length-1 //取最后一个下标
|
|
|
|
+ console.log("1我的修改了photoIndex")
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -522,8 +530,8 @@ export default {
|
|
timeEventLiving() {
|
|
timeEventLiving() {
|
|
if (plv != null) {
|
|
if (plv != null) {
|
|
if(this.livePlay){
|
|
if(this.livePlay){
|
|
- this.liveDuration = this.liveDuration +1.5 //每隔1.5秒
|
|
|
|
- if(this.liveDuration==1.5){ //第6秒拍照
|
|
|
|
|
|
+ this.liveDuration = this.liveDuration +1 //每隔1秒
|
|
|
|
+ if(this.liveDuration==2){ //直播第2秒拍照
|
|
if(this.goodsPhotographConfig){
|
|
if(this.goodsPhotographConfig){
|
|
if(this.goodsPhotographConfig.livephotograph==1){
|
|
if(this.goodsPhotographConfig.livephotograph==1){
|
|
//开启直播拍照
|
|
//开启直播拍照
|
|
@@ -545,12 +553,13 @@ export default {
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
}
|
|
}
|
|
this.livePlay = true
|
|
this.livePlay = true
|
|
- this.timer = setInterval(this.timeEventLiving, 1500); //定时器
|
|
|
|
|
|
+ this.timer = setInterval(this.timeEventLiving, 1000); //定时器
|
|
}
|
|
}
|
|
if (status === 'end') {
|
|
if (status === 'end') {
|
|
this.livePlay = false
|
|
this.livePlay = false
|
|
// 未开始
|
|
// 未开始
|
|
console.log('结束直播');
|
|
console.log('结束直播');
|
|
|
|
+ this.postStudyRecord(1);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
closePlv(){
|
|
closePlv(){
|
|
@@ -856,10 +865,12 @@ export default {
|
|
let currentTime = 0;
|
|
let currentTime = 0;
|
|
var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
if (polyvPlayerContext) {
|
|
if (polyvPlayerContext) {
|
|
- currentTime = polyvPlayerContext.getCurrentTime();
|
|
|
|
|
|
+ currentTime = polyvPlayerContext.getCurrentTime(); //录播回放
|
|
|
|
+ }
|
|
|
|
+ if(this.playChannelId>0){
|
|
|
|
+ currentTime = 2;//直播无法获取,无论开始结束都传2秒
|
|
}
|
|
}
|
|
let self = this;
|
|
let self = this;
|
|
- console.log(self.ossAvatarUrl,"准备提交,照片地址")
|
|
|
|
let data = {
|
|
let data = {
|
|
photo: self.ossAvatarUrl,
|
|
photo: self.ossAvatarUrl,
|
|
sectionId: parseInt(sectionId),
|
|
sectionId: parseInt(sectionId),
|
|
@@ -870,10 +881,7 @@ export default {
|
|
chapterId: parseInt(self.chapterId),
|
|
chapterId: parseInt(self.chapterId),
|
|
moduleId: parseInt(self.moduleId)
|
|
moduleId: parseInt(self.moduleId)
|
|
};
|
|
};
|
|
- if (data.studyDuration <= 5) {
|
|
|
|
- //5秒内不上传记录
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
if (status > 0) {
|
|
if (status > 0) {
|
|
data.status = status;
|
|
data.status = status;
|
|
}
|
|
}
|
|
@@ -982,15 +990,15 @@ export default {
|
|
if(nextIndex<this.photoList.length){
|
|
if(nextIndex<this.photoList.length){
|
|
nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
|
|
nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
|
|
}
|
|
}
|
|
-
|
|
|
|
if (photoTime < this.playTime) {
|
|
if (photoTime < this.playTime) {
|
|
if(this.photoHistoryList.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
|
|
if(this.photoHistoryList.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
|
|
//启动拍照
|
|
//启动拍照
|
|
//暂停
|
|
//暂停
|
|
polyvPlayerContext.exitFullScreen();
|
|
polyvPlayerContext.exitFullScreen();
|
|
polyvPlayerContext.pause();
|
|
polyvPlayerContext.pause();
|
|
- this.openPhoto();
|
|
|
|
this.photoIndex++;
|
|
this.photoIndex++;
|
|
|
|
+ this.openPhoto();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1002,8 +1010,6 @@ export default {
|
|
},
|
|
},
|
|
onStateChange(newstate, oldstate) {
|
|
onStateChange(newstate, oldstate) {
|
|
if (newstate.detail.newstate == 'playing') {
|
|
if (newstate.detail.newstate == 'playing') {
|
|
- //获取拍照历史
|
|
|
|
- this.getPhotoLastRecord()
|
|
|
|
if (this.needSeek) {
|
|
if (this.needSeek) {
|
|
var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
polyvPlayerContext.seek(this.recordObj.studyDuration);
|
|
polyvPlayerContext.seek(this.recordObj.studyDuration);
|
|
@@ -1014,7 +1020,7 @@ export default {
|
|
if (this.timer) {
|
|
if (this.timer) {
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
}
|
|
}
|
|
- this.timer = setInterval(this.timeEvent, 1500); //定时器
|
|
|
|
|
|
+ this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
}
|
|
}
|
|
if (newstate.detail.newstate == 'pause') {
|
|
if (newstate.detail.newstate == 'pause') {
|
|
//暂停提交记录
|
|
//暂停提交记录
|
|
@@ -1044,7 +1050,7 @@ export default {
|
|
if (polyvPlayerContext != null) {
|
|
if (polyvPlayerContext != null) {
|
|
polyvPlayerContext.play();
|
|
polyvPlayerContext.play();
|
|
}
|
|
}
|
|
- console.log(this.ossAvatarUrl, '拍照完成456');
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
//确认拍照
|
|
//确认拍照
|
|
takePhoto() {
|
|
takePhoto() {
|
|
@@ -1114,7 +1120,7 @@ export default {
|
|
},
|
|
},
|
|
getAnswerList() {
|
|
getAnswerList() {
|
|
let self = this;
|
|
let self = this;
|
|
- this.$api.answerList({ courseId: this.courseId }).then(res => {
|
|
|
|
|
|
+ this.$api.answerList({ courseId: this.courseId,goodsId: this.goodsId }).then(res => {
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
self.answerList = res.data.rows;
|
|
self.answerList = res.data.rows;
|
|
}
|
|
}
|