From 7031ece33375a245c76afdb0bd5c51e310308802 Mon Sep 17 00:00:00 2001 From: Rieko-wang Date: Wed, 7 Dec 2022 13:24:41 +0800 Subject: [PATCH] 123 --- index.html | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 7c2c04a..a350e5a 100644 --- a/index.html +++ b/index.html @@ -137,18 +137,20 @@ $('.filter-item').click(function () { hideLoading(); renderBillingDom([]) - $('.loading').show(); - $('.filter-item').removeClass('active'); - const key = $(this).attr('data-query-key'); - $(this).addClass('active') - if (key === 'nearlyMonth') { - renderBillingDom(nearlyMonth) - } else if (key === 'lastThreeMonths') { - renderBillingDom(lastThreeMonths) - } else if (key === 'nearlyWeek') { - renderBillingDom(nearlyWeek) - } + const timer = setTimeout(() => { + clearTimeout(timer) + $('.filter-item').removeClass('active'); + const key = $(this).attr('data-query-key'); + $(this).addClass('active') + if (key === 'nearlyMonth') { + renderBillingDom(nearlyMonth) + } else if (key === 'lastThreeMonths') { + renderBillingDom(lastThreeMonths) + } else if (key === 'nearlyWeek') { + renderBillingDom(nearlyWeek) + } + }, 500) }) $('.account,.mx').on('click', () => {