Authored by 肖亚东

搜索页搜索框固定悬浮 — review by 李其昌

... ... @@ -12,7 +12,7 @@
.removeSearch {
color: #999;
font-size: 32px;
font-weight: 400;
font-weight: normal;
}
}
... ...
... ... @@ -104,30 +104,34 @@ export default class Search extends Component {
let value = '';
return (
<ScrollView
className='search-page'
scrollY
scrollWithAnimation
scrollTop='0'
lowerThreshold='20'
upperThreshold='20'
onScrolltoupper={this.onScrolltoupper}
onScroll={this.onScroll}>
{/* <PageTitle pageTitle="搜索"></PageTitle> */}
<View className={this.fixed ? 'fixed search-out-box' : 'search-out-box'}>
<SearchBar onComplate={this.onComplate} value={value}></SearchBar>
<View>
<View className='search-out-box'>
<SearchBar onComplate={this.onComplate} value={value}></SearchBar>
</View>
{
latelySearch.length > 0 &&
<SearchItem title={latelySearchTitle} list={latelySearch} isSearch={true} onRemoveAllSearch={this.onRemoveAllSearch}></SearchItem>
}
{
hotSearch.length > 0 &&
<SearchItem title={hotSearchTitle} list={hotSearch} ></SearchItem>
}
<ScrollView
className='search-page'
scrollY
scrollWithAnimation
scrollTop='0'
lowerThreshold='20'
upperThreshold='20'
onScrolltoupper={this.onScrolltoupper}
onScroll={this.onScroll}>
{/* <PageTitle pageTitle="搜索"></PageTitle> */}
{
latelySearch.length > 0 &&
<View className='latelySearch'>
<SearchItem title={latelySearchTitle} list={latelySearch} isSearch={true} onRemoveAllSearch={this.onRemoveAllSearch}></SearchItem>
</View>
}
{
hotSearch.length > 0 &&
<SearchItem title={hotSearchTitle} list={hotSearch} ></SearchItem>
}
</ScrollView>
</View>
)
}
}
... ...
.search-page {
padding: 0 40px;
height: 100vh;
width: 670px;
.search-out-box {
width: 100%;
height: 72px;
padding: 20px 0;
background: #fff;
.latelySearch{
margin-top: 120px;
}
}
.fixed {
position: fixed;
top: 0;
}
.search-out-box {
width: 100%;
height: 72px;
padding: 0 40px;
background: #fff;
z-index: 99;
position: fixed;
top: 0;
}
\ No newline at end of file
... ...