yangchenggong1_wd

fix:适配全面屏

@@ -26,6 +26,8 @@ struct SearchCreatorPage { @@ -26,6 +26,8 @@ struct SearchCreatorPage {
26 @State isLoading: boolean = false 26 @State isLoading: boolean = false
27 @State hasMore: boolean = true 27 @State hasMore: boolean = true
28 curPageNum: number = 1; 28 curPageNum: number = 1;
  29 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  30 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
29 31
30 onPageShow() { 32 onPageShow() {
31 this.keyword = this.params?.pageID; 33 this.keyword = this.params?.pageID;
@@ -154,51 +156,57 @@ struct SearchCreatorPage { @@ -154,51 +156,57 @@ struct SearchCreatorPage {
154 } 156 }
155 157
156 build() { 158 build() {
157 - Column() {  
158 - CustomTitleUI({ titleName: "全部结果" })  
159 - Divider()  
160 - .width('100%')  
161 - .height('1lpx')  
162 - .color($r('app.color.color_F5F5F5'))  
163 - .strokeWidth('1lpx')  
164 -  
165 - Column(){  
166 - if(this.count === 0){  
167 - ListHasNoMoreDataUI({style:2})  
168 - .height('100%')  
169 - }else{  
170 - List({ space: 3 }) {  
171 - LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => {  
172 - ListItem() {  
173 - FollowChildComponent({data: item,type:1})  
174 - }  
175 - .onClick(() => {  
176 - })  
177 - }, (item: FollowListDetailItem, index: number) => index.toString()) 159 + Column(){
  160 + Column() {
  161 + CustomTitleUI({ titleName: "全部结果" })
  162 + Divider()
  163 + .width('100%')
  164 + .height('1lpx')
  165 + .color($r('app.color.color_F5F5F5'))
  166 + .strokeWidth('1lpx')
  167 +
  168 + Column(){
  169 + if(this.count === 0){
  170 + ListHasNoMoreDataUI({style:2})
  171 + .height('100%')
  172 + }else{
  173 + List({ space: 3 }) {
  174 + LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => {
  175 + ListItem() {
  176 + FollowChildComponent({data: item,type:1})
  177 + }
  178 + .onClick(() => {
  179 + })
  180 + }, (item: FollowListDetailItem, index: number) => index.toString())
178 181
179 - //没有更多数据 显示提示  
180 - if(!this.hasMore){  
181 - ListItem(){  
182 - ListHasNoMoreDataUI() 182 + //没有更多数据 显示提示
  183 + if(!this.hasMore){
  184 + ListItem(){
  185 + ListHasNoMoreDataUI()
  186 + }
183 } 187 }
184 - }  
185 - }.cachedCount(5)  
186 - .padding({left:'31lpx',right:'31lpx'})  
187 - .layoutWeight(1)  
188 - .scrollBar(BarState.Off)  
189 - .onReachEnd(()=>{  
190 - console.log(TAG,"触底了");  
191 - if(!this.isLoading){  
192 - this.isLoading = true  
193 - //加载分页数据  
194 - this.getNewPageData()  
195 - }  
196 - })  
197 - }  
198 - }.layoutWeight(1) 188 + }.cachedCount(5)
  189 + .padding({left:'31lpx',right:'31lpx'})
  190 + .layoutWeight(1)
  191 + .scrollBar(BarState.Off)
  192 + .onReachEnd(()=>{
  193 + console.log(TAG,"触底了");
  194 + if(!this.isLoading){
  195 + this.isLoading = true
  196 + //加载分页数据
  197 + this.getNewPageData()
  198 + }
  199 + })
  200 + }
  201 + }.layoutWeight(1)
  202 + .width('100%')
  203 + }
199 .width('100%') 204 .width('100%')
200 - }  
201 - .width('100%')  
202 - .height('100%') 205 + .height('100%')
  206 + }.width("100%")
  207 + .height("100%")
  208 + .backgroundColor($r('app.color.color_transparent'))
  209 + .padding({top:px2vp(this.topSafeHeight)})
  210 +
203 } 211 }
204 } 212 }