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 */ 15import DeviceUtil from "../../utils/DeviceUtil"; 16import router from "@system.router"; 17import QueryReportController from "./queryReportController"; 18import WantUtil from "../../utils/WantUtil"; 19 20@Entry 21@Component 22struct queryReport { 23 @StorageLink("QueryReportController") queryReportController: QueryReportController = QueryReportController.getInstance(); 24 private gridColumns: GridRowColumnOption = { sm: 4, md: 8, lg: 12 }; 25 private girdSpan: GridColColumnOption = { sm: 4, md: 8, lg: 12 }; 26 private gridGutter: string = "24vp"; 27 private gridMargin: string = "24vp"; 28 29 onPageShow(): void { 30 this.queryReportController.onShow(); 31 WantUtil.getWant(); 32 } 33 34 aboutToAppear(): void { 35 this.queryReportController.onInit() 36 } 37 38 build() { 39 GridRow({ columns: this.gridColumns, gutter: this.gridGutter }) { 40 GridCol({ span: this.girdSpan }) { 41 Row() { 42 Image($rawfile('icon/ic_message_back.svg')) 43 .width(24) 44 .height(24) 45 .onClick(() => { 46 router.back() 47 }) 48 Text($r("app.string.send_reports")) 49 .margin({ left: 16 }) 50 .fontSize(20) 51 .fontWeight(FontWeight.Bold) 52 .lineHeight(28) 53 } 54 .alignItems(VerticalAlign.Center) 55 .height(56) 56 } 57 GridCol({ span: this.girdSpan }) { 58 Column() { 59 Text() { 60 Span($r("app.string.putAddresser")).fontSize(16) 61 Span(this.queryReportController.telephone).fontSize(16) 62 } 63 .fontSize(16) 64 .height(48) 65 .fontWeight(FontWeight.Medium) 66 .lineHeight(22) 67 68 Text() { 69 Span($r("app.string.Status")).fontSize(16) 70 Span(this.queryReportController.sendStatusDesc).fontSize(16) 71 } 72 .fontSize(16) 73 .height(48) 74 .fontWeight(FontWeight.Medium) 75 .lineHeight(22) 76 77 if (!this.queryReportController.isMsm && this.queryReportController.sendStatus != 2) { 78 Text() { 79 Span($r("app.string.Delivered")).fontSize(16) 80 Span(this.queryReportController.mmsTime).fontSize(16) 81 Span(" ") 82 Span(this.queryReportController.specificTime).fontSize(16) 83 } 84 .fontSize(16) 85 .height(48) 86 .fontWeight(FontWeight.Medium) 87 .lineHeight(22) 88 } 89 } 90 .alignItems(HorizontalAlign.Start) 91 .padding({ left: 12, right: 12 }) 92 } 93 } 94 .width("100%") 95 .height("100%") 96 .margin({ left: this.gridMargin, right: this.gridMargin }) 97 } 98}