register.blade.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!DOCTYPE html>
  2. <html class="bg-white">
  3. <head>
  4. <meta charset="utf-8">
  5. <!--此行代码为禁止苹果手机自动识别电话号码-->
  6. <meta name="format-detection" content="telephone=no">
  7. <meta name="viewport"
  8. content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
  9. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  10. <title>注册</title>
  11. <link rel="stylesheet" type="text/css" href="{{asset('home/css/home.css')}}"/>
  12. <link rel="stylesheet" type="text/css" href="{{asset('home/css/style/edit.css')}}"/>
  13. <link rel="stylesheet" type="text/css" href="{{asset('home/css/alert.css')}}"/>
  14. <script src="{{asset('home/script/jQuery-2.2.0.min.js')}}"></script>
  15. <script src="{{asset('home/script/alert.js')}}"></script>
  16. <script src="{{asset('home/script/vue.js')}}"></script>
  17. <style>
  18. [v-cloak] {
  19. display: none;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div id="app" v-cloak>
  25. <div class="mui-content">
  26. <ul class="edit-list edit-list-4">
  27. <li>
  28. <div class="edit-list-con">
  29. <label>推 荐 人</label>
  30. <div class="edit-list-inp">
  31. <input type="text" v-model="invitation_code1" placeholder="邀请码或推荐人手机号码"/>
  32. </div>
  33. </div>
  34. </li>
  35. <li>
  36. <div class="edit-list-con">
  37. <label>手机账号</label>
  38. <div class="edit-list-inp">
  39. <input type="number" v-model="phone" placeholder="请输入手机号码"/>
  40. </div>
  41. </div>
  42. </li>
  43. <li>
  44. <div class="edit-list-con">
  45. <label>设置密码</label>
  46. <div class="edit-list-inp edit-list-icon">
  47. <input type="password" id="password" v-model="password" placeholder="请设置登录密码"/>
  48. <i @click="tgtype(2)" class="art-icon icon-nolook"></i>
  49. </div>
  50. </div>
  51. </li>
  52. <li>
  53. <div class="edit-list-con">
  54. <label>短信验证</label>
  55. <div class="edit-list-inp edit-list-msg">
  56. <input type="number" v-model="code" placeholder="请输入验证码"/>
  57. <div class="edit-list-btn" v-if="codedaojishinum*1<=0" @click="codedaojishiftel()">发送短信
  58. </div>
  59. <div class="edit-list-btn" v-else>
  60. <div>@{{codedaojishinum+' s'}}</div>
  61. </div>
  62. </div>
  63. </div>
  64. </li>
  65. </ul>
  66. <div class="edit-ft">
  67. <button class="edit-ft-btn edit-ft-btn-1" @click="submitform()" >确认注册</button>
  68. </div>
  69. <div class="edit-link">
  70. <div class="edit-link-l">
  71. 已有账号?&nbsp;&nbsp;
  72. <div class="edit-link-con" onclick="<?php echo url('down');?>">下载app</div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <!--加载动画样式-->
  78. <div id="allload" class="mine-dialog" v-cloak>
  79. <div class="loader-inner ball-spin-fade-loader">
  80. <div></div>
  81. <div></div>
  82. <div></div>
  83. <div></div>
  84. <div></div>
  85. <div></div>
  86. <div></div>
  87. <div></div>
  88. </div>
  89. </div>
  90. </div>
  91. <script>
  92. var daojishiintevaltel = null;
  93. $(function () {
  94. /**
  95. * vue 数据绑定
  96. */
  97. var vm = new Vue({
  98. el: '#app',
  99. data: {
  100. codedaojishinum: 0,
  101. //数据集
  102. is_loading: true,
  103. is_ajax: false,
  104. invitation_code1: '<?php echo $parent_id;?>',
  105. phone: '',
  106. code: '',
  107. password: ''
  108. },
  109. methods: {
  110. submitform: function () {
  111. if (this.is_ajax) {
  112. return false;
  113. }
  114. this.is_ajax = true;
  115. $.post('<?php echo url('/member/register')?>', {
  116. mobile: this.phone,
  117. password: this.password,
  118. invite_code: this.invitation_code1,
  119. sms: this.code,
  120. 'type': 'register_code'
  121. }, function (datas) {
  122. vm.is_ajax = false;
  123. if (datas.code == 1) {
  124. location.href = "<?php echo url('down');?>";
  125. }
  126. alert(datas.msg);
  127. }, 'json');
  128. },
  129. codedaojishiftel: function () {//发送验证码倒计时
  130. if (this.codedaojishinum > 0)return false;
  131. $.post('<?php echo url('/send/sms');?>', {
  132. 'type': 'register_code',
  133. phone: this.phone
  134. }, function (datas) {
  135. if (datas.code != 1) {
  136. vm.codedaojishinum = 0;
  137. } else {
  138. vm.codedaojishinum = 60;
  139. daojishiintevaltel = setInterval(function () {
  140. --vm.codedaojishinum;
  141. if (codedaojishi <= 0) {
  142. clearInterval(daojishiintevaltel);
  143. }
  144. }, 1000);
  145. }
  146. alert(datas.msg);
  147. }, 'json');
  148. },
  149. tgtype: function (num) {
  150. var itype = $("#password").attr("type");
  151. if (itype == "password") {
  152. $("#password").attr("type", "text");
  153. $(".edit-list li").eq(num).find("i").removeClass("icon-nolook").addClass("icon-openeyes");
  154. } else {
  155. $("#password").attr("type", "password");
  156. $(".edit-list li").eq(num).find("i").removeClass("icon-openeyes").addClass("icon-nolook");
  157. }
  158. },
  159. format: function (timestamp) {
  160. //timestamp是整数,否则要parseInt转换,不会出现少个0的情况
  161. var date = new Date(timestamp * 1000);
  162. var y = 1900 + date.getYear();
  163. var d_m = "0" + (date.getMonth() * 1 + 1);
  164. var d = "0" + date.getDate();
  165. var h = "0" + date.getHours();
  166. var m = "0" + date.getMinutes();
  167. var s = "0" + date.getSeconds();
  168. return y + "-" + d_m.substring(d_m.length - 2, d_m.length) + "-" + d.substring(d.length - 2, d.length);
  169. // return y.substring(y.length - 2, y.length) + "." + d_m.substring(d_m.length - 2, d_m.length) + "." + d.substring(d.length - 2, d.length);
  170. },
  171. },
  172. watch: {
  173. //数据监测函数
  174. },
  175. created: function () {
  176. //加载触发函数
  177. }
  178. });
  179. })
  180. </script>
  181. </body>
  182. </html>