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