|
|
|
@ -8,6 +8,7 @@ import SearchList from './components/list' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Search:FC = () => { |
|
|
|
|
const globalData = Taro.getApp().globalData |
|
|
|
|
const [value, setValue] = useState('') |
|
|
|
|
const [recentSearch, setRecentSearch] = useState<string[]>([]) |
|
|
|
|
const [hotSearch,setHotSearch] = useState<any[]>([]) |
|
|
|
@ -55,10 +56,25 @@ const Search:FC = () => { |
|
|
|
|
Taro.setStorageSync('recentSearch', [...new Set(recentSearch)]) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function navBack(){ |
|
|
|
|
Taro.navigateBack() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<View className="flex flex-column"> |
|
|
|
|
<View className={styles.navBox} style={{height:`${globalData.statusBarHeight+globalData.textBarHeight}px`}}> |
|
|
|
|
<View style={{height:`${globalData.statusBarHeight}px`}}></View> |
|
|
|
|
<View style={{height:`${globalData.textBarHeight}px`,display:'flex',alignItems:'center'}}> |
|
|
|
|
<View className="flex justify-end" style={{width:'40px'}}> |
|
|
|
|
<AtIcon value='chevron-left' size='25' color='#333' onClick={navBack}></AtIcon> |
|
|
|
|
</View> |
|
|
|
|
<View className="font-28 font-weight flex-1" style={{display:'flex',justifyContent:'center',paddingRight:'40px',boxSizing:'border-box'}}>搜索</View> |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<View style={{paddingLeft: '30rpx'}}> |
|
|
|
|
<View style={{height:`${globalData.statusBarHeight+globalData.textBarHeight}px`}}></View> |
|
|
|
|
<View className={styles.searchBox}> |
|
|
|
|
<AtIcon value='search' size='20' color='#ccc'></AtIcon> |
|
|
|
|
{ show ? |
|
|
|
@ -106,9 +122,10 @@ const Search:FC = () => { |
|
|
|
|
</> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
<PageContainer onClickOverlay={()=>{ setShow(false)}} show={show} round={true} overlay={true} overlayStyle={'background:rgba(0,0,0,0)'} > |
|
|
|
|
<PageContainer onBeforeLeave={() => {setShow(false)}} onClickOverlay={()=>{ setShow(false)}} show={show} round={true} overlay={true} overlayStyle={'background:rgba(0,0,0,0)'} > |
|
|
|
|
<SearchList name={value} clear={show} /> |
|
|
|
|
</PageContainer> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
|