|
|
@@ -178,67 +178,73 @@
|
|
|
v-for="(item, index) in menuList"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <!--模块 -->
|
|
|
- <view v-if="item.type == 1"
|
|
|
- ><courseModule
|
|
|
- v-if="reStart"
|
|
|
- :orderGoodsId="orderGoodsId"
|
|
|
- :sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
- :needOpen="menuIndex[0] === index ? true : false"
|
|
|
- :courseId="courseId"
|
|
|
- :preItem="menuList[index - 1]"
|
|
|
- :learningOrder="businessData.goodsLearningOrder"
|
|
|
- :goodsId="goodsId"
|
|
|
- :gradeId="gradeId"
|
|
|
- :isBuy="true"
|
|
|
- :menuItem="item"
|
|
|
- :levelId="item.menuId"
|
|
|
- :goodsType="1"
|
|
|
- :menuAllList="menuAllList"
|
|
|
- :sectionItem="sectionItem"
|
|
|
- ></courseModule
|
|
|
- ></view>
|
|
|
- <!--章 -->
|
|
|
- <view v-if="item.type == 2"
|
|
|
- ><courseChapter
|
|
|
- v-if="reStart"
|
|
|
- :orderGoodsId="orderGoodsId"
|
|
|
- :sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
- :needOpen="menuIndex[0] === index ? true : false"
|
|
|
- :courseId="courseId"
|
|
|
- :preItem="menuList[index - 1]"
|
|
|
- @playEnd="sectionPlayEnd($event, index)"
|
|
|
- :learningOrder="businessData.goodsLearningOrder"
|
|
|
- :goodsId="goodsId"
|
|
|
- :gradeId="gradeId"
|
|
|
- :isBuy="true"
|
|
|
- :menuItem="item"
|
|
|
- :levelId="'0-' + item.menuId"
|
|
|
- :goodsType="1"
|
|
|
- :menuAllList="menuAllList"
|
|
|
- ></courseChapter
|
|
|
- ></view>
|
|
|
- <!--节 -->
|
|
|
- <view v-if="item.type == 3"
|
|
|
- ><courseSection
|
|
|
- ref="MoudleSection"
|
|
|
- v-if="reStart"
|
|
|
- :orderGoodsId="orderGoodsId"
|
|
|
- :sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
- @playEnd="sectionPlayEnd($event, index)"
|
|
|
- :courseId="courseId"
|
|
|
- :preItem="menuList[index - 1]"
|
|
|
- :learningOrder="businessData.goodsLearningOrder"
|
|
|
- :goodsId="goodsId"
|
|
|
- :gradeId="gradeId"
|
|
|
- :isBuy="true"
|
|
|
- :menuItem="item"
|
|
|
- :levelId="'0-0-' + item.menuId"
|
|
|
- :goodsType="1"
|
|
|
- :testType="3"
|
|
|
- :menuAllList="menuAllList"
|
|
|
- ></courseSection
|
|
|
- ></view>
|
|
|
+ <template v-if="!$method.isEmptyObject(sectionItem)">
|
|
|
+ <!--模块 -->
|
|
|
+ <view v-if="item.type == 1"
|
|
|
+ ><courseModule
|
|
|
+ v-if="reStart"
|
|
|
+ :orderGoodsId="orderGoodsId"
|
|
|
+ :sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
+ :needOpen="sectionItem.moduleId == item.menuId"
|
|
|
+ :courseId="courseId"
|
|
|
+ :preItem="menuList[index - 1]"
|
|
|
+ :learningOrder="orderNum"
|
|
|
+ :goodsId="goodsId"
|
|
|
+ :gradeId="gradeId"
|
|
|
+ :isBuy="true"
|
|
|
+ :menuItem="item"
|
|
|
+ :levelId="item.menuId"
|
|
|
+ :goodsType="1"
|
|
|
+ :menuAllList="menuAllList"
|
|
|
+ :sectionItem="sectionItem"
|
|
|
+ ></courseModule
|
|
|
+ ></view>
|
|
|
+ <!--章 -->
|
|
|
+ <view v-if="item.type == 2"
|
|
|
+ ><courseChapter
|
|
|
+ v-if="reStart"
|
|
|
+ :orderGoodsId="orderGoodsId"
|
|
|
+ :sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
+ :needOpen="
|
|
|
+ !sectionItem.moduleId &&
|
|
|
+ sectionItem.chapterId == item.menuId
|
|
|
+ "
|
|
|
+ :courseId="courseId"
|
|
|
+ :preItem="menuList[index - 1]"
|
|
|
+ @playEnd="sectionPlayEnd($event, index)"
|
|
|
+ :learningOrder="orderNum"
|
|
|
+ :goodsId="goodsId"
|
|
|
+ :gradeId="gradeId"
|
|
|
+ :isBuy="true"
|
|
|
+ :menuItem="item"
|
|
|
+ :levelId="'0-' + item.menuId"
|
|
|
+ :goodsType="1"
|
|
|
+ :menuAllList="menuAllList"
|
|
|
+ :sectionItem="sectionItem"
|
|
|
+ ></courseChapter
|
|
|
+ ></view>
|
|
|
+ <!--节 -->
|
|
|
+ <view v-if="item.type == 3"
|
|
|
+ ><courseSection
|
|
|
+ ref="MoudleSection"
|
|
|
+ v-if="reStart"
|
|
|
+ :orderGoodsId="orderGoodsId"
|
|
|
+ :sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
+ @playEnd="sectionPlayEnd($event, index)"
|
|
|
+ :courseId="courseId"
|
|
|
+ :preItem="menuList[index - 1]"
|
|
|
+ :learningOrder="orderNum"
|
|
|
+ :goodsId="goodsId"
|
|
|
+ :gradeId="gradeId"
|
|
|
+ :isBuy="true"
|
|
|
+ :menuItem="item"
|
|
|
+ :levelId="'0-0-' + item.menuId"
|
|
|
+ :goodsType="1"
|
|
|
+ :testType="3"
|
|
|
+ :menuAllList="menuAllList"
|
|
|
+ ></courseSection
|
|
|
+ ></view>
|
|
|
+ </template>
|
|
|
<!-- @togoBack="togoBack($event)" -->
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -365,6 +371,7 @@
|
|
|
:orderGoodsId="orderGoodsId"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
:courseId="courseId"
|
|
|
+ :learningOrder="orderNum"
|
|
|
:goodsId="goodsId"
|
|
|
:gradeId="gradeId"
|
|
|
:isRebuild="true"
|
|
|
@@ -381,6 +388,7 @@
|
|
|
<courseChapter
|
|
|
:orderGoodsId="orderGoodsId"
|
|
|
:courseId="courseId"
|
|
|
+ :learningOrder="orderNum"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
@playEnd="sectionPlayEnd($event, index)"
|
|
|
:gradeId="gradeId"
|
|
|
@@ -398,6 +406,7 @@
|
|
|
<courseSection
|
|
|
:orderGoodsId="orderGoodsId"
|
|
|
:courseId="courseId"
|
|
|
+ :learningOrder="orderNum"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
@playEnd="sectionPlayEnd($event, index)"
|
|
|
:gradeId="gradeId"
|
|
|
@@ -644,7 +653,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
-
|
|
|
+ <!-- 倒计时提交 -->
|
|
|
+ <u-popup
|
|
|
+ v-model="noticeShow1"
|
|
|
+ class="notice_modal"
|
|
|
+ mode="center"
|
|
|
+ border-radius="28"
|
|
|
+ width="650rpx"
|
|
|
+ height="262rpx"
|
|
|
+ :mask-close-able="false"
|
|
|
+ >
|
|
|
+ <view class="content">
|
|
|
+ <view class="title">提示</view>
|
|
|
+ <view class="had_read">
|
|
|
+ <text v-if="CountTo1 >= 0">视频学习时长不达标,请等待</text>
|
|
|
+ <text v-if="CountTo1 >= 0">{{ " " + CountTo1 + "s" }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
<u-modal
|
|
|
v-model="showMark"
|
|
|
title="提示"
|
|
|
@@ -889,12 +915,13 @@ export default {
|
|
|
prendreAutoCarme: false, // 是否发起授权相机
|
|
|
studyTimer: null, // 学习记录定时器
|
|
|
CountTo: 30, // 倒计时
|
|
|
+ CountTo1: 0,
|
|
|
handoutTipLength: 0,
|
|
|
menuAllList: [],
|
|
|
popupPhotoShow: false,
|
|
|
curPlayIndex: 0, // 正在播放的节的下标
|
|
|
// h5
|
|
|
- vodPlayerJs: "https://player.polyv.net/script/player.js",
|
|
|
+ vodPlayerJs: "https://player.polyv.net/resp/vod-player/latest/player.js",
|
|
|
player: "",
|
|
|
H5isAllowSeek: "on",
|
|
|
// stream: null,
|
|
|
@@ -904,6 +931,7 @@ export default {
|
|
|
pauseTimer: null,
|
|
|
barTimer: null,
|
|
|
isReach: false,
|
|
|
+ noticeShow1: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -917,6 +945,9 @@ export default {
|
|
|
playSecIsLearn() {
|
|
|
return this.sectionItem.learning != 1;
|
|
|
},
|
|
|
+ orderNum() {
|
|
|
+ return this.businessData.goodsLearningOrder;
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
showSet(n) {
|
|
|
@@ -966,12 +997,14 @@ export default {
|
|
|
if (this.$method.isGoLogin()) {
|
|
|
return;
|
|
|
}
|
|
|
+ this.closePhoto();
|
|
|
this.courseCourseList();
|
|
|
},
|
|
|
onUnload() {
|
|
|
console.log("onUnloadonUnloadonUnloadonUnload");
|
|
|
this.originUnload();
|
|
|
this.clears();
|
|
|
+ clearInterval(this.lockTimer);
|
|
|
},
|
|
|
onHide() {
|
|
|
this.originUnload();
|
|
|
@@ -1182,11 +1215,11 @@ export default {
|
|
|
},
|
|
|
// 原来onshow里面的内容
|
|
|
originOnShow() {
|
|
|
- this.getbaseprofiletplists().then((res) => {
|
|
|
+ this.getbaseprofiletplists().then(async (res) => {
|
|
|
this.courseDetail();
|
|
|
this.getGoodsDetail();
|
|
|
this.getAnswerList();
|
|
|
- this.studyRecordMenuAllList();
|
|
|
+ await this.studyRecordMenuAllList();
|
|
|
// this.answerTimer = setInterval(() => {
|
|
|
// this.getAnswerList();
|
|
|
// }, 5000);
|
|
|
@@ -1293,12 +1326,17 @@ export default {
|
|
|
},
|
|
|
clearPauseTimer() {
|
|
|
if (this.pauseTimer) {
|
|
|
- console.log(this.pauseTimer, "清除定时器");
|
|
|
this.pauseTime = 0;
|
|
|
clearInterval(this.pauseTimer);
|
|
|
this.pauseTimer = null;
|
|
|
}
|
|
|
},
|
|
|
+ clearBarTimer() {
|
|
|
+ if (this.barTimer) {
|
|
|
+ clearInterval(this.barTimer);
|
|
|
+ this.barTimer = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 原来onUnload里面的内容
|
|
|
originUnload() {
|
|
|
if (this.playSectionId > 0 && this.hasStart) {
|
|
|
@@ -1321,10 +1359,7 @@ export default {
|
|
|
this.hasStart = false;
|
|
|
}
|
|
|
this.clearPauseTimer();
|
|
|
- if (this.barTimer) {
|
|
|
- clearInterval(this.barTimer);
|
|
|
- this.barTimer = null;
|
|
|
- }
|
|
|
+ this.clearBarTimer();
|
|
|
this.timer && clearInterval(this.timer);
|
|
|
if (this.lockTimer) {
|
|
|
clearInterval(this.lockTimer);
|
|
|
@@ -1378,36 +1413,15 @@ export default {
|
|
|
this.$api.courseDetail(item.courseId).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
// if (res.data.data.educationName == "继续教育") {
|
|
|
- this.$api
|
|
|
- .lockLockStatus({
|
|
|
- action: "jxjy",
|
|
|
- uuid: this.$method.getUuid(),
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- //有其他端在操作,不能学习
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: res.data.msg,
|
|
|
- mask: true,
|
|
|
- duration: 3000,
|
|
|
- });
|
|
|
- } else if (res.data.code == 500) {
|
|
|
- //可以学习
|
|
|
- // this.$navTo.togo("/pages3/polyv/detail", {
|
|
|
- // id: item.courseId,
|
|
|
- // goodsId: this.goodsId,
|
|
|
- // orderGoodsId: this.orderGoodsId,
|
|
|
- // });
|
|
|
- this.courseId = item.courseId;
|
|
|
- this.originOnShow();
|
|
|
- this.originMounted();
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$method.checkLock().then((res) => {
|
|
|
+ this.courseId = item.courseId;
|
|
|
+ this.originOnShow();
|
|
|
+ this.originMounted();
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- if (this.businessData.goodsLearningOrder == 2) {
|
|
|
+ if (this.orderNum == 2) {
|
|
|
//学习顺序是从头到尾学习,没学完上一课不能学习下一课
|
|
|
let prevItem = this.courseList[index - 1]; //上一课
|
|
|
if (prevItem.stuAllNum == prevItem.secAllNum) {
|
|
|
@@ -1427,32 +1441,11 @@ export default {
|
|
|
this.$api.courseDetail(item.courseId).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
// if (res.data.data.educationName == "继续教育") {
|
|
|
- this.$api
|
|
|
- .lockLockStatus({
|
|
|
- action: "jxjy",
|
|
|
- uuid: this.$method.getUuid(),
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- //有其他端在操作,不能学习
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: res.data.msg,
|
|
|
- duration: 2000,
|
|
|
- });
|
|
|
- } else if (res.data.code == 500) {
|
|
|
- //可以学习
|
|
|
-
|
|
|
- // this.$navTo.togo("/pages3/polyv/detail", {
|
|
|
- // id: item.courseId,
|
|
|
- // goodsId: this.goodsId,
|
|
|
- // orderGoodsId: this.orderGoodsId,
|
|
|
- // });
|
|
|
- this.courseId = item.courseId;
|
|
|
- this.originOnShow();
|
|
|
- this.originMounted();
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$method.checkLock().then((res) => {
|
|
|
+ this.courseId = item.courseId;
|
|
|
+ this.originOnShow();
|
|
|
+ this.originMounted();
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
@@ -1477,31 +1470,11 @@ export default {
|
|
|
this.$api.courseDetail(item.courseId).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
// if (res.data.data.educationName == "继续教育") {
|
|
|
- this.$api
|
|
|
- .lockLockStatus({
|
|
|
- action: "jxjy",
|
|
|
- uuid: this.$method.getUuid(),
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- //有其他端在操作,不能学习
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: res.data.msg,
|
|
|
- duration: 2000,
|
|
|
- });
|
|
|
- } else if (res.data.code == 500) {
|
|
|
- //可以学习
|
|
|
- // this.$navTo.togo("/pages3/polyv/detail", {
|
|
|
- // id: item.courseId,
|
|
|
- // goodsId: this.goodsId,
|
|
|
- // orderGoodsId: this.orderGoodsId,
|
|
|
- // });
|
|
|
- this.courseId = item.courseId;
|
|
|
- this.originOnShow();
|
|
|
- this.originMounted();
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$method.checkLock().then((res) => {
|
|
|
+ this.courseId = item.courseId;
|
|
|
+ this.originOnShow();
|
|
|
+ this.originMounted();
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -1615,6 +1588,71 @@ export default {
|
|
|
this.updateLiveLast(res.data.data);
|
|
|
});
|
|
|
},
|
|
|
+ async initPlayVideo(sectionItem) {
|
|
|
+ console.log(sectionItem, "this.sectionItem", this.menuList);
|
|
|
+ this.moduleId = sectionItem.moduleId;
|
|
|
+ this.chapterId = sectionItem.chapterId;
|
|
|
+ this.sectionItem = sectionItem;
|
|
|
+ if (sectionItem.sectionType == 1) {
|
|
|
+ //录播
|
|
|
+ this.$store.commit("setPlaySectionId", {
|
|
|
+ playSectionId: sectionItem.sectionId,
|
|
|
+ });
|
|
|
+ this.$store.commit("setPlayVID", {
|
|
|
+ playVID: sectionItem.recordingUrl,
|
|
|
+ });
|
|
|
+ await this.getPhotoLastRecord(); // 获取拍照历史
|
|
|
+ this.playVideo(sectionItem);
|
|
|
+ } else if (sectionItem.sectionType == 2) {
|
|
|
+ //直播
|
|
|
+ this.studyRecordGetLastLive();
|
|
|
+ } else if (sectionItem.sectionType == 3) {
|
|
|
+ //回放
|
|
|
+ this.$store.commit("setPlaySectionId", {
|
|
|
+ playSectionId: sectionItem.sectionId,
|
|
|
+ });
|
|
|
+ this.$store.commit("setPlayVID", {
|
|
|
+ playVID: sectionItem.recordingUrl,
|
|
|
+ });
|
|
|
+ this.playVideo(sectionItem);
|
|
|
+ } else if (sectionItem.doType == 2) {
|
|
|
+ uni.showModal({
|
|
|
+ title: "温馨提示",
|
|
|
+ content: "当前节视频已学完,是否进入考试?",
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ this.toQuestionBank(sectionItem);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toQuestionBank(sectionItem) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url:
|
|
|
+ "/pages2/class/questionBank?courseId=" +
|
|
|
+ this.courseId +
|
|
|
+ "&gradeId=" +
|
|
|
+ this.gradeId +
|
|
|
+ "&isFromVideo=1&id=" +
|
|
|
+ sectionItem.id +
|
|
|
+ "&goodsid=" +
|
|
|
+ this.goodsId +
|
|
|
+ "&moduleId=" +
|
|
|
+ (sectionItem.moduleId || 0) +
|
|
|
+ "&chapterId=" +
|
|
|
+ (sectionItem.chapterId || 0) +
|
|
|
+ "&orderGoodsId=" +
|
|
|
+ this.orderGoodsId +
|
|
|
+ "&type=" +
|
|
|
+ (sectionItem.type == 4 ? 1 : 3) +
|
|
|
+ "&learning=" +
|
|
|
+ sectionItem.studyStatus +
|
|
|
+ "&isBackVideo=" +
|
|
|
+ 1,
|
|
|
+ });
|
|
|
+ },
|
|
|
studyRecordQueryLiveLast() {
|
|
|
// /study/record/queryLiveLast
|
|
|
this.$api
|
|
|
@@ -1623,50 +1661,17 @@ export default {
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
courseId: this.courseId,
|
|
|
})
|
|
|
- .then(async (res) => {
|
|
|
- if (res.data.data) {
|
|
|
- this.moduleId = res.data.data.moduleId;
|
|
|
- this.chapterId = res.data.data.chapterId;
|
|
|
- if (res.data.data.sectionType == 1) {
|
|
|
- //录播
|
|
|
- this.$store.commit("setPlaySectionId", {
|
|
|
- playSectionId: res.data.data.sectionId,
|
|
|
- });
|
|
|
- this.$store.commit("setPlayVID", {
|
|
|
- playVID: res.data.data.recordingUrl,
|
|
|
- });
|
|
|
-
|
|
|
- this.sectionItem = res.data.data;
|
|
|
- await this.getPhotoLastRecord(); // 获取拍照历史
|
|
|
- this.playVideo(res.data.data);
|
|
|
- } else if (res.data.data.sectionType == 2) {
|
|
|
- //直播
|
|
|
- this.studyRecordGetLastLive();
|
|
|
- } else if (res.data.data.sectionType == 3) {
|
|
|
- //回放
|
|
|
- this.$store.commit("setPlaySectionId", {
|
|
|
- playSectionId: res.data.data.sectionId,
|
|
|
- });
|
|
|
- this.$store.commit("setPlayVID", {
|
|
|
- playVID: res.data.data.recordingUrl,
|
|
|
- });
|
|
|
- this.sectionItem = res.data.data;
|
|
|
- this.playVideo(res.data.data);
|
|
|
+ .then((res) => {
|
|
|
+ let { data } = res.data;
|
|
|
+ if (!data.sectionId) {
|
|
|
+ data = this.menuAllList[0];
|
|
|
+ } else {
|
|
|
+ if (data.learning == 1 && this.orderNum == 2) {
|
|
|
+ let next = this.menuAllList.find((e) => e.studyStatus != 1);
|
|
|
+ next && (data = next);
|
|
|
}
|
|
|
-
|
|
|
- // 查询用户最后一次看的录播的信息
|
|
|
- this.$http({
|
|
|
- url: "/study/record/getUserWatchLast",
|
|
|
- method: "get",
|
|
|
- data: {
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- },
|
|
|
- }).then((res) => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- this.sectionItem = res.data.data || {};
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
+ this.initPlayVideo(data);
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
@@ -1898,8 +1903,8 @@ export default {
|
|
|
},
|
|
|
studyRecordMenuAllList() {
|
|
|
// study/record/menuAllList
|
|
|
- this.$api
|
|
|
- .studyRecordMenuAllList({
|
|
|
+ return this.$api
|
|
|
+ .studMenuAllList({
|
|
|
courseId: this.courseId,
|
|
|
gradeId: this.gradeId,
|
|
|
goodsId: this.goodsId,
|
|
|
@@ -1907,16 +1912,114 @@ export default {
|
|
|
.then((res) => {
|
|
|
let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
|
if (res.data.data) {
|
|
|
- this.menuAllList = res.data.data;
|
|
|
- // console.log('======0', this.sectionItem);
|
|
|
+ this.menuAllList = res.data.data.filter(
|
|
|
+ (e) => e.doType != 1 || (e.doType == 2 && e.studyStatus == 1)
|
|
|
+ );
|
|
|
this.livingItem = res.data.data.find(
|
|
|
(item) =>
|
|
|
item.liveStartTime <= nowTime && item.liveEndTime > nowTime
|
|
|
);
|
|
|
}
|
|
|
+ return Promise.resolve();
|
|
|
});
|
|
|
},
|
|
|
- getbaseprofiletplists() {
|
|
|
+ async getbaseprofiletplists() {
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ this.getCameraSetting();
|
|
|
+ // #endif
|
|
|
+ let {
|
|
|
+ data: { code, rows },
|
|
|
+ } = await this.$api.getbaseprofiletplists({
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
+ if (code === 200 && rows.length && rows[0].keyValue) {
|
|
|
+ let baseRes = await this.$api.getbaseprofiletpId(this.goodsId);
|
|
|
+ if (baseRes.data.code === 200 && baseRes.data.data) {
|
|
|
+ let {
|
|
|
+ data: { code, data },
|
|
|
+ } = await this.$api.getbaseprofiletpgetInfo({
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ code === 200 &&
|
|
|
+ (!data || (data.status === 3 && data.changeStatus === 1))
|
|
|
+ ) {
|
|
|
+ this.needProfileModal = true;
|
|
|
+ uni.showModal({
|
|
|
+ content: !data
|
|
|
+ ? "请前往填写资料"
|
|
|
+ : "资料审核不通过,请前往重新填写",
|
|
|
+ cancelText: "返回",
|
|
|
+ success: (resultst) => {
|
|
|
+ if (resultst.confirm) {
|
|
|
+ this.$navTo.togo("/pages2/verify/input", {
|
|
|
+ id: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (resultst.cancel) {
|
|
|
+ uni.navigateBack();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return Promise.reject();
|
|
|
+ } else if (data.status === 1 && JSON.parse(rows[0].keyValue2)[0]) {
|
|
|
+ let {
|
|
|
+ data: { code, data },
|
|
|
+ } = await this.$api.getbaseprofileStampgetInfo({
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ code === 200 &&
|
|
|
+ (!data || (data.status === 3 && data.changeStatus === 1))
|
|
|
+ ) {
|
|
|
+ this.needProfileModal = true;
|
|
|
+ uni.showModal({
|
|
|
+ content: !data
|
|
|
+ ? "请前往填写盖章资料"
|
|
|
+ : "资料盖章审核不通过,请前往重新填写",
|
|
|
+ cancelText: "返回",
|
|
|
+ success: (resultst) => {
|
|
|
+ if (resultst.confirm) {
|
|
|
+ this.$navTo.togo("/pages2/verify/input2", {
|
|
|
+ id: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (resultst.cancel) {
|
|
|
+ uni.navigateBack();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return Promise.reject();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let detail = await this.$api.goodsDetail(this.goodsId);
|
|
|
+ if (detail.data.data.erJianErZao) {
|
|
|
+ let info = await this.$api.userConfirmInfoDetail({
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
+ if (!info.data.data || info.data.data.pushInfo !== 1) {
|
|
|
+ uni.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ title: "提示",
|
|
|
+ content: "开通信息推送不成功,无法进入学习!",
|
|
|
+ success: (resultst) => {
|
|
|
+ uni.navigateBack();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return Promise.reject();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Promise.resolve();
|
|
|
+ },
|
|
|
+
|
|
|
+ getbaseprofiletplists1() {
|
|
|
return new Promise((resolve) => {
|
|
|
let self = this;
|
|
|
// #ifdef MP-WEIXIN
|
|
|
@@ -1929,6 +2032,7 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res.data.code === 200 && res.data.rows.length) {
|
|
|
+ console.log(res.data.rows[0], 987);
|
|
|
if (res.data.rows[0].keyValue) {
|
|
|
self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
|
|
|
if (baseRes.data.code === 200) {
|
|
|
@@ -1941,6 +2045,7 @@ export default {
|
|
|
})
|
|
|
.then((result) => {
|
|
|
if (result.data.code === 200) {
|
|
|
+ // status 1通过 2是待审 3是不通过
|
|
|
if (
|
|
|
!result.data.data ||
|
|
|
(result.data.data.status === 3 &&
|
|
|
@@ -2060,6 +2165,7 @@ export default {
|
|
|
resolve();
|
|
|
}
|
|
|
} else {
|
|
|
+ // 调用推送是否成功
|
|
|
resolve();
|
|
|
}
|
|
|
});
|
|
|
@@ -2071,15 +2177,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- // /**
|
|
|
- // * 获取业务层次详情
|
|
|
- // */
|
|
|
- // courseBusiness() {
|
|
|
- // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
|
|
|
- // this.businessData = res.data.data;
|
|
|
- // });
|
|
|
- // },
|
|
|
/**
|
|
|
* 计算tabs宽度
|
|
|
*/
|
|
|
@@ -2473,7 +2570,7 @@ export default {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
|
// #ifdef H5
|
|
|
- await this.clears();
|
|
|
+ // await this.clears();
|
|
|
// #endif
|
|
|
if (this.vid) {
|
|
|
//切换视频
|
|
|
@@ -2737,7 +2834,7 @@ export default {
|
|
|
PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
|
|
|
// #endif
|
|
|
}
|
|
|
- if (currentTime < 15) {
|
|
|
+ if (currentTime < 10 && !this.ossAvatarUrl) {
|
|
|
return;
|
|
|
}
|
|
|
if (this.playChannelId > 0) {
|
|
|
@@ -2760,6 +2857,7 @@ export default {
|
|
|
videoCurrentTime: parseInt(
|
|
|
currentTime > 0 ? currentTime : self.studyDuration
|
|
|
),
|
|
|
+ erJianErZao: this.erJianErZao,
|
|
|
};
|
|
|
if (this.ossAvatarUrl) {
|
|
|
data.similarity = this.compareFaceData; // 相似度
|
|
|
@@ -2773,7 +2871,7 @@ export default {
|
|
|
.studyRecord(data)
|
|
|
.then((res) => {
|
|
|
console.log(res, "记录返回");
|
|
|
- let { code } = res.data;
|
|
|
+ let { code, msg } = res.data;
|
|
|
if (code == 200) {
|
|
|
if (status > 0) {
|
|
|
this.studyRecordMenuAllList();
|
|
|
@@ -2788,6 +2886,27 @@ export default {
|
|
|
uni.$emit("playNext" + playNextId); //通知播放结束
|
|
|
}
|
|
|
self.ossAvatarUrl = "";
|
|
|
+ } else if (code == 600) {
|
|
|
+ uni.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ title: "提示",
|
|
|
+ content: msg,
|
|
|
+ success: (resultst) => {
|
|
|
+ uni.navigateBack();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else if (code == 558) {
|
|
|
+ this.CountTo1 = msg.split(",")[1];
|
|
|
+ this.noticeShow1 = true;
|
|
|
+ var timer = setInterval(() => {
|
|
|
+ this.CountTo1--;
|
|
|
+ if (this.CountTo1 < 0) {
|
|
|
+ this.noticeShow1 = false;
|
|
|
+ clearInterval(timer);
|
|
|
+ this.postStudyRecord(1);
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ reject("中断执行");
|
|
|
} else {
|
|
|
this.uploadLock = false;
|
|
|
uni.showToast({
|
|
|
@@ -3113,14 +3232,38 @@ export default {
|
|
|
//第二个弹窗
|
|
|
uni.showModal({
|
|
|
title: "温馨提示",
|
|
|
- content: "当前最后一节视频已学完 请检查所有章节是否学习完成?",
|
|
|
- showCancel: false,
|
|
|
+ content:
|
|
|
+ "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
|
|
|
+ showCancel: !this.erJianErZao,
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
+ uni.switchTab({
|
|
|
+ url: "/pages/learn/index",
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
|
+ if (data.doType == 2) {
|
|
|
+ if (data.studyStatus == 1) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "试卷已合格!",
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ uni.showModal({
|
|
|
+ title: "温馨提示",
|
|
|
+ content: "当前节视频已学完,是否进入考试?",
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ this.toQuestionBank(data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
uni.showModal({
|
|
|
title: "温馨提示",
|
|
|
content: "当前节视频已学完,继续学习下一节?",
|
|
|
@@ -3404,7 +3547,8 @@ export default {
|
|
|
canvas.width = 400;
|
|
|
canvas.height = 400;
|
|
|
const context = canvas.getContext("2d");
|
|
|
- const video = document.querySelector("video");
|
|
|
+ const box = document.querySelector(".photo_v");
|
|
|
+ const video = box.querySelector("video");
|
|
|
context.drawImage(video, 0, 0, 400, 400);
|
|
|
this.faceUrl = canvas.toDataURL("image/png");
|
|
|
this.isTaking = false;
|
|
|
@@ -3420,13 +3564,12 @@ export default {
|
|
|
//关闭相机
|
|
|
closePhoto() {
|
|
|
this.photoPopup = false;
|
|
|
- self.enableAutoRotation = true;
|
|
|
+ this.enableAutoRotation = true;
|
|
|
},
|
|
|
/**
|
|
|
* 进入全屏
|
|
|
*/
|
|
|
fullscreenchange(event) {
|
|
|
- console.log(event.detail.direction, 666);
|
|
|
if (event.detail.direction == "vertical") {
|
|
|
this.navShow = true;
|
|
|
} else if (event.detail.direction == "horizontal") {
|
|
|
@@ -3456,16 +3599,14 @@ export default {
|
|
|
},
|
|
|
getGoodsDetail() {
|
|
|
let self = this;
|
|
|
- // '/goods/'+ data,
|
|
|
this.$api.goodsDetail(this.goodsId).then(async (res) => {
|
|
|
this.goodsData = res.data.data;
|
|
|
- await this.checkFinishRequiredCourse();
|
|
|
+ this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
|
|
|
if (self.goodsData.buyNote) {
|
|
|
this.baseHandoutTipList();
|
|
|
}
|
|
|
self.gradeId = self.goodsData.gradeId;
|
|
|
self.erJianErZao = self.goodsData.erJianErZao;
|
|
|
-
|
|
|
this.courseBusiness(this.goodsData.businessId);
|
|
|
self.getMenuList();
|
|
|
self.getReMenuList(); //获取重修目录
|
|
|
@@ -3480,11 +3621,9 @@ export default {
|
|
|
if (self.goodsData.goodsPlayConfig) {
|
|
|
self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
|
|
|
if (self.goodsPlayConfig.autoPlay > 0) {
|
|
|
- // #ifdef H5
|
|
|
self.autoplay = true;
|
|
|
- // #endif
|
|
|
}
|
|
|
- if (self.goodsPlayConfig.drag > 0) {
|
|
|
+ if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
|
|
|
// #ifdef MP-WEIXIN
|
|
|
self.isAllowSeek = "yes";
|
|
|
// #endif
|
|
|
@@ -3693,11 +3832,8 @@ export default {
|
|
|
loadPlayer() {
|
|
|
const polyvPlayer = window.polyvPlayer;
|
|
|
this.$api.polyvVideoSign(this.vid).then(async (res) => {
|
|
|
- this.player = await polyvPlayer({
|
|
|
- wrap: "#player",
|
|
|
- width: "100%",
|
|
|
+ let option = {
|
|
|
showLine: "off",
|
|
|
- height: 218,
|
|
|
ban_history_time: "on",
|
|
|
vid: this.vid,
|
|
|
forceH5: true,
|
|
|
@@ -3710,53 +3846,75 @@ export default {
|
|
|
watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
|
|
|
ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
|
|
|
sign: res.data.data.sign, // 移动端播放加密视频所需的签名
|
|
|
- // playsafe: (vid, next) => { // PC端播放加密视频所需的授权凭证
|
|
|
- // console.log('111111111111', vid);
|
|
|
- // // this.$api.obtainpolyvvideopcsign(vid).then((res) => {
|
|
|
- // // console.log('请求完后', res);
|
|
|
- // // next(res.data.data);
|
|
|
- // // });
|
|
|
- // },
|
|
|
- });
|
|
|
-
|
|
|
- polyvPlayerContext = this.player;
|
|
|
-
|
|
|
- this.player.on("s2j_onPlayStart", async (vid) => {
|
|
|
+ };
|
|
|
+ if (polyvPlayerContext) {
|
|
|
+ polyvPlayerContext.changeVid(option);
|
|
|
+ } else {
|
|
|
+ option = {
|
|
|
+ wrap: "#player",
|
|
|
+ width: "100%",
|
|
|
+ height: 218,
|
|
|
+ ...option,
|
|
|
+ };
|
|
|
+ polyvPlayerContext = await polyvPlayer(option);
|
|
|
+ }
|
|
|
+ // polyvPlayerContext = await polyvPlayer({
|
|
|
+ // wrap: "#player",
|
|
|
+ // width: "100%",
|
|
|
+ // showLine: "off",
|
|
|
+ // height: 218,
|
|
|
+ // ban_history_time: "on",
|
|
|
+ // vid: this.vid,
|
|
|
+ // forceH5: true,
|
|
|
+ // autoplay: this.autoplay, // 自动播放
|
|
|
+ // ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
|
|
|
+ // speed: this.playbackRate, // 倍数
|
|
|
+ // teaser_show: 1,
|
|
|
+ // tail_show: 1,
|
|
|
+ // hideSwitchPlayer: true,
|
|
|
+ // watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
|
|
|
+ // ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
|
|
|
+ // sign: res.data.data.sign, // 移动端播放加密视频所需的签名
|
|
|
+ // });
|
|
|
+ // polyvPlayerContext = this.player;
|
|
|
+ polyvPlayerContext.on("s2j_onPlayStart", async (vid) => {
|
|
|
// 视频初次播放时触发
|
|
|
console.log("视频初次播放时触发:");
|
|
|
// #ifdef H5
|
|
|
// h5禁止拖动进度条
|
|
|
- clearInterval(this.barTimer);
|
|
|
- this.barTimer = null;
|
|
|
- let originTime = this.recordObj.videoCurrentTime || 0;
|
|
|
- if (this.H5isAllowSeek == "on" && !this.barTimer) {
|
|
|
- this.barTimer = setInterval(function () {
|
|
|
- const currentTime = polyvPlayerContext.j2s_getCurrentTime();
|
|
|
- if (
|
|
|
- currentTime - originTime > 1 ||
|
|
|
- currentTime - originTime < 0
|
|
|
- ) {
|
|
|
- polyvPlayerContext.j2s_seekVideo(originTime);
|
|
|
- } else {
|
|
|
- originTime = currentTime;
|
|
|
- }
|
|
|
- }, 500);
|
|
|
+ if (!this.$method.isWeixin()) {
|
|
|
+ this.clearBarTimer();
|
|
|
+ let originTime = this.recordObj.videoCurrentTime || 0;
|
|
|
+ if (this.H5isAllowSeek == "on") {
|
|
|
+ this.barTimer = setInterval(() => {
|
|
|
+ const currentTime = polyvPlayerContext.j2s_getCurrentTime();
|
|
|
+ // console.log(currentTime, originTime, 789);
|
|
|
+ if (
|
|
|
+ currentTime - originTime > 15 ||
|
|
|
+ currentTime - originTime < 0
|
|
|
+ ) {
|
|
|
+ polyvPlayerContext.j2s_seekVideo(originTime);
|
|
|
+ } else {
|
|
|
+ originTime = currentTime;
|
|
|
+ }
|
|
|
+ }, 2000);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// #endif
|
|
|
this.loadedmetadata();
|
|
|
this.postStudyRecord(0);
|
|
|
});
|
|
|
-
|
|
|
- this.player.on("s2j_onVideoPause", () => {
|
|
|
+ polyvPlayerContext.on("s2j_onVideoPause", () => {
|
|
|
// 视频暂停时触发
|
|
|
console.log("视频暂停时触发", this.vid);
|
|
|
this.erJianErZaoPauseTip();
|
|
|
|
|
|
+ this.clearBarTimer();
|
|
|
clearInterval(this.studyTimer);
|
|
|
clearInterval(this.timer);
|
|
|
});
|
|
|
-
|
|
|
- this.player.on("s2j_onVideoPlay", () => {
|
|
|
+ polyvPlayerContext.on("s2j_onVideoPlay", () => {
|
|
|
// 视频初次播放或由暂停恢复播放时触发
|
|
|
console.log("视频初次播放或由暂停恢复播放时触发");
|
|
|
if (this.needSeek) {
|
|
|
@@ -3788,10 +3946,10 @@ export default {
|
|
|
this.postStudyRecord(0, this.playSectionId);
|
|
|
}, 15000);
|
|
|
});
|
|
|
-
|
|
|
- this.player.on("s2j_onPlayOver", async () => {
|
|
|
+ polyvPlayerContext.on("s2j_onPlayOver", async () => {
|
|
|
// 当前视频播放完毕时触发
|
|
|
this.hasStart = false;
|
|
|
+ this.clearBarTimer();
|
|
|
clearInterval(this.studyTimer);
|
|
|
clearInterval(this.timer);
|
|
|
uni.showToast({
|
|
|
@@ -3806,7 +3964,8 @@ export default {
|
|
|
clears() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.vid = "";
|
|
|
- this.player && this.player.destroy();
|
|
|
+ polyvPlayerContext && polyvPlayerContext.destroy();
|
|
|
+ polyvPlayerContext = null;
|
|
|
resolve();
|
|
|
});
|
|
|
},
|
|
|
@@ -3866,7 +4025,8 @@ export default {
|
|
|
this.enableAutoRotation = false;
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
- const video = document.querySelector("video");
|
|
|
+ const box = document.querySelector(".photo_v");
|
|
|
+ const video = box.querySelector("video");
|
|
|
console.log("video:", video);
|
|
|
video.srcObject = stream;
|
|
|
video.play();
|