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) }}