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

新增 试看事件限制

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