用户注册跳转

发布时间:2026/6/26 16:41:54
用户注册跳转 两个文件 第一个register import router from ohos.router; Entry Component struct Register{ build() { Column({space:40}){ Text(用户注册) .fontSize(32).fontWeight(FontWeight.Bolder).margin({top:20,bottom:10}) TextInput({placeholder:请输入手机号或邮箱}) .width(320) .height(52) .borderRadius(12) .fontSize(16) TextInput({placeholder:请输入密码}) .type(InputType.Password) .width(320) .height(52) .borderRadius(12) .fontSize(16) TextInput({placeholder:请再次输入密码}) .type(InputType.Password) .width(320) .height(52) .borderRadius(12) .fontSize(16) Button(立即注册) .width(320) .height(52) .backgroundColor(0x007dff) .fontSize(16) .borderRadius(12) Text(已有账号返回登录) .fontSize(14) .fontColor(0x1677ff) .onClick((){ router.pushUrl({ url:pages/Logins }) }) } .backgroundColor(0xf8f8f8) .height(100%) .width(100%) .justifyContent(FlexAlign.Center) } }第二个HomePagesEntryComponentstruct HomePages{build() {Column(){Text(这是一个注册界面)}}}