王士厅
... ... @@ -87,13 +87,12 @@ export struct PageComponent {
ListItem() {
if (this.pageModel.hasMore) {
LoadMoreLayout({ isVisible: this.pageModel.isVisiblePullUpLoad })
} else if (!this.pageModel.contentNeedScroll) {
} else {
PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })
}
}
}
// comp自己处理分页,这里设置EdgeEffect.None
.edgeEffect(this.pageModel.contentNeedScroll ? EdgeEffect.None : EdgeEffect.Spring)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.cachedCount(5)
.height(CommonConstants.FULL_PARENT)
... ...
... ... @@ -141,7 +141,7 @@ struct ThemeListPage {
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
// this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
// })
} else if (!this.pageModel.contentNeedScroll) {
} else {
PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })
}
}
... ...
... ... @@ -35,6 +35,9 @@ export struct TopNavigationComponent {
@Link _currentNavIndex?: number;
// 顶导当前选中/焦点下标
@State currentTopNavSelectedIndex: number = 0;
/**
* @deprecated TODO,没地方用到,是否弃用
*/
@State currentTopNavName: string = '';
@State currentTopNavItem: TopNavDTO = {} as TopNavDTO
// 顶导数据
... ... @@ -154,7 +157,7 @@ export struct TopNavigationComponent {
// 崩溃
// this.currentTopNavName = this._currentNavIndex === 0 ? this.myChannelList[0].name : this.topNavList[0].name
if (this._currentNavIndex === 0 && this.myChannelList && this.myChannelList.length > 0 &&
if (this._currentNavIndex === 0 && this.myChannelList && this.myChannelList.length > 0 && this.myChannelList[0] &&
this.myChannelList[0].name) {
this.currentTopNavName = this.myChannelList[0].name
} else if (this._currentNavIndex != 0 && this.topNavList && this.topNavList.length > 0 && this.topNavList[0].name) {
... ... @@ -170,19 +173,19 @@ export struct TopNavigationComponent {
this.currentTopNavItem = this.myChannelList[this.currentTopNavSelectedIndex]
}
isBroadcast(item: TopNavDTO) {
isBroadcast(item?: TopNavDTO) {
// TODO 用id channelId = '2066'
return item.name === '播报'
return item?.name === '播报'
}
isLayout(item: TopNavDTO) {
isLayout(item?: TopNavDTO) {
// TODO 用id channelId = '2006'
return item.name === '版面'
return item?.name === '版面'
}
isSpecialChannel(item: TopNavDTO) {
isSpecialChannel(item?: TopNavDTO) {
// 版面、播报,可以用这个判断
return item.channelType === 3
return item?.channelType === 3
}
... ... @@ -374,7 +377,7 @@ export struct TopNavigationComponent {
@Builder
tabBarBuilder(item: TopNavDTO, index: number) {
Column() {
Text(item.name)
Text(item?.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.currentTopNavSelectedIndex === index ? Color.Black : "#999999")
... ...
... ... @@ -24,9 +24,6 @@ export default class PageModel {
// 当前请求数据的group
groupData: GroupInfoDTO = {} as GroupInfoDTO;
compList: LazyDataSource<BaseDTO> = new LazyDataSource();
// 是否comp自己处理分页加载;默认是最后一个comp下的content有分页数据,需要节目内容的分页加载
// (如:首页-视频tab-直播tab,最后一个comp是直播回看列表,视频内容需要分页加载)
contentNeedScroll: boolean = false;
// 页面状态,刷新、加载更多等,1-首次、2-下拉、3上拉
loadStrategy: number = 1;
currentPage: number = 1;
... ...