提交 110297ec 编写于 作者: ping_zhang's avatar ping_zhang

新增 试看事件限制

上级 c920446d
...@@ -62,8 +62,20 @@ export default { ...@@ -62,8 +62,20 @@ export default {
listener: this.listener, listener: this.listener,
...this.options ...this.options
}; };
options.width = htmlWidth options.width = htmlWidth;
this.tcPlayer = new TcPlayer(this.id, options);
const tcPlayer = new TcPlayer(this.id, options);
tcPlayer.video.on('timeupdate', (event) => {
let ct = tcPlayer.currentTime();
console.log('视频播放时长S => ', ct);
if (options.trySeeTime && ct >= options.trySeeTime) {
tcPlayer.currentTime(options.trySeeTime);
tcPlayer.pause();
this.$emit('sk-tip');
}
});
this.tcPlayer = tcPlayer;
}, },
reset() { reset() {
if (this.tcPlayer) { if (this.tcPlayer) {
......
...@@ -17,7 +17,7 @@ service.interceptors.request.use(config => { ...@@ -17,7 +17,7 @@ service.interceptors.request.use(config => {
if(config.data.token){ if(config.data.token){
config.headers['token'] = config.data.token || '891F256CC48A4D57905F79C8F7628A74' config.headers['token'] = config.data.token || '891F256CC48A4D57905F79C8F7628A74'
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境 if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
config.headers['token'] = config.data.token || '891F256CC48A4D57905F79C8F7628A74'; config.headers['token'] = config.data.token || '14587B3BBD77434EAFE8755FB1856008';
} }
delete config.data.setEntry; delete config.data.setEntry;
delete config.data.token; delete config.data.token;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<img v-show="project.status == 10" class="banner-img-10" src="../images/status-end-cme.png" /> <img v-show="project.status == 10" class="banner-img-10" src="../images/status-end-cme.png" />
</div> </div>
<!-- banner视频 --> <!-- banner视频 -->
<CommonTcPlayer v-if="bannerType == 2" style="flex" :options="videoOptions"></CommonTcPlayer> <CommonTcPlayer v-if="bannerType == 2" style="flex" :options="videoOptions" @sk-tip="isShowSkDialog = true"></CommonTcPlayer>
<!-- 项目标题 --> <!-- 项目标题 -->
<CommonDescription <CommonDescription
:projectName="project.projectName" :projectName="project.projectName"
...@@ -119,6 +119,13 @@ ...@@ -119,6 +119,13 @@
cancleBtnText="我知道了" cancleBtnText="我知道了"
@handlerAction="handlerEJAction" @handlerAction="handlerEJAction"
/> />
<ShiKanCommonDialog
content="试看结束"
subContent="购买后可看完整课程"
confirmBtnText="去购买"
:isShowDialog="isShowSkDialog"
@handlerAction="confirm"
/>
<ExjumperButton <ExjumperButton
@btnClick="beforeJumpToExam" @btnClick="beforeJumpToExam"
v-if="project.cmeType == 2 && hasBindCard" v-if="project.cmeType == 2 && hasBindCard"
...@@ -175,6 +182,7 @@ import ExjumperDialog from "@/components/cme/exjumper-dialog"; ...@@ -175,6 +182,7 @@ import ExjumperDialog from "@/components/cme/exjumper-dialog";
import ExjumperButton from "@/components/cme/exjumper-button"; import ExjumperButton from "@/components/cme/exjumper-button";
import NoMoreContent from "@/components/business/no-more-content"; import NoMoreContent from "@/components/business/no-more-content";
import CommonAdertImg from "@/components/common/common-advert-img"; import CommonAdertImg from "@/components/common/common-advert-img";
import ShiKanCommonDialog from "@/components/cme/common-dialog";
import { getWebPageUrl, gotoPage } from "@/utils/index"; import { getWebPageUrl, gotoPage } from "@/utils/index";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
...@@ -257,7 +265,8 @@ export default { ...@@ -257,7 +265,8 @@ export default {
autoplay: false, //iOS下safari浏览器,以及大部分移动端浏览器是不开放视频自动播放这个能力的 autoplay: false, //iOS下safari浏览器,以及大部分移动端浏览器是不开放视频自动播放这个能力的
coverpic: require("../images/video-cover.png"), coverpic: require("../images/video-cover.png"),
width: "415", //视频的显示宽度,请尽量使用视频分辨率宽度 width: "415", //视频的显示宽度,请尽量使用视频分辨率宽度
height: "210" //视频的显示高度,请尽量使用视频分辨率高度 height: "210", //视频的显示高度,请尽量使用视频分辨率高度
trySeeTime: ''
}, },
//projectStatus: 1, //1没有获得证书 2是获得全部证书 //projectStatus: 1, //1没有获得证书 2是获得全部证书
attachmentUrl: require("../images/banner-default.png"), attachmentUrl: require("../images/banner-default.png"),
...@@ -283,7 +292,8 @@ export default { ...@@ -283,7 +292,8 @@ export default {
}, },
advertInfoList: [], advertInfoList: [],
showChangeCard: false, //是否展示激活弹框, showChangeCard: false, //是否展示激活弹框,
changeCardErrorMsg: "" changeCardErrorMsg: "",
isShowSkDialog: false
}; };
}, },
components: { components: {
...@@ -306,7 +316,8 @@ export default { ...@@ -306,7 +316,8 @@ export default {
CommonAdertImg, CommonAdertImg,
NoMoreContent, NoMoreContent,
BindCardButton, BindCardButton,
ChangeCard ChangeCard,
ShiKanCommonDialog
}, },
computed: { computed: {
...@@ -865,6 +876,7 @@ export default { ...@@ -865,6 +876,7 @@ export default {
// 先设置视频URL再显示视频组件 ------------ BEGIN // 先设置视频URL再显示视频组件 ------------ BEGIN
if (res.data.attachmentType == 2) { if (res.data.attachmentType == 2) {
_this.videoOptions.mp4 = res.data.attachmentUrl; _this.videoOptions.mp4 = res.data.attachmentUrl;
_this.videoOptions.trySeeTime = res.data.trySeeTime;
} else { } else {
_this.attachmentUrl = res.data.attachmentUrl; _this.attachmentUrl = res.data.attachmentUrl;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册