|
@@ -33,9 +33,9 @@
|
|
|
</u-row>
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
|
- <view>
|
|
|
- <view style="width: 240px;margin: 0 auto;">
|
|
|
- <u-tabs :list="list" item-width="150" font-size="24" bar-width="80" :current="current" @change="change" active-color="#007AFF"></u-tabs>
|
|
|
+ <view style="display: flex;justify-content: center;">
|
|
|
+ <view style="width: 280px;">
|
|
|
+ <u-tabs :list="list" font-size="24" bar-width="80" :current="current" @change="change" active-color="#007AFF"></u-tabs>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
@@ -43,17 +43,28 @@
|
|
|
<view class="box">
|
|
|
<!--目录 -->
|
|
|
<view v-show="current == 0">
|
|
|
+ <view class="menuBox" v-for="(item, index) in reMenuList">
|
|
|
+ <!--模块 -->
|
|
|
+ <view v-if="item.type == 1"><courseModule :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
|
|
|
+ <!--章 -->
|
|
|
+ <view v-if="item.type == 2"><courseChapter :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-'+item.menuId"></courseChapter></view>
|
|
|
+ <!--节 -->
|
|
|
+ <view v-if="item.type == 3"><courseSection :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-0-'+item.menuId"></courseSection></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!--目录 -->
|
|
|
+ <view v-show="current == 1">
|
|
|
<view class="menuBox" v-for="(item, index) in menuList">
|
|
|
<!--模块 -->
|
|
|
- <view v-if="item.type == 1"><courseModule :isBuy="true" :menuItem="item"></courseModule></view>
|
|
|
+ <view v-if="item.type == 1"><courseModule :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
|
|
|
<!--章 -->
|
|
|
- <view v-if="item.type == 2"><courseChapter :isBuy="true" :menuItem="item"></courseChapter></view>
|
|
|
+ <view v-if="item.type == 2"><courseChapter :isBuy="true" :menuItem="item" :levelId="'0-'+item.menuId"></courseChapter></view>
|
|
|
<!--节 -->
|
|
|
- <view v-if="item.type == 3"><courseSection :isBuy="true" :menuItem="item"></courseSection></view>
|
|
|
+ <view v-if="item.type == 3"><courseSection :isBuy="true" :menuItem="item" :levelId="'0-0-'+item.menuId"></courseSection></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!--笔记 -->
|
|
|
- <view v-show="current == 1">
|
|
|
+ <view v-show="current == 2">
|
|
|
<view class="inputBottom">
|
|
|
<view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
|
|
|
<view style="width: 73%;height: 88rpx;margin-bottom: 15rpx;">
|
|
@@ -81,7 +92,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!--答疑 -->
|
|
|
- <view v-show="current == 2">
|
|
|
+ <view v-show="current == 3">
|
|
|
<view class="inputBottom">
|
|
|
<view style="width: 73%;height: 88rpx;margin-bottom: 15rpx;margin-left: 10% ;">
|
|
|
<u-input height="78" fixed="true" placeholder="您可以在这里输入答疑内容" type="textarea" :custom-style="inputStyle" v-model="value" />
|
|
@@ -156,6 +167,9 @@ export default {
|
|
|
},
|
|
|
playbackRate: [0.5, 0.8, 1.0],
|
|
|
list: [
|
|
|
+ {
|
|
|
+ name: '重修目录'
|
|
|
+ },
|
|
|
{
|
|
|
name: '目录'
|
|
|
},
|
|
@@ -167,34 +181,8 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
menuList: [
|
|
|
- {
|
|
|
- list: [
|
|
|
- {
|
|
|
- showChildren: false,
|
|
|
- children: [1, 2, 3]
|
|
|
- },
|
|
|
- {
|
|
|
- showChildren: false,
|
|
|
- children: [1]
|
|
|
- },
|
|
|
- {
|
|
|
- showChildren: false,
|
|
|
- children: [1, 2]
|
|
|
- }
|
|
|
- ],
|
|
|
- type: 1
|
|
|
- },
|
|
|
- {
|
|
|
- type: 2,
|
|
|
- showChildren: false,
|
|
|
- list: [{}, {}, {}]
|
|
|
- },
|
|
|
- {
|
|
|
- type: 3,
|
|
|
- list: [{}, {}]
|
|
|
- }
|
|
|
],
|
|
|
- current: 0,
|
|
|
+ current: 1,
|
|
|
vid:'',
|
|
|
goodsId:0,
|
|
|
goodsData:{},
|
|
@@ -211,7 +199,12 @@ export default {
|
|
|
currentTime:0,
|
|
|
avatarUrl:'',
|
|
|
ossAvatarUrl:'',
|
|
|
- studyDuration:0 // 当前视频时长
|
|
|
+ studyDuration:0, // 当前视频时长
|
|
|
+ gradeId:0,
|
|
|
+ chapterId:0,
|
|
|
+ moduleId:0,
|
|
|
+ reMenuList: [
|
|
|
+ ],
|
|
|
|
|
|
};
|
|
|
},
|
|
@@ -223,8 +216,19 @@ export default {
|
|
|
this.courseDetail();
|
|
|
this.getMenuList();
|
|
|
this.getGoodsDetail()
|
|
|
+
|
|
|
},
|
|
|
onShow() {},
|
|
|
+ onUnload() {
|
|
|
+ if(this.playSectionId>0){
|
|
|
+ //退出提交记录
|
|
|
+ this.ossAvatarUrl = ""
|
|
|
+ this.postStudyRecord()
|
|
|
+ //清除正在播放的节ID
|
|
|
+ this.$store.commit('setPlaySectionId', {playSectionId :0});
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
mounted() {
|
|
|
eventHub.$on('getSection', item => {
|
|
|
if(this.timer){
|
|
@@ -237,24 +241,34 @@ export default {
|
|
|
}else{
|
|
|
this.vid = item.recordingUrl
|
|
|
}
|
|
|
-
|
|
|
this.startStatus = true
|
|
|
this.startTime = 0
|
|
|
});
|
|
|
+ eventHub.$on('levelId', item => {
|
|
|
+ let arr = item.split('-')
|
|
|
+ //点击节获取的各层级ID
|
|
|
+ this.moduleId = arr[0]
|
|
|
+ this.chapterId = arr[1]
|
|
|
+ console.log(item,99)
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
- postStudyRecord() {
|
|
|
- console.log("提交接口A")
|
|
|
+ postStudyRecord(status=0) {
|
|
|
let self = this;
|
|
|
let data = {
|
|
|
photo:self.ossAvatarUrl,
|
|
|
- sectionId:self.playSectionId,
|
|
|
- goodsId:self.goodsId,
|
|
|
- courseId:self.courseId,
|
|
|
- studyDuration:self.studyDuration,
|
|
|
- status:0
|
|
|
+ sectionId:parseInt(self.playSectionId),
|
|
|
+ goodsId:parseInt(self.goodsId),
|
|
|
+ courseId:parseInt(self.courseId),
|
|
|
+ studyDuration:parseInt(self.studyDuration),
|
|
|
+ gradeId:parseInt(self.gradeId),
|
|
|
+ chapterId:parseInt(self.chapterId),
|
|
|
+ moduleId:parseInt(self.moduleId)
|
|
|
+ }
|
|
|
+ if(status>0){
|
|
|
+ data.status = status
|
|
|
}
|
|
|
- console.log("提交接口")
|
|
|
+ console.log("提交接口",data)
|
|
|
this.$api.studyRecord(data).then(res => {
|
|
|
console.log(res)
|
|
|
});
|
|
@@ -357,7 +371,7 @@ export default {
|
|
|
}
|
|
|
//判断是否需要拍照
|
|
|
if(this.intervalTimeList.length>this.intervalTimeIndex){
|
|
|
- let photoTime = parseInt(this.intervalTimeList[this.intervalTimeIndex]) * 60 //获取拍照秒数
|
|
|
+ let photoTime = Number(this.intervalTimeList[this.intervalTimeIndex]) * 60 //获取拍照秒数
|
|
|
if(photoTime<this.playTime){
|
|
|
//启动拍照
|
|
|
//暂停
|
|
@@ -379,9 +393,15 @@ export default {
|
|
|
this.timer = setInterval(this.timeEvent, 1500);//定时器
|
|
|
}
|
|
|
if (newstate.detail.newstate == 'pause') {
|
|
|
-
|
|
|
+ //暂停提交记录
|
|
|
+ /* this.ossAvatarUrl = ""
|
|
|
+ this.postStudyRecord() */
|
|
|
+ }
|
|
|
+ if (newstate.detail.newstate == 'ended') {
|
|
|
+ this.ossAvatarUrl = ""
|
|
|
+ this.postStudyRecord(1)
|
|
|
}
|
|
|
- console.log(newstate,35)
|
|
|
+
|
|
|
|
|
|
},
|
|
|
//拍照
|
|
@@ -391,6 +411,11 @@ export default {
|
|
|
async submit(){
|
|
|
const waitYS = await this.imageInfos();
|
|
|
this.postStudyRecord()//提交记录
|
|
|
+ //恢复播放
|
|
|
+ var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
+ if (polyvPlayerContext != null) {
|
|
|
+ polyvPlayerContext.play();
|
|
|
+ }
|
|
|
console.log(this.ossAvatarUrl,"拍照完成456")
|
|
|
},
|
|
|
//确认拍照
|
|
@@ -423,6 +448,8 @@ export default {
|
|
|
let self = this
|
|
|
this.$api.goodsDetail(this.goodsId).then(res => {
|
|
|
self.goodsData = res.data.data;
|
|
|
+ self.gradeId = self.goodsData.gradeId
|
|
|
+ self.getReMenuList() //获取重修目录
|
|
|
if(self.goodsData.goodsPlayConfig){
|
|
|
self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
|
|
|
if(self.goodsPlayConfig.autoPlay>0){
|
|
@@ -446,6 +473,20 @@ export default {
|
|
|
startVideo() {
|
|
|
this.startStatus = true;
|
|
|
},
|
|
|
+ getReMenuList() {
|
|
|
+ let self = this;
|
|
|
+ this.$api.menuList({ courseId: this.courseId,rebuild:1,gradeId:this.gradeId }).then(res => {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ self.reMenuList = res.data.rows;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getMenuList() {
|
|
|
let self = this;
|
|
|
this.$api.menuList({ courseId: this.courseId }).then(res => {
|
|
@@ -465,6 +506,7 @@ export default {
|
|
|
this.$api.courseDetail(this.courseId).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
self.detail = res.data.data;
|
|
|
+ self.gradeId = self.detail.gradeId
|
|
|
}
|
|
|
});
|
|
|
},
|