wangliang_wd

feat:优化用户主页

import { DateTimeUtils, LazyDataSource, UserDataLocal } from 'wdKit';
import { DateTimeUtils, DisplayUtils, LazyDataSource, UserDataLocal } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { CommentListItem } from '../../../viewmodel/CommentListItem';
import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem';
... ... @@ -27,7 +27,7 @@ export struct HomePageBottomCommentComponent {
@Link commentNum: number
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
@State bottomCompH:number = 200
aboutToAppear() {
this.getNewPageData()
}
... ... @@ -107,7 +107,7 @@ export struct HomePageBottomCommentComponent {
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
ListHasNoMoreDataUI().height(this.bottomCompH > 100 ? this.bottomCompH :100)
}
}
}
... ... @@ -172,6 +172,7 @@ export struct HomePageBottomCommentComponent {
parentCommentUserName))
})
this.bottomCompH = DisplayUtils.getDeviceHeight() - data.length*180
if (status.commentIdList.length === 0) {
if (this.curPageNum === 1) this.data_comment.clear()
... ...
... ... @@ -12,7 +12,7 @@ export struct ListHasNoMoreDataUI{
.lineHeight(20)
}.justifyContent(FlexAlign.Center)
.width('100%')
.margin({top: 24,bottom: 24})
.margin({top: 15})
}else if (this.style === 2){
Column(){
Image($r('app.media.empty_icon'))
... ...
... ... @@ -209,53 +209,55 @@ struct MineHomePage {
.padding({ left: 16 })
//用户简介区域
Column() {
Row() {
Text(this.isHasIntroduction?"简介:"+this.desc:this.desc)
.fontSize(14)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.lineHeight(21)
.fontWeight(400)
.fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
.textAlign(TextAlign.Start)
Column(){
//用户简介区域
Column() {
Row() {
Text(this.isHasIntroduction?"简介:"+this.desc:this.desc)
.fontSize(14)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.lineHeight(21)
.fontWeight(400)
.fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
.textAlign(TextAlign.Start)
if(!this.isHasIntroduction){
Image($r('app.media.user_info_edit_icon'))
.width(14)
.height(14)
.interpolation(ImageInterpolation.High)
.objectFit(ImageFit.Auto)
.margin({
left: 6
})
}
}.onClick(()=>{
let params: editModelParams = {
editContent: this.isHasIntroduction?this.desc:''
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
})
if(!this.isHasIntroduction){
Image($r('app.media.user_info_edit_icon'))
.width(14)
.height(14)
.interpolation(ImageInterpolation.High)
.objectFit(ImageFit.Auto)
.margin({
left: 6
})
}
}.onClick(()=>{
let params: editModelParams = {
editContent: this.isHasIntroduction?this.desc:''
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
})
Text(`来到人民日报${this.registerTimeForDay}天`)
.fontSize(12)
.lineHeight(13)
.fontWeight(400)
.fontColor($r('app.color.color_999999'))
.textAlign(TextAlign.Start)
.margin({ top: 10 })
}
.padding({ left: 16,right: 16,top: 12,bottom: 12})
.alignItems(HorizontalAlign.Start)
Text(`来到人民日报${this.registerTimeForDay}天`)
.fontSize(12)
.lineHeight(13)
.fontWeight(400)
.fontColor($r('app.color.color_999999'))
.textAlign(TextAlign.Start)
.margin({ top: 10 })
//间隔符
Divider().width('100%').height(6).color($r('app.color.color_F5F5F5')).strokeWidth(6)
}
.padding({ left: 16,right: 16,top: 12,bottom: 12})
}.width('100%')
.backgroundColor($r('app.color.white'))
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Center)
.width('100%')
.backgroundColor($r('app.color.white'))
//间隔符
Divider().width('100%').height(6).color($r('app.color.color_F5F5F5')).strokeWidth(6)
//tab 页面
Stack({ alignContent: Alignment.Top }){
... ... @@ -446,6 +448,7 @@ struct MineHomePage {
.fontWeight(this.currentIndex === index ? 600 : 400)
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.lineHeight(20)
.height(40)
if(this.currentIndex === index){
Divider()
... ... @@ -453,7 +456,7 @@ struct MineHomePage {
.height(2)
.color('#ED2800')
.strokeWidth(2)
.margin({top: 35})
.margin({top: 40})
.id("divTag")
}
}.onClick(()=>{
... ... @@ -461,7 +464,7 @@ struct MineHomePage {
this.controller.changeIndex(this.currentIndex)
trackTabFirstClick(index === 0 ? "评论":"关注")
})
.height(35)
.height(42)
.width(36)
.margin({right: 30})
}
... ...