张善主

fix(频道切换):增加切换刷新接口控制

... ... @@ -28,7 +28,7 @@ export struct PageComponent {
// 自动刷新通知
@Prop @Watch('onAutoRefresh') autoRefresh: number = 0
private listScroller: Scroller = new Scroller();
needload: boolean = true;
build() {
Column() {
if (this.pageModel.viewType == ViewType.LOADING) {
... ... @@ -220,13 +220,17 @@ export struct PageComponent {
// 选中tab,才请求数据。拦截大量接口请求
if (this.navIndex === this.currentTopNavSelectedIndex) {
this.getData();
this.needload = false;
}
}
onChange() {
Logger.info(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`);
if (this.navIndex === this.currentTopNavSelectedIndex) {
this.getData();
if(this.needload){
this.getData();
}
this.needload = false;
}
}
... ...