Commit e28d21e2 authored by chenkai1's avatar chenkai1

添加埋点

parent 27757f0c
......@@ -37,6 +37,8 @@
getHealthField
} from "@/api/common";
import md from '@/md';
const curTabIndex = ref(1);
onLoad((options) => {
......@@ -44,10 +46,21 @@
console.log('接收到的参数:', curTabIndex.value)
});
const onSelTab = (index) => {
let str = index === 1 ? '名医专家' : (index === 2 ? '科研专家' : '权威机构')
md.sensorLogTake({
xcxClick: "专家团二级页面点击",
pageName: "专家团-二级页面",
buttonName: str + "tab按钮点击",
});
curTabIndex.value = index;
}
//跳转到医生问诊页面
const onLink = async () => {
md.sensorLogTake({
xcxClick: "专家团二级页面点击",
pageName: "专家团-二级页面",
buttonName: "专家在线咨询按钮点击",
});
const res = await getHealthField();
if (!res.success) {
......
......@@ -60,7 +60,7 @@
<view class="tool">
<button v-if="homeStore && !homeStore.isLogin" open-type="getPhoneNumber"
@getphonenumber="onGetPhoneNumber" class="sq_btn"></button>
<image class="tool_bg" :src="$baseUrl + item.icon" @click="handleToolClick(item)">
<image class="tool_bg" :src="$baseUrl + item.icon" @tap="handleToolClick(item)">
</image>
<!-- <image class="tool_icon" :src="$baseUrl + item.icon"></image>
<image class="tool_jt" :src="$baseUrl + toolList.jtIcon"></image>
......@@ -83,12 +83,12 @@
<view class="et_box">
<view class="et_maintitle">{{ expertTeam.maintitle }}</view>
<view :data-log="{
xcxClick: '首页-首屏页面点击',
pageName: '首页-首屏',
buttonName: '文字资源位入口'
}" @tap="showPopup(1, $event)" class="et_subtitle">
<view class="txtlink">星妈会医生在线答疑群,为孩子成长保驾护航</view>
<image class="icon_more" :src="$baseUrl + 'homepage/et_more.png'"></image>
xcxClick: '首页-二屏页面点击',
pageName: '首页-二屏',
buttonName: '专家团副标题点击'
}" class="et_subtitle">
<view class="txtlink" @tap="showPopup1(1, 1)">星妈会医生在线答疑群,为孩子成长保驾护航</view>
<image class="icon_more" @tap="showPopup1(1, 2)" :src="$baseUrl + 'homepage/et_more.png'"></image>
</view>
<view class="et_main_box">
<view class="et_con_bg">
......@@ -118,7 +118,7 @@
</image>
</view>
</view>
<view class="et_con_box" @tap="onETMore">
<view class="et_con_box" @tap="onETMore(1, etTabSelIndex)">
<image class="et_con1" v-if="etTabSelIndex == 0" :src="$baseUrl + expertTeam.etConUrl1">
</image>
<image class="et_con2" v-if="etTabSelIndex == 1" :src="$baseUrl + expertTeam.etConUrl2">
......@@ -126,7 +126,7 @@
<image class="et_con3" v-if="etTabSelIndex == 2" :src="$baseUrl + expertTeam.etConUrl3">
</image>
</view>
<view class="et_more_txt" @tap="onETMore">
<view class="et_more_txt" @tap="onETMore(2, etTabSelIndex)">
<text class="txtlink">点击查看更多</text>
<image class="icon_arrow_yellow" :src="$baseUrl + 'homepage/icon_arrow_yellow.png'"></image>
</view>
......@@ -308,21 +308,31 @@
<script>
import { jump, JumpType } from '../utils';
import { useHomeStore } from '../stores/home';
import { fetchHomeJSON } from '../api/home';
import { useUserStore } from '../stores/user';
import RegisterLayer from "../components/RegisterLayer.vue";
import md from '../md';
import ExposureTracker from '../utils/exposure';
import { getHealthField } from "@/api/common";
// const homeStore = useHomeStore();
const userStore = useUserStore();
// 定义需要曝光检测的元素配置
const EXPOSURE_CONFIGS = [
{
import {
jump,
JumpType
} from '../utils';
import {
useHomeStore
} from '../stores/home';
import {
fetchHomeJSON
} from '../api/home';
import {
useUserStore
} from '../stores/user';
import RegisterLayer from "../components/RegisterLayer.vue";
import md from '../md';
import ExposureTracker from '../utils/exposure';
import {
getHealthField
} from "@/api/common";
// const homeStore = useHomeStore();
const userStore = useUserStore();
// 定义需要曝光检测的元素配置
const EXPOSURE_CONFIGS = [{
id: 'firstScreen',
logParams: {
xcxPage: '首页-首屏页面浏览',
......@@ -351,9 +361,9 @@ const EXPOSURE_CONFIGS = [
pageName: '首页-四屏'
}
}
];
];
export default {
export default {
beforeDestroy() {
if (this.exposureTracker) {
this.exposureTracker.resetAllExposure();
......@@ -387,8 +397,28 @@ export default {
bottomLinkList: [],
qrInfoObj: undefined,
popupIndex: 0,
qrInfoList: [{ title: '', desc: '', qrUrl: '' }, { title: '', desc: '', qrUrl: '' }, { title: '', desc: '', qrUrl: '' }, { title: '', desc: '', qrUrl: '' }],
qrObj: { title: '', desc: '', qrUrl: '' },
qrInfoList: [{
title: '',
desc: '',
qrUrl: ''
}, {
title: '',
desc: '',
qrUrl: ''
}, {
title: '',
desc: '',
qrUrl: ''
}, {
title: '',
desc: '',
qrUrl: ''
}],
qrObj: {
title: '',
desc: '',
qrUrl: ''
},
showVideo: false,
currentVideoUrl: '',
isClickPhoneAuth: false,
......@@ -471,7 +501,9 @@ export default {
})
},
async initHomeInfo() {
const { data } = await fetchHomeJSON();
const {
data
} = await fetchHomeJSON();
console.warn("data", data)
if (data) {
this.swiperList = data.swiperList;
......@@ -494,7 +526,8 @@ export default {
this.popupImageObj = data.popupImageObj || {};
if (this.homeStore.isLogin) {
this.vipCardList[0] = data.vipConfigList.find(item => item.grade === this.homeStore.homeInfo?.grade);
this.vipCardList[0] = data.vipConfigList.find(item => item.grade === this.homeStore.homeInfo
?.grade);
this.vipCardList[0].level = this.homeStore.homeInfo?.gradeName;
} else {
this.vipCardList[0] = data.vipConfigList[0];
......@@ -554,7 +587,7 @@ export default {
md.sensorLog(evt);
}
if (item.btnSubTitle.length > 0 && item.btnTitle.length > 0) {
return;//如果有按钮的话,废弃这个点击事件
return; //如果有按钮的话,废弃这个点击事件
}
if (item.link) {
jump(item.link);
......@@ -610,6 +643,22 @@ export default {
this.popupIndex = _index;
this.$refs.popup.open(this.popType);
},
showPopup1(_index, type) {
md.sensorLogTake({
xcxClick: `首页-二屏页面点击`,
pageName: `首页-二屏`,
buttonName: type == 1 ? '专家团副标题点击' : '专家团进群咨询按钮点击'
});
if (_index === 3) {
this.qrObj = null;
} else {
_index = Math.max(0, Math.min(_index, this.qrInfoList.length - 1));
this.qrObj = this.qrInfoList[_index];
}
this.popupIndex = _index;
this.$refs.popup.open(this.popType);
},
closePop() {
this.$refs.popup.close();
},
......@@ -678,9 +727,18 @@ export default {
},
goCustomerHandler(e) {
md.sensorLog(e);
const { memberId, mobile, openId, unionId } = this.homeStore.homeInfo;
const customerUrl = `https://intelcc-user.icsoc.net/?channelKey=45839e0505554f8c8aea3c7b6259b049&init=1&crmld=${memberId}&mobile=${mobile}&openId=${openId}&unionId=${unionId}`;
jump({ type: JumpType.H5, url: customerUrl });
const {
memberId,
mobile,
openId,
unionId
} = this.homeStore.homeInfo;
const customerUrl =
`https://intelcc-user.icsoc.net/?channelKey=45839e0505554f8c8aea3c7b6259b049&init=1&crmld=${memberId}&mobile=${mobile}&openId=${openId}&unionId=${unionId}`;
jump({
type: JumpType.H5,
url: customerUrl
});
},
checkExposure(scrollTop) {
if (this.exposureTracker) {
......@@ -703,9 +761,9 @@ export default {
async handleToolClick(item) {
md.sensorLogTake({
xcxClick: "我的页面点击",
pageName: "我的页面",
buttonName: item.title,
xcxClick: "首页-二屏页面点击",
pageName: "首页-二屏",
buttonName: item.title + "工具点击",
});
if (item.title === "医生问诊") {
......@@ -720,7 +778,13 @@ export default {
return;
}
const { sign, timestamp, appId, partnerUserId, env } = res.data;
const {
sign,
timestamp,
appId,
partnerUserId,
env
} = res.data;
jump({
type: JumpType.MINI,
......@@ -733,28 +797,60 @@ export default {
timestamp, // 参考 4.请求参数
appId, // 参考 4.请求参数
partnerUserId, // 参考 4.请求参数
targetApp:
"/h5/partner/shining-like-a-start/landing-free-consult?sysType=CRF",
targetApp: "/h5/partner/shining-like-a-start/landing-free-consult?sysType=CRF",
},
},
});
} else {
jump({ type: item.link.type, url: item.link.url });
jump({
type: item.link.type,
url: item.link.url
});
}
},
onSelEtTap(index) {
let str = index === 0 ? '名医专家' : (index === 1 ? '科研专家' : '权威机构')
md.sensorLogTake({
xcxClick: "首页-二屏页面点击",
pageName: "首页-二屏",
buttonName: str + "tab按钮点击",
});
this.etTabSelIndex = index;
},
onETMore() {
jump({ type: 1, url: '/pages/expertTeamPage/expertTeamPage?tab=' + (this.etTabSelIndex + 1) });
onETMore(index, type) {
let str = '';
if (type === 0) {
str = '名医专家';
} else if (type === 1) {
str = '科研专家';
} else {
str = '权威机构';
}
if (index === 1) {
str += '内容'
} else {
str += '点击查看更多';
}
md.sensorLogTake({
xcxClick: "首页-二屏页面点击",
pageName: "首页-二屏",
buttonName: str + "-点击",
});
jump({
type: 1,
url: '/pages/expertTeamPage/expertTeamPage?tab=' + (this.etTabSelIndex + 1)
});
},
closeImagePopup() {
this.$refs.imagePopup.close();
},
imagePopupJump() {
jump({ type: this.popupImageObj.jumpType, url: this.popupImageObj.jumpUrl });
jump({
type: this.popupImageObj.jumpType,
url: this.popupImageObj.jumpUrl
});
},
showImagePopup() {
this.$refs.imagePopup.open('center');
......@@ -781,13 +877,13 @@ export default {
}
}
}
}
}
</script>
<style lang="less" scoped>
@import '@/common.less';
@import '@/common.less';
.home-container {
.home-container {
width: 100vw;
overflow-x: hidden;
background-color: white;
......@@ -962,7 +1058,7 @@ export default {
width: 400rpx;
height: 700rpx;
.sq_btn{
.sq_btn {
position: absolute;
left: 0rpx;
top: 0rpx;
......@@ -1676,5 +1772,5 @@ export default {
z-index: 10;
}
}
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment