yangchenggong1_wd

fix:bug[16868] 热门搜索列表,搜索热词间距过大,没有搜索历史时搜索框下面不该多出一条横线

... ... @@ -108,12 +108,14 @@ export struct SearchComponent {
SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index) })
}
if(this.searchHistoryData.length>0){
//分隔符
Divider()
.width('100%')
.height('1lpx')
.color($r('app.color.color_EDEDED'))
.strokeWidth('1lpx')
}
SearchHotsComponent({onGetSearchRes: (item): void => this.getSearchHotResData(item)})
}
... ... @@ -123,7 +125,6 @@ export struct SearchComponent {
.width('100%')
.height('100%')
.padding({ left: '31lpx', right: '31lpx' })
.margin({ top: '36lpx' })
} else {
if (this.hasChooseSearch) {
//搜索结果
... ...
... ... @@ -120,7 +120,7 @@ export struct SearchHistoryComponent{
.columnsTemplate('1fr 1fr')
.rowsGap('23lpx')
}
.margin({bottom:'46lpx'})
.margin({top:"36lpx",bottom:'46lpx'})
}
getCategoryRowCount() {
... ...
... ... @@ -41,19 +41,19 @@ export struct SearchHotsComponent{
Text("热门搜索")
.textAlign(TextAlign.Center)
.fontWeight('600lpx')
.fontWeight(FontWeight.Bold)
.fontSize('33lpx')
.lineHeight('46lpx')
.fontColor($r('app.color.color_222222'))
.height('38lpx')
.height('46lpx')
}
.width('100%')
.margin({bottom:"15lpx"})
List(){
ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{
ListItem(){
Column(){
Column(){
Row(){
Row(){
if(item.sequence <=3){
... ... @@ -80,6 +80,7 @@ export struct SearchHotsComponent{
.fontWeight('400lpx')
.lineHeight('42lpx')
}.layoutWeight(1)
if(item.mark===1 || item.mark===2){
Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2'))
.width('42lpx')
... ... @@ -89,6 +90,7 @@ export struct SearchHotsComponent{
}
}.alignItems(VerticalAlign.Center)
.height('84lpx')
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
if(index != this.searchHotsData.length-1 ){
... ... @@ -98,18 +100,15 @@ export struct SearchHotsComponent{
.color($r('app.color.color_F5F5F5'))
.strokeWidth('1lpx')
}
}.height('108lpx')
.justifyContent(FlexAlign.Center)
}.height('85lpx')
.width('100%')
.alignItems(HorizontalAlign.Start)
.padding({left:'27lpx'})
}
}
.onClick(()=>{
if (this.onGetSearchRes !== undefined) {
this.onGetSearchRes(item.hotEntry)
}
})
.height('117lpx')
})
}.onScrollFrameBegin((offset, state) => {
return { offsetRemain: 0 }
... ...