You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

135 lines
4.2 KiB

  1. <!DOCTYPE html>
  2. <html class="ui-page-login">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title></title>
  7. <link href="css/mui.min.css" rel="stylesheet" />
  8. <link href="css/style.css" rel="stylesheet" />
  9. <style>
  10. .area {
  11. margin: 20px auto 0px auto;
  12. }
  13. .mui-input-group:first-child {
  14. margin-top: 20px;
  15. }
  16. .mui-input-group label {
  17. width: 30%;
  18. text-align: center;
  19. }
  20. .mui-input-row label~input,
  21. .mui-input-row label~select,
  22. .mui-input-row label~textarea {
  23. width: 70%;
  24. }
  25. .mui-checkbox input[type=checkbox],
  26. .mui-radio input[type=radio] {
  27. top: 6px;
  28. }
  29. .mui-content-padded {
  30. margin-top: 25px;
  31. }
  32. .mui-btn {
  33. padding: 10px;
  34. }
  35. </style>
  36. </head>
  37. <body>
  38. <header class="mui-bar mui-bar-nav">
  39. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  40. <h1 class="mui-title">注册</h1>
  41. </header>
  42. <div class="mui-content">
  43. <form class="mui-input-group">
  44. <div class="mui-input-row">
  45. <label>姓&nbsp;名</label>
  46. <input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入姓名">
  47. </div>
  48. <div class="mui-input-row">
  49. <label>性&nbsp;别</label>
  50. <input id='password' type="password" class="mui-input-clear mui-input" placeholder="男">
  51. </div>
  52. <div class="mui-input-row">
  53. <label>手机号</label>
  54. <input id='password_confirm' type="password" class="mui-input-clear mui-input" placeholder="请输入手机号">
  55. </div>
  56. <div class="mui-input-row">
  57. <label>身份证号</label>
  58. <input id='email' type="email" class="mui-input-clear mui-input" placeholder="">
  59. </div>
  60. <div class="mui-input-row">
  61. <label>推荐老师</label>
  62. <input id='email' type="email" class="mui-input-clear mui-input" placeholder="">
  63. </div>
  64. <div class="mui-input-row">
  65. <label>备&nbsp;注</label>
  66. <input id='email' type="email" class="mui-input-clear mui-input" placeholder="">
  67. </div>
  68. </form>
  69. <form class="mui-input-group" style="margin-top: 15px;">
  70. <div class="mui-input-row">
  71. <label>密码</label>
  72. <input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入密码(8-20位字符)">
  73. </div>
  74. </form>
  75. <div class="mui-content-padded">
  76. <button id='reg' class="mui-btn mui-btn-block mui-btn-primary">注册</button>
  77. </div>
  78. </div>
  79. <script src="js/mui.min.js"></script>
  80. <script src="js/app.js"></script>
  81. <script>
  82. (function($, doc) {
  83. $.init();
  84. $.plusReady(function() {
  85. var settings = app.getSettings();
  86. var regButton = doc.getElementById('reg');
  87. var accountBox = doc.getElementById('account');
  88. var passwordBox = doc.getElementById('password');
  89. var passwordConfirmBox = doc.getElementById('password_confirm');
  90. var emailBox = doc.getElementById('email');
  91. regButton.addEventListener('tap', function(event) {
  92. var regInfo = {
  93. account: accountBox.value,
  94. password: passwordBox.value,
  95. email: emailBox.value
  96. };
  97. var passwordConfirm = passwordConfirmBox.value;
  98. if (passwordConfirm != regInfo.password) {
  99. plus.nativeUI.toast('密码两次输入不一致');
  100. return;
  101. }
  102. app.reg(regInfo, function(err) {
  103. if (err) {
  104. plus.nativeUI.toast(err);
  105. return;
  106. }
  107. plus.nativeUI.toast('注册成功');
  108. /*
  109. * 注意:
  110. * 1、因本示例应用启动页就是登录页面,因此注册成功后,直接显示登录页即可;
  111. * 2、如果真实案例中,启动页不是登录页,则需修改,使用mui.openWindow打开真实的登录页面
  112. */
  113. plus.webview.getLaunchWebview().show("pop-in",200,function () {
  114. plus.webview.currentWebview().close("none");
  115. });
  116. //若启动页不是登录页,则需通过如下方式打开登录页
  117. // $.openWindow({
  118. // url: 'login.html',
  119. // id: 'login',
  120. // show: {
  121. // aniShow: 'pop-in'
  122. // }
  123. // });
  124. });
  125. });
  126. });
  127. }(mui, document));
  128. </script>
  129. </body>
  130. </html>