yangchenggong1_wd

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

@@ -108,12 +108,14 @@ export struct SearchComponent { @@ -108,12 +108,14 @@ export struct SearchComponent {
108 SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index) }) 108 SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index) })
109 } 109 }
110 110
111 - //分隔符  
112 - Divider()  
113 - .width('100%')  
114 - .height('1lpx')  
115 - .color($r('app.color.color_EDEDED'))  
116 - .strokeWidth('1lpx') 111 + if(this.searchHistoryData.length>0){
  112 + //分隔符
  113 + Divider()
  114 + .width('100%')
  115 + .height('1lpx')
  116 + .color($r('app.color.color_EDEDED'))
  117 + .strokeWidth('1lpx')
  118 + }
117 119
118 SearchHotsComponent({onGetSearchRes: (item): void => this.getSearchHotResData(item)}) 120 SearchHotsComponent({onGetSearchRes: (item): void => this.getSearchHotResData(item)})
119 } 121 }
@@ -123,7 +125,6 @@ export struct SearchComponent { @@ -123,7 +125,6 @@ export struct SearchComponent {
123 .width('100%') 125 .width('100%')
124 .height('100%') 126 .height('100%')
125 .padding({ left: '31lpx', right: '31lpx' }) 127 .padding({ left: '31lpx', right: '31lpx' })
126 - .margin({ top: '36lpx' })  
127 } else { 128 } else {
128 if (this.hasChooseSearch) { 129 if (this.hasChooseSearch) {
129 //搜索结果 130 //搜索结果
@@ -120,7 +120,7 @@ export struct SearchHistoryComponent{ @@ -120,7 +120,7 @@ export struct SearchHistoryComponent{
120 .columnsTemplate('1fr 1fr') 120 .columnsTemplate('1fr 1fr')
121 .rowsGap('23lpx') 121 .rowsGap('23lpx')
122 } 122 }
123 - .margin({bottom:'46lpx'}) 123 + .margin({top:"36lpx",bottom:'46lpx'})
124 } 124 }
125 125
126 getCategoryRowCount() { 126 getCategoryRowCount() {
@@ -41,18 +41,18 @@ export struct SearchHotsComponent{ @@ -41,18 +41,18 @@ export struct SearchHotsComponent{
41 41
42 Text("热门搜索") 42 Text("热门搜索")
43 .textAlign(TextAlign.Center) 43 .textAlign(TextAlign.Center)
44 - .fontWeight('600lpx') 44 + .fontWeight(FontWeight.Bold)
45 .fontSize('33lpx') 45 .fontSize('33lpx')
46 .lineHeight('46lpx') 46 .lineHeight('46lpx')
47 .fontColor($r('app.color.color_222222')) 47 .fontColor($r('app.color.color_222222'))
48 - .height('38lpx') 48 + .height('46lpx')
49 } 49 }
50 .width('100%') 50 .width('100%')
  51 + .margin({bottom:"15lpx"})
51 52
52 List(){ 53 List(){
53 ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{ 54 ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{
54 ListItem(){ 55 ListItem(){
55 - Column(){  
56 Column(){ 56 Column(){
57 Row(){ 57 Row(){
58 Row(){ 58 Row(){
@@ -80,6 +80,7 @@ export struct SearchHotsComponent{ @@ -80,6 +80,7 @@ export struct SearchHotsComponent{
80 .fontWeight('400lpx') 80 .fontWeight('400lpx')
81 .lineHeight('42lpx') 81 .lineHeight('42lpx')
82 }.layoutWeight(1) 82 }.layoutWeight(1)
  83 +
83 if(item.mark===1 || item.mark===2){ 84 if(item.mark===1 || item.mark===2){
84 Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) 85 Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2'))
85 .width('42lpx') 86 .width('42lpx')
@@ -89,6 +90,7 @@ export struct SearchHotsComponent{ @@ -89,6 +90,7 @@ export struct SearchHotsComponent{
89 } 90 }
90 }.alignItems(VerticalAlign.Center) 91 }.alignItems(VerticalAlign.Center)
91 .height('84lpx') 92 .height('84lpx')
  93 + .width('100%')
92 .justifyContent(FlexAlign.SpaceBetween) 94 .justifyContent(FlexAlign.SpaceBetween)
93 95
94 if(index != this.searchHotsData.length-1 ){ 96 if(index != this.searchHotsData.length-1 ){
@@ -98,18 +100,15 @@ export struct SearchHotsComponent{ @@ -98,18 +100,15 @@ export struct SearchHotsComponent{
98 .color($r('app.color.color_F5F5F5')) 100 .color($r('app.color.color_F5F5F5'))
99 .strokeWidth('1lpx') 101 .strokeWidth('1lpx')
100 } 102 }
101 - }.height('108lpx')  
102 - .justifyContent(FlexAlign.Center) 103 + }.height('85lpx')
  104 + .width('100%')
103 .alignItems(HorizontalAlign.Start) 105 .alignItems(HorizontalAlign.Start)
104 - .padding({left:'27lpx'})  
105 - }  
106 } 106 }
107 .onClick(()=>{ 107 .onClick(()=>{
108 if (this.onGetSearchRes !== undefined) { 108 if (this.onGetSearchRes !== undefined) {
109 this.onGetSearchRes(item.hotEntry) 109 this.onGetSearchRes(item.hotEntry)
110 } 110 }
111 }) 111 })
112 - .height('117lpx')  
113 }) 112 })
114 }.onScrollFrameBegin((offset, state) => { 113 }.onScrollFrameBegin((offset, state) => {
115 return { offsetRemain: 0 } 114 return { offsetRemain: 0 }