AboutPageUI.ets
3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import { Params } from 'wdBean';
import { AppUtils, StringUtils } from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { EnvironmentCustomDialog } from './EnvironmentCustomDialog';
const TAG = 'AboutPageUI';
@Component
export struct AboutPageUI {
@State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议','收集个人信息明示清单','第三方信息共享清单'];
@State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.'
@State version: string = '版本号:v'
dialogController: CustomDialogController = new CustomDialogController({
builder: EnvironmentCustomDialog({
cancel: () => {
},
confirm: () => {
}
}),
customStyle: true,
alignment: DialogAlignment.Center
})
build() {
this.aboutUi()
}
aboutToAppear() {
let context = getContext();
context.getApplicationContext();
let appVerion = AppUtils.getAppVersionName()
if (StringUtils.isNotEmpty(appVerion)) {
this.version = "版本号:" + appVerion
}
}
@Builder
aboutUi() {
Column() {
CustomTitleUI({titleName:'关于'})
Image($r('app.media.setting_about_logo'))
.width('278lpx')
.height('154lpx')
.margin({ top: '173lpx', bottom: '154lpx' })
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
this.dialogController.open()
})
)
List() {
ForEach(this.listData, (item: string, index: number) => {
ListItem() {
this.getArrowCell(item, index)
}.onClick(() => {
if (index == 0) {
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
} else if(index == 1){
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
}else if(index == 2){
let bean = { contentID: "5", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
}else if(index == 3){
let bean = { contentID: "6", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
}
})
})
}.divider({
strokeWidth: 1,
startMargin: '29lpx',
endMargin: '29lpx',
color: '#EDEDED'
})
Blank()
Image($r('app.media.about_us_code'))
.width('192lpx')
.height('192lpx')
Text(this.version)
.fontSize('25lpx')
.textAlign(TextAlign.Center)
.fontColor($r("app.color.color_666666"))
.margin({ bottom: '31lpx' })
Text(this.message)
.fontSize('19lpx')
.textAlign(TextAlign.Center)
.fontColor($r("app.color.color_999999"))
.margin({ bottom: '35lpx' })
}
.width('100%')
.height('100%')
}
// 右文字+箭头cell
@Builder
getArrowCell(item: string, index: number) {
Row() {
// 左侧标题
Text(`${item}`)
.fontColor('#666666')
.fontSize('31lpx')
Image($r('app.media.mine_user_arrow'))
.width('27lpx')
.height('27lpx')
.objectFit(ImageFit.Auto)
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.SpaceBetween)
.height('97lpx')
.width('100%')
.padding({ left: '29lpx', right: '29lpx' })
}
}