18779efd5Sopenharmony_ci/** 28779efd5Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 38779efd5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 48779efd5Sopenharmony_ci * you may not use this file except in compliance with the License. 58779efd5Sopenharmony_ci * You may obtain a copy of the License at 68779efd5Sopenharmony_ci * 78779efd5Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 88779efd5Sopenharmony_ci * 98779efd5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 108779efd5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 118779efd5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128779efd5Sopenharmony_ci * See the License for the specific language governing permissions and 138779efd5Sopenharmony_ci * limitations under the License. 148779efd5Sopenharmony_ci */ 158779efd5Sopenharmony_ci 168779efd5Sopenharmony_ciimport CallRecord from './callRecord/CallRecord' 178779efd5Sopenharmony_ciimport { HiLog } from '../../../../../../common/src/main/ets/util/HiLog'; 188779efd5Sopenharmony_ciimport { DialerInitialPage } from '../../component/dialer/DialerInitialPage'; 198779efd5Sopenharmony_ciimport DialerPresenter from '../../presenter/dialer/DialerPresenter'; 208779efd5Sopenharmony_ciimport EnvironmentProp from '../../feature/EnvironmentProp'; 218779efd5Sopenharmony_ciimport PreferencesUtil from '../../util/PreferencesUtil'; 228779efd5Sopenharmony_ci 238779efd5Sopenharmony_ciconst TAG = 'DialerTablet' 248779efd5Sopenharmony_ci 258779efd5Sopenharmony_ci@Component 268779efd5Sopenharmony_cistruct DialButton { 278779efd5Sopenharmony_ci @State button_number: string = ''; 288779efd5Sopenharmony_ci @State button_char: string = ''; 298779efd5Sopenharmony_ci @Link mPresenter: DialerPresenter; 308779efd5Sopenharmony_ci 318779efd5Sopenharmony_ci build() { 328779efd5Sopenharmony_ci Column() { 338779efd5Sopenharmony_ci Button() { 348779efd5Sopenharmony_ci Flex({ 358779efd5Sopenharmony_ci direction: FlexDirection.Column, 368779efd5Sopenharmony_ci alignItems: ItemAlign.Center, 378779efd5Sopenharmony_ci justifyContent: FlexAlign.Center 388779efd5Sopenharmony_ci }) { 398779efd5Sopenharmony_ci if (`${this.button_number}` == '*') { 408779efd5Sopenharmony_ci Image($r('app.media.symbol')) 418779efd5Sopenharmony_ci .width($r('app.float.id_item_height_sm')) 428779efd5Sopenharmony_ci .height($r('app.float.id_item_height_sm')) 438779efd5Sopenharmony_ci } else if (`${this.button_number}` == '#') { 448779efd5Sopenharmony_ci Image($r('app.media.symbols')) 458779efd5Sopenharmony_ci .width($r('app.float.id_item_height_sm')) 468779efd5Sopenharmony_ci .height($r('app.float.id_item_height_sm')) 478779efd5Sopenharmony_ci } else if (`${this.button_number}` == '0') { 488779efd5Sopenharmony_ci Text(`${this.button_number}`) 498779efd5Sopenharmony_ci .fontSize($r('sys.float.ohos_id_text_size_headline6')) 508779efd5Sopenharmony_ci .fontColor($r('sys.color.ohos_id_color_text_primary')) 518779efd5Sopenharmony_ci .fontWeight(FontWeight.Medium) 528779efd5Sopenharmony_ci .margin({ top: $r('app.float.id_card_margin_mid') }) 538779efd5Sopenharmony_ci } else { 548779efd5Sopenharmony_ci Text(`${this.button_number}`) 558779efd5Sopenharmony_ci .fontSize($r('sys.float.ohos_id_text_size_headline6')) 568779efd5Sopenharmony_ci .fontColor($r('sys.color.ohos_id_color_text_primary')) 578779efd5Sopenharmony_ci .fontWeight(FontWeight.Medium) 588779efd5Sopenharmony_ci } 598779efd5Sopenharmony_ci 608779efd5Sopenharmony_ci if ((this.button_char == 'ic')) { 618779efd5Sopenharmony_ci Image($r('app.media.ic_contacts_voicemail_mini')) 628779efd5Sopenharmony_ci .width($r('app.float.id_card_margin_xxl')) 638779efd5Sopenharmony_ci .height($r('app.float.id_card_margin_xxl')) 648779efd5Sopenharmony_ci } else if ((this.button_char == '+')) { 658779efd5Sopenharmony_ci Image($r('app.media.ic_public_add')) 668779efd5Sopenharmony_ci .width($r('app.float.id_card_margin_xl')) 678779efd5Sopenharmony_ci .height($r('app.float.id_card_margin_xl')) 688779efd5Sopenharmony_ci } else { 698779efd5Sopenharmony_ci Text(`${this.button_char}`) 708779efd5Sopenharmony_ci .fontSize($r('sys.float.ohos_id_text_size_body3')) 718779efd5Sopenharmony_ci .fontColor($r('sys.color.ohos_id_color_text_secondary')) 728779efd5Sopenharmony_ci } 738779efd5Sopenharmony_ci } 748779efd5Sopenharmony_ci } 758779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 768779efd5Sopenharmony_ci .type(ButtonType.Circle) 778779efd5Sopenharmony_ci .width($r('app.float.dialer_keypad_button_height')) 788779efd5Sopenharmony_ci .height($r('app.float.dialer_keypad_button_height')) 798779efd5Sopenharmony_ci .onClick(() => { 808779efd5Sopenharmony_ci this.mPresenter.ifNeedSpace(); 818779efd5Sopenharmony_ci AppStorage.SetOrCreate('tele_number', AppStorage.Get('tele_number') + this.button_number); 828779efd5Sopenharmony_ci this.mPresenter.all_number += this.button_number 838779efd5Sopenharmony_ci this.mPresenter.viewNumberTextProc(); 848779efd5Sopenharmony_ci this.mPresenter.playAudio(this.button_number); 858779efd5Sopenharmony_ci }) 868779efd5Sopenharmony_ci } 878779efd5Sopenharmony_ci .flexGrow(1) 888779efd5Sopenharmony_ci } 898779efd5Sopenharmony_ci} 908779efd5Sopenharmony_ci 918779efd5Sopenharmony_ci@Component 928779efd5Sopenharmony_cistruct DialPad { 938779efd5Sopenharmony_ci @Link mPresenter: DialerPresenter; 948779efd5Sopenharmony_ci 958779efd5Sopenharmony_ci build() { 968779efd5Sopenharmony_ci Column() { 978779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row }) { 988779efd5Sopenharmony_ci DialButton({ 998779efd5Sopenharmony_ci button_number: '1', 1008779efd5Sopenharmony_ci button_char: 'ic', 1018779efd5Sopenharmony_ci mPresenter: $mPresenter, 1028779efd5Sopenharmony_ci }) 1038779efd5Sopenharmony_ci 1048779efd5Sopenharmony_ci DialButton({ 1058779efd5Sopenharmony_ci button_number: '2', 1068779efd5Sopenharmony_ci button_char: 'ABC', 1078779efd5Sopenharmony_ci mPresenter: $mPresenter, 1088779efd5Sopenharmony_ci }) 1098779efd5Sopenharmony_ci 1108779efd5Sopenharmony_ci DialButton({ 1118779efd5Sopenharmony_ci button_number: '3', 1128779efd5Sopenharmony_ci button_char: 'DEF', 1138779efd5Sopenharmony_ci mPresenter: $mPresenter, 1148779efd5Sopenharmony_ci }) 1158779efd5Sopenharmony_ci } 1168779efd5Sopenharmony_ci 1178779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row }) { 1188779efd5Sopenharmony_ci DialButton({ 1198779efd5Sopenharmony_ci button_number: '4', 1208779efd5Sopenharmony_ci button_char: 'GHI', 1218779efd5Sopenharmony_ci mPresenter: $mPresenter, 1228779efd5Sopenharmony_ci }) 1238779efd5Sopenharmony_ci 1248779efd5Sopenharmony_ci DialButton({ 1258779efd5Sopenharmony_ci button_number: '5', 1268779efd5Sopenharmony_ci button_char: 'JKL', 1278779efd5Sopenharmony_ci mPresenter: $mPresenter, 1288779efd5Sopenharmony_ci }) 1298779efd5Sopenharmony_ci 1308779efd5Sopenharmony_ci DialButton({ 1318779efd5Sopenharmony_ci button_number: '6', 1328779efd5Sopenharmony_ci button_char: 'MNO', 1338779efd5Sopenharmony_ci mPresenter: $mPresenter, 1348779efd5Sopenharmony_ci }) 1358779efd5Sopenharmony_ci } 1368779efd5Sopenharmony_ci 1378779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row }) { 1388779efd5Sopenharmony_ci DialButton({ 1398779efd5Sopenharmony_ci button_number: '7', 1408779efd5Sopenharmony_ci button_char: 'PQRS', 1418779efd5Sopenharmony_ci mPresenter: $mPresenter, 1428779efd5Sopenharmony_ci }) 1438779efd5Sopenharmony_ci 1448779efd5Sopenharmony_ci DialButton({ 1458779efd5Sopenharmony_ci button_number: '8', 1468779efd5Sopenharmony_ci button_char: 'TUV', 1478779efd5Sopenharmony_ci mPresenter: $mPresenter, 1488779efd5Sopenharmony_ci }) 1498779efd5Sopenharmony_ci 1508779efd5Sopenharmony_ci DialButton({ 1518779efd5Sopenharmony_ci button_number: '9', 1528779efd5Sopenharmony_ci button_char: 'WXYZ', 1538779efd5Sopenharmony_ci mPresenter: $mPresenter, 1548779efd5Sopenharmony_ci }) 1558779efd5Sopenharmony_ci } 1568779efd5Sopenharmony_ci 1578779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row }) { 1588779efd5Sopenharmony_ci DialButton({ 1598779efd5Sopenharmony_ci button_number: '*', 1608779efd5Sopenharmony_ci button_char: '(P)', 1618779efd5Sopenharmony_ci mPresenter: $mPresenter, 1628779efd5Sopenharmony_ci }) 1638779efd5Sopenharmony_ci 1648779efd5Sopenharmony_ci DialButton({ 1658779efd5Sopenharmony_ci button_number: '0', 1668779efd5Sopenharmony_ci button_char: '+', 1678779efd5Sopenharmony_ci mPresenter: $mPresenter, 1688779efd5Sopenharmony_ci }) 1698779efd5Sopenharmony_ci 1708779efd5Sopenharmony_ci DialButton({ 1718779efd5Sopenharmony_ci button_number: '#', 1728779efd5Sopenharmony_ci button_char: '(W)', 1738779efd5Sopenharmony_ci mPresenter: $mPresenter, 1748779efd5Sopenharmony_ci }) 1758779efd5Sopenharmony_ci } 1768779efd5Sopenharmony_ci } 1778779efd5Sopenharmony_ci .width('100%') 1788779efd5Sopenharmony_ci .padding({ left: $r('app.float.dialer_keypad_button_height'), right: $r('app.float.dialer_keypad_button_height') }) 1798779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 1808779efd5Sopenharmony_ci } 1818779efd5Sopenharmony_ci} 1828779efd5Sopenharmony_ci 1838779efd5Sopenharmony_ci@Entry 1848779efd5Sopenharmony_ci@Component 1858779efd5Sopenharmony_ciexport default struct CallTablet { 1868779efd5Sopenharmony_ci @State mPresenter: DialerPresenter = DialerPresenter.getInstance(); 1878779efd5Sopenharmony_ci @StorageLink('tele_number') tele_number: string = ''; 1888779efd5Sopenharmony_ci menuRes: Resource[] = [$r('app.string.call_setting_type_paste'), 1898779efd5Sopenharmony_ci $r('app.string.call_setting_type_batch_delete'), 1908779efd5Sopenharmony_ci $r('app.string.call_setting_type_harassment_interception'), 1918779efd5Sopenharmony_ci $r('app.string.call_setting_type_setting')]; 1928779efd5Sopenharmony_ci @State callmenu: { [key: string]: any } = [{ value: '', action: () => { 1938779efd5Sopenharmony_ci } }]; 1948779efd5Sopenharmony_ci @StorageLink('haveSimCard') haveSimCard: boolean = false; 1958779efd5Sopenharmony_ci @StorageLink('haveMultiSimCard') haveMultiSimCard: boolean = false; 1968779efd5Sopenharmony_ci 1978779efd5Sopenharmony_ci aboutToAppear() { 1988779efd5Sopenharmony_ci HiLog.i(TAG, 'aboutToAppear CallTablet '); 1998779efd5Sopenharmony_ci this.getMenu(); 2008779efd5Sopenharmony_ci this.mPresenter.aboutToAppear(); 2018779efd5Sopenharmony_ci } 2028779efd5Sopenharmony_ci 2038779efd5Sopenharmony_ci aboutToDisappear() { 2048779efd5Sopenharmony_ci this.mPresenter.onDestroy(); 2058779efd5Sopenharmony_ci } 2068779efd5Sopenharmony_ci 2078779efd5Sopenharmony_ci getMenu() { 2088779efd5Sopenharmony_ci let tmpPhoneMenu = []; 2098779efd5Sopenharmony_ci this.menuRes.forEach(element => { 2108779efd5Sopenharmony_ci tmpPhoneMenu.push({}); 2118779efd5Sopenharmony_ci }); 2128779efd5Sopenharmony_ci this.callmenu = tmpPhoneMenu; 2138779efd5Sopenharmony_ci this.menuRes.forEach((element, i) => { 2148779efd5Sopenharmony_ci globalThis.context.resourceManager.getString(element.id, (err, typeName) => { 2158779efd5Sopenharmony_ci HiLog.i(TAG, typeName); 2168779efd5Sopenharmony_ci this.callmenu[i] = { 2178779efd5Sopenharmony_ci value: typeName, 2188779efd5Sopenharmony_ci action: () => { 2198779efd5Sopenharmony_ci } 2208779efd5Sopenharmony_ci }; 2218779efd5Sopenharmony_ci }); 2228779efd5Sopenharmony_ci }); 2238779efd5Sopenharmony_ci } 2248779efd5Sopenharmony_ci 2258779efd5Sopenharmony_ci build() { 2268779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Start, justifyContent: FlexAlign.Start }) { 2278779efd5Sopenharmony_ci 2288779efd5Sopenharmony_ci Column() { 2298779efd5Sopenharmony_ci if (this.tele_number.length > 0) { 2308779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { 2318779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 2328779efd5Sopenharmony_ci Text(`${this.tele_number}`) 2338779efd5Sopenharmony_ci .fontSize(this.mPresenter.tele_num_size) 2348779efd5Sopenharmony_ci .fontColor($r('sys.color.ohos_id_color_text_primary')) 2358779efd5Sopenharmony_ci .maxLines(1) 2368779efd5Sopenharmony_ci } 2378779efd5Sopenharmony_ci .width('100%') 2388779efd5Sopenharmony_ci .height('112vp') 2398779efd5Sopenharmony_ci 2408779efd5Sopenharmony_ci if (this.tele_number.length >= 3) { 2418779efd5Sopenharmony_ci Row() { 2428779efd5Sopenharmony_ci Image($r('app.media.ic_public_add')) 2438779efd5Sopenharmony_ci .width($r('app.float.id_card_margin_max')) 2448779efd5Sopenharmony_ci .height($r('app.float.id_card_margin_max')) 2458779efd5Sopenharmony_ci .margin({ 2468779efd5Sopenharmony_ci left: $r('app.float.id_card_margin_max'), 2478779efd5Sopenharmony_ci right: $r('app.float.id_card_margin_xxl') 2488779efd5Sopenharmony_ci }) 2498779efd5Sopenharmony_ci 2508779efd5Sopenharmony_ci Text($r('app.string.new_contact')) 2518779efd5Sopenharmony_ci .fontSize($r('sys.float.ohos_id_text_size_body1')) 2528779efd5Sopenharmony_ci .fontColor($r('sys.color.ohos_id_color_text_primary')) 2538779efd5Sopenharmony_ci } 2548779efd5Sopenharmony_ci .width('100%') 2558779efd5Sopenharmony_ci .height($r('app.float.id_item_height_large')) 2568779efd5Sopenharmony_ci .onClick(() => { 2578779efd5Sopenharmony_ci this.mPresenter.jumpToAccountants() 2588779efd5Sopenharmony_ci }) 2598779efd5Sopenharmony_ci 2608779efd5Sopenharmony_ci Divider() 2618779efd5Sopenharmony_ci .color($r('sys.color.ohos_id_color_list_separator')) 2628779efd5Sopenharmony_ci .lineCap(LineCapStyle.Square) 2638779efd5Sopenharmony_ci .width('100%') 2648779efd5Sopenharmony_ci .padding({ left: $r('app.float.id_item_height_max') }) 2658779efd5Sopenharmony_ci 2668779efd5Sopenharmony_ci //This component is temporarily shielded because there is no requirement currently. 2678779efd5Sopenharmony_ci// Row() { 2688779efd5Sopenharmony_ci// Image($r('app.media.ic_public_contacts')) 2698779efd5Sopenharmony_ci// .width($r('app.float.id_card_margin_max')) 2708779efd5Sopenharmony_ci// .height($r('app.float.id_card_margin_max')) 2718779efd5Sopenharmony_ci// .margin({ 2728779efd5Sopenharmony_ci// left: $r('app.float.id_card_margin_max'), 2738779efd5Sopenharmony_ci// right: $r('app.float.id_card_margin_xxl') 2748779efd5Sopenharmony_ci// }) 2758779efd5Sopenharmony_ci// 2768779efd5Sopenharmony_ci// Text($r('app.string.save_to_existing_contacts')) 2778779efd5Sopenharmony_ci// .fontSize($r('sys.float.ohos_id_text_size_body1')) 2788779efd5Sopenharmony_ci// .fontColor($r('sys.color.ohos_id_color_text_primary')) 2798779efd5Sopenharmony_ci// } 2808779efd5Sopenharmony_ci// .width('100%') 2818779efd5Sopenharmony_ci// .height($r('app.float.id_item_height_large')) 2828779efd5Sopenharmony_ci// .onClick(() => { 2838779efd5Sopenharmony_ci// }) 2848779efd5Sopenharmony_ci 2858779efd5Sopenharmony_ci Divider() 2868779efd5Sopenharmony_ci .color($r('sys.color.ohos_id_color_list_separator')) 2878779efd5Sopenharmony_ci .lineCap(LineCapStyle.Square) 2888779efd5Sopenharmony_ci .width('100%') 2898779efd5Sopenharmony_ci .padding({ left: $r('app.float.id_item_height_max') }) 2908779efd5Sopenharmony_ci 2918779efd5Sopenharmony_ci Row() { 2928779efd5Sopenharmony_ci Image($r('app.media.ic_public_message')) 2938779efd5Sopenharmony_ci .width($r('app.float.id_card_margin_max')) 2948779efd5Sopenharmony_ci .height($r('app.float.id_card_margin_max')) 2958779efd5Sopenharmony_ci .margin({ 2968779efd5Sopenharmony_ci left: $r('app.float.id_card_margin_max'), 2978779efd5Sopenharmony_ci right: $r('app.float.id_card_margin_xxl') 2988779efd5Sopenharmony_ci }) 2998779efd5Sopenharmony_ci 3008779efd5Sopenharmony_ci Text($r('app.string.send_messages')) 3018779efd5Sopenharmony_ci .fontSize($r('sys.float.ohos_id_text_size_body1')) 3028779efd5Sopenharmony_ci .fontColor($r('sys.color.ohos_id_color_text_primary')) 3038779efd5Sopenharmony_ci } 3048779efd5Sopenharmony_ci .width('100%') 3058779efd5Sopenharmony_ci .height($r('app.float.id_item_height_large')) 3068779efd5Sopenharmony_ci .onClick(() => { 3078779efd5Sopenharmony_ci this.mPresenter.sendMessage(); 3088779efd5Sopenharmony_ci }) 3098779efd5Sopenharmony_ci 3108779efd5Sopenharmony_ci Divider() 3118779efd5Sopenharmony_ci .color($r('sys.color.ohos_id_color_list_separator')) 3128779efd5Sopenharmony_ci .lineCap(LineCapStyle.Square) 3138779efd5Sopenharmony_ci .width('100%') 3148779efd5Sopenharmony_ci .padding({ left: $r('app.float.id_item_height_max') }) 3158779efd5Sopenharmony_ci } 3168779efd5Sopenharmony_ci 3178779efd5Sopenharmony_ci } 3188779efd5Sopenharmony_ci .width('100%') 3198779efd5Sopenharmony_ci .height('100%') 3208779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 3218779efd5Sopenharmony_ci } else { 3228779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.End }) { 3238779efd5Sopenharmony_ci Button() { 3248779efd5Sopenharmony_ci Image($r('app.media.ic_public_more')) 3258779efd5Sopenharmony_ci .width($r('app.float.id_card_margin_max')) 3268779efd5Sopenharmony_ci .height($r('app.float.id_card_margin_max')) 3278779efd5Sopenharmony_ci } 3288779efd5Sopenharmony_ci .width($r('app.float.id_item_height_mid')) 3298779efd5Sopenharmony_ci .height($r('app.float.id_item_height_mid')) 3308779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 3318779efd5Sopenharmony_ci .margin({ right: $r('app.float.id_card_margin_xl') }) 3328779efd5Sopenharmony_ci .type(ButtonType.Normal) 3338779efd5Sopenharmony_ci .opacity(0.4) 3348779efd5Sopenharmony_ci } 3358779efd5Sopenharmony_ci .width('100%') 3368779efd5Sopenharmony_ci .height($r('app.float.id_item_height_large')) 3378779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 3388779efd5Sopenharmony_ci .zIndex(3) 3398779efd5Sopenharmony_ci 3408779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { 3418779efd5Sopenharmony_ci Text($r('app.string.dialer')) 3428779efd5Sopenharmony_ci .fontSize($r('sys.float.ohos_id_text_size_headline6')) 3438779efd5Sopenharmony_ci .fontWeight(FontWeight.Bold) 3448779efd5Sopenharmony_ci .fontColor($r('sys.color.ohos_id_color_text_primary')) 3458779efd5Sopenharmony_ci .margin({ left: $r('app.float.id_card_margin_max') }) 3468779efd5Sopenharmony_ci } 3478779efd5Sopenharmony_ci .width('100%') 3488779efd5Sopenharmony_ci .height($r('app.float.id_item_height_large')) 3498779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 3508779efd5Sopenharmony_ci .zIndex(3) 3518779efd5Sopenharmony_ci 3528779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 3538779efd5Sopenharmony_ci CallRecord() 3548779efd5Sopenharmony_ci } 3558779efd5Sopenharmony_ci .height('100%') 3568779efd5Sopenharmony_ci .zIndex(1) 3578779efd5Sopenharmony_ci } 3588779efd5Sopenharmony_ci } 3598779efd5Sopenharmony_ci .width('40%') 3608779efd5Sopenharmony_ci .height('100%') 3618779efd5Sopenharmony_ci .alignItems(HorizontalAlign.Center) 3628779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 3638779efd5Sopenharmony_ci 3648779efd5Sopenharmony_ci Column() { 3658779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.End }) { 3668779efd5Sopenharmony_ci 3678779efd5Sopenharmony_ci DialPad({ mPresenter: $mPresenter }) 3688779efd5Sopenharmony_ci 3698779efd5Sopenharmony_ci Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceAround }) { 3708779efd5Sopenharmony_ci //TODO 双卡拨号按钮 3718779efd5Sopenharmony_ci Button() 3728779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 3738779efd5Sopenharmony_ci .width($r('app.float.id_item_height_max')) 3748779efd5Sopenharmony_ci .height($r('app.float.id_item_height_max')) 3758779efd5Sopenharmony_ci .enabled(false) 3768779efd5Sopenharmony_ci 3778779efd5Sopenharmony_ci Button() { 3788779efd5Sopenharmony_ci Image($r('app.media.ic_public_phone_filled_white')) 3798779efd5Sopenharmony_ci .width($r('app.float.id_item_height_sm')) 3808779efd5Sopenharmony_ci .height($r('app.float.id_item_height_sm')) 3818779efd5Sopenharmony_ci } 3828779efd5Sopenharmony_ci .width('68vp') 3838779efd5Sopenharmony_ci .height('68vp') 3848779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_connected')) 3858779efd5Sopenharmony_ci // Currently, it is not possible to tell whether the device has dial capability. 3868779efd5Sopenharmony_ci // 1. The dial button in phone is enable. 3878779efd5Sopenharmony_ci // 2. The dial button in tablet is enable only when sim card is inserted. 3888779efd5Sopenharmony_ci .opacity(!EnvironmentProp.isTablet() || this.haveSimCard 3898779efd5Sopenharmony_ci ? 1 : $r('sys.float.ohos_id_alpha_disabled')) 3908779efd5Sopenharmony_ci .onClick(() => { 3918779efd5Sopenharmony_ci if (this.tele_number.length > 0) { 3928779efd5Sopenharmony_ci this.mPresenter.dialing(this.mPresenter.all_number); 3938779efd5Sopenharmony_ci AppStorage.SetOrCreate('tele_number', ''); 3948779efd5Sopenharmony_ci this.mPresenter.all_number = ''; 3958779efd5Sopenharmony_ci } 3968779efd5Sopenharmony_ci }) 3978779efd5Sopenharmony_ci 3988779efd5Sopenharmony_ci Button() { 3998779efd5Sopenharmony_ci Image($r('app.media.ic_public_dial_delete')) 4008779efd5Sopenharmony_ci .width('28vp') 4018779efd5Sopenharmony_ci .height('28vp') 4028779efd5Sopenharmony_ci } 4038779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 4048779efd5Sopenharmony_ci .width($r('app.float.id_item_height_max')) 4058779efd5Sopenharmony_ci .height($r('app.float.id_item_height_max')) 4068779efd5Sopenharmony_ci .type(ButtonType.Normal) 4078779efd5Sopenharmony_ci .opacity(this.tele_number.length > 0 ? 1 : 0.6) 4088779efd5Sopenharmony_ci .enabled(this.tele_number.length > 0 ? true : false) 4098779efd5Sopenharmony_ci .gesture( 4108779efd5Sopenharmony_ci LongPressGesture({ repeat: false, fingers: 1, duration: 700 }) 4118779efd5Sopenharmony_ci .onAction((event: GestureEvent) => { 4128779efd5Sopenharmony_ci AppStorage.SetOrCreate('tele_number', ''); 4138779efd5Sopenharmony_ci this.mPresenter.all_number = ''; 4148779efd5Sopenharmony_ci }) 4158779efd5Sopenharmony_ci ) 4168779efd5Sopenharmony_ci .onClick(() => { 4178779efd5Sopenharmony_ci this.mPresenter.pressVibrate(); 4188779efd5Sopenharmony_ci this.mPresenter.all_number = this.mPresenter.all_number.substr(0, this.mPresenter.all_number.length - 1) 4198779efd5Sopenharmony_ci this.mPresenter.deleteTeleNum(); 4208779efd5Sopenharmony_ci this.mPresenter.deleteAddSpace(); 4218779efd5Sopenharmony_ci }) 4228779efd5Sopenharmony_ci } 4238779efd5Sopenharmony_ci .width('100%') 4248779efd5Sopenharmony_ci .height($r('app.float.dialer_keypad_button_height')) 4258779efd5Sopenharmony_ci .padding({ 4268779efd5Sopenharmony_ci left: $r('app.float.dialer_keypad_button_height'), 4278779efd5Sopenharmony_ci right: $r('app.float.dialer_keypad_button_height') 4288779efd5Sopenharmony_ci }) 4298779efd5Sopenharmony_ci } 4308779efd5Sopenharmony_ci .width('100%') 4318779efd5Sopenharmony_ci .height('100%') 4328779efd5Sopenharmony_ci .padding({ bottom: $r('app.float.dialer_keypad_button_height') }) 4338779efd5Sopenharmony_ci } 4348779efd5Sopenharmony_ci .width('60%') 4358779efd5Sopenharmony_ci .height('100%') 4368779efd5Sopenharmony_ci .backgroundColor($r('sys.color.ohos_id_color_primary_contrary')) 4378779efd5Sopenharmony_ci } 4388779efd5Sopenharmony_ci .width('100%') 4398779efd5Sopenharmony_ci .height('100%') 4408779efd5Sopenharmony_ci } 4418779efd5Sopenharmony_ci}