|
@@ -8,7 +8,7 @@
|
|
|
@clickLeft="clickLeft"
|
|
|
></uni-nav-bar>
|
|
|
<view id="top">
|
|
|
- <view class="video_box" v-if="!startStatus">
|
|
|
+ <view class="video_box" v-if="!playVid">
|
|
|
<image
|
|
|
:src="$method.splitImgHost(goodsData.coverUrl)"
|
|
|
mode="widthFix"
|
|
@@ -17,9 +17,8 @@
|
|
|
</view>
|
|
|
<view v-else>
|
|
|
<my-player
|
|
|
- v-if="playVID"
|
|
|
ref="player"
|
|
|
- :playVid="playVID"
|
|
|
+ :playVid="playVid"
|
|
|
:autoplay="autoplay"
|
|
|
:allowSeek="isAllowSeek"
|
|
|
:playbackRate="playbackRate"
|
|
@@ -91,17 +90,9 @@
|
|
|
</view>
|
|
|
<course-tree
|
|
|
v-if="sectionItem.id || sectionItem.sectionId"
|
|
|
- :orderGoodsId="orderGoodsId"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
- :courseId="courseId"
|
|
|
- :learningOrder="orderNum"
|
|
|
- :goodsId="goodsId"
|
|
|
- :gradeId="gradeId"
|
|
|
:isRebuild="false"
|
|
|
:isBuy="true"
|
|
|
- :goodsType="1"
|
|
|
- :menuAllList="menuAllList"
|
|
|
- :sectionItem="sectionItem"
|
|
|
@isHaverebuild="isHaverebuild = true"
|
|
|
></course-tree>
|
|
|
</view>
|
|
@@ -111,12 +102,7 @@
|
|
|
</view>
|
|
|
<!--笔记 -->
|
|
|
<view v-if="current == 2">
|
|
|
- <note-Box
|
|
|
- :isPlayRebuild="sectionItem.rebuild"
|
|
|
- :refPlv="refPlv"
|
|
|
- @jumpNote="jumpNote"
|
|
|
- :params="params()"
|
|
|
- ></note-Box>
|
|
|
+ <note-Box @jumpNote="jumpNote"></note-Box>
|
|
|
</view>
|
|
|
<!--答疑 -->
|
|
|
<view v-if="current == 3">
|
|
@@ -126,17 +112,9 @@
|
|
|
<view v-if="current == 4">
|
|
|
<course-tree
|
|
|
v-if="sectionItem.id || sectionItem.sectionId"
|
|
|
- :orderGoodsId="orderGoodsId"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
- :courseId="courseId"
|
|
|
- :learningOrder="orderNum"
|
|
|
- :goodsId="goodsId"
|
|
|
- :gradeId="gradeId"
|
|
|
:isRebuild="true"
|
|
|
:isBuy="true"
|
|
|
- :goodsType="1"
|
|
|
- :menuAllList="menuAllList"
|
|
|
- :sectionItem="sectionItem"
|
|
|
></course-tree>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -149,7 +127,6 @@
|
|
|
width="650rpx"
|
|
|
height="622rpx"
|
|
|
:mask-close-able="false"
|
|
|
- @close="closeNotice"
|
|
|
>
|
|
|
<view class="content">
|
|
|
<view class="title">学员须知</view>
|
|
@@ -164,12 +141,13 @@
|
|
|
</scroll-view>
|
|
|
<view
|
|
|
class="had_read"
|
|
|
- :class="{ gray: CountTo >= 0 }"
|
|
|
+ :class="{ gray: CountTo > 0 }"
|
|
|
@click="noticeConfirm()"
|
|
|
>
|
|
|
- <text v-if="CountTo >= 0">请阅读学员须知,30s后可关闭</text>
|
|
|
+ <text v-if="CountTo > 0"
|
|
|
+ >请阅读学员须知,{{ " " + CountTo + "s" }}后可关闭</text
|
|
|
+ >
|
|
|
<text v-else>我已阅读学员须知</text>
|
|
|
- <text v-if="CountTo >= 0">{{ " " + CountTo + "s" }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
@@ -331,15 +309,12 @@ export default {
|
|
|
markContent: "http://admin.zhujianpeixun.com/",
|
|
|
showMark: false,
|
|
|
hasStart: false,
|
|
|
- channelItem: null,
|
|
|
lockTimer: null,
|
|
|
orderGoodsId: 0,
|
|
|
noticeShow: false,
|
|
|
enableAutoRotation: true,
|
|
|
showSet: false,
|
|
|
- startStatus: false,
|
|
|
courseId: 0,
|
|
|
- menuList: [],
|
|
|
current: 0,
|
|
|
vid: "",
|
|
|
goodsId: 0,
|
|
@@ -369,7 +344,6 @@ export default {
|
|
|
photoHistoryList: [], //已拍照历史的下标点
|
|
|
sectionItem: {},
|
|
|
uploadLock: false, //上传图片
|
|
|
- isPlayRebuild: false, //是否正在播放重修视频needOpen
|
|
|
isRebuild: false, //视频是否从重修目录点击
|
|
|
clearTimer: null,
|
|
|
livingItem: "",
|
|
@@ -385,9 +359,8 @@ export default {
|
|
|
compareFaceData: 0, // 拍照匹配相似度
|
|
|
prendreAutoCarme: false, // 是否发起授权相机
|
|
|
studyTimer: null, // 学习记录定时器
|
|
|
- CountTo: 30, // 倒计时
|
|
|
+ CountTo: 0, // 倒计时
|
|
|
CountTo1: 0,
|
|
|
- handoutTipLength: 0,
|
|
|
menuAllList: [],
|
|
|
curPlayIndex: 0, // 正在播放的节的下标
|
|
|
faceUrl: "",
|
|
@@ -404,13 +377,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters([
|
|
|
- "userInfo",
|
|
|
- "playSectionId",
|
|
|
- "playChannelId",
|
|
|
- "playVID",
|
|
|
- "config",
|
|
|
- ]),
|
|
|
+ ...mapGetters(["userInfo", "playSectionId", "config"]),
|
|
|
playSecIsLearn() {
|
|
|
return false;
|
|
|
return this.sectionItem.learning != 1;
|
|
@@ -458,6 +425,12 @@ export default {
|
|
|
sectionId() {
|
|
|
return this.sectionItem.sectionId || this.sectionItem.id;
|
|
|
},
|
|
|
+ playVid() {
|
|
|
+ return this.sectionItem.recordingUrl;
|
|
|
+ },
|
|
|
+ isPlayRebuild() {
|
|
|
+ return this.sectionItem.rebuild != 1;
|
|
|
+ },
|
|
|
},
|
|
|
async onLoad(option) {
|
|
|
if (option.isOther) {
|
|
@@ -517,7 +490,6 @@ export default {
|
|
|
lockAction();
|
|
|
this.lockTimer = setInterval(lockAction, 10000);
|
|
|
await this.isCanLearn();
|
|
|
- !this.userInfo && this.$api.refreshUserInfo();
|
|
|
this.courseCourseList();
|
|
|
},
|
|
|
// 七大员是否能进入学习
|
|
@@ -564,7 +536,6 @@ export default {
|
|
|
},
|
|
|
courseCourseList() {
|
|
|
this.courseList = [];
|
|
|
- this.menuList = [];
|
|
|
this.photoConfig = false;
|
|
|
this.$api
|
|
|
.courseCourseList({
|
|
@@ -575,18 +546,14 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.courseList = res.data.rows;
|
|
|
- // 科目
|
|
|
- let allItem = [{ subjectId: 0, subjectName: "所有" }];
|
|
|
- let ids = [];
|
|
|
- const newArr = [];
|
|
|
- this.courseList.forEach((item) => {
|
|
|
- if (ids.indexOf(item.subjectId) == -1) {
|
|
|
- ids.push(item.subjectId);
|
|
|
- newArr.push(item);
|
|
|
- }
|
|
|
- });
|
|
|
- this.subList = [...allItem, ...newArr];
|
|
|
if (res.data.total > 1) {
|
|
|
+ // 科目
|
|
|
+ this.subList = [{ subjectId: 0, subjectName: "所有" }];
|
|
|
+ this.courseList.forEach((item) => {
|
|
|
+ if (!this.subList.find((e) => e.subjectId == item.subjectId)) {
|
|
|
+ this.subList.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
this.getUserWatchLast();
|
|
|
} else {
|
|
|
this.originOnShow();
|
|
@@ -742,56 +709,19 @@ export default {
|
|
|
},
|
|
|
// 原来的mouted内容
|
|
|
originMounted() {
|
|
|
- uni.$on("changeSection", (oldSectionId) => {
|
|
|
- console.log(
|
|
|
- "切换课程-originMounted->playVID:",
|
|
|
- this.playVID,
|
|
|
- oldSectionId
|
|
|
- );
|
|
|
- this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
|
|
|
- this.clearPauseTimer();
|
|
|
- this.hasStart = false;
|
|
|
- this.photoConfig = false;
|
|
|
- //清除直播
|
|
|
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
- // 防止原先初始化错误
|
|
|
+ uni.$on("getSection", (item) => {
|
|
|
if (!this.refPlv) {
|
|
|
this.refPlv = this.$refs.player;
|
|
|
}
|
|
|
- this.postStudyRecord(0, oldSectionId);
|
|
|
- });
|
|
|
- uni.$on("getSection", (item) => {
|
|
|
+ this.postStudyRecord(0);
|
|
|
//清除直播
|
|
|
this.studyTimer && clearInterval(this.studyTimer);
|
|
|
this.hasStart = false;
|
|
|
- this.isPlayRebuild = item.rebuild;
|
|
|
this.photoConfig = false;
|
|
|
- this.sectionItem = item;
|
|
|
this.moduleId = item.moduleId || null;
|
|
|
this.chapterId = item.chapterId || null;
|
|
|
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
this.playVideo(item);
|
|
|
});
|
|
|
- uni.$on("levelId", (item) => {
|
|
|
- let arr = item.split("-");
|
|
|
- //点击节获取的各层级ID
|
|
|
- this.moduleId = arr[0];
|
|
|
- this.chapterId = arr[1];
|
|
|
- });
|
|
|
- uni.$on("getChannel", (item) => {
|
|
|
- //清除录播
|
|
|
- this.studyTimer && clearInterval(this.studyTimer);
|
|
|
- this.hasStart = false;
|
|
|
- this.$store.commit("setPlayVID", { playVID: null });
|
|
|
-
|
|
|
- this.moduleId = item.moduleId;
|
|
|
- this.chapterId = item.chapterId;
|
|
|
- this.$store.commit("setPlaySectionId", {
|
|
|
- playSectionId: item.sectionId || item.menuId,
|
|
|
- });
|
|
|
- this.playChannel(item);
|
|
|
- this.channelItem = item;
|
|
|
- });
|
|
|
uni.$on("isRebuild", (item) => {
|
|
|
this.isRebuild = item;
|
|
|
});
|
|
@@ -812,15 +742,14 @@ export default {
|
|
|
},
|
|
|
// 原来onUnload里面的内容
|
|
|
originUnload() {
|
|
|
- if (this.playSectionId > 0 && this.hasStart) {
|
|
|
+ if (this.sectionId > 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 });
|
|
|
+
|
|
|
//移除所有的事件监听器
|
|
|
uni.$off();
|
|
|
this.clearTimer && clearTimeout(this.clearTimer);
|
|
@@ -921,20 +850,15 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- closeNotice() {
|
|
|
- this.$api
|
|
|
- .baseHandoutTip({
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- },
|
|
|
noticeConfirm() {
|
|
|
- if (this.CountTo < 0) {
|
|
|
+ if (this.CountTo <= 0) {
|
|
|
this.noticeShow = false;
|
|
|
- if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
|
|
|
- this.autoplay = true;
|
|
|
- this.refPlv.resumeVideo();
|
|
|
+ if (this.autoplay) {
|
|
|
+ this.refPlv && this.refPlv.resumeVideo();
|
|
|
}
|
|
|
+ this.$api.baseHandoutTip({
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
baseHandoutTipList() {
|
|
@@ -943,19 +867,15 @@ export default {
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- this.handoutTipLength = res.data.rows.length;
|
|
|
if (res.data.rows.length == 0) {
|
|
|
this.noticeShow = true;
|
|
|
- if (this.CountTo == 30) {
|
|
|
- var timer = setInterval(() => {
|
|
|
- this.CountTo--;
|
|
|
- if (this.CountTo < 0) {
|
|
|
- clearInterval(timer);
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.CountTo = -1;
|
|
|
+ this.CountTo = 30;
|
|
|
+ var timer = setInterval(() => {
|
|
|
+ this.CountTo--;
|
|
|
+ if (this.CountTo < 0) {
|
|
|
+ clearInterval(timer);
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1005,7 +925,7 @@ export default {
|
|
|
.then(async (res) => {
|
|
|
this.photoHistoryList[this.photoIndex] = true;
|
|
|
await this.postStudyRecord();
|
|
|
- if (!this.erJianErZao && this.isReach) {
|
|
|
+ if (this.erJianErZao && this.isReach) {
|
|
|
await this.postStudyRecord(1);
|
|
|
cb();
|
|
|
this.nextSection();
|
|
@@ -1049,7 +969,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
studyRecordQueryLiveLast() {
|
|
|
- // /study/record/queryLiveLast
|
|
|
this.$api
|
|
|
.studyRecordQueryLiveLast({
|
|
|
gradeId: this.gradeId,
|
|
@@ -1057,10 +976,6 @@ export default {
|
|
|
courseId: this.courseId,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- console.log(
|
|
|
- "🚀 ~ file: detail.vue:1071 ~ .then ~ res:",
|
|
|
- res.data.data
|
|
|
- );
|
|
|
let { data } = res.data;
|
|
|
if (!data.sectionId) {
|
|
|
data = this.menuAllList[0];
|
|
@@ -1251,7 +1166,7 @@ export default {
|
|
|
let data = {
|
|
|
...this.params(["orderGoodsId", "goodsId", "courseId", "gradeId"]),
|
|
|
photo: this.ossAvatarUrl,
|
|
|
- sectionId: this.playSectionId,
|
|
|
+ sectionId: this.sectionId,
|
|
|
photoTime: this.playTime || 0,
|
|
|
photoIndex: postTime ? -2 : this.photoIndex, //从0算起,-2只提交随机时间
|
|
|
photoNum: this.photoNum,
|
|
@@ -1372,10 +1287,6 @@ export default {
|
|
|
async playVideo(item) {
|
|
|
this.sectionItem = item;
|
|
|
let { learning, videoCurrentTime, sectionId, recordingUrl } = item;
|
|
|
- console.log(this.sectionItem, "this.sectionItem");
|
|
|
- if (this.timer) {
|
|
|
- clearInterval(this.timer);
|
|
|
- }
|
|
|
this.recordObj = videoCurrentTime
|
|
|
? { videoCurrentTime }
|
|
|
: await this.getRecordLast(item);
|
|
@@ -1383,13 +1294,9 @@ export default {
|
|
|
if ((this.photoNum > 0 || this.jjShiGongYuan) && learning != 1) {
|
|
|
await this.getPhotoLastRecord();
|
|
|
}
|
|
|
- this.$store.commit("setPlayVID", {
|
|
|
- playVID: recordingUrl,
|
|
|
- });
|
|
|
this.$store.commit("setPlaySectionId", {
|
|
|
playSectionId: sectionId,
|
|
|
});
|
|
|
- this.startStatus = true;
|
|
|
if (this.refPlv) {
|
|
|
this.refPlv.changeVid({
|
|
|
vid: recordingUrl,
|
|
@@ -1416,7 +1323,7 @@ export default {
|
|
|
|
|
|
jumpNote(item) {
|
|
|
this.$u.toast("即将跳到笔记位置");
|
|
|
- if (this.playSectionId != item.sectionId) {
|
|
|
+ if (this.sectionId != item.sectionId) {
|
|
|
this.initPlayVideo({
|
|
|
sectionType: 1,
|
|
|
...item,
|
|
@@ -1459,9 +1366,6 @@ export default {
|
|
|
if (currentTime < 10 && !this.ossAvatarUrl) {
|
|
|
return;
|
|
|
}
|
|
|
- if (this.playChannelId > 0) {
|
|
|
- currentTime = 2; //直播无法获取,无论开始结束都传2秒
|
|
|
- }
|
|
|
let self = this;
|
|
|
let data = {
|
|
|
...this.params([
|
|
@@ -1498,16 +1402,9 @@ export default {
|
|
|
let { code, msg } = res.data;
|
|
|
if (code == 200) {
|
|
|
if (status > 0) {
|
|
|
+ // 刷新数据
|
|
|
+ uni.$emit("playEnd");
|
|
|
this.studyRecordMenuAllList();
|
|
|
- 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
|
|
|
-
|
|
|
- uni.$emit("playNext" + playNextIdisRebuild, {
|
|
|
- fromRebuild: this.isRebuild,
|
|
|
- }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
|
|
|
- uni.$emit("playNext" + playNextId); //通知播放结束
|
|
|
}
|
|
|
self.ossAvatarUrl = "";
|
|
|
} else if (code == 600) {
|
|
@@ -1576,7 +1473,7 @@ export default {
|
|
|
...this.params(),
|
|
|
moduleId: this.moduleId || 0,
|
|
|
chapterId: this.chapterId || 0,
|
|
|
- sectionId: this.playSectionId || 0,
|
|
|
+ sectionId: this.sectionId || 0,
|
|
|
fromPlat: 1, //来源平台 1小程序 2PC网站
|
|
|
goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
|
|
|
},
|
|
@@ -1584,16 +1481,16 @@ export default {
|
|
|
},
|
|
|
timeupdate(time) {
|
|
|
// console.log("播放中", time);
|
|
|
+ if (this.noticeShow) {
|
|
|
+ this.refPlv.playPause();
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.playTime = time;
|
|
|
this.clearPauseTimer();
|
|
|
this.timeEvent(time);
|
|
|
},
|
|
|
playing() {
|
|
|
console.log("playing");
|
|
|
- if (this.noticeShow) {
|
|
|
- this.refPlv.playPause();
|
|
|
- return;
|
|
|
- }
|
|
|
this.studyLog();
|
|
|
if (!this.recordObj.videoCurrentTime) {
|
|
|
this.postStudyRecord(0);
|
|
@@ -1609,17 +1506,17 @@ export default {
|
|
|
this.refPlv.exitFullScreen();
|
|
|
},
|
|
|
pause() {
|
|
|
+ uni.$emit("playEnd");
|
|
|
this.erJianErZaoPauseTip();
|
|
|
- clearInterval(this.timer);
|
|
|
clearInterval(this.studyTimer);
|
|
|
},
|
|
|
async ended() {
|
|
|
+ console.log("🚀 ~ file: detail.vue:1519 ~ ended ~ ended:", "结束");
|
|
|
this.hasStart = false;
|
|
|
uni.showToast({
|
|
|
icon: "none",
|
|
|
title: "播放完毕",
|
|
|
});
|
|
|
- clearInterval(this.timer);
|
|
|
clearInterval(this.studyTimer);
|
|
|
await this.postStudyRecord(1);
|
|
|
this.nextSection();
|
|
@@ -1638,7 +1535,7 @@ export default {
|
|
|
let i_chapterId = item.chapterId || 0;
|
|
|
let i_moduleId = item.moduleId || 0;
|
|
|
return (
|
|
|
- i_sectionId == this.playSectionId &&
|
|
|
+ i_sectionId == this.sectionId &&
|
|
|
i_chapterId == this.chapterId &&
|
|
|
i_moduleId == this.moduleId
|
|
|
);
|
|
@@ -1693,10 +1590,6 @@ export default {
|
|
|
this.$store.commit("setPlaySectionId", {
|
|
|
playSectionId: data.sectionId,
|
|
|
});
|
|
|
- this.$store.commit("setPlayVID", {
|
|
|
- playVID: data.recordingUrl,
|
|
|
- });
|
|
|
-
|
|
|
this.hasStart = false;
|
|
|
this.photoConfig = false;
|
|
|
this.sectionItem = data;
|
|
@@ -1709,9 +1602,6 @@ export default {
|
|
|
this.$store.commit("setPlaySectionId", {
|
|
|
playSectionId: data.sectionId,
|
|
|
});
|
|
|
- this.$store.commit("setPlayVID", {
|
|
|
- playVID: data.recordingUrl,
|
|
|
- });
|
|
|
this.sectionItem = data;
|
|
|
this.playVideo(data);
|
|
|
}
|
|
@@ -1726,10 +1616,6 @@ export default {
|
|
|
playError(e) {
|
|
|
console.log(e);
|
|
|
},
|
|
|
- //拍照报错
|
|
|
- error(e) {
|
|
|
- console.log(e.detail);
|
|
|
- },
|
|
|
async userConfirmInfoDetail() {
|
|
|
let info = await this.$api.userConfirmInfoDetail({
|
|
|
orderGoodsId: this.orderGoodsId,
|