register_h5.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. {extend name='public/base'}
  2. {block name="title"}
  3. <title>注册</title>
  4. <meta name="keywords" content=""/>
  5. <meta name="description" content=""/>
  6. {/block}
  7. {block name="css"}
  8. <link rel="stylesheet" href="__H5CSS__/user.css">
  9. <script src="__H5JS__/code.js"></script>
  10. {/block}
  11. {block name="style"}
  12. <style>
  13. .register-box ._nc .stage1 .slider {left: 0;right: 0;}
  14. .register-box ._nc .stage1 {height: 48px;}
  15. .register-box ._nc .stage1 .slider {height: 48px;box-shadow: none;border: 1px solid #ddd;overflow: hidden;left: 1px;right: 1px;border-radius: 48px;}
  16. .register-box ._nc .stage1 .track div, ._nc .stage1 .label {line-height: 52px;height: 48px;}
  17. .register-box ._nc .stage1 .button {width: 52px;height: 48px;background: #f9f9f9;}
  18. </style>
  19. {/block}
  20. {block name="content"}
  21. <div class="ect-wrapper user-register" id="form">
  22. <!-- <div class="logo"><img src="__H5IMAGE__/user/kefu.png" style="position: fixed;right: 60px;top: 60px;width: 80px;height: 80px;" onclick="kefuact()"></div>-->
  23. <div class="logo"><img src="__H5IMAGE__/user/ic_dl_logo@3x.png"></div>
  24. <div class="register-box">
  25. <p class="title">{$info.name}注册</p>
  26. <div class="input-box">
  27. <input placeholder="请输入用户名" type="text" v-model.trim="username" id="user_name" required="required">
  28. </div>
  29. <div class="input-box">
  30. <img src="__H5IMAGE__/user/ic_phone@3x.png" style="width: 12px;height: 18px;">
  31. <input placeholder="请输入手机号" type="number" v-model.number="mobile" id="mobile" required="required">
  32. </div>
  33. <div class="input-box code">
  34. <input placeholder="请输入验证码" type="text" maxlength="6" v-model="code" required="required">
  35. <span class="send-code send-message">获取验证码</span>
  36. <div style="line-height: 18px;margin-top: 8px;">
  37. <span class="content" style="color: #FF6E2B;font-size: 12px;line-height: 18px;">提示:如若短信验证码发送成功,因运营商原因稍会有延迟,请确定手机号码不在欠费停机状态,以及信号良好情况如果一直没收到请联系客服!</span>
  38. </div>
  39. </div>
  40. <br>
  41. <br>
  42. <div id="__nc" style="margin-top: 50px;margin-left:auto;margin-right:auto;width:100%;height:48px;margin-bottom: 2rem;">
  43. <div id="nc" style="width: 100%;"></div>
  44. </div>
  45. <input type="hidden" id="verify" value="">
  46. <div class="input-box code">
  47. <input placeholder="请输入邀请码" id="invite_code" type="text" v-model.trim="invite_code" required="required">
  48. </div>
  49. <div class="input-box passed">
  50. <img src="__H5IMAGE__/user/ic_close_eyes@3x.png" @click="show_password">
  51. <input placeholder="密码至少8位,必须包含数字/字母" type="password" v-model.trim="password" required="required">
  52. </div>
  53. </div>
  54. <div class="user-agreement">
  55. <var class="ect-click-ico" @click="setXy" style="height: 12px;display: inline-block;vertical-align: sub;"><i></i></var>
  56. <span class="content">注册即代表您已同意<var onclick="redirect('userAgreementInfo')">《用户协议》</var>和<var
  57. onclick="redirect('privateInfo')">《隐私政策》</var></span>
  58. </div>
  59. <!-- <div id="downapp" class="user-agreement">-->
  60. <!-- <span class="content">app下载地址(请复制用浏览器打开):http://api.meikangjw.com/api/downapp</span>-->
  61. <!-- </div>-->
  62. <div class="click-btn"><a href="javascript:void(0)" style="background-color: rgb(233,26,33)" @click="register">注册</a></div>
  63. </div>
  64. {/block}
  65. {block name="footer"}
  66. {/block}
  67. {block name="script"}
  68. <script type="text/javascript" charset="utf-8" src="//g.alicdn.com/sd/nch5/index.js?t=2015052012"></script>
  69. <script>
  70. var registerVue = new Vue({
  71. el: '#form',
  72. data: {
  73. mobile: '', // 电话
  74. code: '', //验证码
  75. invite_code: "{$code|default=''}", // 邀请码
  76. password: '', // 密码
  77. xy: '', // 协议
  78. username:''
  79. },
  80. mounted() {
  81. if (this.invite_code) {
  82. $('#invite_code').attr('disabled', 'true');
  83. }
  84. },
  85. methods: {
  86. register: function () {
  87. var appdownurl = "{$downappurl}";
  88. if (!this.mobile) {
  89. layer.msg('电话不能为空');
  90. return false;
  91. }
  92. if (!this.code) {
  93. layer.msg('验证码不能为空');
  94. return false;
  95. }
  96. if (!this.invite_code) {
  97. layer.msg('邀请码不能为空');
  98. return false;
  99. }
  100. if (!this.password) {
  101. layer.msg('密码不能为空');
  102. return false;
  103. }
  104. if (!this.xy) {
  105. layer.msg('请勾选协议');
  106. return false;
  107. }
  108. axios
  109. .post('registerH5web', {
  110. mobile: this.mobile,
  111. code: this.code,
  112. invite_code: this.invite_code,
  113. password: this.password,
  114. xy: this.xy,
  115. user_name: this.username
  116. })
  117. .then(function (result) {
  118. if (result.data.code == 200) {
  119. setTimeout(function () {
  120. location.href = appdownurl;
  121. // $('#downapp').attr('hidden', 'false');
  122. }, 500)
  123. }
  124. layer.msg(result.data.msg);
  125. })
  126. .catch(function (error) {
  127. layer.msg('注册失败');
  128. })
  129. },
  130. setXy: function (even) {
  131. var obj = even.currentTarget; // 当前选择对象
  132. $(obj).toggleClass('on');
  133. if ($(obj).hasClass('on')) {
  134. this.xy = 1;
  135. } else {
  136. this.xy = '';
  137. }
  138. },
  139. show_password: function (even) {
  140. var obj = even.currentTarget; // 当前选择对象
  141. $(obj).toggleClass('on');
  142. if ($(obj).hasClass('on')) {
  143. $(obj).attr('src', '__IMAGE__/user/ic_dlzc_eyes@3x.png').next().attr('type', 'text');
  144. } else {
  145. $(obj).attr('src', '__IMAGE__/user/ic_close_eyes@3x.png').next().attr('type', 'password');
  146. }
  147. }
  148. },
  149. });
  150. /**
  151. * 发送短信
  152. */
  153. new CatRegister('h5_register', 'register');
  154. /**
  155. * 人机验证
  156. */
  157. var appkey = "{$appkey}";
  158. var scene = "{$scene}";
  159. var nc_token = [appkey, (new Date()).getTime(), Math.random()].join(':');
  160. var nc = NoCaptcha.init({
  161. renderTo: '#nc',
  162. appkey: 'FFFF0N0000000000A9E1',
  163. scene: 'nc_message_h5',
  164. token: nc_token,
  165. trans: {"key1": "code200"},
  166. elementID: ["usernameID"],
  167. is_Opt: 0,
  168. language: "cn",
  169. timeout: 10000,
  170. retryTimes: 5,
  171. errorTimes: 5,
  172. inline: false,
  173. apimap: {
  174. // 'analyze': '//a.com/nocaptcha/analyze.jsonp',
  175. // 'uab_Url': '//aeu.alicdn.com/js/uac/909.js',
  176. },
  177. bannerHidden: false,
  178. initHidden: false,
  179. callback: function (data) {
  180. var arr = {
  181. nc_token: nc_token,
  182. csessionid: data.csessionid,
  183. sig: data.sig,
  184. appkey: appkey,
  185. scene: scene
  186. };
  187. var verify = JSON.stringify(arr);
  188. $('#verify').val(verify);
  189. },
  190. error: function (s) {
  191. }
  192. });
  193. NoCaptcha.setEnabled(true);
  194. nc.reset();//请务必确保这里调用一次reset()方法
  195. NoCaptcha.upLang('cn', {
  196. 'LOADING': "加载中...",//加载
  197. 'SLIDER_LABEL': "请向右滑动验证",//等待滑动
  198. 'CHECK_Y': "验证通过",//通过
  199. 'ERROR_TITLE': "非常抱歉,这出错了...",//拦截
  200. 'CHECK_N': "验证未通过", //准备唤醒二次验证
  201. 'OVERLAY_INFORM': "经检测你当前操作环境存在风险,请输入验证码",//二次验证
  202. 'TIPS_TITLE': "验证码错误,请重新输入"//验证码输错时的提示
  203. });
  204. function kefuact(){
  205. location.href = 'https://live.easyliao.com/live/chat.do?c=27923&g=62563&config=93894';
  206. }
  207. </script>
  208. {/block}
  209. {block name="share"}{/block}