• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 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 router from '@ohos.router';
17import doubleButtonComponent from '../component/autoManager/doubleButtonComponent'
18import utils from '../../common/utils'
19
20@Entry
21@Component
22struct SetFinishSuccess {
23  @State textContext: Resource = $r('app.string.setupComplete');
24  @State textManager: Resource = $r('app.string.unitManage');
25  @State textManagerBefore: Resource = $r('app.string.textManagerBeforeFinish');
26  @State textManagerAfter: Resource = $r('app.string.textManagerAfter');
27
28  build() {
29    Column() {
30      GridContainer({
31        columns: utils.isLargeDevice(),
32        sizeType: SizeType.Auto,
33        gutter: '12vp',
34        margin: '12vp'
35      }) {
36        Column() {
37          Image($r('app.media.ic_public_todo'))
38            .width($r('app.float.wh_value_40'))
39            .height($r('app.float.wh_value_40'))
40            .margin({ top: '72vp', bottom: '16vp' })
41            .objectFit(ImageFit.Contain)
42
43          Text(this.textContext)
44            .height('40vp')
45            .textAlign(TextAlign.Center)
46            .fontWeight(FontWeight.Medium)
47            .lineHeight($r('app.float.lineHeight_vp_41'))
48            .fontSize($r('app.float.font_vp_30'))
49            .fontFamily('HarmonyHeiTi')
50        }
51        .useSizeType({
52          xs: { span: 8, offset: 0 }, sm: { span: 8, offset: 0 },
53          md: { span: 8, offset: 0 }, lg: { span: 8, offset: 2 }
54        })
55        .width('100%')
56        .align(Alignment.Center)
57
58        Column() {
59          Row() {
60            Text() {
61              Span(this.textManagerBefore)
62                .fontWeight(FontWeight.Regular)
63                .fontSize($r('app.float.font_vp_16'))
64                .fontFamily('HarmonyHeiTi')
65
66              Span(this.textManager)
67                .decoration({ type: TextDecorationType.None })
68                .fontColor(0x007DFF)
69                .fontSize($r('app.float.font_vp_16'))
70                .fontFamily('HarmonyHeiTi')
71                .fontWeight(FontWeight.Regular)
72                .onClick(() => {
73                  router.pushUrl({url: 'pages/autoManager/unitManagerShowPage'})
74                })
75
76              Span(this.textManagerAfter)
77                .fontWeight(FontWeight.Regular)
78                .fontSize($r('app.float.font_vp_16'))
79                .fontFamily('HarmonyHeiTi')
80            }
81            .lineHeight($r('app.float.lineHeight_vp_21_5'))
82          }
83          .useSizeType({
84            xs: { span: 8, offset: 0 }, sm: { span: 8, offset: 0 },
85            md: { span: 8, offset: 0 }, lg: { span: 8, offset: 2 }
86          })
87          .width('100%')
88          .margin({ top: '48vp' })
89          .justifyContent(FlexAlign.Center)
90        }
91        .width('100%')
92      }
93
94      Blank()
95
96      GridContainer({
97        columns: utils.isLargeDevice(),
98        sizeType: SizeType.Auto,
99        gutter: '12vp',
100        margin: '12vp'
101      }) {
102        Column() {
103          doubleButtonComponent()
104        }
105        .useSizeType({
106          xs: { span: 8, offset: 0 }, sm: { span: 8, offset: 0 },
107          md: { span: 8, offset: 0 }, lg: { span: 12, offset: 0 }
108        })
109        .width('100%')
110        .margin({ bottom: '16vp' })
111      }
112    }
113    .backgroundColor(0xF1F3F5)
114    .width('100%')
115    .height('100%')
116  }
117}