|
@@ -57,9 +57,9 @@
|
|
|
<!--模块 -->
|
|
|
<view v-if="item.type == 1"><courseModule :courseId="courseId" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
|
|
|
<!--章 -->
|
|
|
- <view v-if="item.type == 2"><courseChapter :courseId="courseId" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter></view>
|
|
|
+ <view v-if="item.type == 2"><courseChapter :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter></view>
|
|
|
<!--节 -->
|
|
|
- <view v-if="item.type == 3"><courseSection @playEnd="sectionPlayEnd(index)" :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection></view>
|
|
|
+ <view v-if="item.type == 3"><courseSection @playEnd="sectionPlayEnd($event,index)" :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!--讲义 -->
|
|
@@ -155,11 +155,11 @@
|
|
|
<view v-if="item.type == 1"><courseModule :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
|
|
|
<!--章 -->
|
|
|
<view v-if="item.type == 2">
|
|
|
- <courseChapter :courseId="courseId" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter>
|
|
|
+ <courseChapter :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter>
|
|
|
</view>
|
|
|
<!--节 -->
|
|
|
<view v-if="item.type == 3">
|
|
|
- <courseSection :courseId="courseId" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :nextMenuItem="findMenuNextSection(index)" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection>
|
|
|
+ <courseSection :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :nextMenuItem="findMenuNextSection(index)" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -281,6 +281,7 @@ export default {
|
|
|
photoIndex:0, //当前位于拍照的区间下标 从0开始
|
|
|
photoHistoryList:[], //已拍照历史的下标点
|
|
|
businessData:{},
|
|
|
+ isRebuild:false, //视频是否从重修目录点击
|
|
|
};
|
|
|
},
|
|
|
computed: { ...mapGetters(['userInfo', 'playSectionId','playChannelId','playVID']) },
|
|
@@ -453,19 +454,179 @@ export default {
|
|
|
this.$store.commit('setPlayVID', {playVID :null});
|
|
|
this.playChannel(item);
|
|
|
});
|
|
|
+ uni.$on('isRebuild',item => {
|
|
|
+ console.log(item)
|
|
|
+ this.isRebuild = item;
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
* 模块大节播放完毕,刷新列表
|
|
|
*/
|
|
|
- sectionPlayEnd(index) {
|
|
|
+ sectionPlayEnd(isRebuild,index) {
|
|
|
console.log('sectionPlayEnd')
|
|
|
- this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- res.data.rows[index].name = res.data.rows[index].menuName;
|
|
|
- this.$set(this.menuList,index,res.data.rows[index])
|
|
|
+ console.log('isRebuild',isRebuild)
|
|
|
+ if(this.reMenuList.length>0) { //有重修目录
|
|
|
+ if(isRebuild.isRebuild) { //从重修点击
|
|
|
+ this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
|
|
|
+ console.log('Rebuild1')
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ if(res.data.rows.length) {
|
|
|
+ // res.data.rows[index].name = res.data.rows[index].menuName;
|
|
|
+ // this.$set(this.reMenuList,index,res.data.rows[index])
|
|
|
+ for (let i = 0; i < res.data.rows.length; i++) {
|
|
|
+ let item = res.data.rows[i];
|
|
|
+ item.down = true;
|
|
|
+ item.id = item.menuId;
|
|
|
+ item.name = item.menuName;
|
|
|
+ }
|
|
|
+ this.reMenuList = []
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.reMenuList = res.data.rows;
|
|
|
+ console.log(this.reMenuList)
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.reMenuList = []
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if(this.reMenuList.length>0){
|
|
|
+ this.list = [
|
|
|
+
|
|
|
+ {
|
|
|
+ name: '目录'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '讲义'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '笔记'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '答疑'
|
|
|
+ },
|
|
|
+ {name:'重修目录'}
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ this.list = [
|
|
|
+
|
|
|
+ {
|
|
|
+ name: '目录'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '讲义'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '笔记'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '答疑'
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ if(this.current == 4) {
|
|
|
+ this.current = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
|
|
|
+ console.log('noRebuild1')
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ for (let i = 0; i < res.data.rows.length; i++) {
|
|
|
+ let item = res.data.rows[i];
|
|
|
+ item.down = true;
|
|
|
+ item.id = item.menuId;
|
|
|
+ item.name = item.menuName;
|
|
|
+ }
|
|
|
+ this.menuList = []
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.menuList = res.data.rows;
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else { //从普通目录点击
|
|
|
+ this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
|
|
|
+ console.log('noRebuild2')
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ res.data.rows[index].name = res.data.rows[index].menuName;
|
|
|
+ this.$set(this.menuList,index,res.data.rows[index])
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
|
|
|
+ console.log('Rebuild2')
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ for (let i = 0; i < res.data.rows.length; i++) {
|
|
|
+ let item = res.data.rows[i];
|
|
|
+ item.down = true;
|
|
|
+ item.id = item.menuId;
|
|
|
+ item.name = item.menuName;
|
|
|
+ }
|
|
|
+ this.reMenuList = []
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.reMenuList = res.data.rows;
|
|
|
+ if(this.reMenuList.length>0){
|
|
|
+ this.list = [
|
|
|
+
|
|
|
+ {
|
|
|
+ name: '目录'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '讲义'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '笔记'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '答疑'
|
|
|
+ },
|
|
|
+ {name:'重修目录'}
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ this.list = [
|
|
|
+
|
|
|
+ {
|
|
|
+ name: '目录'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '讲义'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '笔记'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '答疑'
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ this.current = 0;
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+
|
|
|
+ } else { //没有重修目录
|
|
|
+ this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
|
|
|
+ console.log('noRebuild3')
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ res.data.rows[index].name = res.data.rows[index].menuName;
|
|
|
+ this.$set(this.menuList,index,res.data.rows[index])
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
/**
|
|
|
* 获取业务层次详情
|
|
@@ -761,6 +922,7 @@ export default {
|
|
|
},
|
|
|
//播放笔记视频
|
|
|
async playNoteVideo(item) {
|
|
|
+ console.log(item)
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
@@ -782,6 +944,7 @@ export default {
|
|
|
},
|
|
|
//正常播放视频
|
|
|
async playVideo(item) {
|
|
|
+ console.log(item)
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
@@ -997,12 +1160,23 @@ export default {
|
|
|
videoCurrentTime: parseInt(currentTime > 0 ? currentTime : self.studyDuration)
|
|
|
};
|
|
|
if (status > 0) {
|
|
|
+ console.log(sectionId,'sectionId')
|
|
|
data.status = status;
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
console.log('提交接口', data);
|
|
|
this.$api.studyRecord(data).then(res => {
|
|
|
if (status > 0) {
|
|
|
- uni.$emit('playend'); //通知播放结束
|
|
|
+ let moduleId = this.moduleId || 0;
|
|
|
+ let chapterId = this.chapterId || 0;
|
|
|
+ let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
|
|
|
+ let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
|
|
|
+ console.log(playNextId,'playNextId')
|
|
|
+ console.log(playNextIdisRebuild,'playNextIdisRebuild')
|
|
|
+
|
|
|
+ uni.$emit('playNext'+playNextIdisRebuild,{fromRebuild:this.isRebuild}); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
|
|
|
+ uni.$emit('playNext'+playNextId); //通知播放结束
|
|
|
}
|
|
|
|
|
|
self.ossAvatarUrl = ''
|
|
@@ -1150,7 +1324,7 @@ export default {
|
|
|
}
|
|
|
if (newstate.detail.newstate == 'ended') {
|
|
|
this.postStudyRecord(1);
|
|
|
- uni.$emit('playNext') //播放重修下一节
|
|
|
+ // uni.$emit('playNext') //播放重修下一节
|
|
|
}
|
|
|
},
|
|
|
//拍照
|