diff --git a/entry/src/main/ets/componets/bookDetail/note/CircleGeneralButton.ets b/entry/src/main/ets/componets/bookDetail/note/CircleGeneralButton.ets new file mode 100644 index 00000000..18277c50 --- /dev/null +++ b/entry/src/main/ets/componets/bookDetail/note/CircleGeneralButton.ets @@ -0,0 +1,41 @@ +/** + * Copyright (C), 2024-05-15 + * @author LinXun + * @date 2024/5/15 13:03 + * @version 1.0 + * @description: 圆形通用按钮 + */ +@Component +export default struct CircleGeneralButton { + private icon: ResourceStr = $r('app.media.ic_public_edit'); + private text: string = '编辑'; + build() { + Column({space: 8}) { + Column() { + Image(this.icon) + .width(24) + .height(24) + .fillColor('#a6000000') + } + .backgroundColor('#FFFFFF') + .padding({ + left: 12, + right: 12, + top: 12, + bottom: 12 + }) + .border({ + width: 0.5, + color: '#26000000' + }) + .borderRadius(200) + Text(this.text) + .fontSize(12) + .fontWeight(400) + .lineHeight(20) + .fontColor('#a6000000') + } + .padding({top: 16, bottom: 12}) + .height(118) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/componets/bookDetail/note/NoteIndex.ets b/entry/src/main/ets/componets/bookDetail/note/NoteIndex.ets index beb439c0..041aaa67 100644 --- a/entry/src/main/ets/componets/bookDetail/note/NoteIndex.ets +++ b/entry/src/main/ets/componets/bookDetail/note/NoteIndex.ets @@ -73,6 +73,7 @@ export default struct NoteIndex { } }) } + .scrollBar(BarState.Off) } .width(CommonConstants.FULL_WIDTH) .height(CommonConstants.FULL_HEIGHT) diff --git a/entry/src/main/ets/componets/bookDetail/note/NoteListItem.ets b/entry/src/main/ets/componets/bookDetail/note/NoteListItem.ets index c1bc534a..74c7f913 100644 --- a/entry/src/main/ets/componets/bookDetail/note/NoteListItem.ets +++ b/entry/src/main/ets/componets/bookDetail/note/NoteListItem.ets @@ -7,10 +7,56 @@ */ import CommonConstants from '../../../common/constants/CommonConstants' import { NoteVO } from '../../../componetsmodel/NoteVO'; +import CircleGeneralButton from './CircleGeneralButton'; @Component export default struct NoteListItem { + private moreClick = () => {}; private noteVO: NoteVO = new NoteVO(1, '许七安幽幽醒来,嗅到了空气中潮湿的腐臭味,令人轻微的不适,胃酸翻涌', '2020-03-14 12:34'); + @State newPanel: boolean = false; + @Builder NewPanelDialog() { + Column({space: 12}) { + Grid() { + GridItem() { + CircleGeneralButton() + } + GridItem() { + CircleGeneralButton({icon: $r('app.media.ic_public_copy'), text: '复制'}) + } + GridItem() { + CircleGeneralButton({icon: $r('app.media.ic_public_share'), text: '分享'}) + } + GridItem() { + CircleGeneralButton({icon: $r('app.media.ic_public_delete'), text: '删除'}) + } + } + .width(CommonConstants.FULL_WIDTH) + .height(118) + .columnsTemplate('1fr 1fr 1fr 1fr') + Divider() + Column() { + Text('取消').fontSize(16).fontWeight(400) + .lineHeight(24) + } + .height(56) + .onClick(() => { + this.newPanel = false; + }) + .alignItems(HorizontalAlign.Center) + .padding({ + left: 32, + right: 32, + top: 16, + bottom: 16 + }) + } + .width(CommonConstants.FULL_WIDTH) + .padding({top: 12, bottom: 12}) + .backgroundColor('#0f000000') + + // .width(CommonConstants.FULL_WIDTH) + // .height(CommonConstants.FULL_HEIGHT) + } build() { Column({space: 12}) { Row() { @@ -24,6 +70,19 @@ export default struct NoteListItem { .width(16) .height(16) .fillColor('#73000000') + .onClick(() => { + this.newPanel = true; + }) + .bindSheet($$this.newPanel, this.NewPanelDialog(), { + height: SheetSize.FIT_CONTENT, + showClose: false, + dragBar: false, + blurStyle: BlurStyle.COMPONENT_ULTRA_THIN, + maskColor: 'rgba(0,0,0,0.6)', + onDisappear: () => { + // this.clickBookType = '' + } + }) } .height(20) .width(CommonConstants.FULL_WIDTH) @@ -37,16 +96,16 @@ export default struct NoteListItem { .lineHeight(20) .fontColor('#e0000000') } - if (this.noteVO.note === undefined) { - Divider() - .color('#0f000000') - .width(1) - } Text(this.noteVO.note) .fontSize(12) .fontWeight(400) .lineHeight(20) .fontColor('#73000000') + .padding({top: 12}) + .border({ + width: {top: 1}, + color: '#0f000000' + }) } .width(CommonConstants.FULL_WIDTH) .height('auto') diff --git a/entry/src/main/ets/pages/view/BookDetailPage.ets b/entry/src/main/ets/pages/view/BookDetailPage.ets index 7f9a1f6f..b69925a9 100644 --- a/entry/src/main/ets/pages/view/BookDetailPage.ets +++ b/entry/src/main/ets/pages/view/BookDetailPage.ets @@ -138,7 +138,7 @@ struct BookDetailPage { .width(CommonConstants.FULL_WIDTH) .height(64) } - .padding({left: 20, right: 20}) + .padding({left: 20, right: 20, bottom: 12}) .width(CommonConstants.FULL_WIDTH) .height(CommonConstants.FULL_HEIGHT) .borderRadius(16) diff --git a/entry/src/main/resources/base/media/ic_public_copy.svg b/entry/src/main/resources/base/media/ic_public_copy.svg new file mode 100644 index 00000000..63d55367 --- /dev/null +++ b/entry/src/main/resources/base/media/ic_public_copy.svg @@ -0,0 +1,3 @@ + + + diff --git a/entry/src/main/resources/base/media/ic_public_delete.svg b/entry/src/main/resources/base/media/ic_public_delete.svg new file mode 100644 index 00000000..bb4963ed --- /dev/null +++ b/entry/src/main/resources/base/media/ic_public_delete.svg @@ -0,0 +1,5 @@ + + + + +