wangliang_wd

feat:增加评论内容删除弹出框

@CustomDialog
export struct DeleteCommentDialogView {
functionData:FunctionsItem[] = [
new FunctionsItem('复制',$r('app.media.DeleteComment_copy')),
new FunctionsItem('删除',$r('app.media.DeleteComment_delete')),]
controller: CustomDialogController
confirmCallback: (selectIndex:number) => void = () => {
}
build() {
Column(){
Grid(){
ForEach(this.functionData,(dataItem:FunctionsItem,index:number)=>{
GridItem(){
this.girdItem(dataItem)
}.onClick(()=> {
this.controller.close()
this.confirmCallback(index)
})
.height(88)
})
}
.backgroundColor('#f8f8f8')
.rowsTemplate('1fr')
.columnsTemplate('1fr 1fr 1fr 1fr 1fr')
.height(113)
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(5)
Button('取消',{type:ButtonType.Normal}).height(60).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
.onClick(()=>{
this.controller.close()
})
}.height(198).width('100%').backgroundColor(Color.White)
}
@Builder
girdItem(item:FunctionsItem){
Column(){
Image(item.imgSrc)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.width(48)
.height(48)
Text(`${item.msg}`)
.margin({top:8})
.lineHeight(12)
.height(17)
.fontColor($r('app.color.color_222222'))
.fontSize(12)
}
.alignItems(HorizontalAlign.Center)
.width('100%')
}
}
class FunctionsItem {
msg:string
imgSrc:Resource
constructor(msg:string,imgSrc:Resource){
this.msg = msg
this.imgSrc = imgSrc
}
}
... ...