提交 d6269a06 编写于 作者: M mehaotian

feat(stat): add the uniStatPageLog attribute: whether to statistics page data

上级 8bae9285
......@@ -602,6 +602,20 @@ const is_push_clientid = () => {
return false
};
/**
* 是否上报页面数据
* @returns
*/
const is_page_report = ()=>{
if(uniStatisticsConfig.collectItems){
const statPageLog = uniStatisticsConfig.collectItems.uniStatPageLog;
// 如果字段不存在返回 true , 如果是boolean 值按原值返回,如果是其他类型 返回false
if(statPageLog === undefined) return true
return typeof statPageLog === 'boolean' ? statPageLog : true
}
return true
};
/**
* 是否已处理设备 DeviceId
* 如果值为 1 则表示已处理
......@@ -1343,9 +1357,7 @@ class Stat extends Report {
// uni.__stat_uniCloud_space.config.spaceId
// )
} else {
console.error(
'应用未关联服务空间,请在uniCloud目录右键关联服务空间'
);
console.error('应用未关联服务空间,请在uniCloud目录右键关联服务空间');
}
}
}
......@@ -1367,7 +1379,7 @@ class Stat extends Report {
const cid = res.cid || false;
// 只有获取到才会上传
if (cid) {
this.sendPushRequest(options,cid);
this.sendPushRequest(options, cid);
}
},
});
......@@ -1404,7 +1416,10 @@ class Stat extends Report {
show(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageShow(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageShow(self);
}
}
// #ifdef VUE3
......@@ -1425,7 +1440,10 @@ class Stat extends Report {
hide(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageHide(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageHide(self);
}
}
// #ifdef VUE3
......
......@@ -600,6 +600,20 @@ const is_push_clientid = () => {
return false
};
/**
* 是否上报页面数据
* @returns
*/
const is_page_report = ()=>{
if(uniStatisticsConfig.collectItems){
const statPageLog = uniStatisticsConfig.collectItems.uniStatPageLog;
// 如果字段不存在返回 true , 如果是boolean 值按原值返回,如果是其他类型 返回false
if(statPageLog === undefined) return true
return typeof statPageLog === 'boolean' ? statPageLog : true
}
return true
};
/**
* 是否已处理设备 DeviceId
* 如果值为 1 则表示已处理
......@@ -1341,9 +1355,7 @@ class Stat extends Report {
// uni.__stat_uniCloud_space.config.spaceId
// )
} else {
console.error(
'应用未关联服务空间,请在uniCloud目录右键关联服务空间'
);
console.error('应用未关联服务空间,请在uniCloud目录右键关联服务空间');
}
}
}
......@@ -1365,7 +1377,7 @@ class Stat extends Report {
const cid = res.cid || false;
// 只有获取到才会上传
if (cid) {
this.sendPushRequest(options,cid);
this.sendPushRequest(options, cid);
}
},
});
......@@ -1402,7 +1414,10 @@ class Stat extends Report {
show(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageShow(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageShow(self);
}
}
// #ifdef VUE3
......@@ -1423,7 +1438,10 @@ class Stat extends Report {
hide(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageHide(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageHide(self);
}
}
// #ifdef VUE3
......
......@@ -579,6 +579,20 @@ const is_push_clientid = () => {
return typeof ClientID === 'boolean' ? ClientID : false
}
return false
};
/**
* 是否上报页面数据
* @returns
*/
const is_page_report = ()=>{
if(uniStatisticsConfig.collectItems){
const statPageLog = uniStatisticsConfig.collectItems.uniStatPageLog;
// 如果字段不存在返回 true , 如果是boolean 值按原值返回,如果是其他类型 返回false
if(statPageLog === undefined) return true
return typeof statPageLog === 'boolean' ? statPageLog : true
}
return true
};
// 首次访问时间
......@@ -1315,7 +1329,7 @@ class Stat extends Report {
const cid = res.cid || false;
// 只有获取到才会上传
if (cid) {
this.sendPushRequest(options,cid);
this.sendPushRequest(options, cid);
}
},
});
......@@ -1352,7 +1366,10 @@ class Stat extends Report {
show(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageShow(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageShow(self);
}
}
// #ifdef VUE3
......@@ -1373,7 +1390,10 @@ class Stat extends Report {
hide(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageHide(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageHide(self);
}
}
// #ifdef VUE3
......
......@@ -577,6 +577,20 @@ const is_push_clientid = () => {
return typeof ClientID === 'boolean' ? ClientID : false
}
return false
};
/**
* 是否上报页面数据
* @returns
*/
const is_page_report = ()=>{
if(uniStatisticsConfig.collectItems){
const statPageLog = uniStatisticsConfig.collectItems.uniStatPageLog;
// 如果字段不存在返回 true , 如果是boolean 值按原值返回,如果是其他类型 返回false
if(statPageLog === undefined) return true
return typeof statPageLog === 'boolean' ? statPageLog : true
}
return true
};
// 首次访问时间
......@@ -1313,7 +1327,7 @@ class Stat extends Report {
const cid = res.cid || false;
// 只有获取到才会上传
if (cid) {
this.sendPushRequest(options,cid);
this.sendPushRequest(options, cid);
}
},
});
......@@ -1350,7 +1364,10 @@ class Stat extends Report {
show(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageShow(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageShow(self);
}
}
// #ifdef VUE3
......@@ -1371,7 +1388,10 @@ class Stat extends Report {
hide(self) {
this.self = self;
if (get_page_types(self) === 'page') {
this.pageHide(self);
const isPageReport = is_page_report();
if (isPageReport) {
this.pageHide(self);
}
}
// #ifdef VUE3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册