|
|
@@ -84,7 +84,18 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="course_name">
|
|
|
- <u-row>
|
|
|
+ <view class="course_titles">
|
|
|
+ <view class="video_t1" :class="{'one': !goodsData.buyNote}">{{ detail.courseName }}</view>
|
|
|
+ <view class="notice_wrap" v-if="goodsData.buyNote">
|
|
|
+ <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="courseTotal > 1" class="toggle_course" @click="changeCourses()">
|
|
|
+ <image class="img" src="/pages3/static/imgs/toggle.png"></image>
|
|
|
+ <view class="toggle_name">切换课程</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="courseTotal > 1" class="numbers">共{{ courseTotal }}门</view>
|
|
|
+ </view>
|
|
|
+ <!-- <u-row>
|
|
|
<u-col span="10">
|
|
|
<view class="video_t1">{{ detail.courseName }}</view>
|
|
|
</u-col>
|
|
|
@@ -93,7 +104,7 @@
|
|
|
<view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
|
|
|
</div>
|
|
|
</u-col>
|
|
|
- </u-row>
|
|
|
+ </u-row> -->
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
|
<view>
|
|
|
@@ -125,6 +136,7 @@
|
|
|
<!--模块 -->
|
|
|
<view v-if="item.type == 1"
|
|
|
><courseModule
|
|
|
+ v-if="reStart"
|
|
|
:isLive="true"
|
|
|
:orderGoodsId="orderGoodsId"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
@@ -142,6 +154,7 @@
|
|
|
<!--章 -->
|
|
|
<view v-if="item.type == 2"
|
|
|
><courseChapter
|
|
|
+ v-if="reStart"
|
|
|
:isLive="true"
|
|
|
:orderGoodsId="orderGoodsId"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
@@ -155,11 +168,13 @@
|
|
|
:isBuy="true"
|
|
|
:menuItem="item"
|
|
|
:levelId="'0-' + item.menuId"
|
|
|
+ :goodsType='6'
|
|
|
></courseChapter
|
|
|
></view>
|
|
|
<!--节 -->
|
|
|
<view v-if="item.type == 3"
|
|
|
><courseSection
|
|
|
+ v-if="reStart"
|
|
|
:isLive="true"
|
|
|
:orderGoodsId="orderGoodsId"
|
|
|
:sectionMaxNum="goodsData.sectionMaxNum"
|
|
|
@@ -539,7 +554,37 @@
|
|
|
</div>
|
|
|
</u-popup>
|
|
|
|
|
|
-
|
|
|
+ <!-- 切换课程弹窗 -->
|
|
|
+ <u-popup v-model="toggleCourseShow" mode="bottom" border-radius="40" :mask-close-able='false'>
|
|
|
+ <view class="popup_box">
|
|
|
+ <view class="check_head">
|
|
|
+ <view class="headers">
|
|
|
+ <view class="grade">切换课程</view>
|
|
|
+ <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
|
|
|
+ </view>
|
|
|
+ <view class="coruse_num">共{{ courseTotal }}门</view>
|
|
|
+ </view>
|
|
|
+ <view class="check_con">
|
|
|
+ <scroll-view scroll-y="true" style="height: 700rpx;">
|
|
|
+ <view class="course_items" v-for="(item, index) in courseList" :key="index">
|
|
|
+ <view class="course_lefts">
|
|
|
+ <view class="course_title">{{ item.courseName }}</view>
|
|
|
+ <!-- <view class="course_pros">
|
|
|
+ 学习进度
|
|
|
+ <text> {{ item.stuAllNum + item.recordNum }}/{{ item.secAllNum + item.examNum}}</text>
|
|
|
+ </view> -->
|
|
|
+ </view>
|
|
|
+ <view class="course_rights" @click="jump(item, index)">
|
|
|
+ <view class="cicles">
|
|
|
+ <u-icon name="arrow-right" color="#498AFE" size="20"></u-icon>
|
|
|
+ </view>
|
|
|
+ <view class="intoStudy">进入学习</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -672,61 +717,45 @@ export default {
|
|
|
historyChatMsgList:[],
|
|
|
livingItem:'',
|
|
|
bottomHeight: 0,
|
|
|
+ toggleCourseShow: false, // 切换课程弹窗
|
|
|
+ informId: '', //消息id,从公众号消息模板进来的才有
|
|
|
+ courseList: [], // 课程列表
|
|
|
+ courseTotal: 0,
|
|
|
+ options: {},
|
|
|
+ reStart: false, // 是否显示模块/章/节
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- console.log('option====', option)
|
|
|
- this.courseId = Number(option.courseId);
|
|
|
+ console.log('====option', option, this.playChannelId)
|
|
|
+ this.options = option
|
|
|
+ this.courseId = option.courseId || ''
|
|
|
this.goodsId = Number(option.goodsId);
|
|
|
// this.gradeId = option.gradeId || 0
|
|
|
this.orderGoodsId = Number(option.orderGoodsId) || '';
|
|
|
- this.updateLiveLast(null)
|
|
|
- this.courseDetail();
|
|
|
- this.getGoodsDetail();
|
|
|
- this.getAnswerList();
|
|
|
- this.studyRecordMenuAllList();
|
|
|
- this.answerTimer = setInterval(() => {
|
|
|
- this.getAnswerList();
|
|
|
- }, 5000);
|
|
|
- let noteSecond = Number(option.noteSecond);
|
|
|
- if (noteSecond > 0) {
|
|
|
- //我的消息跳过来,播放节
|
|
|
- let item = {
|
|
|
- sectionId: Number(option.sectionId),
|
|
|
- recordingUrl: option.recordingUrl,
|
|
|
- noteSecond: noteSecond,
|
|
|
- studyDuration: noteSecond,
|
|
|
- };
|
|
|
- let playNextId = `moduleId${option.moduleId}chapterId${
|
|
|
- option.chapterId
|
|
|
- }sectionId${option.sectionId}${option.isRebuild ? "isRebuild" : ""}`;
|
|
|
- this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
|
|
|
- this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
|
|
|
- this.$store.commit("updatePlayNextId", playNextId);
|
|
|
- console.log("this.playNoteVideo");
|
|
|
-
|
|
|
- this.playNoteVideo(item)
|
|
|
- } else {
|
|
|
- this.studyRecordQueryLiveLast();
|
|
|
- }
|
|
|
+
|
|
|
+ // 公众号模板消息的数据埋点
|
|
|
+ if (option.informId) { // 从公众号消息点击进来上报一次,其他地方进来和没登录需要跳到登录页,登录后返回的不需要上报
|
|
|
+ this.informId = option.informId
|
|
|
+ this.clickOfficial()
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$store.getters.dictObj;
|
|
|
+
|
|
|
},
|
|
|
onShow() {
|
|
|
- var self = this;
|
|
|
+ if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.courseCourseList();
|
|
|
//相机授权
|
|
|
// this.userConfirmInfoDetail().then(res => {
|
|
|
|
|
|
// })
|
|
|
-
|
|
|
- // this.getbaseprofiletplists();
|
|
|
-
|
|
|
- console.log(this.gradeId, 7512);
|
|
|
+ // this.getbaseprofiletplists();
|
|
|
},
|
|
|
- onHide() {
|
|
|
-
|
|
|
- },
|
|
|
onUnload() {
|
|
|
if (this.playSectionId > 0 && this.hasStart) {
|
|
|
//退出提交记录
|
|
|
@@ -757,56 +786,161 @@ export default {
|
|
|
// websocket.sendMsg("delAction");
|
|
|
},
|
|
|
mounted() {
|
|
|
- uni.$on("changeSection", (oldSectionId) => {
|
|
|
- console.log(this.playVID);
|
|
|
- this.hasStart = false;
|
|
|
- this.photoConfig = false;
|
|
|
- this.photoIndex = 0;
|
|
|
- var polyvPlayerContext = this.selectComponent("#playerVideo");
|
|
|
- if (polyvPlayerContext) {
|
|
|
- //解决同个节视频切换问题
|
|
|
- polyvPlayerContext.seek(0);
|
|
|
- polyvPlayerContext.pause();
|
|
|
- }
|
|
|
- //清除直播
|
|
|
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
- this.postStudyRecord(0, oldSectionId);
|
|
|
- });
|
|
|
- uni.$on("getSection", (item) => {
|
|
|
- //清除直播
|
|
|
- this.hasStart = false;
|
|
|
- this.isPlayRebuild = item.rebuild;
|
|
|
- this.photoConfig = false;
|
|
|
- this.photoIndex = 0;
|
|
|
- this.sectionItem = item;
|
|
|
- this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
- //获取拍照历史
|
|
|
- this.getPhotoLastRecord();
|
|
|
- this.polyvLiveHistoryChatMsgList();
|
|
|
- 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.hasStart = false;
|
|
|
- this.$store.commit("setPlayVID", { playVID: null });
|
|
|
- this.getPhotoLastRecord();
|
|
|
- this.playChannel(item);
|
|
|
- this.channelItem = item;
|
|
|
- });
|
|
|
- uni.$on("isRebuild", (item) => {
|
|
|
- console.log(item);
|
|
|
- this.isRebuild = item;
|
|
|
- });
|
|
|
- this.updateChapterOpen(true);
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(["updateChapterOpen","updateLiveLast"]),
|
|
|
+ // 新增微信公众号模板消息点击数据
|
|
|
+ clickOfficial() {
|
|
|
+ this.$http({
|
|
|
+ url: '/data/click',
|
|
|
+ method: 'post',
|
|
|
+ data: { informId: this.informId }
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ console.log('埋点')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ courseCourseList() {
|
|
|
+ console.log('ahhhhhhh直播hhhhhh')
|
|
|
+ this.courseList = []
|
|
|
+ this.$api.courseCourseList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ gradeId: this.gradeId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.courseList.push.apply(this.courseList, res.data.rows)
|
|
|
+ this.courseTotal = res.data.total || 0
|
|
|
+ if(res.data.total > 1) {
|
|
|
+ this.getUserWatchLast()
|
|
|
+ } else if(res.data.total == 1) {
|
|
|
+ console.log('111->this.courseId', this.courseId)
|
|
|
+ this.originOnShow()
|
|
|
+ this.originOnMount()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 查询用户最后一次看的录播的信息
|
|
|
+ getUserWatchLast() {
|
|
|
+ this.$http({
|
|
|
+ url: '/study/record/getUserWatchLast',
|
|
|
+ method: 'get',
|
|
|
+ data: {
|
|
|
+ goodsId: this.goodsId
|
|
|
+ }
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ if (res.data.data && Object.keys(res.data.data).length) { //有最后一次看的录播的信息
|
|
|
+ this.courseId = res.data.data.courseId
|
|
|
+ this.originOnShow()
|
|
|
+ this.originOnMount()
|
|
|
+ } else {
|
|
|
+ this.toggleCourseShow = true
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ originOnShow() {
|
|
|
+ this.updateLiveLast(null)
|
|
|
+ this.courseDetail();
|
|
|
+ this.getGoodsDetail();
|
|
|
+ this.getAnswerList();
|
|
|
+ this.studyRecordMenuAllList();
|
|
|
+ this.answerTimer = setInterval(() => {
|
|
|
+ this.getAnswerList();
|
|
|
+ }, 5000);
|
|
|
+ let option = this.options
|
|
|
+ let noteSecond = Number(option.noteSecond);
|
|
|
+ if (noteSecond > 0) {
|
|
|
+ //我的消息跳过来,播放节
|
|
|
+ let item = {
|
|
|
+ sectionId: Number(option.sectionId),
|
|
|
+ recordingUrl: option.recordingUrl,
|
|
|
+ noteSecond: noteSecond,
|
|
|
+ studyDuration: noteSecond,
|
|
|
+ };
|
|
|
+ let playNextId = `moduleId${option.moduleId}chapterId${
|
|
|
+ option.chapterId
|
|
|
+ }sectionId${option.sectionId}${option.isRebuild ? "isRebuild" : ""}`;
|
|
|
+ this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
|
|
|
+ this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
|
|
|
+ this.$store.commit("updatePlayNextId", playNextId);
|
|
|
+ // console.log("this.playNoteVideo");
|
|
|
+
|
|
|
+ this.playNoteVideo(item)
|
|
|
+ } else {
|
|
|
+ this.studyRecordQueryLiveLast();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ originOnMount() {
|
|
|
+ uni.$on("changeSection", (oldSectionId) => {
|
|
|
+ // console.log(this.playVID);
|
|
|
+ this.hasStart = false;
|
|
|
+ this.photoConfig = false;
|
|
|
+ this.photoIndex = 0;
|
|
|
+ var polyvPlayerContext = this.selectComponent("#playerVideo");
|
|
|
+ if (polyvPlayerContext) {
|
|
|
+ //解决同个节视频切换问题
|
|
|
+ polyvPlayerContext.seek(0);
|
|
|
+ polyvPlayerContext.pause();
|
|
|
+ }
|
|
|
+ //清除直播
|
|
|
+ this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
+ this.postStudyRecord(0, oldSectionId);
|
|
|
+ });
|
|
|
+ uni.$on("getSection", (item) => {
|
|
|
+ // console.log('触发事件-=====')
|
|
|
+ //清除直播
|
|
|
+ this.hasStart = false;
|
|
|
+ this.isPlayRebuild = item.rebuild;
|
|
|
+ this.photoConfig = false;
|
|
|
+ this.photoIndex = 0;
|
|
|
+ this.sectionItem = item;
|
|
|
+ this.$store.commit("setPlayChannelId", { playChannelId: 0 });
|
|
|
+ //获取拍照历史
|
|
|
+ this.getPhotoLastRecord();
|
|
|
+ this.polyvLiveHistoryChatMsgList();
|
|
|
+ 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.hasStart = false;
|
|
|
+ this.$store.commit("setPlayVID", { playVID: null });
|
|
|
+ this.getPhotoLastRecord();
|
|
|
+ this.playChannel(item);
|
|
|
+ this.channelItem = item;
|
|
|
+ });
|
|
|
+ uni.$on("isRebuild", (item) => {
|
|
|
+ // console.log(item);
|
|
|
+ this.isRebuild = item;
|
|
|
+ });
|
|
|
+ this.updateChapterOpen(true);
|
|
|
+ },
|
|
|
+ changeCourses() {
|
|
|
+ this.toggleCourseShow = true
|
|
|
+ },
|
|
|
+ closePop() {
|
|
|
+ this.toggleCourseShow = false
|
|
|
+ },
|
|
|
+ // 进入学习
|
|
|
+ jump(item, index) {
|
|
|
+ this.courseId = item.courseId
|
|
|
+ this.reStart = false
|
|
|
+ this.toggleCourseShow = false
|
|
|
+ this.originOnShow()
|
|
|
+ this.originOnMount()
|
|
|
+ },
|
|
|
clickLeft() {
|
|
|
uni.navigateBack()
|
|
|
},
|
|
|
@@ -818,7 +952,7 @@ export default {
|
|
|
orderGoodsId:this.orderGoodsId,
|
|
|
courseId:this.courseId
|
|
|
}).then(res => {
|
|
|
- console.log(res,'liveres')
|
|
|
+ // console.log(res,'liveres')
|
|
|
this.updateLiveLast(res.data.data)
|
|
|
})
|
|
|
},
|
|
|
@@ -888,7 +1022,11 @@ export default {
|
|
|
let moduleId = item.moduleId || 0;
|
|
|
let chapterId = item.chapterId || 0;
|
|
|
let sectionId = item.sectionId || item.menuId;
|
|
|
- let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'§ionId='+sectionId+'&chapterId='+chapterId+'&moduleId='+moduleId)
|
|
|
+ let uuid = new Date().valueOf() + ""
|
|
|
+ // buyCourse 是否购买课程:1是 0否
|
|
|
+ let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+
|
|
|
+ item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'§ionId='+sectionId+
|
|
|
+ '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
|
|
|
uni.navigateTo({
|
|
|
url:`../../pages/webview/index?url=`+encode
|
|
|
})
|
|
|
@@ -1018,11 +1156,11 @@ export default {
|
|
|
timeInterval: postTime ? self.photoList.join(",") : "",
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
};
|
|
|
- console.log("提交接口", data);
|
|
|
+ // console.log("提交接口", data);
|
|
|
this.$api
|
|
|
.coursePhotoRecord(data)
|
|
|
.then((res) => {
|
|
|
- console.log(res,'postCoursePhotoRecord')
|
|
|
+ // console.log(res,'postCoursePhotoRecord')
|
|
|
if (res.data.code == 200) {
|
|
|
resolve();
|
|
|
} else {
|
|
|
@@ -1117,10 +1255,10 @@ export default {
|
|
|
// this.photoList.push(s)
|
|
|
// initSpace+=spaceTime
|
|
|
// }
|
|
|
- console.log(this.photoList, "随机拍照时间数组11", photoNum);
|
|
|
+ // console.log(this.photoList, "随机拍照时间数组11", photoNum);
|
|
|
this.postCoursePhotoRecord(true); //提交随机拍照时间数组
|
|
|
}
|
|
|
- console.log(this.photoList, "随机拍照时间数组");
|
|
|
+ // console.log(this.photoList, "随机拍照时间数组");
|
|
|
//兼容已有观看历史
|
|
|
for (let i = 0; i < this.photoList.length - 1; i++) {
|
|
|
if (
|
|
|
@@ -1128,12 +1266,10 @@ export default {
|
|
|
this.photoList[i + 1] > duration
|
|
|
) {
|
|
|
this.photoIndex = i + 1;
|
|
|
- // console.log("我的修改了photoIndex")
|
|
|
break;
|
|
|
}
|
|
|
if (duration > this.photoList[this.photoList.length - 1]) {
|
|
|
this.photoIndex = this.photoList.length - 1; //取最后一个下标
|
|
|
- // console.log("我的修改了photoIndex")
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -1174,9 +1310,9 @@ export default {
|
|
|
},
|
|
|
playerLiveStatusChange(e) {
|
|
|
const status = e.detail.status;
|
|
|
- console.log("直播状态", status);
|
|
|
+ // console.log("直播状态", status);
|
|
|
if (status === "live") {
|
|
|
- console.log("开始直播");
|
|
|
+ // console.log("开始直播");
|
|
|
//开始播放
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer);
|
|
|
@@ -1190,7 +1326,7 @@ export default {
|
|
|
//只有播放过的结束才提交,避免未开播触发结束
|
|
|
this.postStudyRecord(1);
|
|
|
}
|
|
|
- console.log("结束直播");
|
|
|
+ // console.log("结束直播");
|
|
|
this.livePlay = false;
|
|
|
// 未开始
|
|
|
}
|
|
|
@@ -1205,6 +1341,7 @@ export default {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
|
this.startStatus = true;
|
|
|
+ console.log('11111111111')
|
|
|
this.initLive();
|
|
|
},
|
|
|
setLiveOption(status) {
|
|
|
@@ -1236,7 +1373,6 @@ export default {
|
|
|
// }
|
|
|
},
|
|
|
async initLive() {
|
|
|
- console.log(this.playChannelId, 7111);
|
|
|
this.liveObj = await this.getLiveUid(this.playChannelId);
|
|
|
this.initLiveOk = true;
|
|
|
let optionsData = {};
|
|
|
@@ -1262,7 +1398,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
openSetting(res) {
|
|
|
- console.log(res, 98);
|
|
|
+ // console.log(res, 98);
|
|
|
},
|
|
|
getCameraSetting() {
|
|
|
const self = this;
|
|
|
@@ -1315,12 +1451,17 @@ export default {
|
|
|
this.needSeek = true; //需要跳转到播放记录
|
|
|
}
|
|
|
this.startStatus = true;
|
|
|
+ console.log('222222222222')
|
|
|
//获取节笔记
|
|
|
this.getNoteList();
|
|
|
},
|
|
|
//正常播放视频
|
|
|
async playVideo(item) {
|
|
|
console.log(item);
|
|
|
+ if (item.sectionType == 3) { // 回放的不播放
|
|
|
+ console.log('回放的不播放')
|
|
|
+ return
|
|
|
+ }
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
|
@@ -1337,6 +1478,7 @@ export default {
|
|
|
this.recordObj = await this.getRecordLast();
|
|
|
this.needSeek = true; //跳转到播放记录
|
|
|
this.startStatus = true;
|
|
|
+ console.log('3333333333333')
|
|
|
|
|
|
//获取节笔记
|
|
|
this.getNoteList();
|
|
|
@@ -1529,6 +1671,7 @@ export default {
|
|
|
}
|
|
|
let self = this;
|
|
|
let data = {
|
|
|
+ fromPlat: 1, //来源平台 1小程序 2网站
|
|
|
photo: self.ossAvatarUrl,
|
|
|
sectionId: parseInt(sectionId),
|
|
|
goodsId: parseInt(self.goodsId),
|
|
|
@@ -1727,7 +1870,27 @@ export default {
|
|
|
clearTimeout(this.toastTimer);
|
|
|
this.videoToastShow = false;
|
|
|
},
|
|
|
+ // 新增用户视频学习日志
|
|
|
+ studyLog() {
|
|
|
+ this.$http({
|
|
|
+ url: '/user/study/log',
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ courseId: this.courseId,
|
|
|
+ moduleId: this.moduleId || 0,
|
|
|
+ chapterId: this.chapterId || 0,
|
|
|
+ sectionId: this.playSectionId || 0,
|
|
|
+ fromPlat: 1, //来源平台 1小程序 2PC网站
|
|
|
+ goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ }
|
|
|
+ }).then((res) => {
|
|
|
+ console.log('直播的用户学习日志:', res)
|
|
|
+ })
|
|
|
+ },
|
|
|
onStateChange(newstate, oldstate) {
|
|
|
+ console.log('直播视频的开始播放事件', newstate.detail.newstate,this.needSeek)
|
|
|
if (newstate.detail.newstate == "playing") {
|
|
|
if (this.needSeek) {
|
|
|
var polyvPlayerContext = this.selectComponent("#playerVideo");
|
|
|
@@ -1748,12 +1911,15 @@ export default {
|
|
|
|
|
|
polyvPlayerContext.play();
|
|
|
this.needSeek = false;
|
|
|
+ // 新增用户视频学习日志
|
|
|
+ this.studyLog()
|
|
|
}
|
|
|
//开始播放
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer);
|
|
|
}
|
|
|
this.timer = setInterval(this.timeEvent, 1000); //定时器
|
|
|
+
|
|
|
}
|
|
|
if (newstate.detail.newstate == "pause") {
|
|
|
clearInterval(this.timer);
|
|
|
@@ -1922,8 +2088,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getGoodsDetail() {
|
|
|
+ console.log('goodsDetail(------')
|
|
|
let self = this;
|
|
|
- // app/common/goods/'+ data
|
|
|
+ // goods/'+ data
|
|
|
this.$api.goodsDetail(this.goodsId).then((res) => {
|
|
|
self.goodsData = res.data.data;
|
|
|
console.log(self.gradeId, "班级ID");
|
|
|
@@ -1958,6 +2125,7 @@ export default {
|
|
|
},
|
|
|
startVideo() {
|
|
|
this.startStatus = true;
|
|
|
+ console.log('444444444')
|
|
|
},
|
|
|
getAnswerList() {
|
|
|
let self = this;
|
|
|
@@ -1970,7 +2138,8 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getMenuList() {
|
|
|
- let self = this;
|
|
|
+ // let self = this;
|
|
|
+ // /course/menuList
|
|
|
this.$api
|
|
|
.reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
|
|
|
.then((res) => {
|
|
|
@@ -1982,8 +2151,8 @@ export default {
|
|
|
item.name = item.menuName;
|
|
|
item.menuType = item.type;
|
|
|
}
|
|
|
- self.menuList = res.data.rows;
|
|
|
-
|
|
|
+ this.menuList = res.data.rows;
|
|
|
+ this.reStart = true
|
|
|
for (let i = 0; i < res.data.rows.length; i++) {
|
|
|
if (res.data.rows[i].type == 1) {
|
|
|
this.menuIndex = [i];
|
|
|
@@ -1993,6 +2162,8 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ console.log('--this.menuList:-', this.menuList)
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -2066,6 +2237,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scope>
|
|
|
+@import '../polyv/css/detail.scss';
|
|
|
.top {
|
|
|
&__header {
|
|
|
position:relative;
|