Skip to content

Commit

Permalink
Merge pull request mgz0227#62 from mgz0227/dev_2008
Browse files Browse the repository at this point in the history
小说删除删除填充添加是否删除本地缓存选项
  • Loading branch information
MaoXiaoone committed May 17, 2024
2 parents 52bbc9e + 63729fd commit 2917c9b
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 13 deletions.
13 changes: 12 additions & 1 deletion entry/src/main/ets/componets/common/confirmDialog.ets
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@ export default struct confirmDialogExample {
confirm: () => void = () => {
}
@Prop title:string = '删除'
@Link delCache:boolean
@Prop isShowCache:boolean = false

build() {
Column() {
Text(`确定${this.title}吗?` ).fontWeight(600).maxLines(1).minFontSize(12).maxFontSize(20).margin({ top: 20, bottom: 10 })
if (this.isShowCache){
Row({
space:8
}){
Checkbox().selectedColor($r('app.color.theme_color')).select(this.delCache)
Text('同时删除本地缓存')
.fontColor('rgba(0, 0, 0, 0.45)').fontSize(14).fontWeight(400).lineHeight(22)
}
}
Row({space:24}) {
Text('取消')
.onClick(() => {
Expand All @@ -37,6 +48,6 @@ export default struct confirmDialogExample {
.fontColor(Color.White)
.backgroundColor($r('app.color.theme_color'))
}.padding({top:20,bottom:20})
}.width(200)
}
}
}
5 changes: 3 additions & 2 deletions entry/src/main/ets/componets/panel/catalogMove.ets
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ export default struct catalogMove{
}
}


@State delCache:boolean = false
//是否确认移动分组
clickBookTypeDialog: CustomDialogController | null = new CustomDialogController({
builder: confirmDialogExample({
cancel: ()=> { this.clickBookCancel() },
confirm: ()=> { this.clickBookAccept() },
title:`移动到${this.clickBookType}`
title:`移动到${this.clickBookType}`,
delCache:this.delCache
}),
cancel: this.clickExitDialog,
autoCancel: true,
Expand Down
14 changes: 12 additions & 2 deletions entry/src/main/ets/pages/view/bookShelf/BookInfo.ets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import router from '@ohos.router'
import { promptAction } from '@kit.ArkUI'
import { updateDateListById } from '../../../storage/bookListData'
import { BookList } from '../../../componets/dataList/bookList'
import { showMessage } from '../../../componets/common/promptShow'

@Component
/**
Expand All @@ -18,12 +19,14 @@ export default struct BookInfo{
onDelete: () => void = () => {

}

@State delCache:boolean = false
//弹窗
bookInfoDel: CustomDialogController | null = new CustomDialogController({
builder: confirmDialogExample({
cancel: ()=> { this.onCancel() },
confirm: ()=> { this.onAccept() }
confirm: ()=> { this.onAccept() },
delCache:this.delCache,
isShowCache:true
}),
cancel: this.exitApp,
autoCancel: true,
Expand Down Expand Up @@ -141,6 +144,13 @@ export default struct BookInfo{
.alignItems(HorizontalAlign.End)
}
}
.gesture(
LongPressGesture({ repeat: true,duration:500 })
.onAction((event: GestureEvent) => {
if (event.repeat) {
showMessage('6666')
}
}))
.padding(10)
.borderRadius(10)
}
Expand Down
14 changes: 12 additions & 2 deletions entry/src/main/ets/pages/view/bookShelf/BookInfoGrid.ets
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import confirmDialogExample from '../../../componets/common/confirmDialog'
import router from '@ohos.router'
import { BookList } from '../../../componets/dataList/bookList'
import { showMessage } from '../../../componets/common/promptShow'

@Component
/**
Expand All @@ -13,12 +14,14 @@ export default struct BookInfoGrid{
onDelete: () => void = () => {

}

@State delCache:boolean = false
//弹窗
bookInfoDel: CustomDialogController | null = new CustomDialogController({
builder: confirmDialogExample({
cancel: ()=> { this.onCancel() },
confirm: ()=> { this.onAccept() }
confirm: ()=> { this.onAccept() },
delCache:this.delCache,
isShowCache:true
}),
cancel: this.exitApp,
autoCancel: true,
Expand Down Expand Up @@ -102,5 +105,12 @@ export default struct BookInfoGrid{
}
})
})
.gesture(
LongPressGesture({ repeat: true,duration:500 })
.onAction((event: GestureEvent) => {
if (event.repeat) {
showMessage('6666')
}
}))
}
}
4 changes: 3 additions & 1 deletion entry/src/main/ets/pages/view/bookShelf/IndexShelf.ets
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import BookFolder from './BookFolder'

@Component
export default struct IndexShelf {
@State delCache:boolean = false
IndexShelf: CustomDialogController | null = new CustomDialogController({
builder: confirmDialogExample({
cancel: ()=> { this.onCancel() },
confirm: ()=> { this.onAccept() },
title: '清空'
title: '清空',
delCache:this.delCache
}),
cancel: this.exitApp,
autoCancel: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export default struct BookFolderManages {
@Prop changeTop:boolean
@Link folderList:folderList[]
@Prop EXHIBIT:string

@State delCache:boolean = false
bookInfoDel: CustomDialogController | null = new CustomDialogController({
builder: confirmDialogExample({
cancel: ()=> { this.onCancel() },
confirm: ()=> { this.onAccept() }
confirm: ()=> { this.onAccept() },
delCache:this.delCache
}),
cancel: this.exitApp,
autoCancel: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ export default struct bookListManage{
onIsEXHIBITChange() {
console.log(this.EXHIBIT)
}

@State delCache:boolean = false
//弹窗
bookInfoDel: CustomDialogController | null = new CustomDialogController({
builder: confirmDialogExample({
cancel: ()=> { this.onCancel() },
confirm: ()=> { this.onAccept() }
confirm: ()=> { this.onAccept() },
delCache:this.delCache,
isShowCache:true
}),
cancel: this.exitApp,
autoCancel: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ export default struct newBookShelf{
@Link addCheckShelf:BookList[]
@State TextValue:string = ''
@State deByBookId:string = ''
@State delCache:boolean = false
bookInfoDel: CustomDialogController | null = new CustomDialogController({
builder: confirmDialogExample({
cancel: ()=> { this.onCancel() },
confirm: ()=> { this.onAccept() }
confirm: ()=> { this.onAccept() },
delCache:this.delCache
}),
cancel: this.exitApp,
autoCancel: true,
Expand Down

0 comments on commit 2917c9b

Please sign in to comment.