FeedBackActivity.ets
4.64 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
128
129
import { FeedbackTypeBean } from 'wdBean/Index';
import { NetworkUtil } from 'wdKit/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { CustomTitleUI } from './reusable/CustomTitleUI'
import { ArrayList } from '@kit.ArkTS';
const TAG = 'FeedBackActivity'
// 意见反馈页面
@Entry
@Component
export struct FeedBackActivity {
//UI
scroller: Scroller = new Scroller();
@State isNetConnected: boolean = true
@State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[]
async aboutToAppear() {
await this.getContentDetailData()
}
build() {
Column() {
//标题栏目
CustomTitleUI({ titleName: "意见反馈" })
Stack({ alignContent: Alignment.Bottom }) {
Scroll(this.scroller) {
Column() {
Text('请选择问题类型')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_15'), top: $r('app.float.vp_14') })
GridRow({
gutter: { x: 2, y: 2 }
}) {
ForEach(this.feedbackTypeBeans, (item: FeedbackTypeBean, index: number) => {
GridCol({
span: 12
}) {
Row(){
Toggle({ type: ToggleType.Checkbox, isOn: false })
Text(item.classifyName)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_4') })
}
.width(115)
.height(22)
.backgroundColor($r('app.color.color_fff'))
}
})
}
Blank()
.height(0.5)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') })
.backgroundColor($r('app.color.color_EDEDED'))
Text('描述您的问题')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') })
Stack() {
TextInput({ placeholder: '您的宝贵意见是我们前行的动力' })
GridRow({
gutter: { x: 2, y: 2 }
}) {
ForEach(this.feedbackTypeBeans, (item: FeedbackTypeBean, index: number) => {
GridCol({
span: 12
}) {
}
})
}
Text('0/500')
}
.height(200)
.width('100%')
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') })
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius(4)
Text('期待您留下联系方式,我们将提供更好的服务')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.margin_24') })
Row() {
Text('电话或者邮箱')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_12') })
TextInput({ placeholder: '请输入电话或者邮箱' })
}
.height(44)
.margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_12'), top: $r('app.float.margin_16') })
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius(4)
}
}
Text($r('app.string.submit'))
.height(44)
.fontColor($r('app.color.color_9E9E9E_40'))
.fontSize($r('app.float.font_size_18'))
.margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_16'), top: $r('app.float.vp_15') })
.backgroundColor($r('app.color.color_ED2800_99'))
.borderRadius(4)
}
}
}
/**
* 请求接口数据
* */
private async getContentDetailData() {
this.isNetConnected = NetworkUtil.isNetConnected()
try {
this.feedbackTypeBeans = await MultiPictureDetailViewModel.getFeedbackTypeList()
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
}
}
}