王士厅
@@ -87,13 +87,12 @@ export struct PageComponent { @@ -87,13 +87,12 @@ export struct PageComponent {
87 ListItem() { 87 ListItem() {
88 if (this.pageModel.hasMore) { 88 if (this.pageModel.hasMore) {
89 LoadMoreLayout({ isVisible: this.pageModel.isVisiblePullUpLoad }) 89 LoadMoreLayout({ isVisible: this.pageModel.isVisiblePullUpLoad })
90 - } else if (!this.pageModel.contentNeedScroll) { 90 + } else {
91 PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) }) 91 PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })
92 } 92 }
93 } 93 }
94 } 94 }
95 - // comp自己处理分页,这里设置EdgeEffect.None  
96 - .edgeEffect(this.pageModel.contentNeedScroll ? EdgeEffect.None : EdgeEffect.Spring) 95 + .edgeEffect(EdgeEffect.None)
97 .scrollBar(BarState.Off) 96 .scrollBar(BarState.Off)
98 .cachedCount(5) 97 .cachedCount(5)
99 .height(CommonConstants.FULL_PARENT) 98 .height(CommonConstants.FULL_PARENT)
@@ -141,7 +141,7 @@ struct ThemeListPage { @@ -141,7 +141,7 @@ struct ThemeListPage {
141 // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, 141 // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
142 // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) 142 // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
143 // }) 143 // })
144 - } else if (!this.pageModel.contentNeedScroll) { 144 + } else {
145 PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) }) 145 PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })
146 } 146 }
147 } 147 }
@@ -35,6 +35,9 @@ export struct TopNavigationComponent { @@ -35,6 +35,9 @@ export struct TopNavigationComponent {
35 @Link _currentNavIndex?: number; 35 @Link _currentNavIndex?: number;
36 // 顶导当前选中/焦点下标 36 // 顶导当前选中/焦点下标
37 @State currentTopNavSelectedIndex: number = 0; 37 @State currentTopNavSelectedIndex: number = 0;
  38 + /**
  39 + * @deprecated TODO,没地方用到,是否弃用
  40 + */
38 @State currentTopNavName: string = ''; 41 @State currentTopNavName: string = '';
39 @State currentTopNavItem: TopNavDTO = {} as TopNavDTO 42 @State currentTopNavItem: TopNavDTO = {} as TopNavDTO
40 // 顶导数据 43 // 顶导数据
@@ -154,7 +157,7 @@ export struct TopNavigationComponent { @@ -154,7 +157,7 @@ export struct TopNavigationComponent {
154 157
155 // 崩溃 158 // 崩溃
156 // this.currentTopNavName = this._currentNavIndex === 0 ? this.myChannelList[0].name : this.topNavList[0].name 159 // this.currentTopNavName = this._currentNavIndex === 0 ? this.myChannelList[0].name : this.topNavList[0].name
157 - if (this._currentNavIndex === 0 && this.myChannelList && this.myChannelList.length > 0 && 160 + if (this._currentNavIndex === 0 && this.myChannelList && this.myChannelList.length > 0 && this.myChannelList[0] &&
158 this.myChannelList[0].name) { 161 this.myChannelList[0].name) {
159 this.currentTopNavName = this.myChannelList[0].name 162 this.currentTopNavName = this.myChannelList[0].name
160 } else if (this._currentNavIndex != 0 && this.topNavList && this.topNavList.length > 0 && this.topNavList[0].name) { 163 } else if (this._currentNavIndex != 0 && this.topNavList && this.topNavList.length > 0 && this.topNavList[0].name) {
@@ -170,19 +173,19 @@ export struct TopNavigationComponent { @@ -170,19 +173,19 @@ export struct TopNavigationComponent {
170 this.currentTopNavItem = this.myChannelList[this.currentTopNavSelectedIndex] 173 this.currentTopNavItem = this.myChannelList[this.currentTopNavSelectedIndex]
171 } 174 }
172 175
173 - isBroadcast(item: TopNavDTO) { 176 + isBroadcast(item?: TopNavDTO) {
174 // TODO 用id channelId = '2066' 177 // TODO 用id channelId = '2066'
175 - return item.name === '播报' 178 + return item?.name === '播报'
176 } 179 }
177 180
178 - isLayout(item: TopNavDTO) { 181 + isLayout(item?: TopNavDTO) {
179 // TODO 用id channelId = '2006' 182 // TODO 用id channelId = '2006'
180 - return item.name === '版面' 183 + return item?.name === '版面'
181 } 184 }
182 185
183 - isSpecialChannel(item: TopNavDTO) { 186 + isSpecialChannel(item?: TopNavDTO) {
184 // 版面、播报,可以用这个判断 187 // 版面、播报,可以用这个判断
185 - return item.channelType === 3 188 + return item?.channelType === 3
186 } 189 }
187 190
188 191
@@ -374,7 +377,7 @@ export struct TopNavigationComponent { @@ -374,7 +377,7 @@ export struct TopNavigationComponent {
374 @Builder 377 @Builder
375 tabBarBuilder(item: TopNavDTO, index: number) { 378 tabBarBuilder(item: TopNavDTO, index: number) {
376 Column() { 379 Column() {
377 - Text(item.name) 380 + Text(item?.name)
378 .fontSize($r('app.float.selected_text_size')) 381 .fontSize($r('app.float.selected_text_size'))
379 .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal) 382 .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
380 .fontColor(this.currentTopNavSelectedIndex === index ? Color.Black : "#999999") 383 .fontColor(this.currentTopNavSelectedIndex === index ? Color.Black : "#999999")
@@ -24,9 +24,6 @@ export default class PageModel { @@ -24,9 +24,6 @@ export default class PageModel {
24 // 当前请求数据的group 24 // 当前请求数据的group
25 groupData: GroupInfoDTO = {} as GroupInfoDTO; 25 groupData: GroupInfoDTO = {} as GroupInfoDTO;
26 compList: LazyDataSource<BaseDTO> = new LazyDataSource(); 26 compList: LazyDataSource<BaseDTO> = new LazyDataSource();
27 - // 是否comp自己处理分页加载;默认是最后一个comp下的content有分页数据,需要节目内容的分页加载  
28 - // (如:首页-视频tab-直播tab,最后一个comp是直播回看列表,视频内容需要分页加载)  
29 - contentNeedScroll: boolean = false;  
30 // 页面状态,刷新、加载更多等,1-首次、2-下拉、3上拉 27 // 页面状态,刷新、加载更多等,1-首次、2-下拉、3上拉
31 loadStrategy: number = 1; 28 loadStrategy: number = 1;
32 currentPage: number = 1; 29 currentPage: number = 1;