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

埋点问题

上级 461e086c
......@@ -115,6 +115,9 @@ export default {
methods: {
// 立即申请
applyFor() {
this.$sendBuriedData({
component_tag: `211#211001#${this.projectId}`
});
this.$emit("applicationCredit");
},
// 关闭提示
......@@ -123,6 +126,9 @@ export default {
},
// 审核
verifyResult() {
this.$sendBuriedData({
component_tag: `211#211003#${this.projectId}`
});
gotoPage(this,`cme/#/credit-detail?creditId=${this.creditId}&projectId=${this.projectId}`)
},
// 获得学分--下载证书
......@@ -164,6 +170,9 @@ export default {
modeCode: "M200",
jsonString: paramList
});
this.$sendBuriedData({
component_tag: `211#211004#${this.projectId}`
});
}
}
};
......
<template>
<!-- 组件详情页面:模块列表及其下面的元件列表 -->
<div class="page-container-merge">
<CommonNavbar
id="header"
:bgColor="bgColor"
v-show="isShowNavbar"
:isBlack="isBlack"
:title="navTitle"
: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.png" />
</div>
<!-- banner视频 -->
<CommonTcPlayer v-if="bannerType == 2" style="flex" :options="videoOptions"></CommonTcPlayer>
<!-- 项目标题 -->
<CommonDescription
:projectName="project.projectName"
:studyNum="project.studyNum"
:subject="project.subject"
/>
<!-- 步骤条 -->
<CmeStep
:currentProgress="project.currentProgress"
:studyProgress="project.studyProgress"
:credit="project.credit"
:creditId="project.creditId"
:certificateUrl="project.certificateUrl"
@applicationCredit="applicationCredit"
/>
<!-- 简介和目录 -->
<div class="intro-catalogue-container">
<div id="content-title" class="title" :class="{'fixed-title': fixedFlag}">
<span :class="{'focus': tabFlag}" @click="jumpIntro">简介</span>
<span :class="{'focus': !tabFlag}" @click="jumpCatalogue">目录</span>
</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"
/>
<LearnKnow :mustKnow="project.mustKnow"></LearnKnow>
<CommonSpliteLine></CommonSpliteLine>
<ItemIntro :textContent="project.projectIntro"></ItemIntro>
<ItemLeader :projectLeader="projectLeader"></ItemLeader>
<TeacterIntro :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>
</div>
<Loading v-show="showLoading" />
<!-- 弹框 -->
<CommonDialog
:isShowDialog="isShowDialog"
:isSingle="isSingle"
:cancleBtnText="cancleBtnText"
:confirmBtnText="confirmBtnText"
:content="dialogContent"
@handlerAction="handlerAction"
/>
</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 CommonTitle from "@/components/common/common-title";
// import CertShow from "@/components/business/cert-show";
// import CellListItem from "@/components/business/cell-list-item";
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 { getWebPageUrl } from "@/utils/index";
import { mapGetters, mapActions } from "vuex";
import vueFilters from "@/utils/filter";
export default {
data() {
return {
premissionFlag: false,
isSingle: false,
dialogContent: "", // 弹框内容
confirmBtnText: "", // 弹框按钮
cancleBtnText: "",
isShowDialog: false,
tabFlag: true, // 显示目录还是简介
fixedFlag: false, // 目录和简介是否固定
project: {
credit: "", // 学分
creditId: 0, // 学分Id
level: "", // 项目等级
scope: "", // 申请范围
remind: "", // 在不在范围提醒
startDate: "", // 开始时间
endDate: "", // 结束时间
organName: "", // 发起机构
projectName: "", // 项目名称
projectNo: "", // 项目编号
currentProgress: 0, // 项目进度
projectIntro: "", // 项目介绍
mustKnow: "", // 学习须知
studyNum: 0, // 学习人数
studyProgress: "0%", // 学习进度
subject: "", // 学科
status: 0, // 项目状态 1是参加中 5是进行中 10是已结束
certificateUrl: "" // 证书url
},
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
};
},
components: {
CommonNavbar,
CommonDescription,
CommonSpliteLine,
CellListDetail,
Loading,
CommonTcPlayer,
CmeStep,
BasicInfo,
LearnKnow,
ItemIntro,
ItemLeader,
TeacterIntro,
CommonDialog
},
computed: {
...mapGetters(["userInfo"])
},
created() {
let _this = this;
this.from = this.$route.query.from || this.from || "native";
this.projectId = this.$route.query.id || 1;
//this.componentId = this.$route.query.componentId;
// this.moduleId = this.$route.query.moduleId;
//this.moduleName = this.$route.query.moduleName;
this.courseRequire = this.$route.query.courseRequire;
window.__getUserInfo64Comp = function(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);
}
// alert('mounted __before');
window.__refresh = function() {
// _this.getProjectParticularsV2();
_this.getUserInfo();
};
},
mounted() {
window.addEventListener("scroll", this.scrollFun);
const _this = this;
},
beforeDestroyed() {
window.removeEventListener("scroll", this.scrollFun);
},
methods: {
...mapActions(["setUserInfo"]),
//获取用户信息
getUserInfo() {
rocNative.getUserInfo({
__funcName: "__getUserInfo64Comp"
});
},
scrollFun() {
let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop;
const catalogue = document.getElementById("catalogue-content");
const h = catalogue.offsetTop - 600;
if (scrollTop > 20) {
this.isBlack = true;
this.bgColor = "#fff";
} else {
this.isBlack = false;
this.bgColor = "none";
}
if (scrollTop > 300) {
this.fixedFlag = true;
} else {
this.fixedFlag = false;
}
if (scrollTop > h) {
this.tabFlag = false;
} else {
this.tabFlag = true;
}
},
// token是否失效校验
checkToken() {
let _this = this;
let param = {
token: _this.userInfo.userToken,
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 || 1,
token: _this.userInfo.userToken || "AAA613F74B7A4746AEE8354458FF4896",
setEntry: true
};
_this.NEW_POST("cme/credit/applyCheck", param).then(res => {
if (res.code == "219004" || res.code == "219012") {
// 未加入机构 219004 未身份认证 219005 不在申请范围 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 || 1,
token: _this.userInfo.userToken || "AAA613F74B7A4746AEE8354458FF4896",
setEntry: true
};
_this.NEW_POST("cme/credit/applyCheck", param).then(res => {
if (res.code == "000000") {
let paramList = [
{
key: "pageUrl",
value: getWebPageUrl(`cme/#/credit-edit?id=${_this.project.creditId}`),
type: 4,
seqNo: 1
}
];
rocNative.dispatchEventByModuleCode({
modeCode: "M300",
jsonString: paramList
});
} 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;
}
});
},
// 弹框按钮事件
handlerAction(data) {
if (data == 2) {
if (this.confirmBtnText == "去认证") {
rocNative.gotoAuthentication();
}
} else {
this.isShowDialog = false;
}
},
// 锚点到简介
jumpIntro() {
this.tabFlag = true;
this.fixedFlag = true;
const intro = document.getElementById("intro-content");
const title = document.getElementById("content-title");
const h = intro.offsetTop - 70;
window.scrollTo(0, h);
this.isBlack = true;
this.bgColor = "#fff";
this.$sendBuriedData({
component_tag: `211#211007#${this.projectId}`
});
},
// 锚点到目录
jumpCatalogue() {
this.tabFlag = false;
this.fixedFlag = true;
const catalogue = document.getElementById("catalogue-content");
const h = catalogue.offsetTop;
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 || "AAA613F74B7A4746AEE8354458FF4896",
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;
_this.projectLeader = res.data.projectLeader;
_this.doctorList = res.data.doctorList;
if (_this.project.currentProgress == 2) {
// this.dialogContent =
// "恭喜您已经完成该项目学习及考试,快去申请学分吧";
// this.confirmBtnText = "立即申请";
// this.isShowDialog = true;
}
//_this.projectStatus = res.data.projectStatus;
_this.projectComponentDTOS = _this.setListData(
res.data.projectComponentDTOS
);
}
//_this.showLoading = false;
});
},
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;
}
}
// 获取单个模块信息
// getComponentInfoById(componentId) {
// let _this = this;
// let param = {
// componentId: componentId,
// token: _this.userInfo.userToken,
// setEntry: true
// };
// this.GET("portal/portalApp/component", param).then(res => {
// if (res.code == "000000") {
// _this.attachmentUrl = res.data.imageUrl;
// _this.projectIntro = res.data.introduce;
// _this.projectName = res.data.name;
// }
// });
// },
// 获取单个项目信息
// getCoopInfo(projectId) {
// let _this = this;
// let param = {
// portalProjectId: projectId,
// token: _this.userInfo.userToken,
// setEntry: true
// };
// this.GET("portal/portalApp/queryProjectParticulars", 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.projectIntro = res.data.projectIntro;
// _this.projectName = res.data.projectName;
// _this.pStatus = res.data.status;
// }
// });
// },
// setContent(data) {
// let list = data;
// for(let i=0;i<list.length;i++) {
// let len = vueFilters.strLength(list[i].name);
// let certificate = list[i].certificateFlag;
// if(len > 30 && certificate == 2) {
// list[i].height = "2";
// } else if (len > 30 && certificate != 2) {
// list[i].height = 2;
// } else if (len <= 30 && certificate == 2) {
// list[i].height = "1";
// } else if(len <= 30 && certificate != 2) {
// list[i].height = 1;
// }
// }
// console.log('contentList!',list);
// return list;
// },
// 获取内容列表
// getContentList(moduleId) {
// let _this = this;
// let param = {
// moduleId: _this.moduleId,
// token: _this.userInfo.userToken,
// setEntry: true,
// projectId: _this.projectId,
// };
// _this.showLoading = true;
// this.GET("portal/portalApp/contentList", param).then(res => {
// // _this.showLoading = false;
// if (res.code == "000000") {
// _this.contentList = _this.setContent(res.data.contentList);
// }
// });
// },
}
};
</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(148px);
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(7px);
bottom: px2rem(-14px);
background: #449284;
// border-bottom: px2rem(1px) solid #449284;
width: px2rem(10px);
height: px2rem(3px);
border-radius: px2rem(3px);
}
}
.title.fixed-title {
position: fixed;
left: 0;
top: px2rem(60px);
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);
}
}
}
}
</style>
......@@ -217,6 +217,12 @@ export default {
// _this.getProjectParticularsV2();
_this.getUserInfo();
};
// 打开页面埋点
this.$sendBuriedData({
action: '打开页面',
component_tag: `211#0#${this.projectId}#0`
});
},
mounted() {
window.addEventListener("scroll", this.scrollFun);
......@@ -338,6 +344,9 @@ export default {
window.scrollTo(0, h);
this.isBlack = true;
this.bgColor = "#fff";
this.$sendBuriedData({
component_tag: `211#211007#${this.projectId}`
});
},
// 锚点到目录
jumpCatalogue() {
......@@ -348,6 +357,9 @@ export default {
window.scrollTo(0, h);
this.isBlack = true;
this.bgColor = "#fff";
this.$sendBuriedData({
component_tag: `211#211008#${this.projectId}`
});
},
// 获取项目详情
getProjectParticularsV2() {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册