register_new.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. @extends('muc_front.app.index')
  2. @section('lang', 'Zh-CN')
  3. @section('title')
  4. 注册
  5. @endsection
  6. @section('firstStyle')
  7. @endsection
  8. @section('style')
  9. <link rel="stylesheet" href="{{ asset('front/muc/css/style/login.css') }}" />
  10. @endsection
  11. @section('headerScript')
  12. <script type="text/javascript" src="{{ asset('front/muc/js/layer_mobile/layer.js') }}" ></script>
  13. <script type="text/javascript" src="{{ asset('front/muc/js/script/login.js?time='.time()) }}" ></script>
  14. <script src="https://www.yunpian.com/static/official/js/libs/riddler-sdk-0.2.2.js"></script>
  15. @endsection
  16. @section('footer-nav')
  17. @endsection
  18. @section('content')
  19. <div id="app">
  20. <header class="mui-bar mui-bar-nav">
  21. {{-- <a class="mui-icon mui-icon-left-nav mui-pull-left"></a>--}}
  22. <h1 class="mui-title">注册</h1>
  23. </header>
  24. <div class="mui-content">
  25. <div class="lg-form">
  26. <ul class="lg-list">
  27. <li>
  28. <i class="wk-icon icon-phone"></i>
  29. <input type="tel" id="phone" name="phone" placeholder="请输入绑定手机号码" />
  30. </li>
  31. <li>
  32. <i class="wk-icon icon-unlock"></i>
  33. <input type="password" id="password" name="password" placeholder="请设置登录密码" />
  34. </li>
  35. <li>
  36. <i class="wk-icon icon-unlock"></i>
  37. <input type="password" id="password_confirmation" name="password_confirmation" placeholder="请重复登录密码" />
  38. </li>
  39. <li>
  40. <i class="wk-icon icon-lock"></i>
  41. <input type="password" id="pay_password" name="pay_password" placeholder="请设置交易密码" />
  42. </li>
  43. <li>
  44. <i class="wk-icon icon-lock"></i>
  45. <input type="password" id="pay_password_confirmation" name="pay_password_confirmation" placeholder="请重复交易密码" />
  46. </li>
  47. <li id="yzmParent" class="lg-list-yzm">
  48. <i class="wk-icon icon-msg-o"></i>
  49. <input type="text" id="sms" name="sms" placeholder="请输入短信验证码" />
  50. <button data-url="{{ route('send.sms', ['type' => 'register_web']) }}" onclick="indentifying(this)" class="lg-list-btn">获取验证码</button>
  51. </li>
  52. <li>
  53. <i class="wk-icon icon-key"></i>
  54. <input type="text" id="referee_code" disabled="disabled" name="referee_code" value="{{ $code }}" placeholder="请输入邀请码(必填)" />
  55. </li>
  56. </ul>
  57. <input type="hidden" name="authenticate" id="authenticate">
  58. <input type="hidden" name="send_token_str" id="send_token_str">
  59. <div class="container" id="cbox">
  60. </div>
  61. <button class="lg-btn" id="btn-submit" type="button">注 册</button>
  62. <div class="lg-ft">
  63. 已有账户,<a href="{{ route('front.m.down') }}">下载APP</a>
  64. </div>
  65. </div>
  66. </div>
  67. @endsection
  68. @section('bodyScript')
  69. <script>
  70. var slider1 = null;
  71. function postajax(apiurl, datastr, successfun) {
  72. $.ajax({
  73. type: "post",
  74. url: apiurl,
  75. dataType: 'json',
  76. data: datastr,
  77. success: function(data) {
  78. // alert(JSON.stringify(data));
  79. if(data.code === 1) {
  80. successfun(data);
  81. } else {
  82. $("#btn-submit").attr('disabled', false);
  83. layer.open({
  84. content: data.msg
  85. ,skin: 'msg'
  86. ,time: 2 //2秒后自动关闭
  87. });
  88. }
  89. }
  90. });
  91. }
  92. $(function () {
  93. new YpRiddler({
  94. expired: 10,
  95. mode: 'dialog',
  96. winWidth: '100%',
  97. lang: 'zh-cn', // 界面语言, 目前支持: 中文简体 zh-cn, 英语 en
  98. // langPack: LANG_OTHER, // 你可以通过该参数自定义语言包, 其优先级高于lang
  99. container: document.getElementById('cbox'),
  100. appId: 'bbc2a879ad3a49ab85a32af808d3f687',
  101. version: 'v1',
  102. // noButton: true,
  103. onError: function(param) {
  104. if (param.code === 429) {
  105. utils.alert('请求过于频繁,请稍后再试!');
  106. }
  107. },
  108. onSuccess: function(validInfo, close) {
  109. // 成功回调
  110. is_captcha_verified = true;
  111. // console.log(validInfo.token);
  112. // console.log(validInfo.authenticate);
  113. // $('#smsBtn').trigger('click');
  114. $('#send_token_str').val(validInfo.token);
  115. $('#authenticate').val(validInfo.authenticate);
  116. close()
  117. },
  118. onFail: function(code, msg, retry) {
  119. // 失败回调
  120. retry()
  121. },
  122. beforeStart: function(next) {
  123. next()
  124. },
  125. afterStart: function() {
  126. $('.yp-riddler-mark').remove();
  127. }
  128. });
  129. $(document).on('click', '#btn-submit', function () {
  130. if($("#phone").val() == ""){
  131. layer.open({
  132. content: '请输手机账号!'
  133. ,skin: 'msg'
  134. ,time: 2 //2秒后自动关闭
  135. });
  136. }else{
  137. $("#btn-submit").attr('disabled', true);
  138. apiurl = "{{ route('front.auth.register.post') }}";
  139. datastr = {
  140. phone: $("#phone").val(),
  141. password: $("#password").val(),
  142. password_confirmation: $("#password_confirmation").val(),
  143. pay_password: $("#pay_password").val(),
  144. pay_password_confirmation: $("#pay_password_confirmation").val(),
  145. referee_code: $("#referee_code").val(),
  146. sms: $("#sms").val(),
  147. pc: "pc",
  148. type: "register_web",
  149. mac: "",
  150. _token: "{{ csrf_token() }}"
  151. };
  152. function successfun(data) {
  153. // var date = new Date();
  154. // var y = date.getTime();
  155. // var gqtk = y + (data.expires_in * 500);
  156. if( data.code <= 0 ){
  157. $("#btn-submit").attr('disabled', false);
  158. layer.open({
  159. content: data.msg
  160. ,skin: 'msg'
  161. ,time: 2 //2秒后自动关闭
  162. });
  163. return false;
  164. }
  165. layer.open({
  166. content: data.msg
  167. ,skin: 'msg'
  168. ,time: 2 //2秒后自动关闭
  169. });
  170. setTimeout(function(){
  171. $("#btn-submit").attr('disabled', false);
  172. window.location.href = data.data.redirect;
  173. },2000);
  174. }
  175. postajax(apiurl, datastr, successfun);//提交方法
  176. }
  177. // window.location.href = 'index.html';
  178. });
  179. });
  180. </script>
  181. @endsection