Showing
2 changed files
with
23 additions
and
7 deletions
| @@ -3,21 +3,22 @@ | @@ -3,21 +3,22 @@ | ||
| 3 | 3 | ||
| 4 | export struct DeleteCommentDialogView { | 4 | export struct DeleteCommentDialogView { |
| 5 | functionData:FunctionsItem[] = [ | 5 | functionData:FunctionsItem[] = [ |
| 6 | - new FunctionsItem('复制',$r('app.media.DeleteComment_copy')), | ||
| 7 | - new FunctionsItem('删除',$r('app.media.DeleteComment_delete')),] | 6 | + new FunctionsItem('回复',$r('app.media.DeleteComment_reply'),PublicCommentMoreActionType.PublicCommentMoreActionType_Reply), |
| 7 | + new FunctionsItem('复制',$r('app.media.DeleteComment_copy'),PublicCommentMoreActionType.PublicCommentMoreActionType_Copy), | ||
| 8 | + new FunctionsItem('删除',$r('app.media.DeleteComment_delete'),PublicCommentMoreActionType.PublicCommentMoreActionType_Delete)] | ||
| 8 | 9 | ||
| 9 | controller: CustomDialogController | 10 | controller: CustomDialogController |
| 10 | - confirmCallback: (selectIndex:number) => void = () => { | 11 | + confirmCallback: (actionType:PublicCommentMoreActionType) => void = () => { |
| 11 | } | 12 | } |
| 12 | build() { | 13 | build() { |
| 13 | Column(){ | 14 | Column(){ |
| 14 | Grid(){ | 15 | Grid(){ |
| 15 | ForEach(this.functionData,(dataItem:FunctionsItem,index:number)=>{ | 16 | ForEach(this.functionData,(dataItem:FunctionsItem,index:number)=>{ |
| 16 | - GridItem(){ | 17 | + GridItem() { |
| 17 | this.girdItem(dataItem) | 18 | this.girdItem(dataItem) |
| 18 | }.onClick(()=> { | 19 | }.onClick(()=> { |
| 19 | this.controller.close() | 20 | this.controller.close() |
| 20 | - this.confirmCallback(index) | 21 | + this.confirmCallback(dataItem.actionType) |
| 21 | }) | 22 | }) |
| 22 | .height(88) | 23 | .height(88) |
| 23 | }) | 24 | }) |
| @@ -35,7 +36,11 @@ export struct DeleteCommentDialogView { | @@ -35,7 +36,11 @@ export struct DeleteCommentDialogView { | ||
| 35 | .onClick(()=>{ | 36 | .onClick(()=>{ |
| 36 | this.controller.close() | 37 | this.controller.close() |
| 37 | }) | 38 | }) |
| 38 | - }.height(198).width('100%').backgroundColor(Color.White) | 39 | + } |
| 40 | + .height(198) | ||
| 41 | + .width('100%') | ||
| 42 | + .backgroundColor(Color.White) | ||
| 43 | + .alignItems(HorizontalAlign.End) | ||
| 39 | } | 44 | } |
| 40 | 45 | ||
| 41 | @Builder | 46 | @Builder |
| @@ -60,12 +65,23 @@ export struct DeleteCommentDialogView { | @@ -60,12 +65,23 @@ export struct DeleteCommentDialogView { | ||
| 60 | } | 65 | } |
| 61 | } | 66 | } |
| 62 | 67 | ||
| 68 | +export enum PublicCommentMoreActionType { | ||
| 69 | + /// 删除 | ||
| 70 | + PublicCommentMoreActionType_Delete = 0, | ||
| 71 | + /// 复制 | ||
| 72 | + PublicCommentMoreActionType_Copy = 1, | ||
| 73 | + /// 回复 | ||
| 74 | + PublicCommentMoreActionType_Reply = 2, | ||
| 75 | +} | ||
| 76 | + | ||
| 63 | class FunctionsItem { | 77 | class FunctionsItem { |
| 64 | msg:string | 78 | msg:string |
| 65 | imgSrc:Resource | 79 | imgSrc:Resource |
| 80 | + actionType:PublicCommentMoreActionType | ||
| 66 | 81 | ||
| 67 | - constructor(msg:string,imgSrc:Resource){ | 82 | + constructor(msg:string,imgSrc:Resource,actionType:PublicCommentMoreActionType){ |
| 68 | this.msg = msg | 83 | this.msg = msg |
| 69 | this.imgSrc = imgSrc | 84 | this.imgSrc = imgSrc |
| 85 | + this.actionType = actionType | ||
| 70 | } | 86 | } |
| 71 | } | 87 | } |
-
Please register or login to post a comment