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

浏览器返回问题

上级 7963e758
......@@ -14,10 +14,15 @@
:burialPoint="pointStyle"
borderStyle="0px solid #fff"
:backMethod="from"
></CommonNavbar> -->
></CommonNavbar>-->
<div class="page-content list-container">
<!-- banner图片 -->
<div @click="gotoCourse()" v-if="bannerType == 1" class="page-content-img-container" style="position:relative;">
<div
@click="gotoCourse()"
v-if="bannerType == 1"
class="page-content-img-container"
style="position:relative;"
>
<img class="banner-img" :src="attachmentUrl" />
<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" />
......@@ -25,18 +30,39 @@
<!-- banner视频 -->
<div class="video-box" v-if="bannerType == 2">
<pica-video ref="picaVideo" :coverType="coverType" :download="download" @onVideoEnd="onVideoEnd" @onReplay="onReplay">
<pica-video
ref="picaVideo"
:coverType="coverType"
:download="download"
@onVideoEnd="onVideoEnd"
@onReplay="onReplay"
>
<!-- 试看结束 -->
<div class="cover" v-if="logged && coverType === 1">
<course-covers coverTips="试看结束<br />请来云鹊医App学习完整课程" :isSingle="true" rightBtnText="APP购买更优惠" @btnClick="btnClick1" />
<course-covers
coverTips="试看结束<br />请来云鹊医App学习完整课程"
:isSingle="true"
rightBtnText="APP购买更优惠"
@btnClick="btnClick1"
/>
</div>
<!-- 播放结束,下载App -->
<div class="cover" v-if="logged && coverType === 2">
<course-covers coverTips="播放结束<br />更多其他课程,请前往鹊医App学习" :isSingle="true" rightBtnText="去云鹊医App" @btnClick="btnClick2" />
<course-covers
coverTips="播放结束<br />更多其他课程,请前往鹊医App学习"
:isSingle="true"
rightBtnText="去云鹊医App"
@btnClick="btnClick2"
/>
</div>
<!-- 未登录 -->
<div class="cover" v-if="!logged">
<course-covers coverTips="登录后马上学习课程" :isSingle="true" rightBtnText="去登录" @btnClick="beforeGoLogin" />
<course-covers
coverTips="登录后马上学习课程"
:isSingle="true"
rightBtnText="去登录"
@btnClick="beforeGoLogin"
/>
</div>
</pica-video>
</div>
......@@ -72,7 +98,7 @@
<span :class="{'focus': tabFlag}" @click="jumpIntro">简介</span>
<span :class="{'focus': !tabFlag}" @click="jumpCatalogue">目录</span>
<div class="download-abs" @click="gotoDownload">
<img src="../images/cme/course/pica-icon.png" alt="">
<img src="../images/cme/course/pica-icon.png" alt />
<span :class="{'short': needShort}">{{downloadTips}}</span>
</div>
</div>
......@@ -151,7 +177,7 @@
></ExjumperButton>
<!-- <div v-if="project.cmeType == 2 && !isWeb" style="padding-top: 30px"></div> -->
<div style="padding-top: 20px"></div>
<BindCardButton
v-if="project.cmeType == 2 && !hasBindCard"
:cardInfo="cardInfo"
......@@ -164,18 +190,19 @@
:cardInfo="cardInfo"
@changeClick="changeClick"
@gotoBuy="confirm"
></BindCardButtonShare> -->
></BindCardButtonShare>-->
<!--去激活-->
<ChangeCard
:changeErrorMsg="changeCardErrorMsg"
:isShow="showChangeCard"
@cancle="cancleChangeCard"
@confirm="beforeChangeCardAction">
</ChangeCard>
@confirm="beforeChangeCardAction"
></ChangeCard>
<Loading v-show="showLoading" />
<div>
<span ref="copyLinkBtn"
<span
ref="copyLinkBtn"
data-clipboard-action="copy"
class="cobyOrderSn"
:data-clipboard-text="this.project.cardKey"
......@@ -189,9 +216,8 @@
needSubContent
:isShowDialog="showBindCardTips"
@handlerAction="handlerActionTips"
></CourseDialog>
</div>
></CourseDialog>
</div>
</template>
<script>
import CommonNavbar from "@/components/common/common-navbar";
......@@ -223,8 +249,8 @@ import BindCardButton from "@/components/cme/bind-card-button";
// import BindCardButtonShare from "@/components/cme/bind-card-button-share";
import ChangeCard from "@/components/cme/change-card";
import CourseCovers from "@/components/course/course-covers";
import PicaVideo from '@/components/course/pica-video';
import { getCookie } from '@/utils/index';
import PicaVideo from "@/components/course/pica-video";
import { getCookie } from "@/utils/index";
let cataOffsetTop = 0;
let intorOffsetTop = 0;
......@@ -277,7 +303,7 @@ export default {
firstIntoExam: false, // true弹框,是否首次进入考试,用于首次跳转弹框提示,只跟项目和人员有关
jumpToContents: false, // 是否跳转到目录
cardStatus: 0,
cardKey: '',
cardKey: ""
// cmeType=2时不显示进度,
// projectNo为空时不显示项目编号,
// projectLeader为空时不显示项目负责人,
......@@ -301,7 +327,7 @@ export default {
width: "415", //视频的显示宽度,请尽量使用视频分辨率宽度
height: "210", //视频的显示高度,请尽量使用视频分辨率高度
trySeeTime: "",
x5_fullscreen: false,
x5_fullscreen: false
},
// attachmentUrl: require("../images/banner-default.png"),
attachmentUrl: require("../images/video-cover.png"),
......@@ -332,9 +358,9 @@ export default {
isShowEndDialog: false,
isShowFFDialog: false,
needShort: false,
uuid: '',
token: '',
shareUrl: '',
uuid: "",
token: "",
shareUrl: "",
shareParam: {},
showBindCardTips: false,
cmeCardModels: {
......@@ -342,8 +368,8 @@ export default {
cardKey: "",
cardType: 2,
orderId: 0
},
subContent: ``,
},
subContent: ``
};
},
components: {
......@@ -380,23 +406,23 @@ export default {
let _this = this;
this.from = this.$route.query.from || this.from || "native";
let href = location.href;
let uuidIndex = href.indexOf('uuid') || 0;
if(uuidIndex > 0) {
let uuidIndex = href.indexOf("uuid") || 0;
if (uuidIndex > 0) {
this.uuid = href.substr(uuidIndex + 5, 32);
} else {
this.uuid = '07F9625472D6444EBAE4BF7D2EF83BC4'
this.uuid = "07F9625472D6444EBAE4BF7D2EF83BC4";
}
this.shareUrl = location.href;
if(href.indexOf('singlemessage') >= 0 || href.indexOf('wx_code') >= 0) {
if (href.indexOf("singlemessage") >= 0 || href.indexOf("wx_code") >= 0) {
this.shareUrl = getWebPageUrl(`cme/#/sharecoop?uuid=${this.uuid}`);
location.replace(this.shareUrl);
}
const { token, info } = this.$store.state.user;
this.token = getCookie('token') || token;
this.token = getCookie("token") || token;
// 如果有token,但没有用户信息,则获取用户信息
if (this.token && !info.id) {
this.$store.dispatch('setToken', this.token);
this.$store.dispatch("setToken", this.token);
// this.$store.dispatch('getUserInfo');
}
this.queryByUuid(this.uuid);
......@@ -405,7 +431,7 @@ export default {
// this.getAdvertInfoList();
},
mounted() {
window.addEventListener("scroll", this.scrollFun);
window.addEventListener("scroll", this.scrollFun);
},
beforeDestroyed() {
window.removeEventListener("scroll", this.scrollFun);
......@@ -428,9 +454,9 @@ export default {
this.GET(`portal/shareParam/queryByUuid`, param).then(res => {
if (res.code == "000000") {
this.shareParam = JSON.parse(res.data || "{}");
this.projectId = this.shareParam.projectId || 178; // 178
this.projectId = this.shareParam.projectId || 178; // 178
this.getProjectParticularsV2();
console.log('queryByUuid', res);
console.log("queryByUuid", res);
}
});
},
......@@ -439,7 +465,8 @@ export default {
onVideoEnd(opt) {
if (opt.type === 1) {
this.coverType = 2;
} else if (opt.type === 2) { // 试看结束
} else if (opt.type === 2) {
// 试看结束
this.coverType = 1;
}
},
......@@ -481,7 +508,7 @@ export default {
});
window.location.href =
"https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque";
},
},
cancleChangeCard() {
this.showChangeCard = false;
......@@ -489,7 +516,7 @@ export default {
// 处理提示信息框
handlerActionTips(type) {
if(type == 1) {
if (type == 1) {
this.$sendBuriedData({
component_tag: `883#88319`
});
......@@ -498,15 +525,15 @@ export default {
this.$sendBuriedData({
component_tag: `883#88318`
});
this.beforeChangeCardAction(this.cmeCardModels.cardKey, true)
this.beforeChangeCardAction(this.cmeCardModels.cardKey, true);
}
},
//
//
beforeChangeCardAction(cardKey, isInTips) {
this.commonCheckToken( () => {
this.commonCheckToken(() => {
this.changeCardAction(cardKey, isInTips);
})
});
},
// 查询是否买过类似的卡,但还没有绑定
......@@ -534,32 +561,34 @@ export default {
setEntry: true
};
_this.changeCardErrorMsg = "";
this.POST("cme/projectCard/bind", param).then(res => {
isInTips && (_this.showBindCardTips = false);
console.log('in res', res, isInTips);
if (res.code == "000000") {
if(!res.data) {
if(isInTips) {
Toast(res.message);
this.POST("cme/projectCard/bind", param)
.then(res => {
isInTips && (_this.showBindCardTips = false);
console.log("in res", res, isInTips);
if (res.code == "000000") {
if (!res.data) {
if (isInTips) {
Toast(res.message);
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
_this.showChangeCard = false;
Toast("激活成功,开始学习");
_this.getProjectParticularsV2();
}
} else {
_this.showChangeCard = false;
Toast("激活成功,开始学习");
_this.getProjectParticularsV2();
Toast(res.message);
}
} else {
Toast(res.message);
}
}).catch( e => {
if(isInTips) {
Toast("无效的激活码");
_this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
});
})
.catch(e => {
if (isInTips) {
Toast("无效的激活码");
_this.showBindCardTips = false;
} else {
_this.changeCardErrorMsg = "请输入正确的激活码";
}
});
},
// 复制卡密
......@@ -628,7 +657,7 @@ export default {
// 跳转前判断是否有机构,否则使用定位信息
preJumper() {
this.getCardInfoByProvinceId(this.provinceId || "");
this.getCardInfoByProvinceId(this.provinceId || "");
},
// 根据省ID,获取学习卡信息
......@@ -642,8 +671,11 @@ export default {
this.POST("trade/goods/cardList", param).then(res => {
if (res.code == "000000") {
this.showLoading = false;
this.cardInfo = (res.data && res.data[0]) || { id: 0, name: "国家级继续教育项目(远程)学习卡" };
this.subContent = `您已购买“${this.cardInfo.goodsName}”,是否用此卡绑定并激活当前课程。学习卡激活码一旦使用,不可更改不可退回`
this.cardInfo = (res.data && res.data[0]) || {
id: 0,
name: "国家级继续教育项目(远程)学习卡"
};
this.subContent = `您已购买“${this.cardInfo.goodsName}”,是否用此卡绑定并激活当前课程。学习卡激活码一旦使用,不可更改不可退回`;
}
});
},
......@@ -652,10 +684,15 @@ export default {
// this.$sendBuriedData({
// component_tag: `882#88203`
// });
this.commonCheckToken( () => {
let jumpUrl = getWebPageUrl(`profexam/#/goods-detail?goodsId=${this.cardInfo.id}&projectId=${this.projectId}&returnUrl=${encodeURIComponent(this.shareUrl)}`);
this.commonCheckToken(() => {
let jumpUrl = getWebPageUrl(
`profexam/#/goods-detail?goodsId=${this.cardInfo.id}&projectId=${
this.projectId
}&returnUrl=${encodeURIComponent(this.shareUrl)}`
);
sessionStorage.setItem('returnUrl', encodeURIComponent(this.shareUrl));
window.location.href = jumpUrl;
})
});
},
// 首次进入考试时记录(点击‘我知道了’时调用)
......@@ -732,9 +769,9 @@ export default {
//去激活
changeClick() {
this.commonCheckToken( () => {
this.commonCheckToken(() => {
this.showChangeCard = true;
})
});
},
// 弹框按钮事件
......@@ -744,7 +781,7 @@ export default {
scrollFun() {
//如果是第一次的弹框,则直接退出
if(this.isShowEJDialog) return;
if (this.isShowEJDialog) return;
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
let h = intorOffsetTop - 135;
......@@ -831,7 +868,7 @@ export default {
};
// let videoUrl = this.$route.query.videoUrl || '';
let videoUrl = this.shareParam.videoUrl;
if(videoUrl) {
if (videoUrl) {
param.trySeeFlag = 0;
} else {
param.trySeeFlag = 1;
......@@ -841,10 +878,10 @@ export default {
if (res.code == "000000") {
// 首先使用配置中的参数中的获取视频地址及视频时间
setTimeout(() => {
this.downloadTips = '';
this.downloadTips = "";
this.needShort = true;
}, 5000);
if(videoUrl) {
if (videoUrl) {
_this.limitTimes = this.shareParam.limitTimes || 0;
_this.videoOptions.mp4 = videoUrl;
_this.videoOptions.trySeeTime = this.shareParam.limitTimes || 0;
......@@ -854,26 +891,25 @@ export default {
_this.videoOptions.trySeeTime = res.data.trySeeTime || 0;
}
_this.hasBindCard = res.data.cardStatus == 0 ? false : true;
if(this.hasBindCard) {
if (this.hasBindCard) {
_this.videoOptions.trySeeTime = 0;
_this.videoOptions.autoplay = false;
// 如果没有绑定卡,则查询是否有未绑定的卡
// 如果没有绑定卡,则查询是否有未绑定的卡
} else {
_this.logged && _this.hasNoUsedCard();
}
}
let mp4Url = _this.videoOptions.mp4;
// 判断是否是mp4
if(mp4Url.lastIndexOf('.mp4') > 0) {
if (mp4Url.lastIndexOf(".mp4") > 0) {
_this.bannerType = 2;
this.$nextTick( () => {
console.log('_this.$refs.picaVideo', _this.$refs.picaVideo);
this.$nextTick(() => {
console.log("_this.$refs.picaVideo", _this.$refs.picaVideo);
_this.$refs.picaVideo.switchUrl({
url: mp4Url,
proved: _this.videoOptions.trySeeTime,
enable: true,
enable: true
});
})
});
} else {
if (res.data.attachmentType == 2) {
_this.videoOptions.mp4 = res.data.attachmentUrl;
......@@ -883,8 +919,13 @@ export default {
_this.bannerType = res.data.attachmentType;
}
console.log('location', location);
console.log('_this.videoOptions.mp4, trySeeTime, autoplay', _this.videoOptions.mp4, _this.videoOptions.trySeeTime, _this.videoOptions.autoplay);
console.log("location", location);
console.log(
"_this.videoOptions.mp4, trySeeTime, autoplay",
_this.videoOptions.mp4,
_this.videoOptions.trySeeTime,
_this.videoOptions.autoplay
);
// 如果绑定了卡,则提示学习下一节
_this.project = res.data;
......@@ -965,10 +1006,10 @@ export default {
() => {
console.log("share success...");
}
);
);
} else {
_this.showLoading = false;
_this.$router.replace('/not-found?fromPage=2');
_this.$router.replace("/not-found?fromPage=2");
}
});
},
......@@ -1054,7 +1095,6 @@ export default {
}
},
// 跳转到考试
gotoExamNew: function() {
Toast("请前往APP进行考试");
......@@ -1062,8 +1102,8 @@ export default {
// 跳转到课程(H5)
gotoCourseNew: function() {
window.location.href = ""
},
window.location.href = "";
}
}
};
</script>
......@@ -1099,7 +1139,7 @@ export default {
height: 30px;
}
}
.video-box{
.video-box {
position: relative;
height: 210px;
}
......@@ -1141,10 +1181,11 @@ export default {
font-weight: 700;
border-radius: 20px;
color: #fff;
background: #449284;
background: #449284;
&.android {
padding-top: 2px;
} }
}
}
// opacity: ;
}
}
......@@ -1218,7 +1259,7 @@ export default {
position: absolute;
z-index: 100;
top: 0;
left: 0;
left: 0;
}
.download-abs {
display: flex;
......@@ -1242,9 +1283,9 @@ export default {
padding: 0 8px 0 23px;
font-size: 12px;
font-weight: 700;
color: #5BA99B;
color: #5ba99b;
background: #fff;
box-shadow:0px 2px 10px 0px rgba(0,0,0,0.1);
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1);
width: 120px;
&.short {
width: 10px;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册