DeleteDialog.ets 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @CustomDialog
  2. export struct DeleteDialog {
  3. controller: CustomDialogController
  4. delete=(isDelete:boolean)=>{
  5. }
  6. build() {
  7. Column({ space: 20 }) {
  8. Row({ space: 5 }) {
  9. Image($r('app.media.confim')).width(24)
  10. Text('是否删除该笔记').fontColor('rgba(35, 33, 34, 1)')
  11. }.width('100%')
  12. .justifyContent(FlexAlign.Center)
  13. Row() {
  14. Text('取消')
  15. .width(77)
  16. .height(30)
  17. .borderRadius(6)
  18. .textAlign(TextAlign.Center)
  19. .fontColor('rgba(255, 255, 255, 1)')
  20. .border({ width: 1, color: 'rgba(117, 104, 96, 1)' })
  21. .fontSize(12)
  22. .backgroundColor('rgba(117, 104, 96, 1)')
  23. .onClick(()=>{
  24. this.delete(false)
  25. this.controller.close()
  26. })
  27. Text('确定')
  28. .width(77)
  29. .height(30)
  30. .borderRadius(6)
  31. .textAlign(TextAlign.Center)
  32. .fontColor('rgba(117, 104, 96, 1)')
  33. .border({ width: 1, color: 'rgba(117, 104, 96, 1)' })
  34. .fontSize(12)
  35. .backgroundColor('rgba(254, 222, 155, 1)')
  36. .onClick(()=>{
  37. this.delete(true)
  38. this.controller.close()
  39. })
  40. // YtButton(
  41. // {
  42. // btContent: '取消',
  43. // btWidth: 77,
  44. // btHeight: 30,
  45. // btFontColor: 'rgba(255, 255, 255, 1)',
  46. // btBorder: { width: 1, color: 'rgba(117, 104, 96, 1)' },
  47. // btFontSize: 12,
  48. // bgc: 'rgba(117, 104, 96, 1)',
  49. // click: () => {
  50. // yTToast.hide()
  51. // }
  52. // }
  53. // )
  54. // YtButton(
  55. // {
  56. // btContent: '确定',
  57. // btWidth: 77,
  58. // btHeight: 30,
  59. // btFontSize: 12,
  60. // btFontColor: 'rgba(117, 104, 96, 1)',
  61. // btBorder: { width: 1, color: 'rgba(117, 104, 96, 1)' },
  62. // bgc: 'rgba(254, 222, 155, 1)',
  63. // click: item.click
  64. // }
  65. // )
  66. }
  67. .justifyContent(FlexAlign.SpaceBetween)
  68. .width('100%')
  69. }
  70. .width(280)
  71. .height(118)
  72. .backgroundColor(Color.White)
  73. .border({
  74. width: 1,
  75. color: 'rgba(117, 104, 96, 1)'
  76. })
  77. .borderRadius(12)
  78. .padding(20)
  79. }
  80. }