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
yangchenggong1_wd
2024-10-14 17:36:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f5fe9f83c022894e32f49c6b2572def8dc67672a
f5fe9f83
1 parent
fc03bddc
fix |> 20302 uat>导航换肤,新闻频道列表页,内容区背景未展示换肤图片。
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
6 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
View file @
f5fe9f8
...
...
@@ -44,6 +44,8 @@ export struct PageComponent {
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
@State netStatus: number | undefined = undefined // 存储网络状态
bottomNavi:BottomNavi = BottomNavi.NEWS
@Prop scrollBgHeight:number = 0
onHideBgImage?: (isShow:boolean) => void;
build() {
Column() {
...
...
@@ -156,6 +158,20 @@ export struct PageComponent {
this.pageModel.endIndex = end;
})
.id('page_list')
.onDidScroll(() => {
if(this.scrollBgHeight === 0){
return
}
let y = this.listScroller.currentOffset().yOffset
if (this.onHideBgImage !== undefined ) {
if( y - this.scrollBgHeight > 0){
this.onHideBgImage(true)
}else{
this.onHideBgImage(false)
}
}
})
// 挂角广告
this.pageHornAd()
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
f5fe9f8
import { BottomNavDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { Logger, NetworkUtil, SPHelper,
StringUtils,
ToastUtils } from 'wdKit';
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
import { PageComponent } from './PageComponent';
import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
...
...
@@ -75,9 +75,25 @@ export struct TopNavigationComponentNew {
@State backgroundImageH: number = 0
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
@State backImageHeight:number = 0
@State isHideBackgroundImage:boolean = false
build() {
Column() {
Stack({ alignContent: Alignment.Top }) {
// 顶部背景图
if(StringUtils.isNotEmpty(this.navItem.backgroundUrl)){
Image(this.navItem.backgroundUrl).width('100%')
.objectFit(ImageFit.Cover)
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
.onAreaChange((oldValue: Area, newValue: Area) => {
if(typeof newValue?.height == 'number'){
let backImageHeight = newValue?.height
this.backImageHeight = backImageHeight - 40 - this.topRectHeight
console.log("ycg","height===>"+this.backImageHeight)
}
})
}
// 频道分类list
RelativeContainer() {
this.tabBar()
...
...
@@ -174,7 +190,9 @@ export struct TopNavigationComponentNew {
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page,
isMourning: mourningCheckFn(`${navItem.channelId}`),
bottomNavi:bottomNavi
bottomNavi:bottomNavi,
onHideBgImage: (isShow:boolean): void => this.onHideBgImage(isShow),
scrollBgHeight: this.backImageHeight
})
// .margin({
// left: 6,
...
...
@@ -184,7 +202,7 @@ export struct TopNavigationComponentNew {
// topLeft: 6,
// topRight: 6
// })
.backgroundColor(
CompUtils.isRMH(this.navItem) || CompUtils.isNews(this.navItem) ? Color.White : Color.Transparent
)
.backgroundColor(
(CompUtils.isRMH(this.navItem) || (CompUtils.isNews(this.navItem) && StringUtils.isEmpty(this.navItem.backgroundUrl) )) ? Color.White : ((this.isHideBackgroundImage && (CompUtils.isRMH(this.navItem) || CompUtils.isNews(this.navItem))) ? Color.White : Color.Transparent)
)
}
/**
...
...
@@ -272,8 +290,8 @@ export struct TopNavigationComponentNew {
tabBar() {
// 顶部背景图
Image(this.navItem.backgroundUrl).width('100%').height('100%')
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
// Image(this.navItem.backgroundUrl).width('100%').height('100%')
// .grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
if (CompUtils.isNews(this.navItem)) {
// 顶部搜索、日报logo、早晚报
...
...
@@ -858,4 +876,8 @@ export struct TopNavigationComponentNew {
}
}
onHideBgImage(isShow:boolean){
this.isHideBackgroundImage = isShow
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment