EditUserIntroductionPage.ets
1.83 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
import { CustomTitleUI } from '../reusable/CustomTitleUI'
import router from '@ohos.router'
import { editModelParams } from '../../model/EditInfoModel'
@Entry
@Component
struct EditUserIntroductionPage {
@State numCount: number = 0
@State textColor : string = '#222222'
@State introduction: string = ''
@State params:editModelParams = router.getParams() as editModelParams;
build() {
Column(){
CustomTitleUI({titleName:'修改简介'})
Row(){
TextInput({placeholder:'请输入简介',text:this.params.editContent})
.maxLength(60)
.width('100%')
.height(80)
.backgroundColor(Color.White)
.onChange(value => {
this.numCount = value.length
if (this.numCount === 60) {
this.textColor = '#ED2800'
}else {
this.textColor = '#222222'
}
this.introduction = value
})
Text(this.numCount.toString() + '/60')
.fontColor(this.textColor)
.margin({left: -50})
}
.alignItems(VerticalAlign.Bottom)
Divider()
.margin(12)
Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、出于商业或作为素材恶搞目的,而将国旗、国徽以及国家领导人用于头像、昵称;\n3、最多60个字,只能输入中文、数字、英文字母。')
.fontSize(13)
.padding(12)
.fontColor(Color.Gray)
Button('保存')
.type(ButtonType.Normal)
.width('90%')
.backgroundColor('#ED2800')
.borderRadius(5)
.margin(30)
.onClick(()=>{
let params: editModelParams = {
introduction: this.introduction
}
router.back({
url:'',
params:params
})
})
}
}
}