|
@@ -3,7 +3,7 @@
|
|
|
<nav-bar title="课程详情" v-if="navShow"></nav-bar>
|
|
<nav-bar title="课程详情" v-if="navShow"></nav-bar>
|
|
|
<view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;" id="top">
|
|
<view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;" id="top">
|
|
|
<view class="video_box" v-if="!startStatus">
|
|
<view class="video_box" v-if="!startStatus">
|
|
|
- <image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
|
|
|
|
|
|
|
+ <image :src="$method.splitImgHost(detail.coverUrl)" mode="widthFix" style="width: 100%;height: 460rpx;"></image>
|
|
|
<image v-if="false" class="video_play" src="/static/play.png" @click="startVideo"></image>
|
|
<image v-if="false" class="video_play" src="/static/play.png" @click="startVideo"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-else>
|
|
<view v-else>
|
|
@@ -63,9 +63,9 @@
|
|
|
<view v-show="current == 0">
|
|
<view v-show="current == 0">
|
|
|
<view class="menuBox" v-for="(item, index) in menuList" :key="index">
|
|
<view class="menuBox" v-for="(item, index) in menuList" :key="index">
|
|
|
<!--模块 -->
|
|
<!--模块 -->
|
|
|
- <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 == 1"><courseModule :needOpen="menuIndex[0] === index ? true : false" :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" @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 == 2"><courseChapter :needOpen="menuIndex[0] === index ? true : false" :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($event,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>
|
|
@@ -195,12 +195,17 @@
|
|
|
<view class="sqzz"></view>
|
|
<view class="sqzz"></view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="photoCenter">
|
|
<view class="photoCenter">
|
|
|
- <view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup">
|
|
|
|
|
|
|
+ <view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup && isTaking">
|
|
|
<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
|
|
<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="custom"><image src="/static/zhezhao.png" mode=""></image></view>
|
|
|
|
|
|
|
+ <view class="custom" v-if="!isTaking" ><image :src="avatarUrl" mode=""></image></view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="btnResult" @click="takePhoto">拍照</view>
|
|
|
|
|
|
|
+ <view class="btns">
|
|
|
|
|
+ <view class="btnResult" v-if="isTaking" @click="takePhoto">拍照</view>
|
|
|
|
|
+ <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
|
|
|
|
|
+ <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -214,7 +219,7 @@ import plv from '../static/polyv-sdk/index';
|
|
|
import courseModule from '@/components/course/courseModule.vue';
|
|
import courseModule from '@/components/course/courseModule.vue';
|
|
|
import courseChapter from '@/components/course/courseChapter.vue';
|
|
import courseChapter from '@/components/course/courseChapter.vue';
|
|
|
import courseSection from '@/components/course/courseSection.vue';
|
|
import courseSection from '@/components/course/courseSection.vue';
|
|
|
-import { mapGetters } from 'vuex';
|
|
|
|
|
|
|
+import { mapGetters, mapMutations } from 'vuex';
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
courseModule,
|
|
courseModule,
|
|
@@ -285,6 +290,7 @@ export default {
|
|
|
noteId: 0,
|
|
noteId: 0,
|
|
|
recordObj: 0,
|
|
recordObj: 0,
|
|
|
gradeDetail:{},
|
|
gradeDetail:{},
|
|
|
|
|
+ isTaking:true, //是否正在拍照
|
|
|
needSeek: false, //第一次播放是否需要跳转
|
|
needSeek: false, //第一次播放是否需要跳转
|
|
|
needProfileModal:false, //是否需要资料审核弹框
|
|
needProfileModal:false, //是否需要资料审核弹框
|
|
|
liveObj:{},
|
|
liveObj:{},
|
|
@@ -294,6 +300,7 @@ export default {
|
|
|
photoIndex:0, //当前位于拍照的区间下标 从0开始
|
|
photoIndex:0, //当前位于拍照的区间下标 从0开始
|
|
|
photoHistoryList:[], //已拍照历史的下标点
|
|
photoHistoryList:[], //已拍照历史的下标点
|
|
|
businessData:{},
|
|
businessData:{},
|
|
|
|
|
+ menuIndex:[],
|
|
|
isRebuild:false, //视频是否从重修目录点击
|
|
isRebuild:false, //视频是否从重修目录点击
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -473,8 +480,10 @@ export default {
|
|
|
console.log(item)
|
|
console.log(item)
|
|
|
this.isRebuild = item;
|
|
this.isRebuild = item;
|
|
|
})
|
|
})
|
|
|
|
|
+ this.updateChapterOpen(true)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ ...mapMutations(['updateChapterOpen']),
|
|
|
/**
|
|
/**
|
|
|
* 模块大节播放完毕,刷新列表
|
|
* 模块大节播放完毕,刷新列表
|
|
|
*/
|
|
*/
|
|
@@ -712,30 +721,39 @@ export default {
|
|
|
},
|
|
},
|
|
|
//postTime 只提交随机时间
|
|
//postTime 只提交随机时间
|
|
|
postCoursePhotoRecord(postTime=false) {
|
|
postCoursePhotoRecord(postTime=false) {
|
|
|
- let currentTime = 0;
|
|
|
|
|
- var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
|
|
- if (polyvPlayerContext) {
|
|
|
|
|
- currentTime = polyvPlayerContext.getCurrentTime();
|
|
|
|
|
- }
|
|
|
|
|
- let self = this;
|
|
|
|
|
- let photoIndex = self.photoIndex
|
|
|
|
|
- let data = {
|
|
|
|
|
- photo: self.ossAvatarUrl,
|
|
|
|
|
- sectionId: parseInt(self.playSectionId),
|
|
|
|
|
- goodsId: parseInt(self.goodsId),
|
|
|
|
|
- courseId: parseInt(self.courseId),
|
|
|
|
|
- photoTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
|
|
|
- gradeId: parseInt(self.gradeId),
|
|
|
|
|
- photoIndex: postTime?-2:parseInt(photoIndex),//从0算起,-2只提交随机时间
|
|
|
|
|
- photoNum:parseInt(self.photoNum),
|
|
|
|
|
- chapterId: parseInt(self.chapterId),
|
|
|
|
|
- moduleId: parseInt(self.moduleId),
|
|
|
|
|
- timeInterval: postTime?self.photoList.join(','):''
|
|
|
|
|
- };
|
|
|
|
|
- console.log('提交接口', data);
|
|
|
|
|
- this.$api.coursePhotoRecord(data).then(res => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return new Promise((resolve,reject) => {
|
|
|
|
|
+
|
|
|
|
|
+ let currentTime = 0;
|
|
|
|
|
+ var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
|
|
+ if (polyvPlayerContext) {
|
|
|
|
|
+ currentTime = polyvPlayerContext.getCurrentTime();
|
|
|
|
|
+ }
|
|
|
|
|
+ let self = this;
|
|
|
|
|
+ let photoIndex = self.photoIndex
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ photo: self.ossAvatarUrl,
|
|
|
|
|
+ sectionId: parseInt(self.playSectionId),
|
|
|
|
|
+ goodsId: parseInt(self.goodsId),
|
|
|
|
|
+ courseId: parseInt(self.courseId),
|
|
|
|
|
+ photoTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
|
|
|
+ gradeId: parseInt(self.gradeId),
|
|
|
|
|
+ photoIndex: postTime?-2:parseInt(photoIndex),//从0算起,-2只提交随机时间
|
|
|
|
|
+ photoNum:parseInt(self.photoNum),
|
|
|
|
|
+ chapterId: parseInt(self.chapterId),
|
|
|
|
|
+ moduleId: parseInt(self.moduleId),
|
|
|
|
|
+ timeInterval: postTime?self.photoList.join(','):''
|
|
|
|
|
+ };
|
|
|
|
|
+ console.log('提交接口', data);
|
|
|
|
|
+ this.$api.coursePhotoRecord(data).then(res => {
|
|
|
|
|
+ if(res.data.code == 200) {
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ reject()
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ reject()
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
randomNum(minNum,maxNum){
|
|
randomNum(minNum,maxNum){
|
|
|
switch(arguments.length){
|
|
switch(arguments.length){
|
|
@@ -1210,7 +1228,8 @@ export default {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
var data = {
|
|
var data = {
|
|
|
- imageStatus: int
|
|
|
|
|
|
|
+ imageStatus: int,
|
|
|
|
|
+ gradeId:this.gradeId
|
|
|
};
|
|
};
|
|
|
self.$api.aliyunpolicy(data).then(res => {
|
|
self.$api.aliyunpolicy(data).then(res => {
|
|
|
if (res.data.code != 200) {
|
|
if (res.data.code != 200) {
|
|
@@ -1247,14 +1266,16 @@ export default {
|
|
|
title: '上传失败',
|
|
title: '上传失败',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
});
|
|
});
|
|
|
|
|
+ this.openPhoto();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
fail: error => {
|
|
fail: error => {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: '上传接口报错' + error,
|
|
|
|
|
|
|
+ title: '上传接口报错,请重新拍照上传' + error,
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
});
|
|
});
|
|
|
|
|
+ this.openPhoto();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1384,6 +1405,7 @@ export default {
|
|
|
polyvPlayerContext.exitFullScreen();
|
|
polyvPlayerContext.exitFullScreen();
|
|
|
this.enableAutoRotation = false;
|
|
this.enableAutoRotation = false;
|
|
|
this.photoPopup = true;
|
|
this.photoPopup = true;
|
|
|
|
|
+ this.isTaking = true;
|
|
|
uni.authorize({
|
|
uni.authorize({
|
|
|
scope: 'scope.camera',
|
|
scope: 'scope.camera',
|
|
|
success() {
|
|
success() {
|
|
@@ -1393,15 +1415,29 @@ export default {
|
|
|
},
|
|
},
|
|
|
async submit() {
|
|
async submit() {
|
|
|
const waitYS = await this.imageInfos();
|
|
const waitYS = await this.imageInfos();
|
|
|
- this.postCoursePhotoRecord()
|
|
|
|
|
- this.postStudyRecord(); //提交记录
|
|
|
|
|
- //恢复播放
|
|
|
|
|
- var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
|
|
- if (polyvPlayerContext != null) {
|
|
|
|
|
- polyvPlayerContext.play();
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ await this.postCoursePhotoRecord()
|
|
|
|
|
+ this.postStudyRecord(); //提交记录
|
|
|
|
|
+ //恢复播放
|
|
|
|
|
+
|
|
|
|
|
+ this.photoPopup = false;
|
|
|
|
|
+ this.enableAutoRotation = true;
|
|
|
|
|
+ var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
|
|
+ if (polyvPlayerContext != null) {
|
|
|
|
|
+ polyvPlayerContext.play();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch(err) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '上传接口报错,请重新拍照上传' + err,
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ this.openPhoto();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ reTake() {
|
|
|
|
|
+ this.isTaking = true;
|
|
|
|
|
+ },
|
|
|
//确认拍照
|
|
//确认拍照
|
|
|
takePhoto() {
|
|
takePhoto() {
|
|
|
var self = this;
|
|
var self = this;
|
|
@@ -1411,10 +1447,11 @@ export default {
|
|
|
success: res => {
|
|
success: res => {
|
|
|
console.log(res.tempImagePath);
|
|
console.log(res.tempImagePath);
|
|
|
self.avatarUrl = res.tempImagePath;
|
|
self.avatarUrl = res.tempImagePath;
|
|
|
- self.submit();
|
|
|
|
|
|
|
+ this.isTaking = false;
|
|
|
|
|
+ // self.submit();
|
|
|
|
|
|
|
|
- self.photoPopup = false;
|
|
|
|
|
- self.enableAutoRotation = true;
|
|
|
|
|
|
|
+ // self.photoPopup = false;
|
|
|
|
|
+ // self.enableAutoRotation = true;
|
|
|
},
|
|
},
|
|
|
fail: err => {
|
|
fail: err => {
|
|
|
console.log(err);
|
|
console.log(err);
|
|
@@ -1553,6 +1590,16 @@ export default {
|
|
|
item.name = item.menuName;
|
|
item.name = item.menuName;
|
|
|
}
|
|
}
|
|
|
self.menuList = res.data.rows;
|
|
self.menuList = res.data.rows;
|
|
|
|
|
+
|
|
|
|
|
+ for(let i=0;i<res.data.rows.length;i++){
|
|
|
|
|
+ if(res.data.rows[i].type == 1) {
|
|
|
|
|
+ this.menuIndex = [i];
|
|
|
|
|
+ break;
|
|
|
|
|
+ } else if(res.data.rows[i].type == 2) {
|
|
|
|
|
+ this.menuIndex = [i];
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -1683,31 +1730,31 @@ export default {
|
|
|
background-color: #FFFFFF;
|
|
background-color: #FFFFFF;
|
|
|
border-radius: 32px 32px 0px 0px;
|
|
border-radius: 32px 32px 0px 0px;
|
|
|
.photoTop {
|
|
.photoTop {
|
|
|
- height: 74upx;
|
|
|
|
|
|
|
+ height: 74rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
- padding: 0upx 38upx;
|
|
|
|
|
|
|
+ padding: 0rpx 38rpx;
|
|
|
.sqzz {
|
|
.sqzz {
|
|
|
- width: 28upx;
|
|
|
|
|
- height: 28upx;
|
|
|
|
|
|
|
+ width: 28rpx;
|
|
|
|
|
+ height: 28rpx;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
}
|
|
}
|
|
|
.centersq {
|
|
.centersq {
|
|
|
color: #333;
|
|
color: #333;
|
|
|
- font-size: 30upx;
|
|
|
|
|
|
|
+ font-size: 30rpx;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.photoCenter {
|
|
.photoCenter {
|
|
|
- width: 750upx;
|
|
|
|
|
- height: 979upx;
|
|
|
|
|
|
|
+ width: 750rpx;
|
|
|
|
|
+ height: 979rpx;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
.custom {
|
|
.custom {
|
|
|
- width: 750upx;
|
|
|
|
|
- height: 979upx;
|
|
|
|
|
|
|
+ width: 750rpx;
|
|
|
|
|
+ height: 979rpx;
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
z-index: 1000;
|
|
z-index: 1000;
|
|
|
top: 0;
|
|
top: 0;
|
|
@@ -1718,15 +1765,21 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .btnResult {
|
|
|
|
|
- height: 100rpx;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- background-color: #07c160;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- line-height: 100upx;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- font-size: 32upx;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .btns {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ .btnResult {
|
|
|
|
|
+ height: 100rpx;
|
|
|
|
|
+ flex:1;
|
|
|
|
|
+ background-color: #07c160;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ line-height: 100rpx;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.chat_box {
|
|
.chat_box {
|