|
@@ -26,12 +26,14 @@
|
|
|
></image>
|
|
|
</view>
|
|
|
<view v-else>
|
|
|
+ <!-- v-if="playVID" -->
|
|
|
<view
|
|
|
class="video_box"
|
|
|
style="width: 100%; height: 421rpx"
|
|
|
- v-if="playVID"
|
|
|
+
|
|
|
>
|
|
|
<polyv-player
|
|
|
+ v-if="playVID"
|
|
|
id="playerVideo"
|
|
|
playerId="playerVideo"
|
|
|
height="421rpx"
|
|
@@ -94,8 +96,9 @@
|
|
|
<view class="toggle_course" v-if="courseTotal > 1" @click="changeCourses()">
|
|
|
<image class="img" src="/pages3/static/imgs/toggle.png" mode="widthFix"></image>
|
|
|
<view class="toggle_name">切换课程</view>
|
|
|
+ <view class="numbers">共{{ courseTotal }}门</view>
|
|
|
</view>
|
|
|
- <view v-if="courseTotal > 1" class="numbers">共{{ courseTotal }}门</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
@@ -159,6 +162,7 @@
|
|
|
:menuItem="item"
|
|
|
:levelId="'0-' + item.menuId"
|
|
|
:goodsType='1'
|
|
|
+ @sectionList='sectionList($event, index)'
|
|
|
></courseChapter
|
|
|
></view>
|
|
|
<!--节 -->
|
|
@@ -718,45 +722,19 @@ export default {
|
|
|
if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
|
|
|
return;
|
|
|
}
|
|
|
- console.log('onShowonShowonShowonShow', this.courseId,)
|
|
|
this.courseCourseList();
|
|
|
-
|
|
|
},
|
|
|
onUnload() {
|
|
|
- if (this.playSectionId > 0 && this.hasStart) {
|
|
|
- //退出提交记录
|
|
|
- this.postStudyRecord();
|
|
|
- }
|
|
|
- //清除正在播放的节ID
|
|
|
- // this.$store.commit('setPlayObj',null)
|
|
|
- this.$store.commit("setPlaySectionId", { playSectionId: 0 });
|
|
|
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
- this.$store.commit("setPlayVID", { playVID: null });
|
|
|
- this.closePlv();
|
|
|
- console.log("onUnload");
|
|
|
- //移除所有的事件监听器
|
|
|
- uni.$off();
|
|
|
- clearInterval(this.answerTimer);
|
|
|
- if (this.timer) {
|
|
|
- clearInterval(this.timer);
|
|
|
- }
|
|
|
- console.log(this.lockTimer, "this.lockTimer");
|
|
|
- if (this.lockTimer) {
|
|
|
- clearInterval(this.lockTimer);
|
|
|
- this.$api
|
|
|
- .lockDelLock({
|
|
|
- action: "jxjy",
|
|
|
- uuid:this.$method.getUuid()
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- }
|
|
|
- uni.removeStorageSync('current')
|
|
|
- // websocket.sendMsg("delAction");
|
|
|
+ console.log('onUnloadonUnloadonUnload')
|
|
|
+ this.originUnload()
|
|
|
},
|
|
|
mounted() {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(["updateChapterOpen","updateLiveLast"]),
|
|
|
+ sectionList(value) {
|
|
|
+ console.log('返回返回', value)
|
|
|
+ },
|
|
|
// 新增微信公众号模板消息点击数据
|
|
|
clickOfficial() {
|
|
|
this.$http({
|
|
@@ -811,13 +789,13 @@ export default {
|
|
|
url: '/study/record/getUserWatchLast',
|
|
|
method: 'get',
|
|
|
data: {
|
|
|
- goodsId: this.goodsId
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
- console.log('res.data', res.data)
|
|
|
if (res.data.data && Object.keys(res.data.data).length) { //有最后一次看的录播的信息
|
|
|
this.courseId = res.data.data.courseId
|
|
|
+ console.log('res.data', res.data, this.courseId)
|
|
|
this.originOnShow()
|
|
|
this.originMounted()
|
|
|
} else {
|
|
@@ -843,7 +821,7 @@ export default {
|
|
|
this.getAnswerList();
|
|
|
}, 5000);
|
|
|
let noteSecond = Number(this.option.noteSecond);
|
|
|
- console.log('noteSecondnoteSecond:', noteSecond)
|
|
|
+ console.log('noteSecondnoteSecond:', noteSecond, this.option)
|
|
|
if (noteSecond > 0) {
|
|
|
//我的消息跳过来,播放节
|
|
|
let item = {
|
|
@@ -868,9 +846,9 @@ export default {
|
|
|
},
|
|
|
// 原来的mouted内容
|
|
|
originMounted() {
|
|
|
- console.log('originMounted')
|
|
|
+ // console.log('originMounted')
|
|
|
uni.$on("changeSection", (oldSectionId) => {
|
|
|
- console.log(this.playVID);
|
|
|
+ console.log('originMounted->playVID:', this.playVID, oldSectionId);
|
|
|
this.hasStart = false;
|
|
|
this.photoConfig = false;
|
|
|
this.photoIndex = 0;
|
|
@@ -885,13 +863,21 @@ export default {
|
|
|
this.postStudyRecord(0, oldSectionId);
|
|
|
});
|
|
|
uni.$on("getSection", (item) => {
|
|
|
+ console.log('清除直播===',item, item.recordingUrl)
|
|
|
//清除直播
|
|
|
this.hasStart = false;
|
|
|
this.isPlayRebuild = item.rebuild;
|
|
|
this.photoConfig = false;
|
|
|
this.photoIndex = 0;
|
|
|
this.sectionItem = item;
|
|
|
+
|
|
|
+ this.moduleId = item.moduleId
|
|
|
+ this.chapterId = item.chapterId
|
|
|
+
|
|
|
this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
+ this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
|
|
|
+ console.log('清除直播节点胡:', this.moduleId,this.chapterId, this.playSectionId )
|
|
|
+ this.postStudyRecord(0)
|
|
|
//获取拍照历史
|
|
|
this.getPhotoLastRecord();
|
|
|
this.playVideo(item);
|
|
@@ -903,19 +889,58 @@ export default {
|
|
|
this.chapterId = arr[1];
|
|
|
});
|
|
|
uni.$on("getChannel", (item) => {
|
|
|
+ console.log('--->清除录播录播清除录播录播')
|
|
|
//清除录播
|
|
|
this.hasStart = false;
|
|
|
this.$store.commit("setPlayVID", { playVID: null });
|
|
|
+
|
|
|
+ this.moduleId = item.moduleId
|
|
|
+ this.chapterId = item.chapterId
|
|
|
+ this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
|
|
|
this.getPhotoLastRecord();
|
|
|
this.playChannel(item);
|
|
|
this.channelItem = item;
|
|
|
});
|
|
|
uni.$on("isRebuild", (item) => {
|
|
|
- console.log(item);
|
|
|
+ // console.log(item);
|
|
|
this.isRebuild = item;
|
|
|
});
|
|
|
this.updateChapterOpen(true);
|
|
|
},
|
|
|
+ // 原来onUnload里面的内容
|
|
|
+ originUnload() {
|
|
|
+ console.log('playSectionId', this.playSectionId)
|
|
|
+ if (this.playSectionId > 0 && this.hasStart) {
|
|
|
+ //退出提交记录
|
|
|
+ console.log('退出提交记录sfhasdoufsou敖德萨所多')
|
|
|
+ this.postStudyRecord();
|
|
|
+ }
|
|
|
+ //清除正在播放的节ID
|
|
|
+ // this.$store.commit('setPlayObj',null)
|
|
|
+ this.$store.commit("setPlaySectionId", { playSectionId: 0 });
|
|
|
+ this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
+ this.$store.commit("setPlayVID", { playVID: null });
|
|
|
+ this.closePlv();
|
|
|
+ // console.log("-----onUnload");
|
|
|
+ //移除所有的事件监听器
|
|
|
+ uni.$off();
|
|
|
+ clearInterval(this.answerTimer);
|
|
|
+ if (this.timer) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ }
|
|
|
+ console.log(this.lockTimer, "this.lockTimer");
|
|
|
+ if (this.lockTimer) {
|
|
|
+ clearInterval(this.lockTimer);
|
|
|
+ this.$api
|
|
|
+ .lockDelLock({
|
|
|
+ action: "jxjy",
|
|
|
+ uuid:this.$method.getUuid()
|
|
|
+ })
|
|
|
+ .then((res) => {});
|
|
|
+ }
|
|
|
+ uni.removeStorageSync('current')
|
|
|
+ // websocket.sendMsg("delAction");
|
|
|
+ },
|
|
|
changeCourses() {
|
|
|
this.toggleCourseShow = true
|
|
|
},
|
|
@@ -925,11 +950,15 @@ export default {
|
|
|
// 进入学习
|
|
|
jump(item, index) {
|
|
|
console.log('item------>', item, item.goodsId, item.gradeId, item.courseId, item.orderGoodsId)
|
|
|
+ this.vid = ''
|
|
|
+ this.hasStart = true
|
|
|
+ this.originUnload()
|
|
|
+ // return
|
|
|
this.reStart = false
|
|
|
this.courseId = item.courseId
|
|
|
this.gradeId = item.gradeId
|
|
|
this.toggleCourseShow = false
|
|
|
- // return
|
|
|
+
|
|
|
if (index == 0) {
|
|
|
if (item.rebuild === 0) {
|
|
|
//未重修
|
|
@@ -1124,21 +1153,25 @@ export default {
|
|
|
orderGoodsId:this.orderGoodsId,
|
|
|
courseId:this.courseId
|
|
|
}).then(res => {
|
|
|
- console.log(res,'liveres')
|
|
|
this.updateLiveLast(res.data.data)
|
|
|
})
|
|
|
},
|
|
|
studyRecordQueryLiveLast() {
|
|
|
+ // /study/record/queryLiveLast
|
|
|
this.$api.studyRecordQueryLiveLast({
|
|
|
orderGoodsId:this.orderGoodsId,
|
|
|
courseId:this.courseId
|
|
|
}).then(res => {
|
|
|
console.log(res,'couse')
|
|
|
if(res.data.data) {
|
|
|
+ this.moduleId = res.data.data.moduleId
|
|
|
+ this.chapterId = res.data.data.chapterId
|
|
|
if(res.data.data.sectionType == 1) { //录播
|
|
|
console.log('录播录播录播')
|
|
|
this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
|
|
|
this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
|
|
|
+
|
|
|
+ console.log('playVID:', this.playVID, '-', this.playSectionId, this.moduleId, this.chapterId)
|
|
|
this.sectionItem = res.data.data;
|
|
|
this.playVideo(res.data.data)
|
|
|
} else if(res.data.data.sectionType == 2) { //直播
|
|
@@ -1878,12 +1911,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
studyNotice() {
|
|
|
- console.log('这里也点击了吗')
|
|
|
this.noticeShow = true;
|
|
|
},
|
|
|
//播放笔记视频
|
|
|
async playNoteVideo(item) {
|
|
|
- console.log(item, "noteItem");
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
@@ -1892,6 +1923,7 @@ export default {
|
|
|
var polyvPlayerContext = this.selectComponent("#playerVideo");
|
|
|
polyvPlayerContext.changeVid(item.recordingUrl);
|
|
|
} else {
|
|
|
+
|
|
|
this.vid = item.recordingUrl;
|
|
|
}
|
|
|
this.recordObj = { videoCurrentTime: item.noteSecond };
|
|
@@ -1904,17 +1936,18 @@ export default {
|
|
|
},
|
|
|
//正常播放视频
|
|
|
async playVideo(item) {
|
|
|
- console.log(item,'222', this.vid);
|
|
|
+ console.log(item.recordingUrl,'22222222', this.vid);
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
|
if (this.vid) {
|
|
|
//切换视频
|
|
|
var polyvPlayerContext = this.selectComponent("#playerVideo");
|
|
|
- polyvPlayerContext.changeVid(item.recordingUrl);
|
|
|
+ console.log('polyvPlayerContext', polyvPlayerContext)
|
|
|
+ polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
|
|
|
} else {
|
|
|
this.vid = item.recordingUrl;
|
|
|
-
|
|
|
+ console.log('---------vid----', this.vid)
|
|
|
}
|
|
|
this.recordObj = null;
|
|
|
this.recordObj = await this.getRecordLast();
|
|
@@ -2170,7 +2203,8 @@ export default {
|
|
|
console.log(sectionId, "sectionId");
|
|
|
data.status = status;
|
|
|
}
|
|
|
- console.log("提交接口", data);
|
|
|
+ console.log("提交接口", data, sectionId, self.chapterId, self.moduleId);
|
|
|
+ // return
|
|
|
this.$api.studyRecord(data).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
if (status > 0) {
|
|
@@ -2388,6 +2422,7 @@ export default {
|
|
|
this.needSeek = false;
|
|
|
// 新增用户视频学习日志
|
|
|
this.studyLog()
|
|
|
+ // 提交学习记录
|
|
|
}
|
|
|
//开始播放
|
|
|
if (this.timer) {
|