无网络情况下进入加密分享页面,确定按钮置灰

Signed-off-by: li-li-wang <wangliliang5@huawei.com>
This commit is contained in:
li-li-wang 2024-08-10 15:04:31 +08:00
parent ddff41d2f4
commit e0d4b98cff
3 changed files with 8 additions and 6 deletions

View File

@ -2,8 +2,8 @@
"app": {
"bundleName": "com.ohos.dlpmanager",
"vendor": "example",
"versionCode": 1000103,
"versionName": "1.0.1.03",
"versionCode": 1000105,
"versionName": "1.0.1.05",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 12,

View File

@ -16,8 +16,8 @@
"app": {
"bundleName": "com.ohos.dlpmanager",
"vendor": "example",
"versionCode": 1000103,
"versionName": "1.0.1.03",
"versionCode": 1000105,
"versionName": "1.0.1.05",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 12,

View File

@ -137,6 +137,7 @@ struct encryptedSharing {
}
private async beginShareEncrypt() {
HiLog.info(TAG, `begin Share Encrypt start`);
if (this.checkCloudPhone(this.inputValue)) {
this.enabledFocus = false;
this.isConfirmButtonEnabled = false;
@ -369,13 +370,13 @@ struct encryptedSharing {
HiLog.error(TAG, `getOsAccountInfo failed: ${JSON.stringify(err)}`);
this.showToast($r('app.string.Share_File_Encrypted_Failed'));
this.enabledFocus = true;
this.isConfirmButtonEnabled = true;
this.isConfirmButtonEnabled = this.inputValue.length > 0;
return;
}
} catch {
this.showToast($r('app.string.network_invalid'));
this.enabledFocus = true;
this.isConfirmButtonEnabled = true;
this.isConfirmButtonEnabled = this.inputValue.length > 0;
}
}
@ -613,6 +614,7 @@ struct encryptedSharing {
.onReceive((data) => {
HiLog.info(TAG, `data.status: ${JSON.stringify(data.status)}`);
let res = data.result as Record<string, string>;
HiLog.info(TAG, `res.code: ${JSON.stringify(res.code)}`);
if (data.status) {
this.ownerAccount = res.uid;
this.ownerAccountID = res.uid;