证书管理页面半模态需求

Signed-off-by: 杨海龙2023 <yanghailong26@huawei.com>
This commit is contained in:
杨海龙2023 2024-07-29 18:13:50 +08:00
parent 52308eae6e
commit 97a14fc55b
7 changed files with 25 additions and 21 deletions

View File

@ -774,7 +774,8 @@ export struct evidenceList {
keyUri: item.keyUri,
mShowAppCaPresenter: $mShowAppCaPresenter,
onItemClicked: this.isStartBySheet ? () => {
this.selected?.(NavEntryKey.CRED_USER_DETAIL_ENTRY, new CredUserDetailParam(this.mShowAppCaPresenter));
this.selected?.(NavEntryKey.CRED_USER_DETAIL_ENTRY,
new CredUserDetailParam(this.mShowAppCaPresenter));
} : undefined
})
}

View File

@ -69,18 +69,19 @@ export struct CertificateComponent {
List() {
ForEach(this.listItems, (item: CertListItem) => {
ListItem() {
SubEntryComponent({ targetPage: item.targetPage, title: item.title, onItemClicked: targetRouter => {
if (this.isStartBySheet) {
if (targetRouter === 'pages/trustedCa') {
this.selected?.(NavEntryKey.CA_CERTIFICATE_ENTRY);
SubEntryComponent({ targetPage: item.targetPage, title: item.title,
onItemClicked: targetRouter => {
if (this.isStartBySheet) {
if (targetRouter === 'pages/trustedCa') {
this.selected?.(NavEntryKey.CA_CERTIFICATE_ENTRY);
} else {
this.selected?.(NavEntryKey.CREDENTIAL_LIST_ENTRY);
}
} else {
this.selected?.(NavEntryKey.CREDENTIAL_LIST_ENTRY);
router.pushUrl({
url: targetRouter
});
}
} else {
router.pushUrl({
url: targetRouter
});
}
} })
}
.stateStyles({

View File

@ -28,7 +28,7 @@ import { BusinessError } from '@ohos.base';
const TAG: string = 'CaUserDetailPage: ';
export class CaUserDetailParam {
showUserCaPresenter: CmShowUserCaPresenter;
public showUserCaPresenter: CmShowUserCaPresenter;
constructor(presenter: CmShowUserCaPresenter) {
this.showUserCaPresenter = presenter;
@ -65,12 +65,13 @@ export struct CaUserDetailPage {
value: $r('app.string.root_certificate_continue'),
buttonStyle: ButtonStyleMode.TEXTUAL,
action: () => {
this.showUserCaPresenter.setUserCertificateStatus(this.showUserCaPresenter.certInfo.uri, true).then(result => {
if (result) {
this.showUserCaPresenter.updateUserTrustedCertificateList();
} else {
this.toggleStatus = false;
}
this.showUserCaPresenter.setUserCertificateStatus(this.showUserCaPresenter.certInfo.uri, true)
.then(result => {
if (result) {
this.showUserCaPresenter.updateUserTrustedCertificateList();
} else {
this.toggleStatus = false;
}
});
}
}

View File

@ -22,7 +22,7 @@ import CmShowSysCredPresenter from '../../presenter/CmShowSysCredPresenter';
const TAG: string = 'CredSystemDetailPage: ';
export class CredSystemDetailParam {
presenter: CmShowSysCredPresenter;
public presenter: CmShowSysCredPresenter;
constructor(presenter: CmShowSysCredPresenter) {
this.presenter = presenter;

View File

@ -925,7 +925,8 @@ export struct TrustedEvidence {
setStatus: $mShowUserCaPresenter,
indexNum: index,
onItemClicked: this.isStartBySheet ? () => {
this.selected?.(NavEntryKey.CA_USER_DETAIL_ENTRY, new CaUserDetailParam(this.mShowUserCaPresenter));
this.selected?.(NavEntryKey.CA_USER_DETAIL_ENTRY,
new CaUserDetailParam(this.mShowUserCaPresenter));
} : undefined
})
}

View File

@ -89,7 +89,7 @@
},
{
"name": "CertPickerUIExtAbility",
"srcEntry": "./ets/MainAbility/CertPickerUiExtAbility.ts",
"srcEntry": "./ets/MainAbility/CertPickerUiExtAbility.ets",
"exported": true,
"permissions": ['ohos.permission.ACCESS_CERT_MANAGER'],
"type": "sys/commonUI"