opendemo.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <?php
  2. /* @var $this \yii\web\View */
  3. use yii\helpers\Url;
  4. $this->title = '模拟账户申请';
  5. ?>
  6. <?php $this->beginBlock('header_script'); ?>
  7. <style>
  8. .cover {
  9. width: 100%;
  10. height: 190px;
  11. }
  12. .fileinput-button {
  13. position: relative;
  14. display: inline-block;
  15. overflow: hidden;
  16. width: 100%;
  17. height: 190px;
  18. text-align: center;
  19. border: 1px solid #DDD;
  20. }
  21. .fileinput-button .s {
  22. margin-top: 60px;
  23. font-size: 40px;
  24. }
  25. .fileinput-button input {
  26. position: absolute;
  27. right: 0px;
  28. top: 0px;
  29. opacity: 0;
  30. -ms-filter: 'alpha(opacity=0)';
  31. font-size: 100em;
  32. }
  33. .success {
  34. display: none;
  35. margin: 100px 0px;
  36. text-align: center;
  37. }
  38. .success h1 {
  39. color: #1ab394;
  40. }
  41. .wx {
  42. margin: 50px;
  43. text-align: center;
  44. }
  45. .icheckbox_square-green label.error {
  46. position: absolute;
  47. white-space: nowrap;
  48. top: 0;
  49. left: 190px;
  50. }
  51. .icheckbox_square-green input.error {
  52. background-color: #FBE3E4;
  53. }
  54. </style>
  55. <?php $this->endBlock(); ?>
  56. <div class="ibox">
  57. <div class="ibox-title">
  58. <h2>模拟账户申请</h2>
  59. </div>
  60. <div class="ibox-content">
  61. <form id="form">
  62. <input type='hidden' name='token' value='1950354260442222285'/>
  63. <div class="row">
  64. <div class="col-sm-7 b-r">
  65. <div id="result" class="success">
  66. <h1><i class="fa fa-check"></i>恭喜,账户申请成功!</h1>
  67. <p id="loginMsg"></p>
  68. </div>
  69. <div id="req">
  70. <div class="form-group"><label>姓名 *</label>
  71. <input name="name" type="text" placeholder="您的姓名" class="form-control">
  72. </div>
  73. <div class="form-group">
  74. <label>电子邮箱 *</label>
  75. <input id="email" name="email" type="text" placeholder="您的电子邮箱" class="form-control">
  76. </div>
  77. <div class="form-group">
  78. <label>手机号码 *</label>
  79. <input id="mobile" name="mobile" type="text" placeholder="您的手机号码" class="form-control">
  80. </div>
  81. <div class="form-group">
  82. <label>金额</label>
  83. <input type="text" class="form-control" value="100000" readonly>
  84. </div>
  85. <div class="form-group">
  86. <label>杠杆</label>
  87. <select name="level" class="form-control select22">
  88. <option value="100">1:100</option>
  89. <option value="200">1:200</option>
  90. </select>
  91. </div>
  92. <div class="form-group">
  93. <label>
  94. <input name="agree" type="checkbox" class="i-checks">
  95. 我已阅读和同意<a href="<?= Url::to(['agreement']) ?>" target="_blank">《用户协议》</a>
  96. </label>
  97. </div>
  98. <div class="form-group">
  99. <button id="submit" class="btn btn-lg btn-primary" type="button">
  100. <strong>提交申请</strong>
  101. </button>
  102. </div>
  103. </div>
  104. </div>
  105. <!--<div class="col-sm-5">
  106. <div class="wx">
  107. <div class="qrcode" id="qrcode"></div>
  108. <h3>扫一扫,使用微信开户</h3>
  109. </div>
  110. </div>-->
  111. </div>
  112. </form>
  113. </div>
  114. </div>
  115. <?php $this->beginBlock('footer_script'); ?>
  116. <script src="<?= STATIC_URL ?>/ui/js/jquery-qrcode-0.14.0.min.js"></script>
  117. <script>
  118. jQuery('#qrcode').qrcode({
  119. render: 'image',
  120. correctLevel: 0,
  121. text: '<?= Url::current([], true) ?>',
  122. size: 200,
  123. background: '#FFF'
  124. });
  125. function readFile0(obj) {
  126. var file = obj.files[0];
  127. if (!/image\/\w+/.test(file.type)) {
  128. return false
  129. }
  130. var reader = new FileReader();
  131. reader.readAsDataURL(file);
  132. reader.onload = function (e) {
  133. $('#cover0').attr('src', this.result)
  134. }
  135. }
  136. function readFile1(obj) {
  137. var file = obj.files[0];
  138. if (!/image\/\w+/.test(file.type)) {
  139. return false
  140. }
  141. var reader = new FileReader();
  142. reader.readAsDataURL(file);
  143. reader.onload = function (e) {
  144. $('#cover1').attr('src', this.result)
  145. }
  146. }
  147. var wait = 120;
  148. function time() {
  149. if (wait == 0) {
  150. $('#sendSms').html('获取验证码');
  151. wait = 120
  152. } else {
  153. $('#sendSms').html(wait + '秒后重试');
  154. wait--;
  155. setTimeout(function () {
  156. time()
  157. }, 1000)
  158. }
  159. }
  160. function sendSms() {
  161. if ($('#mobile').val().length == 11) {
  162. $.ajax({
  163. type: 'POST',
  164. url: '<?= Url::to(['sendsms']) ?>',
  165. data: {
  166. mobile: $('#mobile').val()
  167. },
  168. dataType: 'json',
  169. beforeSend: function () {
  170. },
  171. success: function (data) {
  172. if (data.isSuccess) {
  173. time()
  174. } else {
  175. toastr.error(data.msg, '提示')
  176. }
  177. },
  178. complete: function (XMLHttpRequest, textStatus) {
  179. },
  180. error: function () {
  181. }
  182. })
  183. } else {
  184. return;
  185. }
  186. }
  187. $(document).ready(function () {
  188. $('#form').validate({
  189. rules: {
  190. 'name': {
  191. required: true
  192. },
  193. 'email': {
  194. required: true,
  195. email: true
  196. },
  197. 'mobile': {
  198. required: true
  199. },
  200. 'level': {
  201. required: true
  202. },
  203. 'agree': {
  204. required: true
  205. }
  206. }
  207. })
  208. });
  209. $('#submit').on('click', function () {
  210. if ($('#form').valid()) {
  211. $.ajax({
  212. type: 'POST',
  213. url: '<?= Url::to(['opendemosave']) ?>',
  214. data: $('#form').serialize(),
  215. dataType: 'json',
  216. beforeSend: function () {
  217. },
  218. success: function (data) {
  219. if (data.isSuccess) {
  220. $('#req').hide();
  221. $('#loginMsg').html(data.msg);
  222. $('#result').show();
  223. //toastr.success(data.msg, "提示");
  224. } else {
  225. toastr.error(data.msg, '提示')
  226. }
  227. },
  228. complete: function (XMLHttpRequest, textStatus) {
  229. },
  230. error: function () {
  231. }
  232. })
  233. }
  234. })
  235. </script>
  236. <?php $this->endBlock(); ?>