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
wangliang_wd
2024-09-10 16:01:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3ef33edd98826808054bedfca4a8c3e9aa73c127
3ef33edd
1 parent
b83007e0
feat:增加人民号组件背景,防止跳转时UI错乱
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
90 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/PeopleShipHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PeopleShipHomePage.ets
View file @
3ef33ed
...
...
@@ -67,109 +67,114 @@ struct PeopleShipHomePage {
build() {
if(this.isConnectNetwork){
if (this.isHasHomePage){
Stack({ alignContent: Alignment.Top }) {
Stack({ alignContent: Alignment.Top }){
// 顶部图片
Image($r('app.media.home_page_bg'))
.width('100%')
///1-this.topOpacity 联动上滑
.height(this.topOpacity>1?0:120*(1-this.topOpacity))
.objectFit(ImageFit.Cover)
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.backgroundColor($r('app.color.white'))
.visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
.opacity(this.topOpacity )
}
Column(){
Column(){
if(this.isConnectNetwork){
if (this.isHasHomePage){
Stack({ alignContent: Alignment.Top }) {
Stack({ alignContent: Alignment.Top }){
this.peopleHomeTitleTransparent()
// 头部返回
PeopleShipHomePageNavComponent({
attentionOpacity: this.attentionOpacity,
topOpacity: this.topOpacity,
detailModel: this.detailModel
})
}
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)
// 列表
PeopleShipHomeListComponent({
publishCount: this.publishCount,
creatorId: this.creatorId
})
// Column(){
//
//
// }.height('100%')
}
// 顶部图片
Image($r('app.media.home_page_bg'))
.width('100%')
///1-this.topOpacity 联动上滑
.height(this.topOpacity>1?0:120*(1-this.topOpacity))
.objectFit(ImageFit.Cover)
Row()
.height(px2vp(this.topSafeHeight))
.width("100%")
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
.backgroundColor($r('app.color.white'))
.visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
.opacity(this.topOpacity )
}
Column(){
Stack({ alignContent: Alignment.Top }){
this.peopleHomeTitleTransparent()
// 头部返回
PeopleShipHomePageNavComponent({
attentionOpacity: this.attentionOpacity,
topOpacity: this.topOpacity,
detailModel: this.detailModel
})
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.layoutWeight(1)
// .scrollable(ScrollDirection.Vertical)
// .edgeEffect(EdgeEffect.None)
// .friction(0.7)
// .backgroundColor(Color.White)
// .scrollBar(BarState.Off)
// .width('100%')
// .height('calc(100% - 44vp)')
.onDidScroll(() => {
this.topOpacity = this.scroller.currentOffset().yOffset / 120
if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
this.attentionOpacity = true
} else {
this.attentionOpacity = false
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)
// 列表
PeopleShipHomeListComponent({
publishCount: this.publishCount,
creatorId: this.creatorId
})
// Column(){
//
//
// }.height('100%')
}
.width("100%")
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
}
Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.layoutWeight(1)
// .scrollable(ScrollDirection.Vertical)
// .edgeEffect(EdgeEffect.None)
// .friction(0.7)
// .backgroundColor(Color.White)
// .scrollBar(BarState.Off)
// .width('100%')
// .height('calc(100% - 44vp)')
.onDidScroll(() => {
this.topOpacity = this.scroller.currentOffset().yOffset / 120
if (this.scroller.currentOffset().yOffset >= this.topHeight - 66) {
this.attentionOpacity = true
} else {
this.attentionOpacity = false
}
Logger.debug('PeopleShipHomePage',`透明度:${this.topOpacity}`)
})
})
}
}
.margin({top:px2vp(this.topSafeHeight)})
}
.margin({top:px2vp(this.topSafeHeight)})
.width('100%')
}else {
Column(){
CustomTitleUI({ titleName: "" })
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoUserHomepage}).height('70%')
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight)})
}
.width('100%')
}else {
}else{
Column(){
CustomTitleUI({ titleName: "" })
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoUserHomepage}).height('70%')
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.detailModel = {} as PeopleShipUserDetailData
this.getData()
}
}})
.height('calc(100% - 84lpx)')
.width('100%')
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight)})
}
}else{
Column(){
CustomTitleUI({ titleName: "" })
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.detailModel = {} as PeopleShipUserDetailData
this.getData()
}
}})
.height('calc(100% - 84lpx)')
.width('100%')
}.width("100%")
.height("100%")
}
}.width("100%")
.height("100%")
.backgroundColor(Color.White)
}
@Builder peopleHomeTitleTransparent() {
...
...
Please
register
or
login
to post a comment