星空软件

 找回密码
 立即注册

用autojs做一个注册界面

新库软件 | 2024-1-14 13:18:55 | 显示全部楼层 |阅读模式
回复

使用道具 举报

konodioda | 2024-1-14 13:18:56 | 显示全部楼层
  1. var appName = "注册界面";
  2. var activity = ui.activity;

  3. activity.setContentView(
  4.     <vertical padding="16">
  5.         <text text={appName} textSize="20sp" textColor="black" marginBottom="16"/>
  6.         <input id="username" hint="请输入用户名" marginBottom="16"/>
  7.         <input id="password" hint="请输入密码" inputType="textPassword" marginBottom="16"/>
  8.         <button id="registerBtn" text="注册" textSize="16sp"/>
  9.     </vertical>
  10. );

  11. ui.registerBtn.on("click", function(){
  12.     var username = ui.username.text();
  13.     var password = ui.password.text();
  14.    
  15.     // 在这里执行注册逻辑,可以调用相关函数或API
  16.     // ...

  17.     toast("注册成功!");
  18. });
复制代码
回复

使用道具 举报

李小白 | 2024-1-14 13:20:31 | 显示全部楼层
楼上这个代码是不是有点毛病
回复

使用道具 举报

w584518 | 2024-1-14 13:20:41 | 显示全部楼层
李小白 发表于 2024-1-14 13:20
楼上这个代码是不是有点毛病

好像8.0里面运行不了
回复

使用道具 举报

trubnikaa | 2024-1-14 13:23:44 | 显示全部楼层
  1. "ui";

  2. ui.layout(
  3.     <vertical padding="16">
  4.         <text text="注册界面" textSize="20sp" textColor="black" marginBottom="16"/>
  5.         <input id="username" hint="请输入用户名" marginBottom="16"/>
  6.         <input id="password" hint="请输入密码" inputType="textPassword" marginBottom="16"/>
  7.         <button id="registerBtn" text="注册"/>
  8.     </vertical>
  9. );

  10. ui.registerBtn.on("click", ()=>{
  11.     var username = ui.username.getText();
  12.     var password = ui.password.getText();
  13.    
  14.     // 在这里执行注册逻辑,可以调用相关函数或API
  15.     // ...

  16.     ui.toast("注册成功!");
  17. });
复制代码

评分

参与人数 1金钱 +9 收起 理由
新库软件 + 9 赞一个!

查看全部评分

回复

使用道具 举报

woai520 | 2024-1-14 13:24:10 | 显示全部楼层

这个代码可以的
回复

使用道具 举报

ylagixar | 2024-1-14 13:24:21 | 显示全部楼层
上面这个代码没毛病
回复

使用道具 举报

3477737972 | 2024-1-14 13:24:26 | 显示全部楼层
感谢
回复

使用道具 举报

123452@ | 2024-1-14 13:32:29 | 显示全部楼层
第二个提供的代码可以
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

全站声明【必看】|小黑屋|新库软件 |网站地图

GMT+8, 2024-4-28 21:31 , Processed in 0.067229 second(s), 27 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.