register.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>双子星</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  8. <link rel="stylesheet" href="../static/js/vender/bootstrap/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="../static/css/normalize.css">
  10. <link rel="stylesheet" href="../static/css/experience.css">
  11. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  12. <link rel="stylesheet" href="../static/css/verify.css">
  13. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  14. <script src="../static/js/vender/bootstrap/js/bootstrap.min.js"></script>
  15. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  16. <script src="../static/js/vender/config.js"></script>
  17. <script src="../static/js/vender/crypto-js.js"></script>
  18. <script src="../static/js/vender/base64.js"></script>
  19. <script src="../static/js/vender/verify.js"></script>
  20. <script src="../static/js/vender/ase.js"></script>
  21. <script>
  22. toastr.options.positionClass = 'toast-center-center';
  23. </script>
  24. </head>
  25. <body>
  26. <div id="mpanel2"></div>
  27. <div id="form-btn"></div>
  28. <div class="top free-code-con" style="position:relative;">
  29. <div>
  30. <img src="../static/img/register/bg.png" alt="" class="bottom-img">
  31. <div class="user-info">
  32. <div class="head"><img src="" alt="" /></div>
  33. <div class="username"></div>
  34. <div class="txt">
  35. <div style="width: 2.97rem;"><img src="../static/img/register/tuoguan_icon.png" class="icon" alt="">7*24h智能托管
  36. </div>
  37. <div style="width: 1.76rem;"><img src="../static/img/register/haodian_icon.png" class="icon" alt="">0耗电</div>
  38. <div><img src="../static/img/register/liuliang_icon.png" class="icon" alt="">0流量</div>
  39. <div style="width: 2.97rem;"><img src="../static/img/register/wang_icon.png" class="icon" alt="">应用 24h 不断网
  40. </div>
  41. <div><img src="../static/img/register/shou_icon.png" class="icon" alt="">解放双手</div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="center-pic">
  46. <div class="recv-cont" id="recv_cont">
  47. <div class="recv-wrap" style="position: relative;">
  48. <input type="tel" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码">
  49. <div class="tip">该手机号仅用于验证并绑定账号</div>
  50. </div>
  51. <div onclick="handleClick()" style="position: relative">
  52. <div class="recv-btn" id="recv_btn">立即加入</div>
  53. </div>
  54. <div class="bottom">
  55. <div class="mb8">双子星</div>
  56. <div class="wl">云智能 · 享未来</div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <script type="text/javascript" th:inline="javascript">
  62. var parameters = GetRequest();
  63. var phone = parameters["phone"];
  64. var timer, flag = true;
  65. var html = document.documentElement;
  66. var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
  67. var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
  68. var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
  69. $("#recv_ipt").val(phone ? phone : '');
  70. $("#recv_ipt").bind('input propertychange', function (e) {
  71. var ipt_phones = $('#recv_ipt').val();
  72. var c = $(this);
  73. if (/[^\d]/.test(c.val())) {//替换非数字字符
  74. var temp_amount = c.val().replace(/[^\d]/g, '');
  75. $(this).val(temp_amount);
  76. stopManyClick(() => {
  77. toastr.error('请填写正确的手机号')
  78. })
  79. }
  80. if (ipt_phones.length >= 12) {
  81. var recvstr = ipt_phones.substring(0, 11)
  82. $("#recv_ipt").val(recvstr);
  83. stopManyClick(() => {
  84. toastr.error('请填写正确的手机号')
  85. })
  86. }
  87. });
  88. visit();
  89. getUserInfo();
  90. function validate() {
  91. $('#mpanel2').slideVerify({
  92. baseUrl: baseUrl + '/api/activity', //服务器请求地址, 默认地址为安吉服务器;
  93. mode: 'pop', //展示模式
  94. containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
  95. imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
  96. width: imgWidth,
  97. height: imgHeight
  98. },
  99. barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
  100. width: imgWidth,
  101. height: barHeight
  102. },
  103. beforeCheck: () => {
  104. return true
  105. },
  106. ready: () => {
  107. }, //加载完毕的回调
  108. success: (params) => { //成功的回调
  109. setTimeout(() => {
  110. submit(params.captchaVerification);
  111. }, 1000)
  112. },
  113. error: function () { }
  114. });
  115. }
  116. function submit(captchaVerification) {
  117. var data = {}
  118. data.userName = parameters['username'] ? parameters['username'] : null
  119. data.type = parameters['type'] ? parameters['type'] : null
  120. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  121. data.newPhone = $('#recv_ipt').val();
  122. data.captchaVerification = captchaVerification;
  123. $.ajax({
  124. url: baseUrl + '/api/activity/v1/promote',
  125. data: JSON.stringify(data),
  126. type: 'post',
  127. contentType: "application/json",
  128. dataType: 'json',
  129. cache: false,
  130. success: function (res) {
  131. if (res.status === 0) {
  132. toastr.error('领取成功')
  133. $(window).attr('location', res.data);
  134. } else if (res.status === 1) {
  135. toastr.error(res.msg)
  136. setTimeout(function () {
  137. if (baseUrl.includes('prese.phone.androidscloud.com')) {
  138. $(window).attr('location', 'http://14.18.190.144:18888');
  139. } else {
  140. $(window).attr('location', 'http://www.androidscloud.com');
  141. }
  142. }, 1000)
  143. } else if (res.status === 11) {
  144. $('#mpanel2').eq(0).text('');
  145. validate(); // 生成验证码
  146. setTimeout(() => {
  147. document.getElementById('form-btn').click();
  148. }, 500)
  149. } else {
  150. toastr.error(res.msg)
  151. }
  152. }
  153. })
  154. }
  155. function getUserInfo() {
  156. var userName = parameters['username'] ? parameters['username'] : null
  157. userName = Base64.decode(userName)
  158. $.ajax({
  159. url: baseUrl + '/api/activity/v3/invitation/getNickname?username=' + userName,
  160. type: 'get',
  161. cache: false,
  162. dataType: 'text',
  163. success: function (res) {
  164. var result = JSON.parse(res)
  165. if (result.status === 0) {
  166. $(".username").text(result.data.nickName)
  167. getHead(result.data.fileId)
  168. }
  169. }
  170. })
  171. }
  172. function getHead(fileId) {
  173. $('.head img').attr('src', '../static/img/invite/header-img.png');
  174. if (fileId) {
  175. let urls = baseUrl == 'http://prese.phone.androidscloud.com' ? 'http://110.53.221.195:8210' : 'https://wjzx.androidscloud.com:9091';
  176. $('.head img').attr('src', `${urls}/document/newFile/download/0/347905r86eb745a1sc38?fileKey=` + fileId);
  177. }
  178. }
  179. function encrypt(word, keyStr) {
  180. keyStr = keyStr || 'RuiChiSecurityGo' // 判断是否存在ksy,不存在就用定义好的key
  181. var key = CryptoJS.enc.Utf8.parse(keyStr)
  182. var srcs = CryptoJS.enc.Utf8.parse(word)
  183. var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
  184. return encrypted.toString()
  185. }
  186. function handleClick() {
  187. stopManyClick(result);
  188. }
  189. function result() {
  190. var time = new Date().getTime()
  191. var data = {}
  192. data.userName = parameters['username'] ? parameters['username'] : null
  193. data.type = parameters['type'] ? parameters['type'] : null
  194. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  195. toastr.options = {
  196. positionClass: "toast-center-center",
  197. timeOut: 1500
  198. };
  199. var ipt_phone = $('#recv_ipt').val();
  200. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  201. var res = validator.test(ipt_phone)
  202. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  203. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  204. if (!ipt_phone) {
  205. stopManyClick(() => {
  206. toastr.error('请填写正确的手机号')
  207. })
  208. } else if (!res) {
  209. stopManyClick(() => {
  210. toastr.error('请填写正确的手机号')
  211. })
  212. } else {
  213. data.newPhone = ipt_phone
  214. $.ajax({
  215. url: baseUrl + '/api/activity/v1/promote',
  216. data: JSON.stringify(data),
  217. type: 'post',
  218. contentType: "application/json",
  219. dataType: 'json',
  220. cache: false,
  221. success: function (res) {
  222. if (res.status === 0) {
  223. toastr.error('领取成功')
  224. $(window).attr('location', res.data);
  225. } else if (res.status === 1) {
  226. toastr.error(res.msg)
  227. setTimeout(function () {
  228. $(window).attr('location', 'http://www.androidscloud.com/');
  229. }, 1000)
  230. } else if (res.status === '0011') {
  231. $('#mpanel2').eq(0).text('');
  232. validate(); // 生成验证码
  233. setTimeout(() => {
  234. document.getElementById('form-btn').click();
  235. }, 500)
  236. } else {
  237. toastr.error(res.msg)
  238. }
  239. }
  240. })
  241. }
  242. }
  243. // 邀请好友页面访问量统计埋点接口(仅分享好友下载页面调用)
  244. function visit() {
  245. $.ajax({
  246. url: baseUrl + '/api/user/v5/operateApi/addUserVisit',
  247. type: 'post',
  248. data: JSON.stringify({ "accessType": 2, "loginType": 2 }),
  249. contentType:"application/json",
  250. dataType: 'json',
  251. cache: false,
  252. success: function () {
  253. }
  254. })
  255. }
  256. // function visit() {
  257. // $.ajax({
  258. // url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  259. // type: 'get',
  260. // cache: false,
  261. // dataType: 'text',
  262. // success: function () {
  263. // }
  264. // })
  265. // }
  266. //防止提示一秒内重复显示
  267. function stopManyClick(fn) {
  268. if (flag) {
  269. fn();
  270. }
  271. flag = false;
  272. if (timer) { clearTimeout(timer); }
  273. timer = setTimeout(() => { flag = true }, 1500);
  274. }
  275. </script>
  276. </body>
  277. <style>
  278. #toast-container>.toast-error {
  279. background-image: none !important;
  280. }
  281. .toast-error {
  282. background-color: rgba(0, 0, 0, 0.8);
  283. }
  284. #toast-container>div {
  285. font-size: 14px;
  286. min-width: 80px !important;
  287. padding: 12px !important;
  288. box-shadow: none;
  289. }
  290. .toast-center-center {
  291. position: fixed;
  292. min-width: 220px;
  293. top: 50%;
  294. left: 50%;
  295. text-align: center;
  296. transform: translateX(-50%);
  297. color: #FFFFFF;
  298. border-radius: 0.2rem;
  299. }
  300. @media (max-width: 480px) and (min-width: 241px) {
  301. #toast-container>div {
  302. min-width: 80px !important;
  303. width: auto;
  304. }
  305. }
  306. @media only screen and (min-width: 640px) {
  307. .toast-center-center {
  308. top: 50%;
  309. left: 50%;
  310. transform: translate(-50%, -50%);
  311. }
  312. }
  313. @media only screen and (max-width: 640px) {
  314. .toast-center-center {
  315. top: 50%;
  316. left: 50%;
  317. transform: translate(-50%, -50%);
  318. }
  319. }
  320. input::-webkit-input-placeholder {
  321. color: #BBBBBB;
  322. }
  323. input::-moz-placeholder {
  324. /* Mozilla Firefox 19+ */
  325. color: #BBBBBB;
  326. }
  327. input:-moz-placeholder {
  328. /* Mozilla Firefox 4 to 18 */
  329. color: #BBBBBB;
  330. }
  331. input:-ms-input-placeholder {
  332. /* Internet Explorer 10-11 */
  333. color: #BBBBBB;
  334. }
  335. </style>
  336. </html>