From 90e2a79e6ca6cef6aa75d40a76d28b5499ba3ac5 Mon Sep 17 00:00:00 2001 From: xuan Date: Tue, 7 Mar 2023 10:16:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(ID1001456):=20=E3=80=90?= =?UTF-8?q?=E5=86=85=E9=83=A8=E5=95=86=E5=9F=8E=E3=80=91-=E5=95=86?= =?UTF-8?q?=E5=93=81=E8=AF=A6=E6=83=85=E6=90=9C=E7=B4=A2=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E9=A2=9C=E8=89=B2=E6=97=B6=EF=BC=8C=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/shoppingCart/index.module.scss | 2 ++ src/components/shoppingCart/index.tsx | 10 ++++------ src/pages/index/index.tsx | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/shoppingCart/index.module.scss b/src/components/shoppingCart/index.module.scss index 6e5df67..d6d40d8 100644 --- a/src/components/shoppingCart/index.module.scss +++ b/src/components/shoppingCart/index.module.scss @@ -119,6 +119,8 @@ align-items: center; width: 100%; justify-content: center; + font-size: 26px; + color: #ccc; } .posBox { diff --git a/src/components/shoppingCart/index.tsx b/src/components/shoppingCart/index.tsx index b7c7661..6aa4b44 100644 --- a/src/components/shoppingCart/index.tsx +++ b/src/components/shoppingCart/index.tsx @@ -191,12 +191,10 @@ const ShoppingCart = (props: prosObj, ref) => { )} {goodList.length === 0 && ( - <> - - 加载中 - - - + + 暂无更多 + {/* */} + )} {!hasBottom && } {/* */} diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 73c4c64..86a44fb 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -10,7 +10,7 @@ import { goLink } from '@/common/common' import { KindListApi, ProductListApi } from '@/api/index' // import useLogin from '@/use/useLogin' import { ClientListApi, MpProductColorList, MpShoppingCartProductColorList } from '@/api/order' -import { dataLoadingStatus, getFilterData } from '@/common/util' +import { dataLoadingStatus, debounce, getFilterData } from '@/common/util' const Index = () => { const product_kind_id_ref = useRef(0) @@ -234,9 +234,9 @@ const Index = () => { }, [goodList]) // 输入了搜索关键字 - const getSearchData = useCallback((eq) => { + const getSearchData = debounce((eq) => { setSearchObj(e => ({ ...e, code_or_name: eq })) - }, []) + }, 300) // 加入购物车 const { fetchData: preViewFetch } = MpShoppingCartProductColorList() @@ -402,7 +402,7 @@ const Index = () => { handPlus={item => handPlus(item)} obj={goodObj} ref={ShopCartRef} - getSearchData={(e) => { getSearchData(e) }} + getSearchData={getSearchData} onBlur={(e, id) => onBlur(e, id)} reduceNums={(item) => { reduceNums(item) }} addNums={(item) => { handAdd(item) }}