index.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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://libs.baidu.com/jquery/1.9.1/jquery.min.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">
  21. <div class="username">验证码</div>
  22. <div class="flex">
  23. <input class="input-box" style="width: 50%" id="code" type="number" name="code" placeholder="请输入验证码">
  24. <div class="code" id="daojishi" onclick="verification()">发送验证码</div>
  25. </div>
  26. </div>
  27. <div class="login-box">
  28. <div class="username">登录密码</div>
  29. <input class="input-box" id="loginPass" type="password" name="loginPass" placeholder="请输入登录密码">
  30. </div>
  31. <div class="login-box">
  32. <div class="username">交易密码</div>
  33. <input class="input-box" id="payPass" type="password" name="payPass" placeholder="请输入支付密码">
  34. </div>
  35. <div class="login-box">
  36. <div class="username">邀请码</div>
  37. <input class="input-box" id="invitation" type="text" disabled="disabled" name="invitation" placeholder="请输入邀请码">
  38. </div>
  39. <div class="flex">
  40. <div class="login" onclick="fnLogin()">注册</div>
  41. <div class="login"><a href="{:url('down')}">下载APP</a></div>
  42. </div>
  43. </div>
  44. </body>
  45. <script type="text/javascript">
  46. var url = location.search;
  47. if (url.indexOf("?") != -1) {
  48. var str = url.substr(1);
  49. strs = str.split("=");
  50. var invitation = strs[1];
  51. document.getElementById('invitation').value = invitation;
  52. }
  53. function fnLogin() {
  54. var phone = document.getElementById("phone").value;
  55. var loginPass = document.getElementById("loginPass").value;
  56. var payPass = document.getElementById("payPass").value;
  57. var code = document.getElementById("code").value;
  58. var invitation = document.getElementById("invitation").value;
  59. if (phone == '') {
  60. window.alert("请输入账号");
  61. return false;
  62. }
  63. if (code == '') {
  64. window.alert("请输入验证码");
  65. return false;
  66. }
  67. if (loginPass == '') {
  68. window.alert("请输入登录密码");
  69. return false;
  70. }
  71. if (payPass == '') {
  72. window.alert("请输入支付密码");
  73. return false;
  74. }
  75. if (invitation == '') {
  76. window.alert("请输入邀请码");
  77. return false;
  78. }
  79. $.ajax({
  80. type: "post",
  81. headers: {
  82. "Appid": "UtilLa " + "{$appid}",
  83. 'SignTime': "{$time}",
  84. 'Sign': "{$sign}"
  85. },
  86. url: "http://xingpinle.liuniu946.com/api/register",
  87. data: {account: phone, captcha: code, password: loginPass, trade_password: payPass, spread: invitation},
  88. dataType: "json",
  89. success: function (data) {
  90. window.alert(data.msg);
  91. if (data.msg === '注册成功')
  92. window.location.href = "{:url('down')}"
  93. }
  94. });
  95. }
  96. function verification() {
  97. var phone = document.getElementById("phone").value;
  98. if (phone == '') {
  99. window.alert("请输入账号");
  100. return false;
  101. }
  102. if (!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(phone) && !/^1[3|4|5|6|7|8|9]\d{9}$/.test(phone)) {
  103. window.alert('请输入正确的账号');
  104. return;
  105. }
  106. var timer = null;
  107. var count = 60;
  108. var codeText = $('#daojishi').text();
  109. if (codeText == '发送验证码') {
  110. timer = setInterval(function () {
  111. count--;
  112. $('#daojishi').text(count);
  113. if (count <= 0) {
  114. clearInterval(timer);
  115. $('#daojishi').text('发送验证码');
  116. }
  117. }, 1000);
  118. }
  119. if (codeText != '发送验证码') {
  120. return
  121. }
  122. $.ajax({
  123. type: "post",
  124. headers: {
  125. "Appid": "UtilLa " + "{$appid}",
  126. 'SignTime': "{$time}",
  127. 'Sign': "{$sign}"
  128. },
  129. url: "http://xingpinle.liuniu946.com/api/register/verify",
  130. data: {phone: phone, type: 'register'},
  131. dataType: "json",
  132. success: function (data) {
  133. window.alert(data.msg);
  134. }
  135. });
  136. }
  137. </script>
  138. <style type="text/css">
  139. * {
  140. margin: 0;
  141. padding: 0;
  142. font-family: 微软雅黑;
  143. font-size: 12px;
  144. min-height: 100%;
  145. }
  146. .container {
  147. padding: 10% 30px 0px 30px;
  148. }
  149. .loginTitle {
  150. font-weight: bold;
  151. color: #32baff;
  152. font-size: 29px;
  153. padding-bottom: 25px;
  154. }
  155. .loginText {
  156. font-weight: 500;
  157. color: #333333;
  158. font-size: 17px;
  159. margin-bottom: 15px;
  160. }
  161. .login-box {
  162. width: 100%;
  163. font-size: 16px;
  164. padding-top: 15px;
  165. }
  166. .username {
  167. display: block;
  168. padding-bottom: 12px;
  169. font-weight: 500;
  170. color: #333333;
  171. font-size: 16px;
  172. }
  173. .input-box {
  174. border: none;
  175. padding: 10px 8px;
  176. outline: none;
  177. width: 100%;
  178. background-color: #F5F5F5;
  179. border-radius: 9px;
  180. color: #32baff;
  181. }
  182. .input-box::placeholder {
  183. color: #bbbbbb;
  184. }
  185. .code {
  186. background-color: #32baff;
  187. border-radius: 5px;
  188. font-weight: 500;
  189. color: #FFFFFF;
  190. font-size: 13px;
  191. padding: 6px 8px;
  192. }
  193. .login {
  194. background-color: #32baff;
  195. color: #FFFFFF;
  196. text-align: center;
  197. width: 130px;
  198. line-height: 40px;
  199. border-radius: 25px;
  200. margin-top: 30px;
  201. }
  202. .login > a {
  203. color: #FFFFFF;
  204. text-decoration: none;
  205. }
  206. .flex {
  207. display: flex;
  208. align-items: center;
  209. justify-content: space-between;
  210. }
  211. </style>
  212. </html>