From a6948d13ea48cb9f57f070f270b846ac661a79a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 22 Oct 2025 12:03:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(dealer):=E4=BC=98=E5=8C=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E4=BA=A4=E6=98=93=E9=A1=B5=E9=9D=A2=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除搜索关键字长度限制提示 - 注释掉清空搜索功能相关代码 - 修改搜索框onChange事件替代onSearch和onClear事件 - 简化搜索逻辑处理流程 --- src/dealer/customer/trading.tsx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/dealer/customer/trading.tsx b/src/dealer/customer/trading.tsx index 43d8ca4..08d4178 100644 --- a/src/dealer/customer/trading.tsx +++ b/src/dealer/customer/trading.tsx @@ -91,10 +91,6 @@ const CustomerTrading = () => { // 搜索处理函数 const handleSearch = (keyword: string) => { if(keyword.length < 4){ - Taro.showToast({ - title: '请输入至少4个字符', - icon: 'none' - }); return; } setSearchValue(keyword); @@ -105,13 +101,13 @@ const CustomerTrading = () => { }; // 清空搜索 - const handleClearSearch = () => { - setSearchValue(''); - setList([]); - setPage(1); - setHasMore(true); - fetchCustomerData(true, 1, ''); - }; + // const handleClearSearch = () => { + // setSearchValue(''); + // setList([]); + // setPage(1); + // setHasMore(true); + // fetchCustomerData(true, 1, ''); + // }; // 渲染客户项 const renderCustomerItem = (customer: CustomerUser) => ( @@ -192,8 +188,7 @@ const CustomerTrading = () => { handleSearch(value)} - onClear={() => handleClearSearch()} + onChange={(value) => handleSearch(value)} />