Skip to content

Commit

Permalink
Merge pull request #53 from linxunxr/main
Browse files Browse the repository at this point in the history
书籍详情页面笔记第一个panel
  • Loading branch information
mgz0227 authored May 15, 2024
2 parents b0c05ba + a360a2d commit cd78cb5
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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)
}
}
1 change: 1 addition & 0 deletions entry/src/main/ets/componets/bookDetail/note/NoteIndex.ets
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default struct NoteIndex {
}
})
}
.scrollBar(BarState.Off)
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
Expand Down
69 changes: 64 additions & 5 deletions entry/src/main/ets/componets/bookDetail/note/NoteListItem.ets
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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)
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion entry/src/main/ets/pages/view/BookDetailPage.ets
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions entry/src/main/resources/base/media/ic_public_copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions entry/src/main/resources/base/media/ic_public_delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cd78cb5

Please sign in to comment.