二手车交易,用户离开记录浏览量

This commit is contained in:
2025-03-18 20:58:50 +08:00
parent 42a75a644c
commit 82fc504fb5
2 changed files with 12 additions and 0 deletions

View File

@ -141,6 +141,12 @@ export default {
} }
this.imgSrcList.unshift(res?.data?.vehicleAnglePhoto) this.imgSrcList.unshift(res?.data?.vehicleAnglePhoto)
} }
document.addEventListener('visibilitychange', async ( ) => {
let state = document.visibilityState
if (state == 'hidden') { // 用户离开了
this.getDuration()
}
});
}, },
destroyed() { destroyed() {
this.getDuration() this.getDuration()

View File

@ -85,6 +85,12 @@ export default {
}) })
this.detailInfo = res?.data this.detailInfo = res?.data
} }
document.addEventListener('visibilitychange', async ( ) => {
let state = document.visibilityState
if (state == 'hidden') { // 用户离开了
this.getDuration()
}
});
}, },
destroyed() { destroyed() {
this.getDuration() this.getDuration()