注册资料
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
@Component
|
||||
export struct EditUserDataItem {
|
||||
private label: string = ''
|
||||
private required: boolean = false
|
||||
@Prop content: string = ''
|
||||
private hasArrow: boolean = false
|
||||
@Prop isLine:boolean = true;
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Row() {
|
||||
Row() {
|
||||
Text(this.label)
|
||||
.fontSize(16)
|
||||
.fontColor('#333333')
|
||||
.margin({ left: this.isLine?15:10 })
|
||||
if (this.required) {
|
||||
Text('*')
|
||||
.margin({ left: 0 })
|
||||
.fontSize(16)
|
||||
.fontColor($r('app.color.main_color'))
|
||||
}
|
||||
}
|
||||
.layoutWeight(1)//权重自定义
|
||||
.justifyContent(FlexAlign.Start)
|
||||
|
||||
Row({space:5}) {
|
||||
if (this.label == '头像') {
|
||||
Image(this.content)
|
||||
.alt(this.isLine?$r('app.media.userPhoto_default'):$r('app.media.icon_touxiang_persion_ws'))
|
||||
.onComplete(() => console.log('图片加载完成'))
|
||||
.onError(() => console.error('图片加载失败'+this.content))
|
||||
.width(40)
|
||||
.height(40)
|
||||
.margin({ right: this.hasArrow?0:10 })
|
||||
.borderRadius(8)
|
||||
} else if (this.label == '执业医师证图片或胸牌') {
|
||||
Image(this.content)
|
||||
.alt(this.isLine?null:$r('app.media.icon_xiongpai_ws'))
|
||||
.onComplete(() => console.log('图片加载完成'))
|
||||
.onError(() => console.error('图片加载失败'+this.content))
|
||||
.width(60)
|
||||
.height(40)
|
||||
.margin({ right: this.hasArrow?0:10 })
|
||||
} else {
|
||||
Text(this.content)
|
||||
.fontSize(14)
|
||||
.fontColor('#333333')
|
||||
.width('auto')
|
||||
.constraintSize({
|
||||
maxWidth:this.label='专长(可选一到十项)'?'50%':'70%'
|
||||
})
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.maxLines(1)
|
||||
.margin({right: this.hasArrow?0:10 })
|
||||
.textAlign(TextAlign.End)
|
||||
}
|
||||
if (this.hasArrow) {
|
||||
Image($r('sys.media.ohos_ic_public_arrow_right'))
|
||||
.width(15)
|
||||
.height(15)
|
||||
.margin({ right: 10 })
|
||||
}
|
||||
}
|
||||
.justifyContent(FlexAlign.End)
|
||||
}
|
||||
.height(50)
|
||||
.alignItems(VerticalAlign.Center)
|
||||
|
||||
if (this.isLine) {
|
||||
Divider()
|
||||
.color('#F4F4F4')
|
||||
.strokeWidth(1)
|
||||
.height(1)
|
||||
.margin({ left: 10, top: 0 })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user