Skip to content

Commit

Permalink
Update IndexShelf.ets
Browse files Browse the repository at this point in the history
  • Loading branch information
MaoXiaoone committed Jul 25, 2024
1 parent 368c145 commit 9d80c48
Showing 1 changed file with 16 additions and 30 deletions.
46 changes: 16 additions & 30 deletions entry/src/main/ets/pages/view/bookShelf/IndexShelf.ets
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import BookMark from '../../../componets/head/BookMark'
import { router } from '@kit.ArkUI'
import BookBodyContent from './components/BookBodyContent'
import { picker } from '@kit.CoreFileKit'
import { FileHandler } from '../../../common/utils/FileHandler'
import Dialog from '../../../componets/common/Dialog'

Expand All @@ -23,6 +22,20 @@ export default struct IndexShelf {
@State isShowImportBookList: boolean = false
@StorageLink('topRectHeight') topRectHeight: number = 0
@StorageProp('APP_INDEX_SCROLLABLE') APP_INDEX_SCROLLABLE: boolean = false
@StorageLink('BOOK_IS_BOOK_REFRESHING') isBookRefreshing: number = 0
// 网址导入dialog
dialogController: CustomDialogController = new CustomDialogController({
builder: Dialog({
title: '网址导入',
child: () => {
this.DialogInput("请输入书籍目录或详情页", 10)
}
}),
cornerRadius: 8,
offset: { dx: 0, dy: 0 }
})
tabsController: TabsController = new TabsController();
private scrollController: Scroller = new Scroller();
build() {
Column() {
Flex({
Expand Down Expand Up @@ -184,14 +197,6 @@ export default struct IndexShelf {
.borderRadius({ bottomRight: 5, bottomLeft: 5 })
}


@Builder
TabBuilderImage(index: number, name: string) {
Column() {
Image($r('app.media.SUB_theme'))
}.width('100%')
}
@StorageLink('BOOK_IS_BOOK_REFRESHING') isBookRefreshing: number = 0
@Builder
// 书籍导入UI盒子
ImportClickBox(index: number, image: string, text: string) {
Expand Down Expand Up @@ -228,13 +233,8 @@ export default struct IndexShelf {
// router.pushUrl({
// url: 'pages/view/bookShelf/LocalImportPage'
// });
let documentSelectOptions = new picker.DocumentSelectOptions();
let documentPicker = new picker.DocumentViewPicker();
let filePath: string = ""
await documentPicker.select(documentSelectOptions).then((documentSelectResult: Array<string>) => {
filePath = documentSelectResult[0];
})
FileHandler.CopyFile(filePath,this.currentIndex)
let FileResult = await FileHandler.documentPickerFile(1, ['.txt', '.epub'])
FileHandler.CopyFile(FileResult[0], this.currentIndex)
this.isShowImport = false
setTimeout(()=>{
this.isBookRefreshing++
Expand Down Expand Up @@ -298,20 +298,6 @@ export default struct IndexShelf {
}
}

// 网址导入dialog
dialogController: CustomDialogController = new CustomDialogController({
builder: Dialog({
title: '网址导入',
child: () => {
this.DialogInput("请输入书籍目录或详情页", 10)
}
}),
cornerRadius: 8,
offset: { dx: 0, dy: 0 }
})
tabsController: TabsController = new TabsController();
private scrollController: Scroller = new Scroller();

@Builder
DialogInput(placeholder: string, maxlength: number) {
Row() {
Expand Down

0 comments on commit 9d80c48

Please sign in to comment.