Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-06-26 14:43:13 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
9e01eb79a7784b068f63ffb04e463fccff0e7962
9e01eb79
2 parents
ded22de5
e8c50756
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
78 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/PeopleShipHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PeopleShipHomePage.ets
View file @
9e01eb7
...
...
@@ -13,7 +13,7 @@ import {
PeopleShipUserDetailData,
ArticleCountData
} from 'wdBean'
import { EmptyComponent } from '../view/EmptyComponent'
import { EmptyComponent
,WDViewDefaultType
} from '../view/EmptyComponent'
import { CustomTitleUI } from '../reusable/CustomTitleUI'
@Entry
...
...
@@ -41,6 +41,7 @@ struct PeopleShipHomePage {
@State isLoading: boolean = true
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@State isHasHomePage: boolean = true
onPageShow(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
...
...
@@ -60,91 +61,100 @@ struct PeopleShipHomePage {
build() {
if(this.isConnectNetwork){
Stack({ alignContent: Alignment.TopStart }) {
Stack({ alignContent: Alignment.Top }){
// 顶部图片
Image($r('app.media.home_page_bg'))
.width('100%')
.height('120vp')
.objectFit(ImageFit.Auto)
.objectRepeat(ImageRepeat.NoRepeat)
.backgroundColor(Color.White)
.visibility(this.isLoading ? Visibility.None : Visibility.Visible)
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
.opacity(this.topOpacity )
}
if (this.isHasHomePage){
Stack({ alignContent: Alignment.TopStart }) {
Stack({ alignContent: Alignment.Top }){
// 顶部图片
Image($r('app.media.home_page_bg'))
.width('100%')
.height('120vp')
.objectFit(ImageFit.Auto)
.objectRepeat(ImageRepeat.NoRepeat)
.backgroundColor(Color.White)
.visibility(this.isLoading ? Visibility.None : Visibility.Visible)
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
.opacity(this.topOpacity )
}
Column(){
// 头部返回
PeopleShipHomePageNavComponent({
attentionOpacity: this.attentionOpacity,
topOpacity: this.topOpacity,
detailModel: this.detailModel
})
.height($r('app.float.top_bar_height'))
.backgroundColor(Color.Transparent)
if (this.detailModel && this.detailModel.userName) {
Scroll(this.scroller) {
Column() {
// 顶部相关
PeopleShipHomePageTopComponent({
creatorId: this.creatorId,
detailModel: this.detailModel,
publishCount: this.publishCount,
topHeight: this.topHeight
})
.width("100%")
.height(this.topHeight)
// 列表
Column(){
PeopleShipHomeListComponent({
Column(){
// 头部返回
PeopleShipHomePageNavComponent({
attentionOpacity: this.attentionOpacity,
topOpacity: this.topOpacity,
detailModel: this.detailModel
})
.height($r('app.float.top_bar_height'))
.backgroundColor(Color.Transparent)
if (this.detailModel && this.detailModel.userName) {
Scroll(this.scroller) {
Column() {
// 顶部相关
PeopleShipHomePageTopComponent({
creatorId: this.creatorId,
detailModel: this.detailModel,
publishCount: this.publishCount,
creatorId: this.creatorId
topHeight: this.topHeight
})
}.height('100%')
.width("100%")
.height(this.topHeight)
// 列表
Column(){
PeopleShipHomeListComponent({
publishCount: this.publishCount,
creatorId: this.creatorId
})
}.height('100%')
}
.width("100%")
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
// .height('100%')
// .height(this.publishCount == 0 ? '100%' : '')
}
.width("100%")
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
// .height('100%')
// .height(this.publishCount == 0 ? '100%' : '')
.scrollable(ScrollDirection.Vertical)
// .alignSelf(ItemAlign.Start)
// .align(Alignment.Start)
.edgeEffect(EdgeEffect.None)
.friction(0.7)
.backgroundColor(Color.White)
.scrollBar(BarState.Off)
.width('100%')
.height('calc(100% - 44vp)')
// .layoutWeight(1)
.onDidScroll(() => {
// this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)
this.topOpacity = this.scroller.currentOffset().yOffset / 100
if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
this.attentionOpacity = true
} else {
this.attentionOpacity = false
}
Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
})
}
.scrollable(ScrollDirection.Vertical)
// .alignSelf(ItemAlign.Start)
// .align(Alignment.Start)
.edgeEffect(EdgeEffect.None)
.friction(0.7)
.backgroundColor(Color.White)
.scrollBar(BarState.Off)
.width('100%')
.height('calc(100% - 44vp)')
// .layoutWeight(1)
.onDidScroll(() => {
// this.topOpacity = yOffset / (this.getDeviceHeight() * 0.2)
this.topOpacity = this.scroller.currentOffset().yOffset / 100
if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
this.attentionOpacity = true
} else {
this.attentionOpacity = false
}
Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
})
}
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
.width('100%')
.margin({top:px2vp(this.topSafeHeight)})
}
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
.width('100%')
.margin({top:px2vp(this.topSafeHeight)})
}else {
Column(){
CustomTitleUI({ titleName: "" })
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoUserHomepage}).height('70%')
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight)})
}
.width('100%')
}else{
Column(){
CustomTitleUI({ titleName: "" })
...
...
@@ -184,6 +194,7 @@ struct PeopleShipHomePage {
} catch (exception) {
this.isLoading = false
this.isHasHomePage = false
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
View file @
9e01eb7
...
...
@@ -44,7 +44,9 @@ export const enum WDViewDefaultType {
// 17. 暂无评论快来抢沙发
WDViewDefaultType_NoComment1,
// 18. 内容找不到了
WDViewDefaultType_NoContent2
WDViewDefaultType_NoContent2,
// 19. 暂时无法查看该创作者主页
WDViewDefaultType_NoUserHomepage
}
/**
...
...
@@ -214,6 +216,8 @@ export struct EmptyComponent {
contentString = '暂无评论,快来抢沙发'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) {
contentString = '内容找不到了'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){
contentString = '暂时无法查看该创作者主页'
}
return contentString
...
...
@@ -250,6 +254,8 @@ export struct EmptyComponent {
this.emptyType === WDViewDefaultType.WDViewDefaultType_NoFollow ||
this.emptyType === WDViewDefaultType.WDViewDefaultType_NoContent2) {
imageString = $r('app.media.icon_no_appointmentMade1')
}else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoUserHomepage){
imageString = $r('app.media.icon_no_master1')
}
return imageString
}
...
...
Please
register
or
login
to post a comment