wangliang_wd

feat:优化用户主页

1 -import { DateTimeUtils, LazyDataSource, UserDataLocal } from 'wdKit'; 1 +import { DateTimeUtils, DisplayUtils, LazyDataSource, UserDataLocal } from 'wdKit';
2 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 2 import MinePageDatasModel from '../../../model/MinePageDatasModel';
3 import { CommentListItem } from '../../../viewmodel/CommentListItem'; 3 import { CommentListItem } from '../../../viewmodel/CommentListItem';
4 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; 4 import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
@@ -27,7 +27,7 @@ export struct HomePageBottomCommentComponent { @@ -27,7 +27,7 @@ export struct HomePageBottomCommentComponent {
27 @Link commentNum: number 27 @Link commentNum: number
28 @State isGetRequest: boolean = false 28 @State isGetRequest: boolean = false
29 private scroller: Scroller = new Scroller(); 29 private scroller: Scroller = new Scroller();
30 - 30 + @State bottomCompH:number = 200
31 aboutToAppear() { 31 aboutToAppear() {
32 this.getNewPageData() 32 this.getNewPageData()
33 } 33 }
@@ -107,7 +107,7 @@ export struct HomePageBottomCommentComponent { @@ -107,7 +107,7 @@ export struct HomePageBottomCommentComponent {
107 //没有更多数据 显示提示 107 //没有更多数据 显示提示
108 if (!this.hasMore) { 108 if (!this.hasMore) {
109 ListItem() { 109 ListItem() {
110 - ListHasNoMoreDataUI() 110 + ListHasNoMoreDataUI().height(this.bottomCompH > 100 ? this.bottomCompH :100)
111 } 111 }
112 } 112 }
113 } 113 }
@@ -172,6 +172,7 @@ export struct HomePageBottomCommentComponent { @@ -172,6 +172,7 @@ export struct HomePageBottomCommentComponent {
172 parentCommentUserName)) 172 parentCommentUserName))
173 }) 173 })
174 174
  175 + this.bottomCompH = DisplayUtils.getDeviceHeight() - data.length*180
175 if (status.commentIdList.length === 0) { 176 if (status.commentIdList.length === 0) {
176 177
177 if (this.curPageNum === 1) this.data_comment.clear() 178 if (this.curPageNum === 1) this.data_comment.clear()
@@ -12,7 +12,7 @@ export struct ListHasNoMoreDataUI{ @@ -12,7 +12,7 @@ export struct ListHasNoMoreDataUI{
12 .lineHeight(20) 12 .lineHeight(20)
13 }.justifyContent(FlexAlign.Center) 13 }.justifyContent(FlexAlign.Center)
14 .width('100%') 14 .width('100%')
15 - .margin({top: 24,bottom: 24}) 15 + .margin({top: 15})
16 }else if (this.style === 2){ 16 }else if (this.style === 2){
17 Column(){ 17 Column(){
18 Image($r('app.media.empty_icon')) 18 Image($r('app.media.empty_icon'))
@@ -209,6 +209,7 @@ struct MineHomePage { @@ -209,6 +209,7 @@ struct MineHomePage {
209 .padding({ left: 16 }) 209 .padding({ left: 16 })
210 210
211 211
  212 + Column(){
212 //用户简介区域 213 //用户简介区域
213 Column() { 214 Column() {
214 Row() { 215 Row() {
@@ -246,17 +247,18 @@ struct MineHomePage { @@ -246,17 +247,18 @@ struct MineHomePage {
246 .fontColor($r('app.color.color_999999')) 247 .fontColor($r('app.color.color_999999'))
247 .textAlign(TextAlign.Start) 248 .textAlign(TextAlign.Start)
248 .margin({ top: 10 }) 249 .margin({ top: 10 })
249 -  
250 } 250 }
251 .padding({ left: 16,right: 16,top: 12,bottom: 12}) 251 .padding({ left: 16,right: 16,top: 12,bottom: 12})
252 .alignItems(HorizontalAlign.Start) 252 .alignItems(HorizontalAlign.Start)
253 - .justifyContent(FlexAlign.Center)  
254 - .width('100%')  
255 - .backgroundColor($r('app.color.white'))  
256 - //间隔符  
257 253
  254 + //间隔符
258 Divider().width('100%').height(6).color($r('app.color.color_F5F5F5')).strokeWidth(6) 255 Divider().width('100%').height(6).color($r('app.color.color_F5F5F5')).strokeWidth(6)
259 256
  257 + }.width('100%')
  258 + .backgroundColor($r('app.color.white'))
  259 + .alignItems(HorizontalAlign.Start)
  260 + .justifyContent(FlexAlign.Center)
  261 +
260 //tab 页面 262 //tab 页面
261 Stack({ alignContent: Alignment.Top }){ 263 Stack({ alignContent: Alignment.Top }){
262 Tabs({controller: this.controller}) { 264 Tabs({controller: this.controller}) {
@@ -446,6 +448,7 @@ struct MineHomePage { @@ -446,6 +448,7 @@ struct MineHomePage {
446 .fontWeight(this.currentIndex === index ? 600 : 400) 448 .fontWeight(this.currentIndex === index ? 600 : 400)
447 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) 449 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
448 .lineHeight(20) 450 .lineHeight(20)
  451 + .height(40)
449 452
450 if(this.currentIndex === index){ 453 if(this.currentIndex === index){
451 Divider() 454 Divider()
@@ -453,7 +456,7 @@ struct MineHomePage { @@ -453,7 +456,7 @@ struct MineHomePage {
453 .height(2) 456 .height(2)
454 .color('#ED2800') 457 .color('#ED2800')
455 .strokeWidth(2) 458 .strokeWidth(2)
456 - .margin({top: 35}) 459 + .margin({top: 40})
457 .id("divTag") 460 .id("divTag")
458 } 461 }
459 }.onClick(()=>{ 462 }.onClick(()=>{
@@ -461,7 +464,7 @@ struct MineHomePage { @@ -461,7 +464,7 @@ struct MineHomePage {
461 this.controller.changeIndex(this.currentIndex) 464 this.controller.changeIndex(this.currentIndex)
462 trackTabFirstClick(index === 0 ? "评论":"关注") 465 trackTabFirstClick(index === 0 ? "评论":"关注")
463 }) 466 })
464 - .height(35) 467 + .height(42)
465 .width(36) 468 .width(36)
466 .margin({right: 30}) 469 .margin({right: 30})
467 } 470 }