用户注册跳转
2026/7/9 10:18:26 网站建设 项目流程
两个文件 第一个: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) } }

第二个:

HomePages

@Entry
@Component
struct HomePages{
build() {
Column(){
Text('这是一个注册界面')
}
}
}

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询