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-11 11:11:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7085cd9bf0db3b1517c689cf344022ecf5771856
7085cd9b
1 parent
fe09f0f5
fix |> 频道页已加载的稿件,断网后,切换至其他频道再返回不能展示数据
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 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/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
View file @
7085cd9
import { CommonConstants, ViewType } from 'wdConstant';
import {
BottomNavi,
CommonConstants, ViewType } from 'wdConstant';
import { EmitterEventId, EmitterUtils, Logger, NetworkUtil } from 'wdKit';
import { EmptyComponent } from '../view/EmptyComponent';
import PageModel from '../../viewmodel/PageModel';
...
...
@@ -43,7 +43,7 @@ export struct PageComponent {
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
@State netStatus: number | undefined = undefined // 存储网络状态
isRMH:boolean = false
bottomNavi:BottomNavi = BottomNavi.NEWS
build() {
Column() {
...
...
@@ -286,7 +286,7 @@ export struct PageComponent {
//人民号推荐 监听登录事件(刷新页面)
EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => {
if(this.navIndex === this.currentTopNavSelectedIndex && this.
isRMH
){
if(this.navIndex === this.currentTopNavSelectedIndex && this.
bottomNavi == BottomNavi.PEOPLE
){
this.listScroller.scrollEdge(Edge.Top)
this.pageModel.viewType = ViewType.LOADING;
this.getData()
...
...
@@ -298,6 +298,7 @@ export struct PageComponent {
onChange() {
// console.log(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`);
// 注册监听网络连接
if(this.bottomNavi == BottomNavi.VIDEO){
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
...
...
@@ -311,6 +312,16 @@ export struct PageComponent {
} else {
this.pageModel.viewType = ViewType.NoNetwork;
}
}else{
if (this.navIndex === this.currentTopNavSelectedIndex) {
// console.log(TAG, 'page onAutoRefresh111 ' + this.needload)
if (this.needload) {
this.getData();
}
this.needload = false;
}
}
}
async onAutoRefresh() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
7085cd9
...
...
@@ -15,6 +15,7 @@ import { GrayManageModel } from '../../viewmodel/GrayManageModel';
import { ColorUtils } from '../../utils/ColorUtils';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { CommonUtils } from '../../utils/CommonUtils';
import { BottomNavi } from 'wdConstant';
const TAG = 'TopNavigationComponent';
...
...
@@ -97,10 +98,10 @@ export struct TopNavigationComponentNew {
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
if (CompUtils.isNews(this.navItem)) {
this.createPageComponent(navItem, index,
(channelId) => this.GrayManage.get().isNewsMourning(channelId),
false
);
(channelId) => this.GrayManage.get().isNewsMourning(channelId),
BottomNavi.NEWS
);
} else if (CompUtils.isRMH(this.navItem)) {
this.createPageComponent(navItem, index,
(channelId) => this.GrayManage.get().isRmhMourning(channelId),
true
);
(channelId) => this.GrayManage.get().isRmhMourning(channelId),
BottomNavi.PEOPLE
);
}
} else {
...
...
@@ -165,7 +166,7 @@ export struct TopNavigationComponentNew {
}
@Builder
createPageComponent(navItem: TopNavDTO, index: number, mourningCheckFn: (channelId: string) => boolean,
isRMH:boolean = false
) {
createPageComponent(navItem: TopNavDTO, index: number, mourningCheckFn: (channelId: string) => boolean,
bottomNavi:BottomNavi = BottomNavi.NEWS
) {
PageComponent({
currentTopNavSelectedIndex: this.currentTopNavSelectedIndex,
navIndex: index,
...
...
@@ -173,7 +174,7 @@ export struct TopNavigationComponentNew {
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page,
isMourning: mourningCheckFn(`${navItem.channelId}`),
isRMH:isRMH
bottomNavi:bottomNavi
})
// .margin({
// left: 6,
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
7085cd9
...
...
@@ -5,7 +5,7 @@
import { BottomNavDTO, TopNavDTO } from 'wdBean/Index';
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection } from 'wdConstant/Index';
import { DisplayDirection
,BottomNavi
} from 'wdConstant/Index';
import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { ParamType, Tracking } from 'wdTracking/Index';
...
...
@@ -335,6 +335,7 @@ export struct VideoChannelPage {
channelId: item.channelId + '',
autoRefresh: this.autoRefresh,
isMourning: this.GrayManage.get().isVideoMourning(`${item.channelId}`),
bottomNavi:BottomNavi.VIDEO
}).backgroundColor(Color.White)
}
...
...
Please
register
or
login
to post a comment