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 { Mine } from '../common/ui/main/Mine'; 17import { Home } from '../common/ui/main/Home'; 18import { Report } from '../common/ui/main/Report'; 19import { HomeBottomPage } from '../common/ui/main/HomeBottomPage'; 20/* 21 * 主页 程序主页面 22 */ 23@Entry 24@Component 25struct Main { 26 @State currentPage: number = 0 27 28 build() { 29 Column() { 30 Column() { 31 if (this.currentPage == 0) { 32 Home() 33 } else if (this.currentPage == 1) { 34 Report() 35 } else if (this.currentPage == 2) { 36 Mine() 37 } 38 }.width('100%').height('88%') 39 .flexGrow(1) 40 41 HomeBottomPage({ currentPage: $currentPage }) 42 } 43 } 44} 45 46 47 48 49 50 51 52 53 54