From 85b460b57cd7e9ad935042df74f40e1bbdfa3408 Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期二, 22 十月 2024 09:13:36 +0800 Subject: [PATCH] ll --- h5_meeting/pages/index/index.vue | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/h5_meeting/pages/index/index.vue b/h5_meeting/pages/index/index.vue index 6f01181..fded8ae 100644 --- a/h5_meeting/pages/index/index.vue +++ b/h5_meeting/pages/index/index.vue @@ -98,20 +98,24 @@ 4: '鍗冲皢寮�濮�', 5: '宸叉挙閿�', }, - meetingInfo: {} + meetingInfo: {}, + timer: null } }, onShow() { this.initDatetime() - this.param = uni.getStorageSync('param') || {} if (!this.param.code) { return uni.navigateTo({ url: '/pages/index/config' }) } - this.getData() }, - onReady() {}, + onReady() {}, + onHide(){ + if(this.timer){ + clearInterval(this.timer) + } + }, methods: { getData() { this.showQrbg = false @@ -173,8 +177,13 @@ this.timer = setInterval(() => { this.time = dayjs().format('HH:mm') this.date = dayjs().format('YYYY-MM-DD') + ' ' + weeks[new Date().getDay()] - }, 1000) - setInterval(() => { + }, 1000) + this.param = uni.getStorageSync('param') || {} + if(this.timer){ + clearInterval(this.timer) + } + this.getData() + this.timer = setInterval(() => { this.getData() }, this.param.time ? this.param.time * 1000 : 60 * 1000) } -- Gitblit v1.9.3