update埋点

This commit is contained in:
路 范
2021-09-17 11:35:29 +08:00
parent 0e6b6d7ffa
commit 2c1de9b107
2 changed files with 60 additions and 17 deletions

View File

@@ -3,9 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title>房屋征收</title>
<script type="text/javascript" src="https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085"></script>
<script type="text/javascript" src="//jssdk.yyhj.zjzwfw.gov.cn/jsbridge/v2.0.0/bridge.min.js"></script>
<!-- 引入ZWJSBridge -->
<script type="text/javascript" src="//assets.zjzwfw.gov.cn/assets/ZWJSBridge/1.0.1/zwjsbridge.js"></script>
</head>
<body>
@@ -13,7 +17,7 @@
<!-- built files will be auto injected -->
<script>
// console.log("初始页面");
(function(w, d, s, q, i) {
(function (w, d, s, q, i) {
w[q] = w[q] || [];
var f = d.getElementsByTagName(s)[0];
var j = d.createElement(s);
@@ -46,6 +50,7 @@
arguments: [{
is_auto: false
}, {
isMini: true,
miniAppId: "2001833218", //'应用开发管理平台-应用 ID
miniAppName: "房屋征收"
}]

View File

@@ -287,14 +287,15 @@ export default {
idCard: "加载中...",
userName: "加载中...",
policiesRegulationsLists: {
totalCount: 0
}
}
totalCount: 0,
},
},
};
},
async created() {
this.onInit();
console.log("this", this);
this.setLocationAplus();
},
methods: {
// 获取数据
@@ -305,11 +306,11 @@ export default {
dataType: "JSON",
type: "POST",
data: {
// ticket: this.$route.query.ticket
ticket: "8a118a427bda7bed017bed084ec10622-ticket"
ticket: this.$route.query.ticket,
//ticket: "8a118a427bda7bed017bed084ec10622-ticket"
},
appKey: "es4b8zmz+2001833218+dehllx",
onSuccess: data => {
onSuccess: (data) => {
console.log("首页数据", data);
if (data.data && data.data.success == true) {
this.data = data.data.data;
@@ -325,16 +326,16 @@ export default {
} else console.log("用户无数据,不展示");
}
},
onFail: err => {
onFail: (err) => {
console.log("用户无数据,不展示");
}
},
});
},
// 跳转项目详情
gotoProject(type) {
this.$router.push({
name: "projectSelect",
params: { type: type, ticket: this.$route.query.ticket }
params: { type: type, ticket: this.$route.query.ticket },
});
},
onLoadStatistic() {
@@ -358,21 +359,58 @@ export default {
// 设置用户信息埋点
aplus_queue.push({
action: "aplus.setMetaInfo",
arguments: ["_hold", "BLOCK"]
arguments: ["_hold", "BLOCK"],
});
aplus_queue.push({
action: "aplus.setMetaInfo",
arguments: ["_user_nick", userName] // this.userInfoData.username],
arguments: ["_user_nick", userName], // this.userInfoData.username],
});
aplus_queue.push({
action: "aplus.setMetaInfo",
arguments: ["_user_id", Userid]
arguments: ["_user_id", Userid],
});
aplus_queue.push({
action: "aplus.setMetaInfo",
arguments: ["_hold", "START"]
arguments: ["_hold", "START"],
});
}
}
},
setLocationAplus() {
ZWJSBridge.onReady(() => {
console.log("初始化完成后执行bridge方法");
ZWJSBridge.getUserType()
.then((result1) => {
console.log(result1);
//经纬度
ZWJSBridge.getLocation()
.then((result2) => {
console.log(result2);
debugger;
aplus_queue.push({
action: "aplus.sendPV",
arguments: [
{
is_auto: false,
},
{
isMini: true,
miniAppId: "2001833218", //'应用开发管理平台-应用 ID
miniAppName: "房屋征收",
long: result2.longitude,
lati: result2.latitude,
userType: result1.userType,
},
],
});
})
.catch((error) => {
console.log(error);
});
})
.catch((error) => {
console.log(error);
});
});
},
},
};
</script>