chenquansheng

fix |> 评论弹窗样式修改

@@ -3,39 +3,44 @@ @@ -3,39 +3,44 @@
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 - Grid(){  
15 - ForEach(this.functionData,(dataItem:FunctionsItem,index:number)=>{  
16 - GridItem(){  
17 - this.girdItem(dataItem)  
18 - }.onClick(()=> { 14 + Column(){
  15 + Grid(){
  16 + ForEach(this.functionData,(dataItem:FunctionsItem,index:number)=>{
  17 + GridItem() {
  18 + this.girdItem(dataItem)
  19 + }.onClick(()=> {
  20 + this.controller.close()
  21 + this.confirmCallback(dataItem.actionType)
  22 + })
  23 + .height(88)
  24 + })
  25 + }
  26 + .backgroundColor('#f8f8f8')
  27 + .rowsTemplate('1fr')
  28 + .columnsTemplate('1fr 1fr 1fr 1fr 1fr')
  29 + .height(113)
  30 +
  31 + Divider()
  32 + .color('#f5f5f5')
  33 + .width('100%')
  34 + .strokeWidth(5)
  35 + Button('取消',{type:ButtonType.Normal}).height(60).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
  36 + .onClick(()=>{
19 this.controller.close() 37 this.controller.close()
20 - this.confirmCallback(index)  
21 }) 38 })
22 - .height(88)  
23 - })  
24 } 39 }
25 - .backgroundColor('#f8f8f8')  
26 - .rowsTemplate('1fr')  
27 - .columnsTemplate('1fr 1fr 1fr 1fr 1fr')  
28 - .height(113)  
29 -  
30 - Divider()  
31 - .color('#f5f5f5')  
32 - .width('100%')  
33 - .strokeWidth(5)  
34 - Button('取消',{type:ButtonType.Normal}).height(60).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)  
35 - .onClick(()=>{  
36 - this.controller.close()  
37 - })  
38 - }.height(198).width('100%').backgroundColor(Color.White) 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 }