Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

131 linhas
4.1 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: 35%;
  18. }
  19. .mui-input-row label~input,
  20. .mui-input-row label~select,
  21. .mui-input-row label~textarea {
  22. width: 65%;
  23. }
  24. .mui-checkbox input[type=checkbox],
  25. .mui-radio input[type=radio] {
  26. top: 6px;
  27. }
  28. .mui-content-padded {
  29. margin-top: 25px;
  30. }
  31. .mui-btn {
  32. padding: 10px;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <header class="mui-bar mui-bar-nav">
  38. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  39. <h1 class="mui-title">注册</h1>
  40. </header>
  41. <div class="mui-content">
  42. <form class="mui-input-group">
  43. <div class="mui-input-row">
  44. <label>手机号</label>
  45. <input id='phone' type="text" class="mui-input-clear mui-input" placeholder="请输入手机号">
  46. </div>
  47. <div class="mui-input-row">
  48. <label>姓&nbsp;&nbsp;&nbsp;名</label>
  49. <input id='username' type="text" class="mui-input-clear mui-input" placeholder="请输入姓名">
  50. </div>
  51. <div class="mui-input-row">
  52. <label>身份证号</label>
  53. <input id='ids' type="text" class="mui-input-clear mui-input" placeholder="身份证号选填" maxlength="18" min="15">
  54. </div>
  55. <div class="mui-input-row">
  56. <label>密码</label>
  57. <input id='password' type="password" class="mui-input-password mui-input" placeholder="请输入密码">
  58. </div>
  59. <div class="mui-input-row">
  60. <label>确认</label>
  61. <input id='password_confirm' type="password" class="mui-input-password mui-input" placeholder="请确认密码">
  62. </div>
  63. </form>
  64. <div class="mui-content-padded">
  65. <button id='reg' class="mui-btn mui-btn-block mui-btn-primary">注册</button>
  66. </div>
  67. </div>
  68. <script src="js/mui.min.js"></script>
  69. <script src="js/userinfos.js"></script>
  70. <script type="text/javascript" src="js/serverurl.js"></script>
  71. <script src="js/tools.js"></script>
  72. <script>
  73. (function($, doc) {
  74. $.init();
  75. $.plusReady(function() {
  76. var regButton = doc.getElementById('reg');
  77. var passwordBox = doc.getElementById('password');
  78. var passwordConfirmBox = doc.getElementById('password_confirm');
  79. regButton.addEventListener('tap', function(event) {
  80. if(document.getElementById("username").value == "" || document.getElementById("phone").value == "" ||
  81. document.getElementById("password").value == "" || document.getElementById("password_confirm").value == "") {
  82. plus.nativeUI.toast("提交失败!请您填写完整表单信息。");
  83. return;
  84. }
  85. // if(!isIdCardNo(document.getElementById("ids").value)) {
  86. // plus.nativeUI.toast("请您填写正确的身份证号。");
  87. // return;
  88. // }
  89. var phonereg = /(^0?[1][3578][0-9]{9}$)/;
  90. if(!phonereg.test(document.getElementById("phone").value)) {
  91. plus.nativeUI.toast("请您填写正确的手机号。");
  92. return;
  93. }
  94. var passwordConfirm = passwordConfirmBox.value;
  95. if(passwordConfirm != passwordBox.value) {
  96. plus.nativeUI.toast('密码两次输入不一致');
  97. return;
  98. }
  99. var param={
  100. name:document.getElementById("username").value,
  101. logpwd:document.getElementById("password").value,
  102. ids:document.getElementById("ids").value,
  103. mobile:document.getElementById("phone").value
  104. }
  105. plus.nativeUI.showWaiting("加载中...");
  106. mui.post(api+'/user/studentRegister',{data:JSON.stringify(param)},function(res){
  107. plus.nativeUI.closeWaiting();
  108. if(res.code=="200"){
  109. plus.nativeUI.toast("注册成功。");
  110. plus.webview.currentWebview().close();
  111. }else{
  112. plus.nativeUI.toast(res.info);
  113. }
  114. },'json')
  115. });
  116. });
  117. }(mui, document));
  118. </script>
  119. </body>
  120. </html>