二手车交易,测试记录浏览量1
This commit is contained in:
@ -140,19 +140,15 @@ export default {
|
||||
}
|
||||
this.imgSrcList.unshift(res?.data?.vehicleAnglePhoto)
|
||||
}
|
||||
window.addEventListener('message', function(event) {
|
||||
console.log("iframeCloseDialog",event)
|
||||
if (event.data == 'iframeCloseDialog') {
|
||||
// 执行关闭操作
|
||||
console.log('Dialog is closing...');
|
||||
// 你可以在这里执行一些清理操作或其他逻辑
|
||||
}
|
||||
});
|
||||
document.addEventListener('visibilitychange', async ( ) => {
|
||||
document.addEventListener('visibilitychange', ( ) => {
|
||||
let state = document.visibilityState
|
||||
if (state == 'hidden') { // 用户离开了
|
||||
console.log("用户离开了1")
|
||||
await this.getDuration(1);
|
||||
// 使用 sendBeacon 发送数据
|
||||
/*const data = new FormData();
|
||||
data.append('duration', 1);
|
||||
navigator.sendBeacon('/api/getDuration', data);*/
|
||||
this.getDuration(1);
|
||||
console.log("用户离开了2")
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user