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

兑换或购买后可学习课程

上级 fad3ccfd
<template>
<section class="bind-cart-wrapper">
<article class="left">
<div class="top">
<span class="discount">{{(cardInfo.preferentialPrice || cardInfo.costPrice) | formatMoney}}</span>
<span v-show="cardInfo.preferentialPrice" class="price">
<del>原价¥{{cardInfo.costPrice | formatMoney}}</del>
</span>
</div>
<div class="bottom">
<img src="../../images/cme/phrase2/info.png" />
<span>兑换或购买后可学习课程</span>
</div>
</article>
<article class="right">
<span class="left">去兑换</span>
<span class="right">去购买</span>
</article>
</section>
</template>
<script>
export default {
props: {
cardInfo: {
type: Object,
default: () => {}
}
},
data() {
return {};
},
methods: {
btnClick() {
this.$emit("btnClick");
}
}
};
</script>
<style lang="scss" scoped>
@import "../../style/mixin";
.bind-cart-wrapper {
width: 100%;
display: flex;
flex-direction: row;
height: px2rem(60px);
line-height: 1;
justify-content: space-between;
padding: px2rem(10px) px2rem(15px);
font-size: px2rem(14px);
background: rgba(255, 255, 255, 1);
box-shadow: 0px -2px 10px 0px rgba(0, 0, 0, 0.1);
.left {
display: flex;
flex-direction: column;
height: px2rem(40px);
line-height: 1;
font-size: 12px;
// align-items: ;
.top {
height: px2rem(27px);
.discount {
color: #FB5B52;
font-size: px2rem(18px);
font-weight: 700;
margin-right: px2rem(4px);
}
.price {
color: #979899;
}
}
.bottom {
display: flex;
flex-direction: row;
img {
width: px2rem(12px);
height: px2rem(12px);
margin-left: 1px;
margin-right: px2rem(4px);
}
color: #979899;
}
}
.right {
display: flex;
flex-direction: row;
span {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: px2rem(80px);
font-size: px2rem(14px);
font-weight: 700;
text-align: center;
&.left {
border-radius: px2rem(20px) 0px 0px px2rem(20px);
border: 1px solid rgba(255, 122, 75, 1);
color: #ff7a4b;
}
&.right {
background: linear-gradient(
137deg,
rgba(255, 166, 95, 1) 0%,
rgba(255, 122, 75, 1) 100%
);
border-radius: 0px px2rem(20px) px2rem(20px) 0px;
color: #fff;
}
}
}
}
</style>
\ No newline at end of file
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
</td> </td>
</tr> </tr>
</table> </table>
<article v-show="isShow" class="cb-wrapper" :class="{'padding-top-111': !isWeb}"> <!-- <article v-show="isShow" class="cb-wrapper" :class="{'padding-top-111': !isWeb}">
<CardBanner :userMobile="userMobile"></CardBanner> <CardBanner :userMobile="userMobile"></CardBanner>
</article> </article> -->
<article class="page-content-list"> <article class="page-content-list">
<CommonTitle v-show="tabIndex === 2" title="I类学分继续医学教育项目" :isShowCert="false"></CommonTitle> <CommonTitle title="I类学分继续医学教育项目" :isShowCert="false"></CommonTitle>
<ICardItem v-show="tabIndex === 2" :oneLevelUrl="oneLevelUrl" :provinceId="provinceId" :organizationId="organizationId" :cmeToken="token"></ICardItem> <ICardItem :oneLevelUrl="oneLevelUrl" :provinceId="provinceId" :organizationId="organizationId" :cmeToken="token"></ICardItem>
<CommonTitle class="mt-10" v-show="isShow" title="II类学分继续医学教育项目" :isShowCert="false"></CommonTitle> <CommonTitle class="mt-10" v-show="isShow && tabIndex === 2" title="II类学分继续医学教育项目" :isShowCert="false"></CommonTitle>
<section v-if="tabIndex === 1"> <section v-if="tabIndex === 1">
<CoopListItem <CoopListItem
:paramData="joinProjectList" :paramData="joinProjectList"
...@@ -206,11 +206,9 @@ export default { ...@@ -206,11 +206,9 @@ export default {
_this.otherProjectList = res.data.allCMEProjectListDtoList; _this.otherProjectList = res.data.allCMEProjectListDtoList;
_this.provinceId = res.data.provinceId; _this.provinceId = res.data.provinceId;
_this.organizationId = res.data.organizationId; _this.organizationId = res.data.organizationId;
// _this.organizationInfo.provinceId = res.data.provinceId;
// _this.organizationInfo.organizationId = res.data.organizationId;
_this.oneLevelUrl = res.data.oneLevelUrl; // I类学习卡列表地址 _this.oneLevelUrl = res.data.oneLevelUrl; // I类学习卡列表地址
// _this.setJumpURLForI(res.data.oneLevelUrl);
// _this.setOrganizationInfo(_this.organizationInfo); // 不做相应判断
if (_this.userMobile) { if (_this.userMobile) {
_this.tabIndex = 1; _this.tabIndex = 1;
} else { } else {
...@@ -219,6 +217,7 @@ export default { ...@@ -219,6 +217,7 @@ export default {
if (_this.joinProjectList && _this.joinProjectList.length === 0) { if (_this.joinProjectList && _this.joinProjectList.length === 0) {
_this.tabIndex = 2; _this.tabIndex = 2;
} }
_this.isShow = true; _this.isShow = true;
} }
}); });
...@@ -295,7 +294,7 @@ export default { ...@@ -295,7 +294,7 @@ export default {
} }
} }
&-list { &-list {
padding-top: px2rem(85px); padding-top: px2rem(50px);
.mt-10 { .mt-10 {
margin-bottom: px2rem(-10px); margin-bottom: px2rem(-10px);
} }
......
<template>
<!-- 组件详情页面:模块列表及其下面的元件列表 -->
<div class="page-container-merge">
<CommonNavbar
id="header"
:bgColor="bgColor"
v-show="isShowNavbar"
:isBlack="isBlack"
:isShowShare="isShowShare"
:title="navTitle"
:shareTitle="project.projectName"
:shareTitleInfo="project.projectIntro"
:isFixNavbar="isFixNavbar"
:burialPoint="pointStyle"
borderStyle="0px solid #fff"
:backMethod="from"
></CommonNavbar>
<div class="page-content list-container">
<!-- banner图片 -->
<div v-if="bannerType == 1" class="page-content-img-container">
<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 == 10" class="banner-img-10" src="../images/status-end-cme.png" />
</div>
<!-- banner视频 -->
<CommonTcPlayer v-if="bannerType == 2" style="flex" :options="videoOptions"></CommonTcPlayer>
<!-- 项目标题 -->
<CommonDescription
:projectName="project.projectName"
:studyNum="project.studyNum"
:subject="project.subject"
/>
<CommonAdertImg
:advertInfoList="advertInfoList"
position="0"
/>
<!-- 步骤条 -->
<div v-if="project.cmeType != 2">
<CmeStep
:currentProgress="project.currentProgress"
:studyProgress="project.studyProgress"
:credit="project.credit"
:creditId="project.creditId"
:certificateUrl="project.certificateUrl"
:inScope="project.inScope"
:projectId="projectId"
:certificateId="project.certificateId"
@applicationCredit="applicationCredit"
/>
</div>
<!-- 简介和目录 -->
<div class="intro-catalogue-container">
<div
id="content-title"
class="title"
:class="{'fixed-title-1': (fixedFlag && !isWeb), 'fixed-title-2': (fixedFlag && isWeb)}"
>
<span :class="{'focus': tabFlag}" @click="jumpIntro">简介</span>
<span :class="{'focus': !tabFlag}" @click="jumpCatalogue">目录</span>
</div>
<div v-show="fixedFlag" class="fixed-flag-height"></div>
<div id="intro-content" class="intro-content">
<BasicInfo
:projectNo="project.projectNo"
:credit="project.credit"
:level="project.level"
:scope="project.scope"
:startDate="project.startDate"
:endDate="project.endDate"
:organName="project.organName"
:remind="project.remind"
:projectCredit="project.projectCredit"
:cmeType="project.cmeType"
/>
<LearnKnow :mustKnow="project.mustKnow"></LearnKnow>
<CommonSpliteLine></CommonSpliteLine>
<ItemIntro :textContent="textContent" @itemIntroText="itemIntroText"></ItemIntro>
<ItemLeader v-if="projectLeader"
:projectLeader="projectLeader"
:leaderText="leaderText"
@changeLeaderText="changeLeaderText"
/>
<TeacterIntro v-if="doctorList.length" :doctorList="doctorList"></TeacterIntro>
</div>
<CommonSpliteLine></CommonSpliteLine>
<div id="catalogue-content" class="catalogue-content">
<div class="catalogue-title">目录</div>
<CellListDetail
:projectComponent="projectComponentDTOS"
:actionList="actionList"
:detailNum="detailNum"
:courseRequire="courseRequire"
/>
</div>
</div>
<CommonAdertImg
needPadTop
:advertInfoList="advertInfoList"
position="1"
/>
<NoMoreContent />
<div v-if="detailNum <= 9" class="no-more-bottom"></div>
</div>
<!-- 弹框 -->
<CommonDialog
:isShowDialog="isShowDialog"
:isSingle="isSingle"
:cancleBtnText="cancleBtnText"
:confirmBtnText="confirmBtnText"
:content="dialogContent"
@handlerAction="handlerAction"
/>
<!-- 弹框 -->
<ExjumperDialog
:isShowDialog="isShowEJDialog"
isSingle
needSubContent
content="请确保您已经在云鹊平台购买学员优惠学习卡"
subContent="1. 跳转后点击“购买学习”,注册登录“中华医学教育在线”平台(首次登录需用手机号注册)<br/>2. 支付方式选择 “学习卡支付”,输入在云鹊平台已购学习卡的激活码,即可参加考试申请学分"
cancleBtnText="我知道了"
@handlerAction="handlerEJAction"
/>
<ExjumperButton
@btnClick="beforeJumpToExam"
v-if="project.cmeType == 2"
:btnText="project.currentProgress > 1 ? '参加考试' : '学完全部课程,可参加考试'"
:type="project.currentProgress > 1 ? 'primary' : 'disabled'"></ExjumperButton>
<div v-if="project.cmeType == 2" style="padding-top: 30px"></div>
<CardPopup :cardInfo="cardInfo" :isShow="isShowPopup" @clickOverlay="clickOverlay" @cancle="jumpToCardList()" @confirm="confirm"></CardPopup>
<Loading v-show="showLoading" />
</div>
</template>
<script>
import CommonNavbar from "@/components/common/common-navbar";
import CommonDescription from "@/components/common/common-description";
import CommonSpliteLine from "@/components/common/common-splite-line";
import CellListDetail from "@/components/business/cell-list-detail";
// import NoPermContent from "@/components/business/no-perm-content";
// import CommonBannerVideo from "@/components/common/common-banner-video";
import CommonTcPlayer from "@/components/common/common-tcplayer";
import Loading from "@/components/common/common-loading";
import CmeStep from "@/components/cme/cme-step";
import BasicInfo from "@/components/cme/basic-info";
import LearnKnow from "@/components/cme/learn-know";
import ItemIntro from "@/components/cme/item-intro";
import ItemLeader from "@/components/cme/item-leader";
import TeacterIntro from "@/components/cme/teacter-intro";
import CommonDialog from "@/components/cme/common-dialog";
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 { getWebPageUrl, gotoPage } from "@/utils/index";
import { mapGetters, mapActions } from "vuex";
import vueFilters from "@/utils/filter";
import { Toast } from 'vant';
import CardPopup from "@/components/cme/card-popup";
let cataOffsetTop = 0;
let intorOffsetTop = 0;
let titleOffsetHeight = 50;
export default {
data() {
return {
// token: "9B62E5874DA94979A54DB3E9DFC1443F",
isWeb: window.__isWeb,
textContent: "",
leaderText: "",
pageTitle: "",
isShowShare: true,
premissionFlag: false,
isSingle: false,
dialogContent: "", // 弹框内容
confirmBtnText: "", // 弹框按钮
cancleBtnText: "",
isShowDialog: false,
isShowEJDialog: false,
tabFlag: true, // 显示目录还是简介
fixedFlag: false, // 目录和简介是否固定
project: {
credit: "", // 学分
creditId: 0, // 学分Id
level: "", // 项目等级
scope: "", // 申请范围
remind: "", // 在不在范围提醒
startDate: 0, // 开始时间
endDate: 0, // 结束时间
organName: "", // 发起机构
projectName: "", // 项目名称
projectNo: "", // 项目编号
currentProgress: 0, // 项目进度
projectIntro: "", // 项目介绍
mustKnow: "", // 学习须知
studyNum: 0, // 学习人数
studyProgress: "0%", // 学习进度
subject: "", // 学科
status: 0, // 项目状态 5是进行中 10是已结束
certificateUrl: "", // 证书url
inScope: 0, // 是否在范围内判断
projectCredit: "", // 学分
certificateId: "0",
cmeType: 1, // 1: 自营项目; 2: 中华医学会二类
examBtnUrl: '', // 考试按钮跳转连接
firstIntoExam: false, // true弹框,是否首次进入考试,用于首次跳转弹框提示,只跟项目和人员有关
jumpToContents: false, // 是否跳转到目录
// cmeType=2时不显示进度,
// projectNo为空时不显示项目编号,
// projectLeader为空时不显示项目负责人,
// inScope=0时考试按钮不显示,
// currentProgress>1时考试按钮显示并可用
},
projectLeader: {},
doctorList: [],
from: "inner",
isBlack: false,
showLoading: false,
projectId: "1",
//componentId: 1,
//moduleId: 1,
contentList: [],
//moduleName: "",
bannerType: 1, // 1 图片 2视频
videoOptions: {
mp4: "",
autoplay: false, //iOS下safari浏览器,以及大部分移动端浏览器是不开放视频自动播放这个能力的
coverpic: require("../images/video-cover.png"),
width: "415", //视频的显示宽度,请尽量使用视频分辨率宽度
height: "210" //视频的显示高度,请尽量使用视频分辨率高度
},
//projectStatus: 1, //1没有获得证书 2是获得全部证书
attachmentUrl: require("../images/banner-default.png"),
bgColor: "none",
navTitle: "项目详情",
// compTitle: "组件名称",
isShowNavbar: true,
isFixNavbar: true,
pointStyle: "activity",
projectComponentDTOS: [],
actionList: [],
detailNum: 0,
courseRequire: 0,
clientType: 0,
// currentProgress>1时考试按钮显示并可用
btnType: 'primary', // primary: 可跳转时(currentProgress = 1); disabled: 不可跳转时
btnText: '学完全部课程,可参加考试', // 参加考试(currentProgress = 1); 或者学完全部课程,可参加考试
provinceId: '',
organizationId: '',
isShowPopup: false,
cardInfo: {
id: 0
},
advertInfoList: [],
};
},
components: {
CommonNavbar,
CommonDescription,
CommonSpliteLine,
CellListDetail,
Loading,
CommonTcPlayer,
CmeStep,
BasicInfo,
LearnKnow,
ItemIntro,
ItemLeader,
TeacterIntro,
CommonDialog,
ExjumperButton,
ExjumperDialog,
CardPopup,
CommonAdertImg,
NoMoreContent
},
computed: {
...mapGetters(["userInfo"]),
},
created() {
let _this = this;
this.from = this.$route.query.from || this.from || "native";
this.projectId = this.$route.query.id || 1;
// 此两个参数将由接口返回
// this.courseRequire = this.$route.query.courseRequire;
// this.provinceId = this.$route.query && this.$route.query.provinceId || 0;
// this.organizationId = this.$route.query && this.$route.query.organizationId || 0;
window.__getUserInfo64Comp = function(param) {
// appVersion 安卓 3.2.2 iOS
console.log('__getUserInfo64Comp', param);
_this.token = param.userToken;
_this.setUserInfo(param);
_this.checkToken();
_this.getProjectParticularsV2();
};
_this.getUserInfo();
// if (__isWeb && process.env.BUILD_ENV == "development") {
// let param = {};
// __getUserInfo64Comp(param);
// }
if (__isWeb) {
_this.getProjectParticularsV2();
}
window.__refresh = function() {
_this.getUserInfo();
};
// 打开页面埋点
this.$sendBuriedData({
// action: "打开页面",
component_tag: `211#0#${this.projectId}#0`
});
window.__getPositionData = function(param) {
console.log(param);
// _this.showLoading = false;
param.setEntry = true;
_this.getProvinceIdByPosition(param);
}
// 调用广告位接口
this.getAdvertInfoList();
},
mounted() {
window.addEventListener("scroll", this.scrollFun);
const _this = this;
},
beforeDestroyed() {
window.removeEventListener("scroll", this.scrollFun);
},
methods: {
...mapActions(["setUserInfo"]),
// 查询教培项目广告位配置信息
getAdvertInfoList() {
let param = {
setEntry: true
};
this.GET(`portal/jump/${this.projectId}/1`, param).then(res => {
if (res.code == "000000") {
this.advertInfoList = res.data && res.data.list || [];
console.log('advertInfoList', this.advertInfoList);
}
});
},
// 点击弹层
clickOverlay() {
console.log('clickOverlay');
this.isShowPopup = false;
},
// 点击“参与考试”
beforeJumpToExam() {
this.$sendBuriedData({
component_tag: `882#8824`
});
// 如果是首次,则弹出弹框
if(this.project.firstIntoExam) {
this.isShowEJDialog = true;
} else {
this.isBuy(2);
// this.jumpToExamAction();
}
},
// 第一次跳转弹框,点击时调用相应接口
handlerEJAction() {
this.$sendBuriedData({
component_tag: `883#8831`
});
this.isShowEJDialog = false;
this.isBuy(2);
// this.jumpToExamAction();
this.firstIntoExamAction();
},
// 判断用户是否购买过I类学习卡
isBuy(cardType) {
this.showLoading = true;
// alert(this.showLoading)
let param = {
cardType: cardType,
setEntry: true,
}
this.GET("trade/storage/card/isBuy", param).then(res => {
if (res.code == "000000") {
// 如果购买过,则直接跳转到中华医学会页面
if(res.data) {
this.jumpToCardList();
} else {
this.preJumper();
}
}
});
},
// 跳转II类学习详情页面(中华医学会项目详情页面)
jumpToCardList() {
this.$sendBuriedData({
component_tag: `885#8851`
});
this.showLoading = false;
this.isShowPopup = false;
// 判断版本号,如果小于3.4.0,则只做提示
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split('.').join('');
if(appVersionNum < 341) {
Toast('请您下载新版本App');
return;
}
if (window.__isWeb) {
return;
} else {
let pageUrl = this.project.examBtnUrl;
let paramList = [
{
key: "pageUrl",
value: pageUrl,
type: 4,
seqNo: 1
},
// 此字段不配置,则用原来的逻辑
{
key: "needCache",
value: '1', // 0不缓存,其它值都做缓存
type: 4,
seqNo: 1
}
]
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
});
}
},
// 跳转前判断是否有机构,否则使用定位信息
preJumper() {
if(this.organizationId != 0 && this.provinceId != 0) {
this.getCardInfoByProvinceId(this.provinceId);
} else {
this.getPositionData();
}
},
// 根据位置信息获取省ID
getProvinceIdByPosition(param) {
param.setEntry = true;
this.POST("aggregate/cme/convertLocationToProvinceId", param).then(res => {
if (res.code == "000000") {
this.getCardInfoByProvinceId(res.data);
}
});
},
// 根据省ID,获取学习卡信息
getCardInfoByProvinceId(provinceId) {
let param = {
"area": provinceId + '',
"cardType": 2,
"pageNum": 1,
"pageSize": 1
}
this.POST("trade/goods/cardList", param).then(res => {
if (res.code == "000000") {
this.showLoading = false;
this.isShowPopup = true;
this.cardInfo = res.data && res.data[0] || {id: 0} ;
}
});
},
// 获取地理位置信息
getPositionData() {
// this.showLoading = true;
console.log('getPositionData');
rocNative.getPositionData({
__funcName: "__getPositionData"
});
},
// 跳转到原生的购买页面
confirm() {
this.$sendBuriedData({
component_tag: `885#8852`
});
this.isShowPopup = false;
let pageUrl = this.project.examBtnUrl;
let paramList = [
{
key: "className",
value: "com.picahealth.yunque.activitys.studycard.StudyCardDetailActivity###PicaDo.LearningCardVC",
type: 4,
seqNo: 1
},
{
key: "goodId",
value: this.cardInfo.id,
type: 4,
seqNo: 1
},
{
key: "courseUrl",
value: encodeURIComponent(pageUrl),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M200",
jsonString: paramList
});
},
// 跳转到第三方考试页面
jumpToExamAction() {
// 判断版本号,如果小于3.4.0,则只做提示
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split('.').join('');
if(appVersionNum < 341) {
Toast('请您下载新版本App');
return;
}
let paramList = [
{
key: "pageUrl",
value: this.project.examBtnUrl,
type: 4,
seqNo: 1
},
// 此字段不配置,则用原来的逻辑
{
key: "needCache",
value: '1', // 0不缓存,其它值都做缓存
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
});
},
// 首次进入考试时记录(点击‘我知道了’时调用)
firstIntoExamAction() {
let _this = this;
let param = {
token: _this.userInfo.userToken || this.token,
setEntry: true
};
this.NEW_POST(`cme/project/${_this.projectId}/firstIntoExam`, param).then(res => {
if (res.code == "000000") {
this.project.firstIntoExam = false;
}
});
},
//获取用户信息
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfo64Comp"
});
},
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken || _this.token,
setEntry: true
};
this.GET("campaign/admin/task/checkToken", param).then(res => {
if (res.code !== "000000") {
//未登录 跳转登录页
console.log("跳登录");
rocNative.gotoLogin();
} else {
// if (!_this.premissionFlag) {
// _this.premissionFlag = true;
// _this.permission(); // 提示是否有机构和在申请范围内
// }
}
});
},
//(判断是否加入机构,是否为认证用户,是否在申请范围内)
permission() {
let _this = this;
let param = {
id: _this.projectId,
creditId: _this.project.creditId,
token: _this.userInfo.userToken || this.token,
setEntry: true
};
_this.NEW_POST("cme/credit/rangeCheck", param).then(res => {
if ( (_this.project.cmeType != 2) && (res.code == "219004" || res.code == "219012")) {
// 未加入机构 219004 不在申请范围 219012
this.dialogContent = `该项目仅对${_this.project.scope}的用户开放`;
this.cancleBtnText = "我知道了";
this.isShowDialog = true;
this.isSingle = true;
} else {
this.isShowDialog = false;
}
});
},
// 立即申请学分
applicationCredit() {
let _this = this;
let param = {
id: _this.projectId,
creditId: _this.project.creditId,
token: _this.userInfo.userToken || this.token,
setEntry: true
};
_this.NEW_POST("cme/credit/applyCheck", param).then(res => {
if (res.code == "000000") {
gotoPage(
_this,
`cme/#/credit-edit?creditId=${_this.project.creditId}`
);
} else if (res.code == "219004" || res.code == "219005") {
// 未加入机构 219004 未身份认证 219005 不在申请范围 219012
let params = {
__funcName: "__checkPermissions",
permCode: "009014"
};
rocNative.checkPermissions(params);
}
// else if (res.code == "219012") {
// this.dialogContent = res.message;
// this.cancleBtnText = "我知道了";
// this.isShowDialog = true;
// this.isSingle = true;
// }
else {
this.dialogContent = res.message;
this.cancleBtnText = "我知道了";
this.isShowDialog = true;
this.isSingle = true;
}
});
},
// 弹框按钮事件
handlerAction(data) {
this.isShowDialog = false;
},
scrollFun() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
let h = intorOffsetTop - 135
// 显示头部导航
if (scrollTop > 20) {
this.isBlack = true;
this.bgColor = "#fff";
} else {
this.isBlack = false;
this.bgColor = "none";
}
if(window.__isWeb) {
h = intorOffsetTop - 75;
} else if(window.__isIOS) {
h = intorOffsetTop - 140;
}
// 如果滚动高度大于简介头部(并减去tab高度),则进行固定
if(scrollTop > h) {
this.fixedFlag = true;
} else {
this.fixedFlag = false;
}
// 如果滚动高度大于
if(scrollTop > cataOffsetTop - 600) {
this.tabFlag = false;
} else {
this.tabFlag = true;
}
},
// 锚点到简介
jumpIntro() {
if(!this.tabFlag) {
this.tabFlag = true;
}
if(!this.fixedFlag) {
this.fixedFlag = true;
}
let h;
if (this.isWeb) {
h = intorOffsetTop - 30 - titleOffsetHeight;
} else {
h = intorOffsetTop - 85 - titleOffsetHeight;
}
window.scrollTo(0, h);
this.isBlack = true;
this.bgColor = "#fff";
this.$sendBuriedData({
component_tag: `211#211007#${this.projectId}`
});
},
// 锚点到目录
jumpCatalogue() {
if(this.tabFlag) {
this.tabFlag = false;
}
if(!this.fixedFlag) {
this.fixedFlag = true;
}
let h;
if (this.isWeb) {
h = cataOffsetTop - titleOffsetHeight;
} else {
h = cataOffsetTop - 100;
}
window.scrollTo(0, h);
this.isBlack = true;
this.bgColor = "#fff";
this.$sendBuriedData({
component_tag: `211#211008#${this.projectId}`
});
},
// 获取项目详情
getProjectParticularsV2() {
let _this = this;
let param = {
token: _this.userInfo.userToken || this.token,
setEntry: true
};
_this.showLoading = true;
this.NEW_GET(`cme/project/${_this.projectId}/info`, param).then(res => {
if (res.code == "000000") {
// 先设置视频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
_this.project = res.data;
if (_this.project.projectIntro) {
_this.textContent =
_this.project.projectIntro.length > 70
? _this.project.projectIntro.slice(0, 70) + "..."
: this.project.projectIntro;
}
_this.project.mustKnow = _this.project.mustKnow.replace(
/(\r\n)|\r|\n/g,
"<br>"
);
_this.projectLeader = res.data.projectLeader;
if (_this.projectLeader && _this.projectLeader.info) {
_this.leaderText =
_this.projectLeader.info.length > 70
? _this.projectLeader.info.slice(0, 70) + "..."
: this.projectLeader.info;
}
_this.doctorList = res.data.doctorList;
//_this.projectStatus = res.data.projectStatus;
_this.projectComponentDTOS = _this.setListData(
res.data.projectComponentDTOS
);
if (!_this.isWeb && !_this.premissionFlag) {
_this.premissionFlag = true;
_this.permission(); // 提示是否有机构和在申请范围内
}
// TODO Add by Anndy Yang
if (_this.project.currentProgress == 2) {
_this.$nextTick(() => {
window.scrollTo(0, 0);
});
}
_this.provinceId = res.data.positionModel.provinceId;
_this.organizationId = res.data.positionModel.organizationId;
_this.courseRequire = res.data.courseRequire || 0;
setTimeout( () => {
cataOffsetTop = document.getElementById("catalogue-content").offsetTop;
intorOffsetTop = document.getElementById("intro-content").offsetTop;
console.log('getProjectParticularsV2', cataOffsetTop, intorOffsetTop);
// 直接跳转
if(_this.project.jumpToContents) {
setTimeout(() => {
this.jumpCatalogue();
}, 200);
}
}, 200);
setTimeout(() => {
_this.showLoading = false;
}, 800);
}
});
},
// 项目负责人--详情(收起)
changeLeaderText(data) {
let _this = this;
if (_this.projectLeader.info) {
if (!data.allTextFlag) {
_this.leaderText =
_this.projectLeader.info.length > 70
? _this.projectLeader.info.slice(0, 70) + "..."
: this.projectLeader.info;
} else {
_this.leaderText = _this.projectLeader.info;
}
}
},
// 项目介绍
itemIntroText(data) {
let _this = this;
if (_this.project.projectIntro) {
if (!data.allTextFlag) {
_this.textContent =
_this.project.projectIntro.length > 70
? _this.project.projectIntro.slice(0, 70) + "..."
: this.project.projectIntro;
} else {
_this.textContent = _this.project.projectIntro;
}
}
},
setListData(data) {
let _this = this;
let list = data;
let actionList = [];
let detailNum = 0;
for (let i = 0; i < list.length; i++) {
for (let j = 0; j < list[i].portalModuleDTOS.length; j++) {
detailNum++;
if (list[i].portalModuleDTOS[j].status === 2) {
list[i].portalModuleDTOS[j].value =
"共" + list[i].portalModuleDTOS[j].nodeCount + "节";
} else {
list[i].portalModuleDTOS[j].value = "尚未开始";
}
list[i].portalModuleDTOS[j].disabled =
list[i].portalModuleDTOS[j].status === 2 ? false : true;
//展开项记录
if (list[i].portalModuleDTOS[j].expandStatus == 1) {
actionList.push(list[i].portalModuleDTOS[j].expandKey);
}
for (
let z = 0;
z < list[i].portalModuleDTOS[j].contentList.length;
z++
) {
list[i].portalModuleDTOS[j].contentList[z].height = _this.getHight(
list[i].portalModuleDTOS[j].contentList[z]
);
}
}
}
_this.actionList = actionList;
_this.detailNum = detailNum;
console.log("list转为:", list, actionList, detailNum);
// list[0].portalModuleDTOS[3].contentList[0].certificateFlag = 2;
// list[0].portalModuleDTOS[3].contentList[1].certificateFlag = 2;
return list;
},
getHight(data) {
let len = vueFilters.strLength(data.name);
let certificate = data.certificateFlag;
if (len > 30 && certificate == 2) {
return "2";
} else if (len > 30 && certificate != 2) {
return 2;
} else if (len <= 30 && certificate == 2) {
return "1";
} else if (len <= 30 && certificate != 2) {
return 1;
}
}
}
};
</script>
<style lang="scss" scoped>
@import "../style/mixin";
.page-container-merge {
.nav-top .nav-title {
height: px2rem(0px);
// padding: px2rem(18px);
}
.banner-img {
display: inherit;
width: px2rem(375px);
height: px2rem(210px);
&-1 {
position: absolute;
left: 0;
top: px2rem(180px);
width: px2rem(76px);
height: px2rem(30px);
}
&-5 {
position: absolute;
left: 0;
top: px2rem(180px);
width: px2rem(76px);
height: px2rem(30px);
}
&-10 {
position: absolute;
left: 0;
top: px2rem(180px);
width: px2rem(76px);
height: px2rem(30px);
}
}
.list-container {
// margin-bottom: px2rem(40px);
}
.intro-catalogue-container {
.title {
height: px2rem(50px);
line-height: px2rem(30px);
padding: 0 px2rem(15px);
border-bottom: 1px solid #f0f1f2;
span {
display: inline-block;
line-height: px2rem(15px);
font-size: px2rem(15px);
color: #979899;
padding-right: px2rem(35px);
}
span.focus {
position: relative;
color: #373839;
}
span.focus:after {
content: "";
position: absolute;
left: px2rem(9px);
bottom: px2rem(-14px);
background: #449284;
// border-bottom: px2rem(1px) solid #449284;
width: px2rem(10px);
height: px2rem(3px);
border-radius: px2rem(3px);
}
}
.title.fixed-title-1 {
position: fixed;
left: 0;
top: px2rem(60px);
background: #fff;
width: 100%;
z-index: 999;
}
.title.fixed-title-2 {
position: fixed;
left: 0;
top: px2rem(0px);
background: #fff;
width: 100%;
z-index: 999;
}
.catalogue-content {
padding: px2rem(30px) px2rem(15px) 0;
.catalogue-title {
font-size: px2rem(18px);
color: #373839;
font-weight: 700;
margin-bottom: px2rem(16px);
}
}
.fixed-flag-height {
height: px2rem(50px);
}
}
}
.no-more-bottom {
position: relative;
width: 100%;
height: px2rem(40px);
}
</style>
...@@ -125,11 +125,14 @@ ...@@ -125,11 +125,14 @@
/> />
<ExjumperButton <ExjumperButton
@btnClick="beforeJumpToExam" @btnClick="beforeJumpToExam"
v-if="project.cmeType == 2" v-if="project.cmeType == 2 && project.hasBindCard"
:btnText="project.currentProgress > 1 ? '参加考试' : '学完全部课程,可参加考试'" :btnText="project.currentProgress > 1 ? '参加考试' : '学完全部课程,可参加考试'"
:type="project.currentProgress > 1 ? 'primary' : 'disabled'"></ExjumperButton> :type="project.currentProgress > 1 ? 'primary' : 'disabled'"></ExjumperButton>
<div v-if="project.cmeType == 2" style="padding-top: 30px"></div> <div v-if="project.cmeType == 2" style="padding-top: 30px"></div>
<CardPopup :cardInfo="cardInfo" :isShow="isShowPopup" @clickOverlay="clickOverlay" @cancle="jumpToCardList()" @confirm="confirm"></CardPopup>
<BindCardButton v-if="project.cmeType == 2 && !project.hasBindCard" :cardInfo="cardInfo"></BindCardButton>
<!-- <CardPopup :cardInfo="cardInfo" :isShow="isShowPopup" @clickOverlay="clickOverlay" @cancle="jumpToCardList()" @confirm="confirm"></CardPopup> -->
<Loading v-show="showLoading" /> <Loading v-show="showLoading" />
</div> </div>
</template> </template>
...@@ -160,7 +163,8 @@ import { getWebPageUrl, gotoPage } from "@/utils/index"; ...@@ -160,7 +163,8 @@ import { getWebPageUrl, gotoPage } from "@/utils/index";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import vueFilters from "@/utils/filter"; import vueFilters from "@/utils/filter";
import { Toast } from 'vant'; import { Toast } from 'vant';
import CardPopup from "@/components/cme/card-popup"; // import CardPopup from "@/components/cme/card-popup";
import BindCardButton from "@/components/cme/bind-card-button";
let cataOffsetTop = 0; let cataOffsetTop = 0;
let intorOffsetTop = 0; let intorOffsetTop = 0;
...@@ -210,6 +214,7 @@ export default { ...@@ -210,6 +214,7 @@ export default {
examBtnUrl: '', // 考试按钮跳转连接 examBtnUrl: '', // 考试按钮跳转连接
firstIntoExam: false, // true弹框,是否首次进入考试,用于首次跳转弹框提示,只跟项目和人员有关 firstIntoExam: false, // true弹框,是否首次进入考试,用于首次跳转弹框提示,只跟项目和人员有关
jumpToContents: false, // 是否跳转到目录 jumpToContents: false, // 是否跳转到目录
hasBindCard: false, // 是否绑定过学习卡或兑换过 没有绑定,则显示绑定按钮
// cmeType=2时不显示进度, // cmeType=2时不显示进度,
// projectNo为空时不显示项目编号, // projectNo为空时不显示项目编号,
// projectLeader为空时不显示项目负责人, // projectLeader为空时不显示项目负责人,
...@@ -275,9 +280,10 @@ export default { ...@@ -275,9 +280,10 @@ export default {
CommonDialog, CommonDialog,
ExjumperButton, ExjumperButton,
ExjumperDialog, ExjumperDialog,
CardPopup, // CardPopup,
CommonAdertImg, CommonAdertImg,
NoMoreContent NoMoreContent,
BindCardButton
}, },
computed: { computed: {
...@@ -355,7 +361,7 @@ export default { ...@@ -355,7 +361,7 @@ export default {
// 点击弹层 // 点击弹层
clickOverlay() { clickOverlay() {
console.log('clickOverlay'); console.log('clickOverlay');
this.isShowPopup = false; // this.isShowPopup = false;
}, },
// 点击“参与考试” // 点击“参与考试”
...@@ -367,8 +373,8 @@ export default { ...@@ -367,8 +373,8 @@ export default {
if(this.project.firstIntoExam) { if(this.project.firstIntoExam) {
this.isShowEJDialog = true; this.isShowEJDialog = true;
} else { } else {
this.isBuy(2); // this.isBuy(2);
// this.jumpToExamAction(); this.jumpToCardList();
} }
}, },
...@@ -378,30 +384,30 @@ export default { ...@@ -378,30 +384,30 @@ export default {
component_tag: `883#8831` component_tag: `883#8831`
}); });
this.isShowEJDialog = false; this.isShowEJDialog = false;
this.isBuy(2); this.jumpToCardList();
// this.jumpToExamAction(); // this.isBuy(2);
this.firstIntoExamAction(); this.firstIntoExamAction();
}, },
// 判断用户是否购买过I类学习卡 // 判断用户是否购买过I类学习卡
isBuy(cardType) { // isBuy(cardType) {
this.showLoading = true; // this.showLoading = true;
// alert(this.showLoading) // // alert(this.showLoading)
let param = { // let param = {
cardType: cardType, // cardType: cardType,
setEntry: true, // setEntry: true,
} // }
this.GET("trade/storage/card/isBuy", param).then(res => { // this.GET("trade/storage/card/isBuy", param).then(res => {
if (res.code == "000000") { // if (res.code == "000000") {
// 如果购买过,则直接跳转到中华医学会页面 // // 如果购买过,则直接跳转到中华医学会页面
if(res.data) { // if(res.data) {
this.jumpToCardList(); // this.jumpToCardList();
} else { // } else {
this.preJumper(); // this.preJumper();
} // }
} // }
}); // });
}, // },
// 跳转II类学习详情页面(中华医学会项目详情页面) // 跳转II类学习详情页面(中华医学会项目详情页面)
jumpToCardList() { jumpToCardList() {
...@@ -410,7 +416,7 @@ export default { ...@@ -410,7 +416,7 @@ export default {
}); });
this.showLoading = false; this.showLoading = false;
this.isShowPopup = false; // this.isShowPopup = false;
// 判断版本号,如果小于3.4.0,则只做提示 // 判断版本号,如果小于3.4.0,则只做提示
let appVersion = this.userInfo.appVersion; let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split('.').join(''); let appVersionNum = appVersion.split('.').join('');
...@@ -446,10 +452,15 @@ export default { ...@@ -446,10 +452,15 @@ export default {
// 跳转前判断是否有机构,否则使用定位信息 // 跳转前判断是否有机构,否则使用定位信息
preJumper() { preJumper() {
if(this.organizationId != 0 && this.provinceId != 0) { // TODO 测试代码
this.getCardInfoByProvinceId(this.provinceId); if(window.__isWeb) {
this.getCardInfoByProvinceId(310);
} else { } else {
this.getPositionData(); if(this.organizationId != 0 && this.provinceId != 0) {
this.getCardInfoByProvinceId(this.provinceId);
} else {
this.getPositionData();
}
} }
}, },
...@@ -474,7 +485,7 @@ export default { ...@@ -474,7 +485,7 @@ export default {
this.POST("trade/goods/cardList", param).then(res => { this.POST("trade/goods/cardList", param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.showLoading = false; this.showLoading = false;
this.isShowPopup = true; // this.isShowPopup = true;
this.cardInfo = res.data && res.data[0] || {id: 0} ; this.cardInfo = res.data && res.data[0] || {id: 0} ;
} }
}); });
...@@ -495,7 +506,7 @@ export default { ...@@ -495,7 +506,7 @@ export default {
component_tag: `885#8852` component_tag: `885#8852`
}); });
this.isShowPopup = false; // this.isShowPopup = false;
let pageUrl = this.project.examBtnUrl; let pageUrl = this.project.examBtnUrl;
let paramList = [ let paramList = [
{ {
...@@ -522,36 +533,6 @@ export default { ...@@ -522,36 +533,6 @@ export default {
jsonString: paramList jsonString: paramList
}); });
}, },
// 跳转到第三方考试页面
jumpToExamAction() {
// 判断版本号,如果小于3.4.0,则只做提示
let appVersion = this.userInfo.appVersion;
let appVersionNum = appVersion.split('.').join('');
if(appVersionNum < 341) {
Toast('请您下载新版本App');
return;
}
let paramList = [
{
key: "pageUrl",
value: this.project.examBtnUrl,
type: 4,
seqNo: 1
},
// 此字段不配置,则用原来的逻辑
{
key: "needCache",
value: '1', // 0不缓存,其它值都做缓存
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
});
},
// 首次进入考试时记录(点击‘我知道了’时调用) // 首次进入考试时记录(点击‘我知道了’时调用)
firstIntoExamAction() { firstIntoExamAction() {
...@@ -816,9 +797,13 @@ export default { ...@@ -816,9 +797,13 @@ export default {
setTimeout(() => { setTimeout(() => {
_this.showLoading = false; _this.showLoading = false;
}, 800); }, 800);
// TODO 如果 hasBindCard 为false,则获取卡信息
_this.preJumper()
} }
}); });
}, },
// 项目负责人--详情(收起) // 项目负责人--详情(收起)
changeLeaderText(data) { changeLeaderText(data) {
let _this = this; let _this = this;
...@@ -833,6 +818,7 @@ export default { ...@@ -833,6 +818,7 @@ export default {
} }
} }
}, },
// 项目介绍 // 项目介绍
itemIntroText(data) { itemIntroText(data) {
let _this = this; let _this = this;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册