1048147e0Sopenharmony_ci/**
2048147e0Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3048147e0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4048147e0Sopenharmony_ci * you may not use this file except in compliance with the License.
5048147e0Sopenharmony_ci * You may obtain a copy of the License at
6048147e0Sopenharmony_ci *
7048147e0Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8048147e0Sopenharmony_ci *
9048147e0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10048147e0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11048147e0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12048147e0Sopenharmony_ci * See the License for the specific language governing permissions and
13048147e0Sopenharmony_ci * limitations under the License.
14048147e0Sopenharmony_ci */
15048147e0Sopenharmony_ciimport DeviceUtil from '../../utils/DeviceUtil';
16048147e0Sopenharmony_ciimport InfoMsgController from './InfoMsgController';
17048147e0Sopenharmony_ciimport { DeleteDialog } from '../../views/MmsDialogs';
18048147e0Sopenharmony_ciimport { MmsListItem } from '../../views/MmsListItem';
19048147e0Sopenharmony_ciimport { MoreMenu } from '../../views/MmsMenu';
20048147e0Sopenharmony_ciimport WantUtil from '../../utils/WantUtil';
21048147e0Sopenharmony_ci
22048147e0Sopenharmony_ci@Entry
23048147e0Sopenharmony_ci@Component
24048147e0Sopenharmony_ciexport default struct InfoMsg {
25048147e0Sopenharmony_ci    @StorageLink('InfoMsgController') @Watch('changeSelectState') mInfoMsgCtrl: InfoMsgController = InfoMsgController.getInstance();
26048147e0Sopenharmony_ci    @State mIsMultipleSelectState : boolean = false;
27048147e0Sopenharmony_ci    @State misShowContactHeadIcon : boolean = true;
28048147e0Sopenharmony_ci    private gridColumns: GridRowColumnOption = { sm: 4, md: 8, lg: 12 };
29048147e0Sopenharmony_ci    private girdSpan: GridColColumnOption = { sm: 4, md: 8, lg: 12 };
30048147e0Sopenharmony_ci    private gridGutter: string = '24vp';
31048147e0Sopenharmony_ci    private gridMargin: string = '24vp';
32048147e0Sopenharmony_ci    private dialogGridCount: number = 4;
33048147e0Sopenharmony_ci    private dialogAlignment: DialogAlignment = DeviceUtil.isTablet() ? DialogAlignment.Center : DialogAlignment.Bottom;
34048147e0Sopenharmony_ci    private dialogOffset: Offset = DeviceUtil.isTablet() ? { dx: 0, dy: 0 } : { dx: 0, dy: -12 };
35048147e0Sopenharmony_ci    delDialogController: CustomDialogController = new CustomDialogController({
36048147e0Sopenharmony_ci        builder: DeleteDialog({
37048147e0Sopenharmony_ci            cancel: () => {
38048147e0Sopenharmony_ci                this.mInfoMsgCtrl.delDialogShow = false;
39048147e0Sopenharmony_ci                this.mInfoMsgCtrl.deleteDialogCancel()
40048147e0Sopenharmony_ci            },
41048147e0Sopenharmony_ci            confirm: () => {
42048147e0Sopenharmony_ci                this.mInfoMsgCtrl.delDialogShow = false;
43048147e0Sopenharmony_ci                this.mInfoMsgCtrl.deleteDialogConfirm()
44048147e0Sopenharmony_ci            },
45048147e0Sopenharmony_ci            msg: this.mInfoMsgCtrl.strMsgDeleteDialogTip,
46048147e0Sopenharmony_ci            hasLockMsg: this.mInfoMsgCtrl.hasLockMsg,
47048147e0Sopenharmony_ci            setSelectLock: () => {
48048147e0Sopenharmony_ci                this.mInfoMsgCtrl.setSelectLock()
49048147e0Sopenharmony_ci            },
50048147e0Sopenharmony_ci            isSelectLockMsg: this.mInfoMsgCtrl.isSelectLockMsg,
51048147e0Sopenharmony_ci            setSelectLockChange: (isOn: boolean) => {
52048147e0Sopenharmony_ci                this.mInfoMsgCtrl.setSelectLockChange(isOn)
53048147e0Sopenharmony_ci            }
54048147e0Sopenharmony_ci        }),
55048147e0Sopenharmony_ci        autoCancel: false,
56048147e0Sopenharmony_ci        alignment: this.dialogAlignment,
57048147e0Sopenharmony_ci        offset: this.dialogOffset,
58048147e0Sopenharmony_ci        gridCount: this.dialogGridCount
59048147e0Sopenharmony_ci    })
60048147e0Sopenharmony_ci    @Provide menuItems: Array<any> = [
61048147e0Sopenharmony_ci        {
62048147e0Sopenharmony_ci            value: $r('app.string.delete'),
63048147e0Sopenharmony_ci            action: () => {
64048147e0Sopenharmony_ci                this.mInfoMsgCtrl.selectInMoreMenu(1);
65048147e0Sopenharmony_ci            },
66048147e0Sopenharmony_ci            enabled: true
67048147e0Sopenharmony_ci        }
68048147e0Sopenharmony_ci//        ,
69048147e0Sopenharmony_ci//        {
70048147e0Sopenharmony_ci//            value: $r('app.string.blocked'),
71048147e0Sopenharmony_ci//            action: () => {
72048147e0Sopenharmony_ci//                this.mInfoMsgCtrl.selectInMoreMenu(2);
73048147e0Sopenharmony_ci//            },
74048147e0Sopenharmony_ci//            enabled: true
75048147e0Sopenharmony_ci//        }
76048147e0Sopenharmony_ci    ];
77048147e0Sopenharmony_ci
78048147e0Sopenharmony_ci    changeSelectState() {
79048147e0Sopenharmony_ci        this.mIsMultipleSelectState = this.mInfoMsgCtrl.isMultipleSelectState
80048147e0Sopenharmony_ci        this.misShowContactHeadIcon = this.mInfoMsgCtrl.isShowContactHeadIcon
81048147e0Sopenharmony_ci        // @ts-ignore
82048147e0Sopenharmony_ci        this.forceCompleteRerender(true) // recusvise
83048147e0Sopenharmony_ci    }
84048147e0Sopenharmony_ci
85048147e0Sopenharmony_ci    /**
86048147e0Sopenharmony_ci     * The function executes after a new instance of the custom component is created and before its build function
87048147e0Sopenharmony_ci     * is executed.
88048147e0Sopenharmony_ci     * Allows state variables to be changed in the aboutToAppear function, and these changes will take effect in
89048147e0Sopenharmony_ci     * subsequent executions of the build function.
90048147e0Sopenharmony_ci     */
91048147e0Sopenharmony_ci    aboutToAppear() {
92048147e0Sopenharmony_ci        this.mInfoMsgCtrl.onInit()
93048147e0Sopenharmony_ci    }
94048147e0Sopenharmony_ci    /**
95048147e0Sopenharmony_ci     * Function executes before custom component destructor consumption.
96048147e0Sopenharmony_ci     * Allow changes to state variables in the aboutToDisappear function, especially changes to the @Link variable,
97048147e0Sopenharmony_ci     * can cause erratic application behavior.
98048147e0Sopenharmony_ci     */
99048147e0Sopenharmony_ci    aboutToDisappear() {
100048147e0Sopenharmony_ci        this.delDialogController = null;
101048147e0Sopenharmony_ci    }
102048147e0Sopenharmony_ci    /**
103048147e0Sopenharmony_ci     * Triggers once when this page is displayed. In scenarios such as routing and application access to the
104048147e0Sopenharmony_ci     * foreground and background, only customized components modified by @Entry take effect.
105048147e0Sopenharmony_ci     */
106048147e0Sopenharmony_ci    onPageShow() {
107048147e0Sopenharmony_ci        this.mInfoMsgCtrl.onShow();
108048147e0Sopenharmony_ci        WantUtil.getWant();
109048147e0Sopenharmony_ci    }
110048147e0Sopenharmony_ci    /**
111048147e0Sopenharmony_ci     * Triggers once when this page disappears. In scenarios such as routing and application access to the foreground
112048147e0Sopenharmony_ci     * and background, only customized components modified by @Entry take effect.
113048147e0Sopenharmony_ci     */
114048147e0Sopenharmony_ci    onPageHide() {
115048147e0Sopenharmony_ci        this.mInfoMsgCtrl.onHide()
116048147e0Sopenharmony_ci    }
117048147e0Sopenharmony_ci    /**
118048147e0Sopenharmony_ci     * Triggered when a user clicks the back button. Only the customized component modified by @Entry takes effect.
119048147e0Sopenharmony_ci     * If true is returned, the page processes the return logic and does not route the page
120048147e0Sopenharmony_ci     * 返If false is returned, the default return logic is used.
121048147e0Sopenharmony_ci     * If no value is returned, the value is treated as false.
122048147e0Sopenharmony_ci     */
123048147e0Sopenharmony_ci    onBackPress() {
124048147e0Sopenharmony_ci        // Key returned by the system. The value true indicates interception.
125048147e0Sopenharmony_ci        if (this.mInfoMsgCtrl.delDialogShow) {
126048147e0Sopenharmony_ci            this.delDialogController.close();
127048147e0Sopenharmony_ci            this.mInfoMsgCtrl.delDialogShow = false;
128048147e0Sopenharmony_ci            return true;
129048147e0Sopenharmony_ci        }
130048147e0Sopenharmony_ci        if (this.mInfoMsgCtrl.isMultipleSelectState) {
131048147e0Sopenharmony_ci            for (let element of this.mInfoMsgCtrl.messageList) {
132048147e0Sopenharmony_ci                element.isCbChecked = false;
133048147e0Sopenharmony_ci            }
134048147e0Sopenharmony_ci            this.mInfoMsgCtrl.isMultipleSelectState = false;
135048147e0Sopenharmony_ci            this.mInfoMsgCtrl.showToolBar = true;
136048147e0Sopenharmony_ci            return true;
137048147e0Sopenharmony_ci        }
138048147e0Sopenharmony_ci        return false;
139048147e0Sopenharmony_ci    }
140048147e0Sopenharmony_ci
141048147e0Sopenharmony_ci    build() {
142048147e0Sopenharmony_ci        GridRow({ columns: this.gridColumns, gutter: this.gridGutter }) {
143048147e0Sopenharmony_ci            GridCol({ span: this.girdSpan }) {
144048147e0Sopenharmony_ci                //Notification Information
145048147e0Sopenharmony_ci                Column() {
146048147e0Sopenharmony_ci                    if (this.mIsMultipleSelectState) {
147048147e0Sopenharmony_ci                        //Multi-Select Status Title
148048147e0Sopenharmony_ci                        Flex({ direction: FlexDirection.Column }) {
149048147e0Sopenharmony_ci                            Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
150048147e0Sopenharmony_ci                                Image($rawfile('icon/ic_public_cancel.svg'))
151048147e0Sopenharmony_ci                                    .width('24vp')
152048147e0Sopenharmony_ci                                    .height('24vp')
153048147e0Sopenharmony_ci                                    .onClick(() => {
154048147e0Sopenharmony_ci                                        this.onBackPress()
155048147e0Sopenharmony_ci                                    })
156048147e0Sopenharmony_ci                                Text(this.mInfoMsgCtrl.conversationSelectedNumber == 0 ?
157048147e0Sopenharmony_ci                                $r('app.string.msg_unselected_tip') :
158048147e0Sopenharmony_ci                                $r('app.string.msg_selected_tip', this.mInfoMsgCtrl.conversationSelectedNumber))
159048147e0Sopenharmony_ci                                    .padding({ left: '16vp' })
160048147e0Sopenharmony_ci                                    .fontSize('20fp')
161048147e0Sopenharmony_ci                                    .fontWeight(FontWeight.Bold)
162048147e0Sopenharmony_ci                            }
163048147e0Sopenharmony_ci                            .height('56vp')
164048147e0Sopenharmony_ci                        }
165048147e0Sopenharmony_ci                        .width('100%')
166048147e0Sopenharmony_ci                        .height('56vp')
167048147e0Sopenharmony_ci                    } else if (!this.mInfoMsgCtrl.searchStatus) {
168048147e0Sopenharmony_ci                        //Header Row
169048147e0Sopenharmony_ci                        Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
170048147e0Sopenharmony_ci                            Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
171048147e0Sopenharmony_ci                                Image($rawfile('icon/ic_message_back.svg'))
172048147e0Sopenharmony_ci                                    .width('24vp')
173048147e0Sopenharmony_ci                                    .height('24vp')
174048147e0Sopenharmony_ci                                    .onClick(() => {
175048147e0Sopenharmony_ci                                        this.mInfoMsgCtrl.back()
176048147e0Sopenharmony_ci                                    })
177048147e0Sopenharmony_ci                                Text($r('app.string.infoMessages'))
178048147e0Sopenharmony_ci                                    .padding({ left: '16vp' })
179048147e0Sopenharmony_ci                                    .fontSize('20fp')
180048147e0Sopenharmony_ci                                    .fontWeight(FontWeight.Bold)
181048147e0Sopenharmony_ci                            }
182048147e0Sopenharmony_ci                            .height('56vp')
183048147e0Sopenharmony_ci                        }
184048147e0Sopenharmony_ci                        .width('100%')
185048147e0Sopenharmony_ci                        .height('56vp')
186048147e0Sopenharmony_ci                    }
187048147e0Sopenharmony_ci
188048147e0Sopenharmony_ci                    Row() {
189048147e0Sopenharmony_ci                        //Back button
190048147e0Sopenharmony_ci                        if (this.mInfoMsgCtrl.isShowSearchBack) {
191048147e0Sopenharmony_ci                            Image($rawfile('icon/ic_message_back.svg'))
192048147e0Sopenharmony_ci                                .width(24)
193048147e0Sopenharmony_ci                                .height(24)
194048147e0Sopenharmony_ci                                .onClick((event: ClickEvent) => {
195048147e0Sopenharmony_ci                                    this.mInfoMsgCtrl.clickSearchBack();
196048147e0Sopenharmony_ci                                })
197048147e0Sopenharmony_ci                        }
198048147e0Sopenharmony_ci                        //Search box
199048147e0Sopenharmony_ci                        // @ts-ignore
200048147e0Sopenharmony_ci                        Search({ value: this.mInfoMsgCtrl.inputValueOfSearch, placeholder: '搜索通知信息' })
201048147e0Sopenharmony_ci                            .layoutWeight(1)
202048147e0Sopenharmony_ci                            .height('40vp')
203048147e0Sopenharmony_ci                            .border({ radius: '20vp' })
204048147e0Sopenharmony_ci                            .enabled(!this.mIsMultipleSelectState)
205048147e0Sopenharmony_ci                            .backgroundColor($r('sys.color.ohos_id_color_text_field_bg'))
206048147e0Sopenharmony_ci                            .onChange((value: string) => {
207048147e0Sopenharmony_ci                                //this.mInfoMsgCtrl.clickToSearch(value);
208048147e0Sopenharmony_ci                            })
209048147e0Sopenharmony_ci                            .onSubmit((value: string) => {
210048147e0Sopenharmony_ci                                //this.mInfoMsgCtrl.clickToSearch(value);
211048147e0Sopenharmony_ci                            })
212048147e0Sopenharmony_ci                    }
213048147e0Sopenharmony_ci                    .visibility(Visibility.None)
214048147e0Sopenharmony_ci                    .width('100%')
215048147e0Sopenharmony_ci                    .height('56vp')
216048147e0Sopenharmony_ci                    .padding({ left: 24, right: 24 })
217048147e0Sopenharmony_ci                    .alignItems(VerticalAlign.Center)
218048147e0Sopenharmony_ci
219048147e0Sopenharmony_ci                    //SMS message display list
220048147e0Sopenharmony_ci                    Stack({ alignContent: Alignment.Top }) {
221048147e0Sopenharmony_ci                        Column() {
222048147e0Sopenharmony_ci                            List({ initialIndex: 0 }) {
223048147e0Sopenharmony_ci                                if (this.mInfoMsgCtrl.isSearchStatus) {
224048147e0Sopenharmony_ci                                    LazyForEach(this.mInfoMsgCtrl.conversationListDataSource, (item, index) => {
225048147e0Sopenharmony_ci                                        //A real list of information
226048147e0Sopenharmony_ci                                        ListItem() {
227048147e0Sopenharmony_ci                                            MmsListItem({
228048147e0Sopenharmony_ci                                                item: item,
229048147e0Sopenharmony_ci                                                isShowHead: this.misShowContactHeadIcon,
230048147e0Sopenharmony_ci                                                isMultipleSelectState: this.mIsMultipleSelectState,
231048147e0Sopenharmony_ci                                                onClickHead: (event: ClickEvent) => {
232048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.clickToGroupDetail(item.index);
233048147e0Sopenharmony_ci                                                },
234048147e0Sopenharmony_ci                                                onClickBody: (event: ClickEvent) => {
235048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.clickInfoToConversation(item.index);
236048147e0Sopenharmony_ci                                                },
237048147e0Sopenharmony_ci                                                onItemLongPress: (event: GestureEvent) => {
238048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.conversationLongPress(item.index)
239048147e0Sopenharmony_ci                                                },
240048147e0Sopenharmony_ci                                                onTouchStart: (event: GestureEvent) => {
241048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.touchStart(event, item.index);
242048147e0Sopenharmony_ci                                                },
243048147e0Sopenharmony_ci                                                onTouchUpdate: (event: GestureEvent) => {
244048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.touchMove(event, item.index);
245048147e0Sopenharmony_ci                                                },
246048147e0Sopenharmony_ci                                                onTouchEnd: (event: GestureEvent) => {
247048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.touchEnd(event, item.index);
248048147e0Sopenharmony_ci                                                    // @ts-ignore
249048147e0Sopenharmony_ci                                                    this.forceCompleteRerender(true) // recusvise
250048147e0Sopenharmony_ci                                                },
251048147e0Sopenharmony_ci                                                onClickFirstSlipBtn: (event: ClickEvent) => {
252048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.markAllAsReadByIndex(item.index);
253048147e0Sopenharmony_ci                                                },
254048147e0Sopenharmony_ci                                                onClickSecondSlipBtn: (event: ClickEvent) => {
255048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.deleteAction(item.index);
256048147e0Sopenharmony_ci                                                    this.delDialogController.open();
257048147e0Sopenharmony_ci                                                    this.mInfoMsgCtrl.delDialogShow = true;
258048147e0Sopenharmony_ci                                                }
259048147e0Sopenharmony_ci                                            })
260048147e0Sopenharmony_ci                                        }
261048147e0Sopenharmony_ci                                        .width('100%')
262048147e0Sopenharmony_ci                                        .height('64vp')
263048147e0Sopenharmony_ci                                        .alignSelf(ItemAlign.Start)
264048147e0Sopenharmony_ci                                    }, item => JSON.stringify(item))
265048147e0Sopenharmony_ci                                }
266048147e0Sopenharmony_ci                            }
267048147e0Sopenharmony_ci                            .align(Alignment.Top)
268048147e0Sopenharmony_ci                            .cachedCount(this.mInfoMsgCtrl.limit)
269048147e0Sopenharmony_ci                            .edgeEffect(EdgeEffect.Spring)
270048147e0Sopenharmony_ci                            .width('100%')
271048147e0Sopenharmony_ci                            .divider({
272048147e0Sopenharmony_ci                                strokeWidth: 1,
273048147e0Sopenharmony_ci                                startMargin: this.mInfoMsgCtrl.isShowContactHeadIcon ? 52 : 12,
274048147e0Sopenharmony_ci                                endMargin: 0
275048147e0Sopenharmony_ci                            })
276048147e0Sopenharmony_ci                        }.width('100%')
277048147e0Sopenharmony_ci                        //Search Above
278048147e0Sopenharmony_ci                        //SMS Search Session Item
279048147e0Sopenharmony_ci                        //Left avatar
280048147e0Sopenharmony_ci                        //Information on the right
281048147e0Sopenharmony_ci                        //Name and date above
282048147e0Sopenharmony_ci                        //Details of the information below
283048147e0Sopenharmony_ci                        //intermediate spacing line
284048147e0Sopenharmony_ci                        //Number of barcodes in the search information list
285048147e0Sopenharmony_ci                        //Search Information List
286048147e0Sopenharmony_ci                        //Left avatar
287048147e0Sopenharmony_ci                        //Information on the right
288048147e0Sopenharmony_ci                        //Name and date above
289048147e0Sopenharmony_ci                        //Details of the information below
290048147e0Sopenharmony_ci                        //If there is no session information, that is, {{total}} is 0, a blank image is displayed.
291048147e0Sopenharmony_ci                        //Show Search Status
292048147e0Sopenharmony_ci                        if (this.mInfoMsgCtrl.isSearchCoverage) {
293048147e0Sopenharmony_ci                            //Display of layers for search
294048147e0Sopenharmony_ci                            Flex()
295048147e0Sopenharmony_ci                                .width('100%')
296048147e0Sopenharmony_ci                                .height('100%')
297048147e0Sopenharmony_ci                                .opacity(0.2)
298048147e0Sopenharmony_ci                                .backgroundColor(Color.Gray)
299048147e0Sopenharmony_ci                                .onTouch((event: TouchEvent) => {
300048147e0Sopenharmony_ci                                    if (event.type === TouchType.Down) {
301048147e0Sopenharmony_ci                                        this.mInfoMsgCtrl.searchCoverageClick()
302048147e0Sopenharmony_ci                                    }
303048147e0Sopenharmony_ci                                })
304048147e0Sopenharmony_ci                        }
305048147e0Sopenharmony_ci                    }
306048147e0Sopenharmony_ci                    .flexShrink(1)
307048147e0Sopenharmony_ci
308048147e0Sopenharmony_ci                    Blank()
309048147e0Sopenharmony_ci
310048147e0Sopenharmony_ci                    //Single session press and hold option
311048147e0Sopenharmony_ci                    if (this.mInfoMsgCtrl.isMultipleSelectState) {
312048147e0Sopenharmony_ci                        Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
313048147e0Sopenharmony_ci                            //Delete
314048147e0Sopenharmony_ci                            Flex({
315048147e0Sopenharmony_ci                                direction: FlexDirection.Column,
316048147e0Sopenharmony_ci                                justifyContent: FlexAlign.Center,
317048147e0Sopenharmony_ci                                alignItems: ItemAlign.Center
318048147e0Sopenharmony_ci                            }) {
319048147e0Sopenharmony_ci                                Image($rawfile(this.mInfoMsgCtrl.svgDelete))
320048147e0Sopenharmony_ci                                    .width('24vp')
321048147e0Sopenharmony_ci                                    .height('24vp')
322048147e0Sopenharmony_ci                                    .margin({ top: '3vp' })
323048147e0Sopenharmony_ci                                Text($r('app.string.delete'))
324048147e0Sopenharmony_ci                                    .fontSize('10fp')
325048147e0Sopenharmony_ci                                    .fontWeight(FontWeight.Medium)
326048147e0Sopenharmony_ci                                    .fontFamily('HarmonyHeiTi')
327048147e0Sopenharmony_ci                                    .margin({ top: 3 })
328048147e0Sopenharmony_ci                            }
329048147e0Sopenharmony_ci                            .width('50%')
330048147e0Sopenharmony_ci                            .opacity(this.mInfoMsgCtrl.checkSelectedNumberIsEmpty() ? 0.4 : 1)
331048147e0Sopenharmony_ci                            .onClick(() => {
332048147e0Sopenharmony_ci                                if (!this.mInfoMsgCtrl.checkSelectedNumberIsEmpty()) {
333048147e0Sopenharmony_ci                                    this.mInfoMsgCtrl.clickConversationDelete()
334048147e0Sopenharmony_ci                                    this.delDialogController.open()
335048147e0Sopenharmony_ci                                    this.mInfoMsgCtrl.delDialogShow = true;
336048147e0Sopenharmony_ci                                }
337048147e0Sopenharmony_ci                            })
338048147e0Sopenharmony_ci                            //Select All
339048147e0Sopenharmony_ci                            Flex({
340048147e0Sopenharmony_ci                                direction: FlexDirection.Column,
341048147e0Sopenharmony_ci                                justifyContent: FlexAlign.Center,
342048147e0Sopenharmony_ci                                alignItems: ItemAlign.Center
343048147e0Sopenharmony_ci                            }) {
344048147e0Sopenharmony_ci                                Image($rawfile(this.mInfoMsgCtrl.isConversationCheckAll ?
345048147e0Sopenharmony_ci                                    'icon/ic_select_all_filled.svg' :
346048147e0Sopenharmony_ci                                    'icon/ic_select_all.svg'))
347048147e0Sopenharmony_ci                                    .width('24vp')
348048147e0Sopenharmony_ci                                    .height('24vp')
349048147e0Sopenharmony_ci                                    .margin({ top: '3vp' })
350048147e0Sopenharmony_ci                                Text(this.mInfoMsgCtrl.strCheckBoxSelectTip)
351048147e0Sopenharmony_ci                                    .fontSize('10fp')
352048147e0Sopenharmony_ci                                    .fontColor(this.mInfoMsgCtrl.isConversationCheckAll ?
353048147e0Sopenharmony_ci                                    $r('sys.color.ohos_id_color_bottom_tab_text_on') :
354048147e0Sopenharmony_ci                                    $r('sys.color.ohos_id_color_bottom_tab_text_off'))
355048147e0Sopenharmony_ci                                    .fontWeight(FontWeight.Medium)
356048147e0Sopenharmony_ci                                    .fontFamily('HarmonyHeiTi')
357048147e0Sopenharmony_ci                                    .margin({ top: 3 })
358048147e0Sopenharmony_ci                            }
359048147e0Sopenharmony_ci                            .width('50%')
360048147e0Sopenharmony_ci                            .onClick(() => {
361048147e0Sopenharmony_ci                                this.mInfoMsgCtrl.clickConversationCheckAll()
362048147e0Sopenharmony_ci                            })
363048147e0Sopenharmony_ci                        }
364048147e0Sopenharmony_ci                        .width('100%')
365048147e0Sopenharmony_ci                        .height(56)
366048147e0Sopenharmony_ci                        .padding({ left: $r('app.float.menu_layout_padding_left'),
367048147e0Sopenharmony_ci                            right: $r('app.float.menu_layout_padding_right') })
368048147e0Sopenharmony_ci                        .flexBasis(56)
369048147e0Sopenharmony_ci                        .flexShrink(0)
370048147e0Sopenharmony_ci                    }
371048147e0Sopenharmony_ci
372048147e0Sopenharmony_ci                    //All read and more
373048147e0Sopenharmony_ci                    if (!this.mInfoMsgCtrl.isMultipleSelectState && this.mInfoMsgCtrl.showToolBar) {
374048147e0Sopenharmony_ci                        Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
375048147e0Sopenharmony_ci                            //All read
376048147e0Sopenharmony_ci                            Flex({
377048147e0Sopenharmony_ci                                direction: FlexDirection.Column,
378048147e0Sopenharmony_ci                                justifyContent: FlexAlign.Center,
379048147e0Sopenharmony_ci                                alignItems: ItemAlign.Center
380048147e0Sopenharmony_ci                            }) {
381048147e0Sopenharmony_ci                                Image($rawfile('icon/ic_allread.svg'))
382048147e0Sopenharmony_ci                                    .width('24vp')
383048147e0Sopenharmony_ci                                    .height('24vp')
384048147e0Sopenharmony_ci                                    .margin({ top: '3vp' })
385048147e0Sopenharmony_ci                                Text($r('app.string.markAllAsRead'))
386048147e0Sopenharmony_ci                                    .fontSize($r('sys.float.ohos_id_text_size_caption'))
387048147e0Sopenharmony_ci                                    .fontWeight(FontWeight.Medium)
388048147e0Sopenharmony_ci                                    .fontColor($r('sys.color.ohos_id_color_toolbar_text'))
389048147e0Sopenharmony_ci                            }
390048147e0Sopenharmony_ci                            .width('50%')
391048147e0Sopenharmony_ci                            .opacity(this.mInfoMsgCtrl.unreadTotalOfInfo == 0 ? 0.4 : 1)
392048147e0Sopenharmony_ci                            .onClick(() => {
393048147e0Sopenharmony_ci                                this.mInfoMsgCtrl.clickToMarkAllAsReadForInfo()
394048147e0Sopenharmony_ci                            })
395048147e0Sopenharmony_ci                            //more
396048147e0Sopenharmony_ci                            Flex({
397048147e0Sopenharmony_ci                                direction: FlexDirection.Column,
398048147e0Sopenharmony_ci                                justifyContent: FlexAlign.Center,
399048147e0Sopenharmony_ci                                alignItems: ItemAlign.Center
400048147e0Sopenharmony_ci                            }) {
401048147e0Sopenharmony_ci                                MoreMenu({
402048147e0Sopenharmony_ci                                    menuText: $r('app.string.more')
403048147e0Sopenharmony_ci                                })
404048147e0Sopenharmony_ci                            }
405048147e0Sopenharmony_ci                            .width('50%')
406048147e0Sopenharmony_ci                        }
407048147e0Sopenharmony_ci                        .width('100%')
408048147e0Sopenharmony_ci                        .height(56)
409048147e0Sopenharmony_ci                        .padding({ left: $r('app.float.menu_layout_padding_left'),
410048147e0Sopenharmony_ci                            right: $r('app.float.menu_layout_padding_right') })
411048147e0Sopenharmony_ci                        .flexBasis(56)
412048147e0Sopenharmony_ci                        .flexShrink(0)
413048147e0Sopenharmony_ci                    }
414048147e0Sopenharmony_ci                    //Setting the background of the navigation bar
415048147e0Sopenharmony_ci                    //Delete pop-up dialog box
416048147e0Sopenharmony_ci                }
417048147e0Sopenharmony_ci                .width('100%')
418048147e0Sopenharmony_ci                .height('100%')
419048147e0Sopenharmony_ci            }
420048147e0Sopenharmony_ci        }
421048147e0Sopenharmony_ci        .margin({ left: this.gridMargin, right: this.gridMargin })
422048147e0Sopenharmony_ci    }
423048147e0Sopenharmony_ci}