1/*
2 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
3 */
4
5
6import { DeviceInfo, DeviceTypes } from '../../common/global/globalmodel/GlobalModel';
7import { createOrGet, globalKeys } from '../../common/global/GlobalThisHelper';
8import { Logger } from '../../common/util/HiLogger'
9
10const logger: Logger = new Logger('SafetyTipDialog')
11
12/*
13 *  安全提示弹窗
14 * */
15@CustomDialog
16export struct SafetyTipDialog {
17  // 设备信息
18  private globalDeviceInfo: DeviceInfo = createOrGet(DeviceInfo, globalKeys.deviceInfo)
19  controller?: CustomDialogController
20  know?: () => void
21
22  build() {
23    Column() {
24      Stack() {
25        Image($r('app.media.ic_public_privacy_big'))
26          .height(28)
27          .fillColor($r('sys.color.ohos_id_color_component_activated'))
28        Image($r('app.media.img'))
29          .width(24)
30          .height(24)
31          .zIndex(99)
32          .borderRadius(5)
33          .position({
34            x: 24,
35            y: 24
36          })
37      }
38      .width(48)
39      .height(48)
40      .borderRadius(8)
41      .margin({ top: 24, bottom: 16 })
42
43      Text($r('app.string.secure_access_to_audio_library'))
44        .width(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? 280 : 352)
45        .height(26)
46        .fontSize(20)
47        .fontWeight(FontWeight.Medium)
48        .fontFamily('HarmonyHeiTi')
49        .lineHeight(27)
50        .textAlign(TextAlign.Center)
51
52      Text($r('app.string.your_audio_will_be_displayed_here'))
53        .width(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? 280 : 352)
54        .height(38)
55        .fontSize(14)
56        .fontWeight(FontWeight.Regular)
57        .fontFamily('HarmonyHeiTi')
58        .lineHeight(19)
59        .margin({
60          left: 24,
61          right: 24,
62          top: 8,
63          bottom: 16
64        })
65        .textAlign(TextAlign.Center)
66
67      Text($r('app.string.got_it'))
68        .width(this.globalDeviceInfo.deviceType === DeviceTypes.PHONE ? 280 : 352)
69        .height(40)
70        .margin({ left: 16, right: 16 })
71        .fontSize(16)
72        .fontWeight(FontWeight.Medium)
73        .fontFamily('HarmonyHeiTi')
74        .lineHeight(21)
75        .fontColor($r('sys.color.ohos_id_text_color_active'))
76        .textAlign(TextAlign.Center)
77        .onClick(() => {
78          if (this.know) {
79            this.know()
80          }
81        })
82    }
83    .width('100%')
84    .height(232)
85    .borderRadius(32)
86    .margin({ left: 16, right: 16 })
87    .alignItems(HorizontalAlign.Center)
88    .justifyContent(FlexAlign.Center)
89  }
90}
91
92
93
94