From 16a26485634b203810d16ca86a6096381c3775d0 Mon Sep 17 00:00:00 2001 From: Andy <454846659@qq.com> Date: Sun, 21 Jul 2024 17:39:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=BA=90=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/componets/source/SourceView.ets | 2 +- entry/src/main/ets/database/entities/BookSource.ets | 4 ++-- .../ets/pages/view/Find/BookSource/AddSourcePage.ets | 2 +- .../view/Find/BookSource/components/SourceView.ets | 2 +- .../ets/pages/view/Find/components/BodyContent.ets | 11 +++++------ 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/entry/src/main/ets/componets/source/SourceView.ets b/entry/src/main/ets/componets/source/SourceView.ets index 751d3c3d..7babe2a0 100644 --- a/entry/src/main/ets/componets/source/SourceView.ets +++ b/entry/src/main/ets/componets/source/SourceView.ets @@ -44,7 +44,7 @@ export default struct SourceView { getList() { BookSourceDao.flowSearch({ - type: this.type, + type: [0, 2, 1][this.type], searchKey: this.searchValue, enabled: this.index === 0 }).then(data => { diff --git a/entry/src/main/ets/database/entities/BookSource.ets b/entry/src/main/ets/database/entities/BookSource.ets index 4426f1f2..ab061e0f 100644 --- a/entry/src/main/ets/database/entities/BookSource.ets +++ b/entry/src/main/ets/database/entities/BookSource.ets @@ -91,8 +91,8 @@ export const GRADE_TYPE: Record = { export const BOOK_SOURCE_TYPE: Record = { 0 : '小说', - 1 : '漫画', - 2 : '有声' + 2 : '漫画', + 1 : '有声' } export interface BookSourceDb extends Omit { diff --git a/entry/src/main/ets/pages/view/Find/BookSource/AddSourcePage.ets b/entry/src/main/ets/pages/view/Find/BookSource/AddSourcePage.ets index b28a3e07..786227f1 100644 --- a/entry/src/main/ets/pages/view/Find/BookSource/AddSourcePage.ets +++ b/entry/src/main/ets/pages/view/Find/BookSource/AddSourcePage.ets @@ -264,7 +264,7 @@ struct AddSourcePage { .borderRadius(4) .fontColor(this.formModel.bookSourceType !== undefined ? '#E0000000' : '#73000000') .onSelect((index: number, text?: string | undefined) => { - this.formModel.bookSourceType = index + this.formModel.bookSourceType = [0, 2, 1][index] }) .backgroundColor('#f5f5f5') .layoutWeight(1) 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 9c8114da..52423070 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 @@ -95,7 +95,7 @@ export default struct SourceView { getList() { this.refreshCount += 1 BookSourceDao.flowSearch({ - type: this.index, + type: [0, 2, 1][this.index], searchKey: this.searchValue }).then(data => { const bookSource = data ?? [] 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 2e4345a5..71d571ff 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(); - @StorageLink('refreshCount') @Watch('getList')refreshCount: number = 0 + @StorageLink('refreshCount') @Watch('getList') refreshCount: number = 0 aboutToAppear() { this.getList() @@ -33,7 +33,7 @@ export default struct BodyContent { getList() { this.loading = true BookSourceDao.search({ - type: this.currentIndex, + type: [0, 2, 1][this.currentIndex], enabled: true, hasExploreUrl: this.hasExploreUrl }).then(bookSources => { @@ -88,9 +88,8 @@ export default struct BodyContent { Row() { Image($r('app.media.more_search')).width(24).height(24) - }.width( - '10%' - ) + } + .width(34) .onClick(() => { if (this.sourceList.length) { this.isShowDialog = true @@ -105,7 +104,7 @@ export default struct BodyContent { } }) } - .margin({ left: 15 }) + .margin({ left: 20, right: 10 }) if (this.loading) {