Skip to content

Commit d659af5

Browse files
committed
解决冲突
解决冲突
1 parent b509d45 commit d659af5

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

entry/src/main/ets/pages/view/BookDetailPage.ets

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,9 @@ struct BookDetailPage {
9090
console.log('router BookDetailPage:' + JSON.stringify(router.getParams()))
9191
if (router.getParams() as Books) {
9292
this.bookData = router.getParams() as Books
93-
setTimeout(async () => {
94-
let temp = await FileHandler.readFile(this.bookData?.bookUrl||'') //txt小说
95-
this.txtFile.pushAllData(temp)
96-
this.txtFiles = this.txtFile.getListData()
97-
},0)
93+
let temp = await FileHandler.readFile(this.bookData?.bookUrl||'') //txt小说
94+
this.txtFile.pushAllData(temp)
95+
this.txtFiles = this.txtFile.getListData()
9896
}
9997
}
10098

@@ -121,7 +119,7 @@ struct BookDetailPage {
121119
Tabs({ barPosition: BarPosition.Start }) {
122120
TabContent() {
123121
Column() {
124-
if (this.txtFiles.length=== 0 || undefined) {
122+
if (this.txtFiles.length === 0 || undefined) {
125123
SwipeRefresher({
126124
content: '目录加载中...',
127125
isLoading: true
@@ -221,7 +219,7 @@ struct BookDetailPage {
221219
.width(150)
222220
.height(40)
223221
.borderRadius(200)
224-
.backgroundColor(this.txtFile.totalCount() ? '#FF6600' : 'gray')
222+
.backgroundColor(this.txtFile.totalCount() > 0 ? '#FF6600' : 'gray')
225223
.fontColor('#FFFFFF')
226224
.enabled(this.txtFile.totalCount() > 0)
227225
.onClick(() => {
@@ -331,12 +329,12 @@ struct BookDetailPage {
331329

332330
// 小说标题
333331
Row({ space: CommonConstants.SPACE_20 }) {
334-
Image(this.bookData.bookImage ?? $r('app.media.cover_list'))
332+
Image(this.bookData.coverUrl?? $r('app.media.cover_list'))
335333
.width(CommonConstants.NOVEL_IMG_WIDTH)
336334
.height(CommonConstants.NOVEL_IMG_HEIGHT)
337335
.borderRadius(5)
338336
Column({ space: 8 }) {
339-
Text(this.bookData.title.replace(new RegExp('\\..*', 'g'), ''))
337+
Text(this.bookData.bookName.replace(new RegExp('\\..*', 'g'), ''))
340338
.fontColor(Color.White)
341339
.fontSize(20)
342340
Blank()

entry/src/main/ets/pages/view/bookShelf/IndexShelf.ets

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,23 @@ export default struct IndexShelf {
146146

147147
Tabs({
148148
barPosition: BarPosition.Start,
149-
controller: this.tabsController
149+
controller: this.tabsController,
150+
index: this.currentIndex
150151
}) {
151-
TabContent() {
152-
this.book()
153-
}
154-
155-
TabContent() {
156-
this.book()
157-
}
158-
159-
TabContent() {
160-
this.book()
161-
}
152+
ForEach(this.titleArray, () => {
153+
TabContent() {
154+
Column(){
155+
BookBodyContent({
156+
currentIndex: this.currentIndex,
157+
EXHIBIT: this.EXHIBIT,
158+
GROUP: this.GROUP,
159+
searchValue: this.searchValue,
160+
isClear: this.isClear,
161+
bookType: this.bookType
162+
})
163+
}
164+
}
165+
})
162166
}
163167
.layoutWeight(1)
164168
.barWidth(0)

0 commit comments

Comments
 (0)