|
|
@@ -176,6 +176,9 @@ export default {
|
|
|
liveLast: null,
|
|
|
isFirst: true,
|
|
|
backNum: -1, //返回页面数
|
|
|
+ buyCourse: 1, // 是否购买课程:1是 0否
|
|
|
+ identification: '', // 标识
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -191,7 +194,23 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ created() {
|
|
|
+ if (!this.$tools.isLogin()) {
|
|
|
+ console.log('1111',this.$route)
|
|
|
+ this.setCurrentRouter(this.$route);
|
|
|
+ this.$router.push({
|
|
|
+ path: "/login",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const { a } = this.$route.query
|
|
|
+ this.channelId = this.$route.params.channelId
|
|
|
+ // 有a字段是标识是复制链接进来
|
|
|
+ if (a ==1) {
|
|
|
+ this.getParam()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 下面不是复制链接进来的
|
|
|
this.sectionId = this.$route.query.sectionId;
|
|
|
this.goodsId = this.$route.query.goodsId;
|
|
|
this.courseId = this.$route.query.courseId;
|
|
|
@@ -200,6 +219,8 @@ export default {
|
|
|
this.chapterId = this.$route.query.chapterId;
|
|
|
this.moduleId = this.$route.query.moduleId;
|
|
|
this.channelId = this.$route.params.channelId;
|
|
|
+ this.identification = new Date().valueOf() + ""
|
|
|
+ this.buyCourse = 0
|
|
|
this.playVideo();
|
|
|
this.studyRecordGetLastLive();
|
|
|
},
|
|
|
@@ -208,7 +229,41 @@ export default {
|
|
|
clearInterval(this.timer);
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations(["getCartCount"]),
|
|
|
+ ...mapMutations(["setCurrentRouter", "getCartCount"]),
|
|
|
+ // 获取直播间跳转参数的接口
|
|
|
+ getParam() {
|
|
|
+ const { cid, gid, sid} = this.$route.query
|
|
|
+ this.$request({
|
|
|
+ url: '/course/check/watch/per',
|
|
|
+ method: 'get',
|
|
|
+ params: {
|
|
|
+ courseId: cid, //课程ID
|
|
|
+ goodsId: gid, // 商品id
|
|
|
+ sectionId: sid, // 节id
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ let item = res.data.data
|
|
|
+ console.log('item', item)
|
|
|
+ const {sectionId, goodsId, courseId, orderGoodsId, gradeId, chapterId, moduleId, buyCourse} = item
|
|
|
+ this.sectionId = sectionId
|
|
|
+ this.goodsId = goodsId
|
|
|
+ this.courseId = courseId
|
|
|
+ this.orderGoodsId = orderGoodsId
|
|
|
+ this.gradeId = +gradeId || 0
|
|
|
+ this.chapterId = chapterId
|
|
|
+ this.moduleId = moduleId
|
|
|
+ this.buyCourse = buyCourse
|
|
|
+ // console.log('url:', this.url)
|
|
|
+ this.identification = new Date().valueOf() + ""
|
|
|
+ this.playVideo();
|
|
|
+ this.studyRecordGetLastLive();
|
|
|
+ } else {
|
|
|
+ this.$u.toast(res.data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
close() {
|
|
|
this.signModal = false;
|
|
|
this.signSuccess = true;
|
|
|
@@ -218,6 +273,7 @@ export default {
|
|
|
},
|
|
|
polyvLivesign() {
|
|
|
console.log(this.channelId);
|
|
|
+ // /polyv/live/sign
|
|
|
this.$request
|
|
|
.polyvLivesign({
|
|
|
channelId: this.channelId,
|
|
|
@@ -246,6 +302,7 @@ export default {
|
|
|
*/
|
|
|
studyRecordGetLastLive() {
|
|
|
if (!this.gradeId && this.sectionId) {
|
|
|
+ // /study/record/getLastLive
|
|
|
this.$request
|
|
|
.studyRecordGetLastLive({
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
@@ -417,6 +474,8 @@ export default {
|
|
|
}
|
|
|
let self = this;
|
|
|
this.$request.studyRecord({
|
|
|
+ buyCourse: this.buyCourse,
|
|
|
+ identification: this.identification,
|
|
|
sectionId: parseInt(this.sectionId),
|
|
|
goodsId: parseInt(self.goodsId),
|
|
|
courseId: parseInt(self.courseId),
|