diff --git a/src/views/newcomerTraining/newTrainingList.vue b/src/views/newcomerTraining/newTrainingList.vue index fd2fb918..b1cfcd1e 100644 --- a/src/views/newcomerTraining/newTrainingList.vue +++ b/src/views/newcomerTraining/newTrainingList.vue @@ -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")