reg.php 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. ?> <script>
  27. function update_seccode() {
  28. document.getElementById('img_seccode').src = '<?php echo IN_PATH;?>index/seccode?' + Math.random();
  29. }
  30. </script>
  31. <style>
  32. .tit {
  33. display: table;
  34. width: 100%;
  35. }
  36. .tit a {
  37. line-height: 35px;
  38. font-size: 15px;
  39. display: table-cell;
  40. width: 48%;
  41. text-align: center;
  42. border-bottom: 2px solid beige;
  43. }
  44. .tit a.active {
  45. font-size: 18px;
  46. color: #333;
  47. border-bottom: 2px solid #fff;
  48. }
  49. .index1 {
  50. display: block;
  51. }
  52. </style>
  53. </head>
  54. <body>
  55. <?php
  56. $this->header();
  57. ?> <div class="login-common register-common">
  58. <div class="tit"><div class="active">账户注册</div></div>
  59. <div class="form-container">
  60. <div class="form-inner">
  61. <form action="" method="post">
  62. <input type="password" style="position: absolute;top: -999px">
  63. <div class="form-group">
  64. <label class="iconfont icon-user" for="a"></label>
  65. <input type="text" class="form-control input-lg" id="nickname" placeholder="请输入您的用户名">
  66. <span class="help-block">请输入正确的用户名</span>
  67. </div>
  68. <div class="form-group index index1">
  69. <label class="iconfont icon-tel" for="a"></label>
  70. <input class="form-control input-lg" placeholder="手机号码" type="text" id="mobile">
  71. <span class="help-block">请输入正确的手机号码</span>
  72. </div>
  73. <?php
  74. if (IN_SMS == 1) {
  75. ?> <div class="form-group index index1">
  76. <label class="iconfont icon-dunpai"></label>
  77. <div class="clearfix verification-code">
  78. <input type="text" class="form-control input-lg fl" id="code1"
  79. placeholder="请输入手机验证码">
  80. <button id="sendcode1" type="button" class="ms-btn ms-btn-primary input-lg fr">
  81. 获取验证码
  82. </button>
  83. </div>
  84. <span class="help-block">请输入正确的验证码</span>
  85. </div>
  86. <?php
  87. }
  88. ?> <div class="form-group">
  89. <label class="iconfont icon-pwd" for="c"></label>
  90. <input class="form-control input-lg" placeholder="请输入密码,密码长度不能少于6位" type="password"
  91. id="password">
  92. <span class="help-block">密码不正确</span>
  93. </div>
  94. <div class="form-group">
  95. <label class="iconfont icon-pwd" for="c"></label>
  96. <input class="form-control input-lg" placeholder="请再次输入你的密码" type="password"
  97. id="repassword">
  98. <span class="help-block">两次密码不一致</span>
  99. </div>
  100. <div class="form-group" style="display:none">
  101. <label class="iconfont icon-dunpai"></label>
  102. <div class="clearfix verification-code">
  103. <input class="form-control input-lg fl" value="1234" placeholder="请输入图形验证码" type="text" id="seccode"
  104. maxlength="4">
  105. <img id="img_seccode" onclick="update_seccode()" style="float:right"
  106. src="/index/seccode" height="46" width="27%">
  107. </div>
  108. </div>
  109. </div>
  110. <div class="checkbox">
  111. <input type="checkbox" checked>
  112. <span>我已阅读并同意<a href="/index/about/agreement" target="_blank" class="color-hover">《服务协议》</a>及<a
  113. href="/index/about/privacy" target="_blank" class="color-hover">《隐私政策》</a></span>
  114. </div>
  115. </div>
  116. <button type="button" id="submitButton" class="ms-btn ms-btn-primary input-lg btn-register">注册</button>
  117. <div class="text-center to-login">
  118. 已有账号,<a href="<?php echo IN_PATH;?>index/login" class="color-hover">点击登录</a>
  119. </div>
  120. </form>
  121. </div>
  122. <script>
  123. $(function () {
  124. function settime(countdown) {
  125. if (countdown == 0) {
  126. $('#sendcode' + regtype).attr("disabled", false);
  127. $('#sendcode' + regtype).html("获取验证码");
  128. countdown = 60;
  129. return;
  130. } else {
  131. $('#sendcode' + regtype).attr("disabled", true);
  132. $('#sendcode' + regtype).html("重新发送(" + countdown + ")");
  133. countdown--;
  134. }
  135. setTimeout(function () {
  136. settime(countdown)
  137. }, 1000)
  138. }
  139. var regtype = 1;
  140. $('.tit a').click(function () {
  141. $(this).addClass('active').siblings().removeClass('active');
  142. $('.index').hide();
  143. regtype = $(this).index()
  144. $('.index' + regtype).show();
  145. });
  146. $('#sendcode0').click(function () {
  147. var email = $('#email').val();
  148. if (email) {
  149. $.post('/index/ajax/send_reg', {email}, function (data) {
  150. if (data.code != 200) {
  151. alert(data.msg);
  152. } else {
  153. settime(60);
  154. }
  155. }, 'json');
  156. }
  157. });
  158. $('#sendcode1').click(function () {
  159. var mobile = $('#mobile').val();
  160. if (mobile) {
  161. $.post('/index/ajax/send_sms', {phone: mobile}, function (data) {
  162. if (data.code != 200) {
  163. alert(data.msg);
  164. } else {
  165. alert(data.msg);
  166. settime(60);
  167. }
  168. }, 'json');
  169. }
  170. });
  171. $("#submitButton").click(function () {
  172. var nickname = $("#nickname").val();
  173. var email = $("#email").val();
  174. var mobile = $("#mobile").val();
  175. var code = $("#code" + regtype).val();
  176. var seccode = $("#seccode").val();
  177. var password = $("#password").val();
  178. var repassword = $("#repassword").val();
  179. var pid = "<?php echo $this->action;?>";
  180. $.post("/index/ajax/reg", {
  181. pid, nickname, mobile, email, code, seccode, password, repassword, regtype
  182. },
  183. function (data) {
  184. if (data.code != 200) {
  185. alert(data.msg);
  186. } else {
  187. alert('注册成功', function () {
  188. top.location.href = '/index/apps/apps';
  189. });
  190. }
  191. }, 'json');
  192. });
  193. });
  194. </script>
  195. <?php
  196. $this->footer();
  197. ?> </body>
  198. </html>
  199. <?php
  200. }
  201. }