diff --git a/entry/src/main/ets/componets/import/ImportCommon.ets b/entry/src/main/ets/componets/import/ImportCommon.ets index 834ada80..b706e9a7 100644 --- a/entry/src/main/ets/componets/import/ImportCommon.ets +++ b/entry/src/main/ets/componets/import/ImportCommon.ets @@ -24,6 +24,7 @@ export default struct ImportCommon { @State updateNameMap: Record = {} @State fullActive: boolean = false @State waringActive: boolean = false + @StorageLink('refreshCount') refreshCount: number = 0 private scroll: Scroller = new Scroller() private secondScroll = new Scroller() @@ -190,6 +191,7 @@ export default struct ImportCommon { this.show = false; this.resetState() showMessage('添加成功') + this.refreshCount += 1 }) } .width('100%') diff --git a/entry/src/main/ets/pages/view/Find/BookSource/components/SourceView.ets b/entry/src/main/ets/pages/view/Find/BookSource/components/SourceView.ets index 9b48b659..9c8114da 100644 --- a/entry/src/main/ets/pages/view/Find/BookSource/components/SourceView.ets +++ b/entry/src/main/ets/pages/view/Find/BookSource/components/SourceView.ets @@ -39,6 +39,7 @@ export default struct SourceView { private scroll: Scroller = new Scroller() private secondScroll = new Scroller() @State dialogItem: Partial = {} + @StorageLink('refreshCount') refreshCount: number = 0 private dialogController: CustomDialogController = new CustomDialogController({ builder: CustomContentDialog({ primaryTitle: '书源评分', @@ -92,9 +93,7 @@ export default struct SourceView { } getList() { - // axios.get('https://node.wisdoms.xin/static/file/20240704/sy.json').then((res: AxiosResponse) => { - // const bookSource: BookSource[] = res.data ?? [] - // FileHandler.readJsonFile(this.pathBookSource) + this.refreshCount += 1 BookSourceDao.flowSearch({ type: this.index, searchKey: this.searchValue diff --git a/entry/src/main/ets/pages/view/Find/components/BodyContent.ets b/entry/src/main/ets/pages/view/Find/components/BodyContent.ets index 540b238d..2e4345a5 100644 --- a/entry/src/main/ets/pages/view/Find/components/BodyContent.ets +++ b/entry/src/main/ets/pages/view/Find/components/BodyContent.ets @@ -20,7 +20,7 @@ export default struct BodyContent { @Prop currentIndex: number @StorageLink(CommonConstants.HAS_EXPLORE_URL) @Watch('getList') hasExploreUrl?: boolean = undefined tabsBodyController: TabsController = new TabsController(); - @State @Watch('getList')refreshCount: number = 0 + @StorageLink('refreshCount') @Watch('getList')refreshCount: number = 0 aboutToAppear() { this.getList()