提交 44e7bd00 编写于 作者: guangjun.yang's avatar guangjun.yang

请您下载新版本App

上级 8171d3be
<template>
<div class="common-dialog-wrraper" v-if="isShowDialog">
<div class="dialog-mask"></div>
<div class="dialog-container">
<div class="dialog-content">{{content}}</div>
<div v-show="needSubContent" class="dialog-sub-content" v-html="subContent"></div>
<div class="dialog-footer v-hairline-top">
<span :class="{'single-btn': isSingle}" @click.stop.prevent="handlerAction(1)">{{cancleBtnText}}</span>
<span v-show="!isSingle" class="confirm-btn v-hairline-left" @click.stop.prevent="handlerAction(2)">{{confirmBtnText}}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: "common-dialog",
data() {
return {
};
},
props: {
content: {
type: String,
default: ''
},
needSubContent: {
type: Boolean,
default: false
},
subContent: {
type: String,
default: ''
},
cancleBtnText: {
type: String,
default: '取消'
},
confirmBtnText: {
type: String,
default: '确定'
},
isShowDialog: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: false
},
},
methods: {
handlerAction(type) {
this.$emit("handlerAction", type);
}
}
};
</script>
<style lang="scss" scoped>
@import "../../style/mixin";
.common-dialog-wrraper {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 2019;
.dialog-mask {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 2020;
}
.dialog-container {
z-index: 2021;
position: absolute;
top: 50%;
left: 50%;
overflow: hidden;
width: px2rem(300px);
font-size: px2rem(18px);
-webkit-transition: 0.3s;
transition: 0.3s;
border-radius: px2rem(4px);
background-color: #fff;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
.dialog-content {
// margin: px2rem(30px) px2rem(22px);
margin: px2rem(30px);
text-align: center;
font-size: px2rem(18px);
font-weight: 400;
color: #373839;
}
.dialog-sub-content {
margin: px2rem(-16px) px2rem(30px) px2rem(30px);
// margin: px2rem(-16px) px2rem(22px) px2rem(30px);
text-align: left;
font-size: px2rem(14px);
line-height: px2rem(24px);
font-weight: 400;
color: #676869;
}
.dialog-footer {
height: px2rem(50px);
display: flex;
align-items: center;
&.v-hairline-top::after {
border-top-width: 1px;
}
span {
display: inline-block;
// width: 50%;
flex: 1;
height: px2rem(50px);
line-height: px2rem(50px);
font-size: px2rem(17px);
text-align: center;
color: #979899;
&.v-hairline-left::after {
border-left-width: 1px;
}
&.confirm-btn {
color: #449284;
}
&.single-btn {
color: #449284;
}
}
}
}
[class*="v-hairline"] {
position: relative;
&::after {
content: " ";
position: absolute;
pointer-events: none;
box-sizing: border-box;
top: -50%;
left: -50%;
right: -50%;
bottom: -50%;
-webkit-transform: scale(0.5);
transform: scale(0.5);
border: 0 solid #f0f1f2;
}
}
}
</style>
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<div class="dialog-content">{{content}}</div> <div class="dialog-content">{{content}}</div>
<div v-show="needSubContent" class="dialog-sub-content" v-html="subContent"></div> <div v-show="needSubContent" class="dialog-sub-content" v-html="subContent"></div>
<div class="dialog-footer v-hairline-top"> <div class="dialog-footer v-hairline-top">
<span :class="{'single-btn': isSingle}" @click.stop.prevent="handlerAction(1)">{{cancleBtnText}}</span> <span :class="{'single-btn': isSingle}" @click="handlerAction(1)">{{cancleBtnText}}</span>
<span v-show="!isSingle" class="confirm-btn v-hairline-left" @click.stop.prevent="handlerAction(2)">{{confirmBtnText}}</span> <span v-show="!isSingle" class="confirm-btn v-hairline-left" @click="handlerAction(2)">{{confirmBtnText}}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -151,5 +151,11 @@ export default { ...@@ -151,5 +151,11 @@ export default {
border: 0 solid #f0f1f2; border: 0 solid #f0f1f2;
} }
} }
&.shikan {
.dialog-sub-content {
text-align: center;
font-size: px2rem(16px);
}
}
} }
</style> </style>
<template>
<!-- <div :id="id" class="banner-img" autoplay="autoplay"> -->
<div :id="id" class="banner-img">
</div>
</template>
<script>
// const TcPlayer = window.TcPlayer
import { TcPlayer } from "@/utils/tc-player-2.2.0";
export default {
props: {
id: {
type: String,
default: "tc-player"
},
width: {
type: [Number, String],
default: 375
},
height: {
type: [Number, String],
default: 210
},
listener: {
type: Function,
default() {
return function(msg) {};
}
},
live: {
type: Boolean,
default: false
},
options: {
type: Object
},
pStatus: {
type: Number,
default: 1
}
},
data() {
return {
tcPlayer: null
};
},
mounted() {
this.$nextTick(function(){
let htmlDom = document.getElementsByTagName('html')[0];
let htmlWidth = parseFloat(htmlDom.style.fontSize) * 10
this.init(htmlWidth);
})
},
methods: {
init(htmlWidth) {
const options = {
// width: String(htmlWidth),
// width: String(this.width),
// width: String('100%'),
// height: String(this.height),
live: this.live,
listener: this.listener,
...this.options
};
options.width = htmlWidth
this.tcPlayer = new TcPlayer(this.id, options);
},
reset() {
if (this.tcPlayer) {
this.tcPlayer.destroy();
this.init();
}
},
play() {
if (!this.tcPlayer) return;
return this.tcPlayer.play();
},
pause() {
if (!this.tcPlayer) return;
return this.tcPlayer.pause();
},
togglePlay() {
if (!this.tcPlayer) return;
return this.tcPlayer.togglePlay();
},
mute(muted) {
if (!this.tcPlayer) return;
return this.tcPlayer.mute(muted);
},
volume(val) {
if (!this.tcPlayer) return;
return this.tcPlayer.volume(val);
},
playing() {
if (!this.tcPlayer) return;
return this.tcPlayer.playing();
},
duration() {
if (!this.tcPlayer) return;
return this.tcPlayer.duration();
},
currentTime(time) {
if (!this.tcPlayer) return;
return this.tcPlayer.currentTime(time);
},
fullscreen(enter) {
if (!this.tcPlayer) return;
return this.tcPlayer.fullscreen(enter);
},
buffered() {
if (!this.tcPlayer) return;
return this.tcPlayer.buffered();
},
switchClarity(clarity) {
if (!this.tcPlayer) return;
return this.tcPlayer.switchClarity(clarity);
}
},
destroyed() {
if (this.tcPlayer) {
this.tcPlayer.destroy();
}
}
};
</script>
<style lang="scss" scoped>
@import "../../style/mixin";
.banner-img {
// display: inherit;
width: px2rem(375px);
height: px2rem(210px);
}
</style>
\ No newline at end of file
...@@ -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(0);
tcPlayer.pause();
this.$emit('sk-tip');
}
});
this.tcPlayer = tcPlayer;
}, },
reset() { reset() {
if (this.tcPlayer) { if (this.tcPlayer) {
......
...@@ -19,12 +19,14 @@ ...@@ -19,12 +19,14 @@
<!-- banner图片 --> <!-- banner图片 -->
<div v-if="bannerType == 1" class="page-content-img-container"> <div v-if="bannerType == 1" class="page-content-img-container">
<img class="banner-img" :src="attachmentUrl" /> <img class="banner-img" :src="attachmentUrl" />
<!-- <img v-show="project.status == 1" class="banner-img-1" src="../images/status-join.png" /> -->
<img v-show="project.status == 5" class="banner-img-5" src="../images/status-keep-on.png" /> <img v-show="project.status == 5" class="banner-img-5" src="../images/status-keep-on.png" />
<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"></CommonTcPlayer>
<div class="sk-btn-cover-new" @click="continueStudy()" v-if="bannerType == 2 && hasBindCard" >
<span>继续学习</span>
</div>
<!-- 项目标题 --> <!-- 项目标题 -->
<CommonDescription <CommonDescription
:projectName="project.projectName" :projectName="project.projectName"
...@@ -120,6 +122,25 @@ ...@@ -120,6 +122,25 @@
@click="copyLink" @click="copyLink"
></span> ></span>
</div> </div>
<ShiKanCommonDialog
class="shikan"
needSubContent
content="试看结束"
subContent="购买后可看完整课程"
confirmBtnText="去购买"
:isShowDialog="isShowSkDialog"
@handlerAction="goBuyKc"
/>
<IOSDownloadDialog
class="shikan"
isSingle
content="请您下载新版本App"
cancleBtnText="我知道了"
:isShowDialog="isShowIOSDownloadDialog"
@handlerAction="goBack"
/>
</div> </div>
</template> </template>
<script> <script>
...@@ -140,6 +161,8 @@ import CommonDialog from "@/components/cme/common-dialog"; ...@@ -140,6 +161,8 @@ import CommonDialog from "@/components/cme/common-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 IOSDownloadDialog 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";
...@@ -234,6 +257,9 @@ export default { ...@@ -234,6 +257,9 @@ export default {
changeCardErrorMsg: "", changeCardErrorMsg: "",
isInfresh: false, isInfresh: false,
needShowUpdate: false, needShowUpdate: false,
skCourseId: 0,
isShowSkDialog: false,
isShowIOSDownloadDialog: false,
}; };
}, },
components: { components: {
...@@ -253,7 +279,9 @@ export default { ...@@ -253,7 +279,9 @@ export default {
CommonAdertImg, CommonAdertImg,
NoMoreContent, NoMoreContent,
BindCardButton, BindCardButton,
ChangeCard ChangeCard,
ShiKanCommonDialog,
IOSDownloadDialog
}, },
computed: { computed: {
...@@ -269,6 +297,12 @@ export default { ...@@ -269,6 +297,12 @@ export default {
// appVersion 安卓 3.2.2 iOS // appVersion 安卓 3.2.2 iOS
console.log("__getUserInfo64Comp", param); console.log("__getUserInfo64Comp", param);
_this.token = param.userToken; _this.token = param.userToken;
let appVersion = param.appVersion || '300';
let appVersionNum = appVersion.split(".").join("");
// 如果是iOS系统并且版本小于344,则提示升级
if(__isIOS && appVersionNum < 344) {
_this.isShowIOSDownloadDialog = true;
}
_this.setUserInfo(param); _this.setUserInfo(param);
_this.checkToken(); _this.checkToken();
_this.getProjectInfoById(); _this.getProjectInfoById();
...@@ -691,20 +725,43 @@ export default { ...@@ -691,20 +725,43 @@ export default {
token: _this.userInfo.userToken || this.token || '47993ED00ECB46CE8D31ECF3AE34B4AA', token: _this.userInfo.userToken || this.token || '47993ED00ECB46CE8D31ECF3AE34B4AA',
setEntry: true setEntry: true
}; };
let videoUrl = this.$route.query.videoUrl || '';
if(videoUrl) {
param.trySeeFlag = 0;
} else {
param.trySeeFlag = 1;
}
console.log('getProjectInfoById', param); console.log('getProjectInfoById', param);
_this.showLoading = true; _this.showLoading = true;
this.NEW_GET(`cme/project/${_this.projectId}/info`, param).then(res => { this.NEW_GET(`cme/project/${_this.projectId}/info`, param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
// 先设置视频URL再显示视频组件 ------------ BEGIN if(videoUrl) {
if (res.data.attachmentType == 2) { _this.videoOptions.mp4 = videoUrl;
_this.videoOptions.mp4 = res.data.attachmentUrl; this.limitTimes = this.$route.query.trySeeTime || 300000;
} else { } else {
_this.attachmentUrl = res.data.attachmentUrl; _this.videoOptions.mp4 = res.data.attachmentUrl;
_this.videoOptions.trySeeTime = res.data.trySeeTime || 300000;
} }
_this.bannerType = res.data.attachmentType; if(this.hasBindCard) {
if (_this.bannerType == 2) { _this.videoOptions.trySeeTime = 300000;
_this.clientType = __isWeb ? 1 : __isAndroid ? 2 : 3; _this.videoOptions.autoplay = false;
} }
_this.bannerType = 2; // 这里写死是2
console.log('_this.videoOptions.mp4, trySeeTime, autoplay', _this.videoOptions.mp4, _this.videoOptions.trySeeTime, _this.videoOptions.autoplay);
// 先设置视频URL再显示视频组件 ------------ BEGIN
// if (res.data.attachmentType == 2) {
// _this.videoOptions.mp4 = res.data.attachmentUrl;
// } else {
// _this.attachmentUrl = res.data.attachmentUrl;
// }
// _this.bannerType = res.data.attachmentType;
// if (_this.bannerType == 2) {
// _this.clientType = __isWeb ? 1 : __isAndroid ? 2 : 3;
// }
// 先设置视频URL再显示视频组件 ------------ END // 先设置视频URL再显示视频组件 ------------ END
_this.project = res.data; _this.project = res.data;
...@@ -870,7 +927,143 @@ export default { ...@@ -870,7 +927,143 @@ export default {
} else if (len <= 30 && certificate != 2) { } else if (len <= 30 && certificate != 2) {
return 1; return 1;
} }
} },
// 查找没有学习完成的课程或考试
continueStudy() {
let courseIdOrExamId = '';
let portalModuleDTOS = [];
let contentList = [];
let item = {};
let firstItem = null;
outloop: for(let i = 0; i < this.projectComponentDTOS.length; i ++) {
portalModuleDTOS = this.projectComponentDTOS[i].portalModuleDTOS;
for(let j = 0; j < portalModuleDTOS.length; j ++) {
contentList = portalModuleDTOS[j].contentList;
for(let k = 0; k < contentList.length; k ++) {
item = contentList[k];
if(!firstItem && item.id) {
firstItem = item;
}
if( (item.type == 1 && item.id && (item.status == 11 || item.status == 12))
|| (item.type == 2 && item.id && (item.status == 21 || item.status == 22)) ) {
this.continueStudyType = item.type;
this.skCourseId = item.id;
break outloop;
}
}
}
}
if(!this.skCourseId) {
this.continueStudyType = firstItem.type;
this.skCourseId = firstItem.id;
}
console.log('continueStudyType', this.continueStudyType, 'skCourseId', this.skCourseId);
if(this.continueStudyType == 1) {
this.gotoExamNew();
} else {
this.gotoCourseNew();
}
},
// 跳转到考试
gotoExamNew: function(examId) {
let paramList = [
{
key: "className",
value:
"com.picahealth.yunque.activitys.exammodule.ExamPreActivity###PicaDo.ExamModuleManager",
type: 4,
seqNo: 1
},
{
key: "examId",
value: skCourseId,
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M200",
jsonString: paramList
});
},
// 跳转到课程
gotoCourseNew: function() {
// if(this.hasBindCard || this.project.cmeType != 2) return;
// let courseId = '';
let appVersion = getAppVersion(this.userInfo.appVersion);
// 弹框提示下载新版本可以试看
if(appVersion < 343 && !this.hasBindCard) {
this.$dialog.confirm({
className: 'con-dialog',
showCancelButton: false,
// message: '激活/购买后可学习完整课程',
message: '升级最新版本可试看课程',
confirmButtonText: '我知道了',
}).then(res => {
})
return;
}
let paramList = []
// let limitTimes = this.limitTimes - 0;
// if(this.hasBindCard) {
// limitTimes = -1;
// }
paramList = [
{
key: "className",
value: "com.picahealth.yunque.activitys.courseplaynew.MyTcPlayVideoActivity###CourseMultiMediaPlayController",
type: 4,
seqNo: 1
},
{
key: "isCHC",
value: 0,
type: 4,
seqNo: 1
},
{
key: "courseId",
value: this.skCourseId,
type: 4,
seqNo: 1
},
{
key: "courseRequire",
value: this.courseRequire - 0,
type: 4,
seqNo: 1
},
// {
// key: "limitTimes",
// value: limitTimes,
// type: 4,
// seqNo: 1
// },
];
console.log('gotoCourse', paramList);
rocNative.dispatchEventByModuleCode({
modeCode: "M200",
jsonString: paramList
});
},
goBuyKc(type) {
this.isShowSkDialog = false;
type == 2 && this.confirm();
},
// 直接返回到上层
goBack() {
this.isShowIOSDownloadDialog = false;
rocNative.goBack();
}
} }
}; };
</script> </script>
...@@ -909,6 +1102,30 @@ export default { ...@@ -909,6 +1102,30 @@ export default {
} }
.list-container { .list-container {
// margin-bottom: px2rem(40px); // margin-bottom: px2rem(40px);
.sk-btn-cover-new {
position: absolute;
top: 0;
left: 0;
right: 0;
height: px2rem(210px);
z-index: 100;
text-align: center;
// background: #fff;
font-size: px2rem(13px);
// border-radius: 50%;
background: rgba(51, 51, 51, 0.8);
span {
display: inline-block;
margin-top: px2rem(82px);
width: px2rem(120px);
height: px2rem(40px);
line-height: px2rem(40px);
font-size: px2rem(15px);
font-weight: 700;
color: #fff;
background: #449284;
}
}
} }
.intro-catalogue-container { .intro-catalogue-container {
.title { .title {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册