列表搜索页面
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import InputCustomerBar from "@/container/inputCustomerNavbar";
|
||||
import CustomerNavbarBack from "@/components/CustomerNavbarBack";
|
||||
import { View, Image, Text } from "@tarojs/components";
|
||||
import { Input } from "@nutui/nutui-react-taro";
|
||||
@@ -18,7 +17,6 @@ const ListSearch = () => {
|
||||
searchSuggestion,
|
||||
suggestionList,
|
||||
isShowSuggestion,
|
||||
isShowInputCustomerNavBar,
|
||||
} = useListState() || {};
|
||||
|
||||
const ref = useRef<any>(null);
|
||||
@@ -45,6 +43,10 @@ const ListSearch = () => {
|
||||
updateState({ searchValue: value });
|
||||
if (value) {
|
||||
searchSuggestion(value);
|
||||
} else {
|
||||
updateState({
|
||||
isShowSuggestion: false,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -85,11 +87,11 @@ const ListSearch = () => {
|
||||
/**
|
||||
* @description 点击搜索
|
||||
*/
|
||||
const handleSearch = () => {
|
||||
const handleSearch = () => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/searchResult/index`,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 是否显示清空图标
|
||||
const isShowClearIcon = searchValue && searchValue?.length > 0;
|
||||
@@ -100,11 +102,6 @@ const ListSearch = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{!isShowInputCustomerNavBar ? (
|
||||
<CustomerNavbarBack />
|
||||
) : (
|
||||
<InputCustomerBar icon={img.ICON_LIST_INPUT_LOGO} />
|
||||
)}
|
||||
<View className="listSearchContainer">
|
||||
{/* 搜索 */}
|
||||
<View className="topSearch">
|
||||
@@ -128,7 +125,9 @@ const ListSearch = () => {
|
||||
/>
|
||||
)}
|
||||
<View className="searchLine" />
|
||||
<Text className="searchText" onClick={handleSearch}>搜索</Text>
|
||||
<Text className="searchText" onClick={handleSearch}>
|
||||
搜索
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
{/* 联想词 */}
|
||||
|
||||
Reference in New Issue
Block a user