index.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  6. <meta name="misapplication-tap-highlight" content="no" />
  7. <meta name="HandheldFriendly" content="true" />
  8. <meta name="MobileOptimized" content="320" />
  9. <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
  10. <script typet="text/javascript" src="http://hgd.liuniu946.com/appdom/js/JQ.js"></script>
  11. </head>
  12. <body>
  13. <div class="container">
  14. <div class="loginTitle">欢迎宏根蒂</div>
  15. <div class="loginText">请认真填写个人信息</div>
  16. <div class="login-box">
  17. <div class="username">账号</div>
  18. <input class="input-box" type="email" id="phone" name="phone" placeholder="请输入手机号" />
  19. </div>
  20. <div class="login-box" style="display:none;">
  21. <div class="username">验证码</div>
  22. <div class="flex">
  23. <input class="input-box" style="width: 50%" id="code" type="number" name="code"
  24. placeholder="请输入验证码">
  25. <div class="code" id="daojishi" onclick="verification()">发送验证码</div>
  26. </div>
  27. </div>
  28. <div class="login-box">
  29. <div class="username">登录密码</div>
  30. <input class="input-box" id="loginPass" type="password" name="loginPass" placeholder="请输入登录密码">
  31. </div>
  32. <div class="login-box">
  33. <div class="username">邀请码</div>
  34. <input class="input-box" id="invitation" type="text" disabled="disabled" name="invitation"
  35. placeholder="请输入邀请码">
  36. </div>
  37. <div class="flex">
  38. <div class="login" onclick="fnLogin()">注册</div>
  39. <div class="login"><a href="http://hgd.liuniu946.com/appdom/down.html">下载APP</a></div>
  40. </div>
  41. </div>
  42. </body>
  43. <script type="text/javascript">
  44. var url = location.search;
  45. if (url.indexOf("?") != -1) {
  46. var str = url.substr(1);
  47. strs = str.split("=");
  48. var invitation = strs[1];
  49. document.getElementById('invitation').value = invitation;
  50. }
  51. function fnLogin() {
  52. var phone = document.getElementById("phone").value;
  53. var loginPass = document.getElementById("loginPass").value;
  54. var code = document.getElementById("code").value;
  55. var invitation = document.getElementById("invitation").value;
  56. if (phone == '') {
  57. window.alert("请输入账号");
  58. return false;
  59. }
  60. if (code == '') {
  61. // window.alert("请输入验证码");
  62. // return false;
  63. code = '123456'
  64. }
  65. if (loginPass == '') {
  66. window.alert("请输入登录密码");
  67. return false;
  68. }
  69. // if (invitation == '') {
  70. // window.alert("请输入邀请码");
  71. // return false;
  72. // }
  73. $.ajax({
  74. type: "post",
  75. url: "http://hgd.liuniu946.com/api/register",
  76. data: {
  77. // mobile: phone,
  78. // captcha: code,
  79. // password: loginPass,
  80. // sharecode: invitation
  81. account: phone, //账号
  82. captcha: code, //验证码
  83. password: loginPass ,//密码
  84. spread:invitation//上级推广人
  85. },
  86. dataType: "json",
  87. success: function(data) {
  88. window.alert(data.msg);
  89. if (data.msg === '注册成功')
  90. window.location.href = "http://hgd.liuniu946.com/appdom/down.html"
  91. }
  92. });
  93. }
  94. function verification() {
  95. var phone = document.getElementById("phone").value;
  96. if (phone == '') {
  97. window.alert("请输入手机号");
  98. return false;
  99. }
  100. if (!/^1[3|4|5|6|7|8|9]\d{9}$/.test(phone)) {
  101. window.alert('请输入正确的手机号');
  102. return;
  103. }
  104. var timer = null;
  105. var count = 60;
  106. var codeText = $('#daojishi').text();
  107. if (codeText == '发送验证码') {
  108. timer = setInterval(function() {
  109. count--;
  110. $('#daojishi').text(count);
  111. if (count <= 0) {
  112. clearInterval(timer);
  113. $('#daojishi').text('发送验证码');
  114. }
  115. }, 1000);
  116. }
  117. if (codeText != '发送验证码') {
  118. return
  119. }
  120. $.ajax({
  121. type: "post",
  122. url: "http://hgd.liuniu946.com/api/sms/send",
  123. data: {
  124. mobile: phone,
  125. msg: '发送中',
  126. event: 'register'
  127. },
  128. dataType: "json",
  129. success: function(data) {
  130. window.alert(data.msg);
  131. }
  132. });
  133. }
  134. </script>
  135. <style type="text/css">
  136. * {
  137. margin: 0;
  138. padding: 0;
  139. font-family: 微软雅黑;
  140. font-size: 12px;
  141. min-height: 100%;
  142. }
  143. .container {
  144. padding: 10% 30px 0px 30px;
  145. }
  146. .loginTitle {
  147. font-weight: bold;
  148. color: #32baff;
  149. font-size: 29px;
  150. padding-bottom: 25px;
  151. }
  152. .loginText {
  153. font-weight: 500;
  154. color: #333333;
  155. font-size: 17px;
  156. margin-bottom: 15px;
  157. }
  158. .login-box {
  159. width: 100%;
  160. font-size: 16px;
  161. padding-top: 15px;
  162. }
  163. .username {
  164. display: block;
  165. padding-bottom: 12px;
  166. font-weight: 500;
  167. color: #333333;
  168. font-size: 16px;
  169. }
  170. .input-box {
  171. border: none;
  172. padding: 10px 8px;
  173. outline: none;
  174. width: 100%;
  175. background-color: #F5F5F5;
  176. border-radius: 9px;
  177. color: #32baff;
  178. }
  179. .input-box::placeholder {
  180. color: #bbbbbb;
  181. }
  182. .code {
  183. background-color: #32baff;
  184. border-radius: 5px;
  185. font-weight: 500;
  186. color: #FFFFFF;
  187. font-size: 13px;
  188. padding: 6px 8px;
  189. }
  190. .login {
  191. background-color: #32baff;
  192. color: #FFFFFF;
  193. text-align: center;
  194. width: 130px;
  195. line-height: 40px;
  196. border-radius: 25px;
  197. margin-top: 30px;
  198. }
  199. .login>a {
  200. color: #FFFFFF;
  201. text-decoration: none;
  202. }
  203. .flex {
  204. display: flex;
  205. align-items: center;
  206. justify-content: space-between;
  207. }
  208. </style>
  209. </html>