yumaochao
... ... @@ -47,7 +47,7 @@ struct PeopleShipHomePage {
}
onPageHide(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
}
topOpacityChange(){
... ...
import router from '@ohos.router'
import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit';
import { DateTimeUtils, NetworkUtil, StringUtils, WindowModel } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { editModelParams } from '../model/EditInfoModel';
import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent';
... ... @@ -14,7 +14,7 @@ const TAG = "MineHomePage"
@Entry
@Component
struct MineHomePage {
@State tileOpacity: number = 0;
@Watch('topOpacityChange') @State tileOpacity: number = 0;
firstPositionY:number = 0;
fontColor: string = '#999999'
selectedFontColor: string = '#000000'
... ... @@ -43,6 +43,7 @@ struct MineHomePage {
pageHideTime:number = 0;
onPageShow(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.getUserInfo()
... ... @@ -55,7 +56,16 @@ struct MineHomePage {
}, 200);
}
topOpacityChange(){
if(this.tileOpacity > 0.8){
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
}else{
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
}
onPageHide(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
... ...
... ... @@ -16,6 +16,7 @@ import { CommentListItem } from '../viewmodel/CommentListItem';
struct VisitorCommentPage {
@State data: LazyDataSource<CommentListItem> = new LazyDataSource();
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State count: number = 0;
@State isLoading: boolean = false
@State hasMore: boolean = true
... ... @@ -35,69 +36,74 @@ struct VisitorCommentPage {
}
build() {
Column() {
//标题栏目
CustomTitleUI({ titleName: "评论列表" })
if (this.count == 0) {
if (this.isGetRequest == true) {
if(this.isConnectNetwork){
EmptyComponent({ emptyType: 10 })
.height('100%')
.width('100%')
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
Column(){
Column() {
//标题栏目
CustomTitleUI({ titleName: "评论列表" })
if (this.count == 0) {
if (this.isGetRequest == true) {
if(this.isConnectNetwork){
EmptyComponent({ emptyType: 11 })
.height('100%')
.width('100%')
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading) {
this.getNewPageData(this.commentTime)
}
}
}})
.layoutWeight(1)
.width('100%')
}
}
} else {
Stack(){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.white'))
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading){
this.getNewPageData(this.commentTime)
if(resolve) resolve('刷新成功')
}
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
this.isLoading = true
this.getNewPageData(this.commentTime)
}
}
}})
.layoutWeight(1)
.width('100%')
})
}
}
} else {
Stack(){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.white'))
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading){
this.getNewPageData(this.commentTime)
if(resolve) resolve('刷新成功')
}
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
this.isLoading = true
this.getNewPageData(this.commentTime)
}
}
})
}
}
}
.backgroundColor($r('app.color.color_transparent'))
.height('100%')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.height('100%')
.width('100%')
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
@Builder ListLayout(){
... ...