|
@@ -11,6 +11,10 @@ export function getBuilder(param: DiaLogParam, onBack: (ans?: string) => void){
|
|
|
else if (param.pageEnum == DiaLogPageEnum.DatePicker) DatePickerBuilder(onBack, param.param)
|
|
else if (param.pageEnum == DiaLogPageEnum.DatePicker) DatePickerBuilder(onBack, param.param)
|
|
|
else if (param.pageEnum == DiaLogPageEnum.NumBerInput) NumberInputBuilder({onBack: onBack, param: param.param})
|
|
else if (param.pageEnum == DiaLogPageEnum.NumBerInput) NumberInputBuilder({onBack: onBack, param: param.param})
|
|
|
else if (param.pageEnum == DiaLogPageEnum.Confirm) DoubleConfirm(onBack, param.param)
|
|
else if (param.pageEnum == DiaLogPageEnum.Confirm) DoubleConfirm(onBack, param.param)
|
|
|
|
|
+ else if (param.pageEnum == DiaLogPageEnum.TextInput) InputComp({onBack: onBack, param: param.param})
|
|
|
|
|
+
|
|
|
|
|
+ /******** 额外的 ***********/
|
|
|
|
|
+ else if (param.pageEnum == DiaLogPageEnum.SelectGender) GenderPickerBuilder(onBack, param.param)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 底部菜单
|
|
// 底部菜单
|
|
@@ -118,6 +122,7 @@ struct NumberInputBuilder{
|
|
|
|
|
|
|
|
build() {
|
|
build() {
|
|
|
Column(){
|
|
Column(){
|
|
|
|
|
+ // 标题
|
|
|
RelativeContainer(){
|
|
RelativeContainer(){
|
|
|
_YtHeader({ title: this.param?.text ?? '', isShowBackComp: false, })
|
|
_YtHeader({ title: this.param?.text ?? '', isShowBackComp: false, })
|
|
|
.height(44)
|
|
.height(44)
|
|
@@ -162,6 +167,7 @@ struct NumberInputBuilder{
|
|
|
.height(210)
|
|
.height(210)
|
|
|
.backgroundColor(Color.White)
|
|
.backgroundColor(Color.White)
|
|
|
|
|
|
|
|
|
|
+ // 数字键盘
|
|
|
Column(){
|
|
Column(){
|
|
|
NumberKeyBoard({
|
|
NumberKeyBoard({
|
|
|
textInputValue: this.ans,
|
|
textInputValue: this.ans,
|
|
@@ -194,3 +200,108 @@ struct NumberInputBuilder{
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// 输入框
|
|
|
|
|
+@ComponentV2
|
|
|
|
|
+struct InputComp{
|
|
|
|
|
+ @Event onBack: (ans?:string) => void
|
|
|
|
|
+ @Param @Require param: BasicType
|
|
|
|
|
+
|
|
|
|
|
+ @Local ans: string = ''
|
|
|
|
|
+
|
|
|
|
|
+ aboutToAppear(): void {
|
|
|
|
|
+ this.ans = this.param.text ?? ''
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ build() {
|
|
|
|
|
+ Column({space: 10}){
|
|
|
|
|
+ Row(){
|
|
|
|
|
+ Text("取消")
|
|
|
|
|
+ .fontSize(12)
|
|
|
|
|
+ .fontWeight(400)
|
|
|
|
|
+ .borderRadius(45)
|
|
|
|
|
+ .backgroundColor('#C1EDE9')
|
|
|
|
|
+ .padding({ left: 20,top: 8, right: 20, bottom: 8})
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.onBack()
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ // Text(this.param.text ?? '')
|
|
|
|
|
+ // .fontSize(18)
|
|
|
|
|
+ // .fontWeight(500)
|
|
|
|
|
+
|
|
|
|
|
+ Text("确定")
|
|
|
|
|
+ .fontSize(12)
|
|
|
|
|
+ .fontWeight(400)
|
|
|
|
|
+ .borderRadius(45)
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+ .backgroundColor('#30E3CE')
|
|
|
|
|
+ .padding({ left: 20,top: 8, right: 20, bottom: 8})
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.onBack(this.ans)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ .width("100%")
|
|
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
|
|
+
|
|
|
|
|
+ TextInput({text: $$this.ans, placeholder: this.param.message})
|
|
|
|
|
+ .height('48')
|
|
|
|
|
+ .borderRadius(8)
|
|
|
|
|
+ .defaultFocus(true)
|
|
|
|
|
+ .maxLength(13)
|
|
|
|
|
+ .backgroundColor(Color.White)
|
|
|
|
|
+ .onSubmit(() => {
|
|
|
|
|
+ this.onBack(this.ans)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ .width("100%")
|
|
|
|
|
+ .padding({ bottom: 42, left: 16, right: 16, top: 24 })
|
|
|
|
|
+ .backgroundColor('#B2F4EE')
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 性别 - 选择器
|
|
|
|
|
+@Builder
|
|
|
|
|
+function GenderPickerBuilder(onBack: (ans?:string) => void, param?: BasicType){
|
|
|
|
|
+ Column({space: 20}) {
|
|
|
|
|
+ Row(){
|
|
|
|
|
+ Text("性别")
|
|
|
|
|
+ .fontSize(18)
|
|
|
|
|
+ .fontWeight(500)
|
|
|
|
|
+ }
|
|
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
|
|
+ .width("100%")
|
|
|
|
|
+
|
|
|
|
|
+ Row(){
|
|
|
|
|
+ Text("女生")
|
|
|
|
|
+ .fontSize(16)
|
|
|
|
|
+ .fontWeight(500)
|
|
|
|
|
+ .backgroundColor('#E3FBFA')
|
|
|
|
|
+ .borderRadius(10)
|
|
|
|
|
+ .padding({ left: 38, right: 38, top: 12, bottom: 12 })
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ onBack('女')
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ Text("男生")
|
|
|
|
|
+ .fontSize(16)
|
|
|
|
|
+ .fontWeight(500)
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
+ .backgroundColor('#30E3CE')
|
|
|
|
|
+ .borderRadius(10)
|
|
|
|
|
+ .padding({ left: 38, right: 38, top: 12, bottom: 12 })
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ onBack('男')
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
|
|
+ }
|
|
|
|
|
+ .width("100%")
|
|
|
|
|
+ .backgroundColor('#B2F4EE')
|
|
|
|
|
+ .padding({ bottom: 60, left: 16, right: 16, top: 24 })
|
|
|
|
|
+}
|