Skip to content

Commit

Permalink
fix: 修复源类型展示
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-boide committed Jul 21, 2024
1 parent 15c5879 commit 16a2648
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion entry/src/main/ets/componets/source/SourceView.ets
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
4 changes: 2 additions & 2 deletions entry/src/main/ets/database/entities/BookSource.ets
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export const GRADE_TYPE: Record<number, string> = {

export const BOOK_SOURCE_TYPE: Record<number, string> = {
0 : '小说',
1 : '漫画',
2 : '有声'
2 : '漫画',
1 : '有声'
}

export interface BookSourceDb extends Omit<BookSource, 'ruleExplore' | 'ruleSearch' | 'ruleBookInfo' | 'ruleToc' | 'ruleContent' | 'ruleReview'> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? []
Expand Down
11 changes: 5 additions & 6 deletions entry/src/main/ets/pages/view/Find/components/BodyContent.ets
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 => {
Expand Down Expand Up @@ -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
Expand All @@ -105,7 +104,7 @@ export default struct BodyContent {
}
})
}
.margin({ left: 15 })
.margin({ left: 20, right: 10 })


if (this.loading) {
Expand Down

0 comments on commit 16a2648

Please sign in to comment.