From 15c5879e3a44bf3d1fb69cc9789dc3e3846cf6cb Mon Sep 17 00:00:00 2001 From: Marvin <63292605+yi-boide@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:24:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E5=85=A5=EF=BC=8C=E4=B9=A6?= =?UTF-8?q?=E6=BA=90=E7=AE=A1=E7=90=86=E6=93=8D=E4=BD=9C=E5=90=8E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8F=91=E7=8E=B0=E9=A1=B5=E9=9D=A2=20(#214)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/componets/import/ImportCommon.ets | 2 ++ .../ets/pages/view/Find/BookSource/components/SourceView.ets | 5 ++--- .../src/main/ets/pages/view/Find/components/BodyContent.ets | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) 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()