reg.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <?php
  2. namespace app\index;
  3. class reg extends Base
  4. {
  5. function index()
  6. {
  7. if (!IN_REG_ON || !IN_LOGIN_ON) {
  8. redirect();
  9. }
  10. ?> <!DOCTYPE html>
  11. <html lang="">
  12. <head>
  13. <title>账号注册 - <?php echo IN_NAME;?>免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发</title>
  14. <meta charset="utf-8"/>
  15. <meta name="viewport"
  16. content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  17. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  18. <meta name="renderer" content="webkit"/>
  19. <meta name="keywords" content="<?php echo IN_KEYWORDS;?>"/>
  20. <meta property="og:url" content="https://<?php echo $_SERVER['HTTP_HOST'];?>/"/>
  21. <meta property="og:title" content="<?php echo IN_NAME;?>"/>
  22. <meta name="description"
  23. content="<?php echo IN_NAME;?> 为开发者提供测试应用极速发布,iOS/Android应用开发、封装打包APP、内测发布等一系列效率工具服务"/>
  24. <?php
  25. $this->static_();
  26. ?>
  27. <link rel="stylesheet" href="/static/index/css/login.css">
  28. <script>
  29. function update_seccode() {
  30. document.getElementById('img_seccode').src = '<?php echo IN_PATH;?>index/seccode?' + Math.random();
  31. }
  32. </script>
  33. <style>
  34. .login-common .form-group:nth-child(5) {
  35. margin-bottom: 0;
  36. }
  37. /* 自定义checkbox样式 */
  38. .custom-checkbox {
  39. position: relative;
  40. display: inline-block;
  41. width: 18px;
  42. height: 18px;
  43. vertical-align: middle;
  44. cursor: pointer;
  45. background: #fff;
  46. transition: all 0.3s ease;
  47. margin: 0;
  48. border: 1px solid #ddd;
  49. }
  50. .custom-checkbox:hover {
  51. border-color: #2168fb;
  52. box-shadow: 0 0 5px rgba(33, 104, 251, 0.3);
  53. }
  54. .custom-checkbox.checked {
  55. background: url(/static/index/image/login/check-on.svg) center / 100% no-repeat;
  56. border-color: #2168fb;
  57. border: unset;
  58. }
  59. .login-common .checkbox {
  60. display: flex;
  61. align-items: center;
  62. margin: 0;
  63. }
  64. .login-common .checkbox span {
  65. margin-left: 8px;
  66. }
  67. /* 响应式设计 */
  68. @media (max-width: 767px) {
  69. .custom-checkbox {
  70. width: 0.32rem;
  71. height: 0.32rem;
  72. }
  73. .login-common .checkbox span {
  74. margin-left: 0.16rem;
  75. }
  76. .register-common .form-group .form-control {
  77. padding-left: 0.8rem;
  78. }
  79. }
  80. </style>
  81. </head>
  82. <body>
  83. <?php
  84. $this->header();
  85. ?>
  86. <div class="login-common register-common">
  87. <div class="tit-tabs">
  88. <div class="tit active">账户注册</div>
  89. </div>
  90. <div class="form-container">
  91. <div class="form-inner">
  92. <form action="" method="post">
  93. <input type="password" style="position: absolute;top: -999px">
  94. <div class="form-group">
  95. <label class="iconfont icon-user" for="a"></label>
  96. <input type="text" class="form-control input-lg" id="nickname" placeholder="请输入您的用户名">
  97. <span class="help-block">请输入正确的用户名</span>
  98. </div>
  99. <div class="form-group index index1">
  100. <label class="iconfont icon-tel" for="a"></label>
  101. <input class="form-control input-lg" placeholder="手机号码" type="text" id="mobile">
  102. <span class="help-block">请输入正确的手机号码</span>
  103. </div>
  104. <?php
  105. if (IN_SMS == 1) {
  106. ?>
  107. <div class="form-group index index1">
  108. <label class="iconfont icon-dunpai"></label>
  109. <div class="clearfix verification-code">
  110. <input type="text" class="form-control input-lg fl" id="code1"
  111. placeholder="请输入手机验证码">
  112. <button id="sendcode1" type="button" class="ms-btn ms-btn-primary input-lg fr">
  113. 获取验证码
  114. </button>
  115. </div>
  116. <span class="help-block">请输入正确的验证码</span>
  117. </div>
  118. <?php
  119. }
  120. ?> <div class="form-group">
  121. <label class="iconfont icon-pwd" for="c"></label>
  122. <input class="form-control input-lg" placeholder="请输入密码,密码长度不能少于6位" type="password"
  123. id="password">
  124. <span class="help-block">密码不正确</span>
  125. </div>
  126. <div class="form-group">
  127. <label class="iconfont icon-pwd" for="c"></label>
  128. <input class="form-control input-lg" placeholder="请再次输入你的密码" type="password"
  129. id="repassword">
  130. <span class="help-block">两次密码不一致</span>
  131. </div>
  132. <div class="form-group" style="display:none">
  133. <label class="iconfont icon-dunpai"></label>
  134. <div class="clearfix verification-code">
  135. <input class="form-control input-lg fl" value="1234" placeholder="请输入图形验证码" type="text" id="seccode"
  136. maxlength="4">
  137. <img id="img_seccode" onclick="update_seccode()" style="float:right"
  138. src="/index/seccode" height="46" width="27%">
  139. </div>
  140. </div>
  141. </div>
  142. <div class="checkbox">
  143. <div class="custom-checkbox checked" id="agreementCheckbox"></div>
  144. <span>我已阅读并同意<a href="/index/about/agreement" target="_blank" class="color-hover">《服务协议》</a>及<a
  145. href="/index/about/privacy" target="_blank" class="color-hover">《隐私政策》</a></span>
  146. </div>
  147. </div>
  148. <button type="button" id="submitButton" class="ms-btn ms-btn-primary input-lg btn-register">注册</button>
  149. <div class="text-center to-login">
  150. 已有账号,<a href="<?php echo IN_PATH;?>index/login" class="color-hover">点击登录</a>
  151. </div>
  152. </form>
  153. </div>
  154. <script>
  155. $(function () {
  156. // 自定义checkbox点击事件
  157. $('#agreementCheckbox').click(function() {
  158. $(this).toggleClass('checked');
  159. });
  160. function settime(countdown) {
  161. if (countdown == 0) {
  162. $('#sendcode' + regtype).attr("disabled", false);
  163. $('#sendcode' + regtype).html("获取验证码");
  164. countdown = 60;
  165. return;
  166. } else {
  167. $('#sendcode' + regtype).attr("disabled", true);
  168. $('#sendcode' + regtype).html("重新发送(" + countdown + ")");
  169. countdown--;
  170. }
  171. setTimeout(function () {
  172. settime(countdown)
  173. }, 1000)
  174. }
  175. var regtype = 1;
  176. $('.tit a').click(function () {
  177. $(this).addClass('active').siblings().removeClass('active');
  178. $('.index').hide();
  179. regtype = $(this).index()
  180. $('.index' + regtype).show();
  181. });
  182. $('#sendcode0').click(function () {
  183. var email = $('#email').val();
  184. if (email) {
  185. $.post('/index/ajax/send_reg', {email}, function (data) {
  186. if (data.code != 200) {
  187. alert(data.msg);
  188. } else {
  189. settime(60);
  190. }
  191. }, 'json');
  192. }
  193. });
  194. $('#sendcode1').click(function () {
  195. var mobile = $('#mobile').val();
  196. if (mobile) {
  197. $.post('/index/ajax/send_sms', {phone: mobile}, function (data) {
  198. if (data.code != 200) {
  199. alert(data.msg);
  200. } else {
  201. alert(data.msg);
  202. settime(60);
  203. }
  204. }, 'json');
  205. }
  206. });
  207. $("#submitButton").click(function () {
  208. // 检查是否同意协议
  209. if (!$('#agreementCheckbox').hasClass('checked')) {
  210. alert('请先阅读并同意服务协议和隐私政策');
  211. return;
  212. }
  213. var nickname = $("#nickname").val();
  214. var email = $("#email").val();
  215. var mobile = $("#mobile").val();
  216. var code = $("#code" + regtype).val();
  217. var seccode = $("#seccode").val();
  218. var password = $("#password").val();
  219. var repassword = $("#repassword").val();
  220. var pid = "<?php echo $this->action;?>";
  221. $.post("/index/ajax/reg", {
  222. pid, nickname, mobile, email, code, seccode, password, repassword, regtype
  223. },
  224. function (data) {
  225. if (data.code != 200) {
  226. alert(data.msg);
  227. } else {
  228. alert('注册成功', function () {
  229. top.location.href = '/index/apps/apps';
  230. });
  231. }
  232. }, 'json');
  233. });
  234. });
  235. </script>
  236. <?php
  237. $this->footer();
  238. ?> </body>
  239. </html>
  240. <?php
  241. }
  242. }