From c7b956bbf714a1e33e5c17314175f6155a3d3032 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 25 Mar 2024 19:36:25 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AA=20optimize:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- combining.html | 12 +++++++++--- reduce.html | 12 +++++++++--- ysf-reduce.html | 12 +++++++++--- zfb-reduce.html | 12 +++++++++--- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/combining.html b/combining.html index b876eb2..26e3426 100644 --- a/combining.html +++ b/combining.html @@ -157,11 +157,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, diff --git a/reduce.html b/reduce.html index 1198c1a..ab15f5b 100644 --- a/reduce.html +++ b/reduce.html @@ -186,11 +186,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, filters: { diff --git a/ysf-reduce.html b/ysf-reduce.html index 51d905a..e8a72d6 100644 --- a/ysf-reduce.html +++ b/ysf-reduce.html @@ -152,11 +152,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, filters: { diff --git a/zfb-reduce.html b/zfb-reduce.html index 4e3555e..55841cb 100644 --- a/zfb-reduce.html +++ b/zfb-reduce.html @@ -151,11 +151,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } },