|
@@ -4,15 +4,24 @@
|
|
|
|
|
|
<div class="container">
|
|
<div class="container">
|
|
<div class="clearfix top-line">
|
|
<div class="clearfix top-line">
|
|
- <el-button
|
|
|
|
- v-if="backNum"
|
|
|
|
- class="float-right"
|
|
|
|
- type="primary"
|
|
|
|
- size="small"
|
|
|
|
- round
|
|
|
|
- @click="$router.go(backNum)"
|
|
|
|
- >返回</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="title">{{ goodsName }}</div>
|
|
|
|
+ <div class="bottoms">
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ round
|
|
|
|
+ @click="toShare()"
|
|
|
|
+ >分享</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="backNum"
|
|
|
|
+ class="float-right"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ round
|
|
|
|
+ @click="returnBack()"
|
|
|
|
+ >返回</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- pc端 -->
|
|
<!-- pc端 -->
|
|
@@ -111,7 +120,6 @@
|
|
|
|
|
|
<el-dialog
|
|
<el-dialog
|
|
width="400px"
|
|
width="400px"
|
|
- class="sign-success"
|
|
|
|
:visible.sync="signSuccess"
|
|
:visible.sync="signSuccess"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
@@ -122,6 +130,43 @@
|
|
<div class="title">签到成功!</div>
|
|
<div class="title">签到成功!</div>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 您还没有开通直播课程,无法观看 -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="提示"
|
|
|
|
+ :visible.sync="showAuth"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :close-on-press-escape="false"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ width="400px"
|
|
|
|
+ >
|
|
|
|
+ <div class="popCentent">
|
|
|
|
+ <div class="tips">您还没有开通直播课程,无法观看</div>
|
|
|
|
+ <div class="btns" @click="toAuth()">立即开通</div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 分享弹窗 -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="提示"
|
|
|
|
+ :visible.sync="shareShow"
|
|
|
|
+ width="600px"
|
|
|
|
+ >
|
|
|
|
+ <div v-loading="shareLoading" class="popShare">
|
|
|
|
+ <el-form ref="form" :model="formShare" label-width="130px">
|
|
|
|
+ <el-form-item label="观看链接(pc端):">
|
|
|
|
+ <div>
|
|
|
|
+ <span>{{ formShare.links }}</span>
|
|
|
|
+ <span class="ccopy" @click="copy()">复制</span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="观看二维码:">
|
|
|
|
+ <img class="ercode_pic" :src="formShare.ercode" alt="" />
|
|
|
|
+ <span class="ccopy" @click="download()">下载</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -179,7 +224,17 @@ export default {
|
|
backNum: -1, //返回页面数
|
|
backNum: -1, //返回页面数
|
|
buyCourse: 1, // 是否购买课程:1是 0否
|
|
buyCourse: 1, // 是否购买课程:1是 0否
|
|
identification: '', // 标识
|
|
identification: '', // 标识
|
|
-
|
|
|
|
|
|
+ goodsName: '', // 名称
|
|
|
|
+ checkStatus: 0, // 0没有权限,1有权限
|
|
|
|
+ goodsStatus: 0, // 0未上架,1上架
|
|
|
|
+ showAuth: false,
|
|
|
|
+ shareShow: false,
|
|
|
|
+ sectionType: '',
|
|
|
|
+ formShare: {
|
|
|
|
+ links: '',
|
|
|
|
+ ercode: '',
|
|
|
|
+ },
|
|
|
|
+ shareLoading: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -197,7 +252,7 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- console.log('是否登录了', this.$tools.isLogin())
|
|
|
|
|
|
+ console.log('是否登录了', this.$route.query)
|
|
if (!this.$tools.isLogin()) {
|
|
if (!this.$tools.isLogin()) {
|
|
this.setCurrentRouter(this.$route);
|
|
this.setCurrentRouter(this.$route);
|
|
this.$router.push({
|
|
this.$router.push({
|
|
@@ -222,8 +277,11 @@ export default {
|
|
this.chapterId = this.$route.query.chapterId;
|
|
this.chapterId = this.$route.query.chapterId;
|
|
this.moduleId = this.$route.query.moduleId;
|
|
this.moduleId = this.$route.query.moduleId;
|
|
this.channelId = this.$route.params.channelId;
|
|
this.channelId = this.$route.params.channelId;
|
|
|
|
+ this.goodsName = this.$route.query.goodsName
|
|
|
|
+ this.sectionType = this.$route.query.sectionType
|
|
this.identification = new Date().valueOf() + ""
|
|
this.identification = new Date().valueOf() + ""
|
|
this.buyCourse = 0
|
|
this.buyCourse = 0
|
|
|
|
+ // this.getParam()
|
|
this.playVideo();
|
|
this.playVideo();
|
|
this.studyRecordGetLastLive();
|
|
this.studyRecordGetLastLive();
|
|
},
|
|
},
|
|
@@ -234,9 +292,45 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(["setCurrentRouter", "getCartCount"]),
|
|
...mapMutations(["setCurrentRouter", "getCartCount"]),
|
|
|
|
+ returnBack() {
|
|
|
|
+ console.log('backNum', this.backNum)
|
|
|
|
+ if (this.backNum == 0) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/home'
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$router.go(this.backNum)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ toShare() {
|
|
|
|
+ this.shareLoading = true
|
|
|
|
+ this.shareShow = true
|
|
|
|
+ this.$axios({
|
|
|
|
+ url: '/course/watch/per',
|
|
|
|
+ method: 'get',
|
|
|
|
+ params: {
|
|
|
|
+ courseId: this.courseId, //课程ID
|
|
|
|
+ goodsId: this.goodsId, // 商品id
|
|
|
|
+ moduleId: this.moduleId || null,
|
|
|
|
+ chapterId: this.chapterId || null,
|
|
|
|
+ sectionId: this.sectionId, // 节id
|
|
|
|
+ sectionType: this.sectionType, //节类型 1录播 2直播 3回放
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.shareLoading = false
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.formShare.links = res.data.enCodePC
|
|
|
|
+ this.formShare.ercode = res.data.enCode
|
|
|
|
+ }
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ this.shareLoading = false
|
|
|
|
+ this.$message.warning(err.msg)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 获取直播间跳转参数的接口
|
|
// 获取直播间跳转参数的接口
|
|
getParam() {
|
|
getParam() {
|
|
const { cid, gid, sid} = this.$route.query
|
|
const { cid, gid, sid} = this.$route.query
|
|
|
|
+ console.log('cid, gid, sid', cid, gid, sid)
|
|
this.$axios({
|
|
this.$axios({
|
|
url: '/course/check/watch/per',
|
|
url: '/course/check/watch/per',
|
|
method: 'get',
|
|
method: 'get',
|
|
@@ -246,28 +340,51 @@ export default {
|
|
sectionId: sid, // 节id
|
|
sectionId: sid, // 节id
|
|
},
|
|
},
|
|
}).then((res) => {
|
|
}).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
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ let item = res.data
|
|
|
|
+ const {sectionId, goodsId, courseId, orderGoodsId, gradeId, chapterId, moduleId, buyCourse, sectionType} = item
|
|
this.goodsId = goodsId
|
|
this.goodsId = goodsId
|
|
|
|
+ this.sectionId = sectionId
|
|
this.courseId = courseId
|
|
this.courseId = courseId
|
|
this.orderGoodsId = orderGoodsId
|
|
this.orderGoodsId = orderGoodsId
|
|
this.gradeId = +gradeId || 0
|
|
this.gradeId = +gradeId || 0
|
|
this.chapterId = chapterId
|
|
this.chapterId = chapterId
|
|
this.moduleId = moduleId
|
|
this.moduleId = moduleId
|
|
this.buyCourse = buyCourse
|
|
this.buyCourse = buyCourse
|
|
- // console.log('url:', this.url)
|
|
|
|
- this.identification = new Date().valueOf() + ""
|
|
|
|
- this.playVideo();
|
|
|
|
- this.studyRecordGetLastLive();
|
|
|
|
- } else {
|
|
|
|
- this.$u.toast(res.data.msg)
|
|
|
|
|
|
+ this.goodsStatus = item.goodsStatus
|
|
|
|
+ this.goodsName = item.goodsName
|
|
|
|
+ this.sectionType = sectionType
|
|
|
|
+ if (item.checkStatus == 1) { // 有权限
|
|
|
|
+ this.identification = new Date().valueOf() + ""
|
|
|
|
+ this.playVideo();
|
|
|
|
+ this.studyRecordGetLastLive();
|
|
|
|
+ } else {
|
|
|
|
+ this.showAuth = true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ console.log('500:', err)
|
|
|
|
+ this.$message({
|
|
|
|
+ message: err.msg,
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/home'
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ toAuth() {
|
|
|
|
+ if (this.goodsStatus == 1) { //已上架
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "/course-detail/" + this.goodsId,
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: '/home'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 新增用户视频学习日志
|
|
// 新增用户视频学习日志
|
|
studyLog() {
|
|
studyLog() {
|
|
this.$axios({
|
|
this.$axios({
|
|
@@ -597,6 +714,31 @@ export default {
|
|
this.plv.liveSdk.player.resize(); // ppt容器宽高修改,调用resize刷新ppt尺寸
|
|
this.plv.liveSdk.player.resize(); // ppt容器宽高修改,调用resize刷新ppt尺寸
|
|
this.plv.liveSdk.player.resizeBarrage(); // 刷新弹幕显示区域尺寸
|
|
this.plv.liveSdk.player.resizeBarrage(); // 刷新弹幕显示区域尺寸
|
|
},
|
|
},
|
|
|
|
+ download() {
|
|
|
|
+ var url = this.formShare.ercode
|
|
|
|
+ var a = document.createElement("a");
|
|
|
|
+ var event = new MouseEvent("click");
|
|
|
|
+ a.download = "二维码";
|
|
|
|
+ a.href = url;
|
|
|
|
+ a.dispatchEvent(event);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ copy() {
|
|
|
|
+ var copyInput = document.createElement("input");
|
|
|
|
+ //val是要复制的内容
|
|
|
|
+ copyInput.setAttribute("value", this.formShare.links);
|
|
|
|
+ document.body.appendChild(copyInput);
|
|
|
|
+ copyInput.select();
|
|
|
|
+ try {
|
|
|
|
+ var copyed = document.execCommand("copy");
|
|
|
|
+ if (copyed) {
|
|
|
|
+ document.body.removeChild(copyInput);
|
|
|
|
+ this.$message.success("复制成功");
|
|
|
|
+ }
|
|
|
|
+ } catch (err) {
|
|
|
|
+ this.$message.error("复制失败,请检查浏览器兼容");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -607,8 +749,16 @@ export default {
|
|
background: #eee;
|
|
background: #eee;
|
|
.top-line {
|
|
.top-line {
|
|
margin: 10px 0;
|
|
margin: 10px 0;
|
|
- .float-right {
|
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ padding: 0px 45px;
|
|
|
|
+ .title {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ float: left;
|
|
|
|
+ }
|
|
|
|
+ .bottoms {
|
|
float: right;
|
|
float: right;
|
|
|
|
+ }
|
|
|
|
+ .float-right {
|
|
width: 100px;
|
|
width: 100px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -730,5 +880,38 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .popCentent {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .btns {
|
|
|
|
+ width: 300px;
|
|
|
|
+ height: 40px;
|
|
|
|
+ line-height: 40px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background-color: #3577E8;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .popShare {
|
|
|
|
+ .ccopy {
|
|
|
|
+ color: #1890ff;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ .ercode_pic {
|
|
|
|
+ width: 150px;
|
|
|
|
+ height: 150px;
|
|
|
|
+ // &.bg {
|
|
|
|
+ // background: url();
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|