From 689722355144d62545a9fac3390c701f60886fbc Mon Sep 17 00:00:00 2001 From: zhouhongli2023 Date: Sat, 23 Mar 2024 17:00:05 +0800 Subject: [PATCH] =?UTF-8?q?4.1=20release=20issue=20=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouhongli2023 --- .../ets/component/contact/ContactListItemView.ets | 10 +++++++++- entry/src/main/ets/pages/contacts/ContactList.ets | 12 ++++++++++-- .../ets/pages/contacts/accountants/Accountants.ets | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/entry/src/main/ets/component/contact/ContactListItemView.ets b/entry/src/main/ets/component/contact/ContactListItemView.ets index 1cc4451..d0702e3 100644 --- a/entry/src/main/ets/component/contact/ContactListItemView.ets +++ b/entry/src/main/ets/component/contact/ContactListItemView.ets @@ -34,6 +34,7 @@ export default struct ContactListItemView { @State private index: number = 0; @State showIndex: boolean = false; @State showDivifer: boolean = false; + @Link contactListTouchable: boolean; @LocalStorageProp('breakpoint') curBp: string = 'sm'; shareDialogControler: CustomDialogController = new CustomDialogController({ builder: ShareDialogEx({ @@ -193,6 +194,13 @@ export default struct ContactListItemView { } ); }) - .bindContextMenu(this.MenuBuilder, ResponseType.LongPress) + .bindContextMenu(this.MenuBuilder, ResponseType.LongPress, { + onAppear: () => { + this.contactListTouchable = false; + }, + onDisappear: () => { + this.contactListTouchable = true; + } + }) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/contacts/ContactList.ets b/entry/src/main/ets/pages/contacts/ContactList.ets index 9c33077..d2238eb 100644 --- a/entry/src/main/ets/pages/contacts/ContactList.ets +++ b/entry/src/main/ets/pages/contacts/ContactList.ets @@ -37,6 +37,7 @@ export default struct ContactListPage { @LocalStorageProp('breakpoint') curBp: string = 'sm'; @State contactListListLen: number = 0; emitterId: number = 2; + @State contactListTouchable: boolean = true; refresh() { let contactListLen = this.mContactPresenter.contactListDataSource.totalCount(); @@ -72,8 +73,13 @@ export default struct ContactListPage { ContactEmptyPage({ presenter: $mContactPresenter }) .backgroundColor(this.curBp === 'lg' ? $r("sys.color.ohos_id_color_sub_background") : Color.White) } else { - ContactContent({ presenter: $mContactPresenter, contactListListLen: $contactListListLen }) + ContactContent({ + presenter: $mContactPresenter, + contactListListLen: $contactListListLen, + contactListTouchable: $contactListTouchable + }) .backgroundColor(this.curBp === 'lg' ? $r("sys.color.ohos_id_color_sub_background") : Color.White) + .hitTestBehavior(this.contactListTouchable ? HitTestMode.Default : HitTestMode.Block) } } } @@ -117,6 +123,7 @@ struct ContactContent { @State dragList: boolean = true; @State alphabetIndexPresenter: AlphabetIndexerPresenter = this.presenter.alphabetIndexPresenter; @State type: number = 0; + @Link contactListTouchable: boolean; @Builder GroupsView(imageRes: Resource, title: string | Resource, showArrow: boolean) { @@ -241,7 +248,8 @@ struct ContactContent { item: item.contact, index: index, showIndex: item.showIndex, - showDivifer: item.showDivifer + showDivifer: item.showDivifer, + contactListTouchable: $contactListTouchable }) } .alignItems(HorizontalAlign.Start) diff --git a/entry/src/main/ets/pages/contacts/accountants/Accountants.ets b/entry/src/main/ets/pages/contacts/accountants/Accountants.ets index 338f6e9..ab7b46e 100644 --- a/entry/src/main/ets/pages/contacts/accountants/Accountants.ets +++ b/entry/src/main/ets/pages/contacts/accountants/Accountants.ets @@ -309,6 +309,8 @@ struct Accountants { this.mPresenter.contactInfoAfter.display_name = value; this.mPresenter.textChange(value); }) + .enableKeyboardOnFocus(true) + .defaultFocus(true) } .margin(this.curBp === 'lg' ? {} : { left: $r("app.float.id_card_margin_mid") }) } -- Gitee