1/* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { Contact } from '../model/Contact' 17 18@Component 19export struct ContactDetailInfo { 20 @Link contact: Contact 21 22 build() { 23 Column() { 24 Text(this.contact.name.substring(0, 1) 25 .toUpperCase()) 26 .width($r('app.float.head_size_big')) 27 .height($r('app.float.head_size_big')) 28 .fontSize($r('app.float.font_size_35')) 29 .fontColor('#ffffff') 30 .borderRadius(100) 31 .margin({ top: 62, bottom: 22 }) 32 .textAlign(TextAlign.Center) 33 .backgroundColor('#B6C5D1') 34 35 Text(this.contact.name) 36 .fontSize($r('app.float.font_size_32')) 37 .margin({ bottom: $r('app.float.page_space_16') }) 38 39 Column() { 40 ForEach(this.contact.phone.split(','), item => { 41 Column() { 42 Row() { 43 Text(item) 44 .fontSize($r('app.float.font_size_22')) 45 .margin({ left: $r('app.float.page_space_16') }) 46 47 Blank() 48 49 Image($r('app.media.phone2')) 50 .width($r('app.float.image_size_32')) 51 .height($r('app.float.image_size_32')) 52 .margin({ right: $r('app.float.page_space_24') }) 53 .objectFit(ImageFit.Contain) 54 55 Image($r('app.media.note')) 56 .width($r('app.float.image_size_32')) 57 .height($r('app.float.image_size_32')) 58 .margin({ right: $r('app.float.page_space_24') }) 59 .objectFit(ImageFit.Contain) 60 } 61 .width('100%') 62 .height(45) 63 .padding($r('app.float.page_space_12')) 64 65 Divider() 66 .width('100%') 67 .strokeWidth(1) 68 .color('#ffefefef') 69 .margin({ left: $r('app.float.page_space_16'), right: $r('app.float.page_space_16') }) 70 } 71 }) 72 73 Row() { 74 Column() { 75 Text($r('app.string.default')) 76 .fontSize(16) 77 .margin({ left: $r('app.float.page_space_16') }) 78 Text($r('app.string.phone_ring')) 79 .fontSize(16) 80 .fontColor(Color.Gray) 81 .margin({ left: $r('app.float.page_space_16') }) 82 } 83 .alignItems(HorizontalAlign.Start) 84 85 Blank() 86 87 Image($r('app.media.right')) 88 .height(32) 89 .width(12) 90 .objectFit(ImageFit.Contain) 91 .margin({ right: $r('app.float.page_space_24') }) 92 } 93 .width('100%') 94 .padding($r('app.float.page_space_12')) 95 .height(50) 96 } 97 .width('100%') 98 .borderRadius(30) 99 .backgroundColor(Color.White) 100 } 101 .width('100%') 102 .height('100%') 103 } 104}