task#15348,司机app自动刷新功能
This commit is contained in:
@ -11,9 +11,6 @@
|
||||
v-model="keyword"
|
||||
placeholder="名称/关键词/简介"
|
||||
>
|
||||
<!-- <template #button>
|
||||
<van-icon class="search" name="search" size="20" @click="getTrainingList"/>
|
||||
</template>-->
|
||||
</van-field>
|
||||
</template>
|
||||
<template slot="left">
|
||||
@ -105,6 +102,14 @@ export default {
|
||||
this.driverId = urlParams.get('driverId');
|
||||
this.time=timeFormat(Date.now())
|
||||
this.getTrainingList();
|
||||
document.addEventListener('visibilitychange', async ( ) => {
|
||||
let state = document.visibilityState
|
||||
if (state == 'hidden') { // 用户离开了
|
||||
}
|
||||
if (state == 'visible') {
|
||||
this.getTrainingList();
|
||||
}
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
onRefresh() {
|
||||
|
@ -85,13 +85,12 @@ export default {
|
||||
this.getList();
|
||||
|
||||
document.addEventListener('visibilitychange', async ( ) => {
|
||||
console.log('document.visibilityState', document.visibilityState);
|
||||
let state = document.visibilityState
|
||||
if (state == 'hidden') { // 用户离开了
|
||||
console.log('用户离开了')
|
||||
// console.log('用户离开了')
|
||||
}
|
||||
if (state == 'visible') {
|
||||
console.log('用户回来了')
|
||||
// console.log('用户回来了')
|
||||
this.getList();
|
||||
//调用接口,获取订单状态
|
||||
}
|
||||
|
Reference in New Issue
Block a user