1/* 2 * Copyright (c) 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 Want from '@ohos.app.ability.Want'; 17import router from '@ohos.router'; 18import { GlobalContext } from '../../utils/GlobalContext'; 19 20@Entry 21@Component 22struct First { 23 onPageShow() { 24 let newWant = GlobalContext.getContext().getObject('newWant') as Want; 25 if (newWant) { 26 if (newWant.parameters) { 27 if (newWant.parameters.page) { 28 router.push({ url: newWant.parameters.page as string}); 29 GlobalContext.getContext().setObject("newWant", undefined); 30 } 31 } 32 } 33 } 34 build() { 35 Column() { 36 Row() { 37 Text($r('app.string.singleton_first_title')) 38 .fontSize(24) 39 .fontWeight(FontWeight.Bold) 40 .textAlign(TextAlign.Start) 41 .margin({ top: 12, bottom: 11, right: 24, left: 24 }) 42 } 43 .width('100%') 44 .height(56) 45 .justifyContent(FlexAlign.Start) 46 47 Image($r('app.media.pic_empty')) 48 .width(120) 49 .height(120) 50 .margin({ top: 224 }) 51 52 Text($r('app.string.no_content')) 53 .fontSize(14) 54 .margin({ top: 8, bottom: 317, right: 152, left: 152 }) 55 .fontColor($r('app.color.text_color')) 56 .opacity(0.4) 57 } 58 .width('100%') 59 .height('100%') 60 .backgroundColor($r('app.color.backGrounding')) 61 } 62}