王士厅

fix: 沉浸式播放时关闭网络,恢复网络后,切换到直播tab,tab列表内容未自动重新加载

import { CommonConstants, ViewType } from 'wdConstant';
import { Logger } from 'wdKit';
import { Logger, NetworkUtil } from 'wdKit';
import { EmptyComponent } from '../view/EmptyComponent';
import PageModel from '../../viewmodel/PageModel';
import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh';
... ... @@ -41,6 +41,7 @@ export struct PageComponent {
private pageTrackBean: PageTrackBean = new PageTrackBean()
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
build() {
Column() {
... ... @@ -278,19 +279,26 @@ export struct PageComponent {
if (this.navIndex === this.currentTopNavSelectedIndex) {
this.getData();
this.needload = false;
// console.log(TAG, 'aboutToAppear onAutoRefresh111 ' + this.needload)
}
}
onChange() {
Logger.info(TAG,
`onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`);
// console.log(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`);
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
if (this.navIndex === this.currentTopNavSelectedIndex) {
Logger.debug(TAG, 'page onAutoRefresh111 ' + this.needload)
// console.log(TAG, 'page onAutoRefresh111 ' + this.needload)
if (this.needload) {
this.getData();
}
this.needload = false;
}
} else {
this.pageModel.viewType = ViewType.EMPTY;
}
}
onAutoRefresh() {
... ...