chenquansheng

fix |> 长按评论显示弹窗优化

@@ -2,14 +2,29 @@ @@ -2,14 +2,29 @@
2 @CustomDialog 2 @CustomDialog
3 3
4 export struct DeleteCommentDialogView { 4 export struct DeleteCommentDialogView {
5 - functionData:FunctionsItem[] = [  
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)]  
9 5
  6 + @State configItem:string[] = ['回复','复制','删除']
  7 + @Provide functionData:FunctionsItem[] = []
10 controller: CustomDialogController 8 controller: CustomDialogController
11 confirmCallback: (actionType:PublicCommentMoreActionType) => void = () => { 9 confirmCallback: (actionType:PublicCommentMoreActionType) => void = () => {
12 } 10 }
  11 +
  12 + aboutToAppear(): void {
  13 +
  14 + for (let index = 0; index < this.configItem.length; index++) {
  15 + const element = this.configItem[index];
  16 + if (element === '回复') {
  17 + this.functionData.push(new FunctionsItem('回复',$r('app.media.DeleteComment_reply'),PublicCommentMoreActionType.PublicCommentMoreActionType_Reply))
  18 + }
  19 + if (element === '复制') {
  20 + this.functionData.push(new FunctionsItem('复制',$r('app.media.DeleteComment_copy'),PublicCommentMoreActionType.PublicCommentMoreActionType_Copy))
  21 + }
  22 + if (element === '删除') {
  23 + this.functionData.push(new FunctionsItem('删除',$r('app.media.DeleteComment_delete'),PublicCommentMoreActionType.PublicCommentMoreActionType_Delete))
  24 + }
  25 + }
  26 + }
  27 +
13 build() { 28 build() {
14 Column(){ 29 Column(){
15 Grid(){ 30 Grid(){