监听页面显示
This commit is contained in:
@ -84,6 +84,18 @@ export default {
|
||||
// this.onRefresh();
|
||||
this.getList();
|
||||
|
||||
document.addEventListener('visibilitychange', async ( e ) => {
|
||||
console.log('document.visibilityState', document.visibilityState);
|
||||
let state = document.visibilityState
|
||||
if (state == 'hidden') { // 用户离开了
|
||||
console.log('用户离开了')
|
||||
}
|
||||
if (state == 'visible') {
|
||||
console.log('用户回来了')
|
||||
this.getList();
|
||||
//调用接口,获取订单状态
|
||||
}
|
||||
});
|
||||
},
|
||||
created() {
|
||||
console.log("createdcreatedcreated")
|
||||
|
Reference in New Issue
Block a user