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