register.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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>
  14. (function () {
  15. if (!window.Promise) {
  16. document.writeln('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.min.js"><' + '/' + 'script>');
  17. }
  18. })();
  19. </script>
  20. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  21. <script src="../static/js/vender/bootstrap/js/bootstrap.min.js"></script>
  22. <script src="../static/js/vender/config.js"></script>
  23. <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.js"></script>
  24. <script src="../static/js/vender/crypto-js.js"></script>
  25. <script src="../static/js/vender/base64.js"></script>
  26. <script src="../static/js/vender/ase.js"></script>
  27. <script src="../static/js/vender/verify.js"></script>
  28. <script type="text/javascript" src="../static/js/vender/toastr/toastr.min.js"></script>
  29. </head>
  30. <body>
  31. <div class="top free-code-con" style="position:relative;">
  32. <div>
  33. <img src="../static/img/register/bg.png" alt="" class="bottom-img">
  34. <div class="user-info">
  35. <div class="head"><img src="" alt="" /></div>
  36. <div class="username"></div>
  37. <div class="txt">
  38. <div style="width: 2.97rem;"><img src="../static/img/register/tuoguan_icon.png" class="icon" alt="">7*24h智能托管
  39. </div>
  40. <div style="width: 1.76rem;"><img src="../static/img/register/haodian_icon.png" class="icon" alt="">0耗电</div>
  41. <div><img src="../static/img/register/liuliang_icon.png" class="icon" alt="">0流量</div>
  42. <div style="width: 2.97rem;"><img src="../static/img/register/wang_icon.png" class="icon" alt="">应用 24h 不断网
  43. </div>
  44. <div style="width: 1.76rem;"><img src="../static/img/register/shou_icon.png" class="icon" alt="">解放双手</div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="center-pic">
  49. <div class="recv-cont" id="recv_cont">
  50. <div style="position: relative;">
  51. <input type="tel" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码">
  52. <div class="tip">该手机号仅用于验证并绑定账号</div>
  53. </div>
  54. <div class="recv-btn" id="recv_btn">立即加入</div>
  55. <div id="mpanel2"></div>
  56. <div class="bottom">
  57. <div class="mb8">双子星</div>
  58. <div class="wl">云智能 · 享未来</div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <script type="text/javascript" th:inline="javascript">
  64. toastr.options = {
  65. positionClass: "toast-center-center",
  66. timeOut: 1500
  67. };
  68. var toast = toastr;
  69. var html = document.documentElement;
  70. var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
  71. var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
  72. var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
  73. $('#mpanel2').slideVerify({
  74. baseUrl: baseUrl + '/api/user', //服务器请求地址, 默认地址为安吉服务器;
  75. mode: 'pop', //展示模式
  76. containerId: 'recv_btn', //pop模式 必填 被点击之后出现行为验证码的元素id
  77. imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
  78. width: imgWidth,
  79. height: imgHeight
  80. },
  81. barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
  82. width: imgWidth,
  83. height: barHeight
  84. },
  85. beforeCheck: function () {
  86. var tel = $("#recv_ipt").val()
  87. if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(tel)) {
  88. stopManyClick(() => {
  89. toastr.error('请填写正确的手机号')
  90. })
  91. return false
  92. } else {
  93. return true
  94. }
  95. },
  96. ready: function () { }, //加载完毕的回调
  97. success: function (params) { //成功的回调
  98. // params为返回的二次验证参数 需要在接下来的实现逻辑回传服务器
  99. // 例如: login($.extend({}, params))
  100. var time = new Date().getTime()
  101. var data = {}
  102. data.userName = parameters['username'] ? parameters['username'] : null
  103. data.type = parameters['type'] ? parameters['type'] : null
  104. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  105. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  106. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  107. data.newPhone = $("#recv_ipt").val()
  108. data.captchaVerification = params.captchaVerification
  109. $.ajax({
  110. url: baseUrl + '/api/user/v1/promote',
  111. data: JSON.stringify(data),
  112. type: 'post',
  113. contentType: "application/json",
  114. dataType: 'json',
  115. cache: false,
  116. success: function (res) {
  117. if (res.status === 0) {
  118. toast.error('领取成功')
  119. $(window).attr('location', res.data);
  120. } else if (res.status === 1) {
  121. toast.error(res.msg)
  122. setTimeout(function () {
  123. $(window).attr('location', 'http://www.androidscloud.com');
  124. }, 1000)
  125. } else {
  126. toast.error(res.msg)
  127. }
  128. }
  129. })
  130. var Sys = {};
  131. var ua = navigator.userAgent.toLowerCase();
  132. var s, browserType;
  133. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  134. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  135. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  136. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  137. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  138. if (Sys.ie) {
  139. browserType = 'IE: ' + Sys.ie
  140. }
  141. if (Sys.firefox) {
  142. browserType = 'Firefox: ' + Sys.firefox
  143. }
  144. if (Sys.chrome) {
  145. browserType = 'Chrome: ' + Sys.chrome
  146. }
  147. if (Sys.opera) {
  148. browserType = 'Opera: ' + Sys.opera
  149. }
  150. if (Sys.safari) {
  151. browserType = 'Safari: ' + Sys.safari
  152. }
  153. var form = {
  154. platform: 4,
  155. visitType: 4,
  156. time: time,
  157. phoneNum: $("#recv_ipt").val(),
  158. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  159. browserType: browserType
  160. }
  161. var list = []
  162. list.push(form)
  163. // 推广页面下载埋点接口
  164. $.ajax({
  165. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  166. data: JSON.stringify(list),
  167. type: 'post',
  168. contentType: "application/json",
  169. dataType: 'json',
  170. cache: false,
  171. success: function (res) {
  172. }
  173. })
  174. },
  175. error: function () {
  176. console.log('error');
  177. } //失败的回调
  178. });
  179. var parameters = GetRequest();
  180. var phone = parameters["phone"];
  181. var timer, flag = true;
  182. $("#recv_ipt").val(phone ? phone : '');
  183. $("#recv_ipt").bind('input propertychange', function (e) {
  184. var ipt_phones = $('#recv_ipt').val();
  185. var c = $(this);
  186. if (/[^\d]/.test(c.val())) {//替换非数字字符
  187. var temp_amount = c.val().replace(/[^\d]/g, '');
  188. $(this).val(temp_amount);
  189. stopManyClick(() => {
  190. toastr.error('请填写正确的手机号')
  191. })
  192. }
  193. if (ipt_phones.length >= 12) {
  194. var recvstr = ipt_phones.substring(0, 11)
  195. $("#recv_ipt").val(recvstr);
  196. stopManyClick(() => {
  197. toastr.error('请填写正确的手机号')
  198. })
  199. }
  200. });
  201. function getUserInfo() {
  202. var userName = parameters['username'] ? parameters['username'] : null
  203. userName = Base64.decode(userName)
  204. $.ajax({
  205. url: baseUrl + '/api/user/v3/invitation/getNickname?username=' + userName,
  206. type: 'get',
  207. cache: false,
  208. dataType: 'text',
  209. success: function (res) {
  210. var result = JSON.parse(res)
  211. if (result.status === 0) {
  212. $(".username").text(result.data.nickName)
  213. getHead(result.data.fileId)
  214. }
  215. }
  216. })
  217. }
  218. function getHead(fileId) {
  219. $('.head img').attr('src', '../static/img/invite/header-img.png');
  220. var timestamp = new Date().getTime()
  221. var encrypts = encrypt(
  222. 'RuiChiSecurityGo' + timestamp,
  223. 'RuiChiSecurityGo'
  224. )
  225. var data = {
  226. keyType: 2,
  227. security: encrypts
  228. }
  229. $.ajax({
  230. url: 'https://wjzx.androidscloud.com:9091/file-center/fileOperate/getImage?id='+fileId,
  231. type: 'get',
  232. headers: data,
  233. xhrFields: { responseType: "blob" },
  234. cache: false,
  235. success: function (res) {
  236. var xhr = new XMLHttpRequest();
  237. var imageType = xhr.getResponseHeader("Content-Type");
  238. var blob = new Blob([res], { type: imageType });
  239. var imageUrl = (window.URL || window.webkitURL).createObjectURL(blob);
  240. $('.head img').attr('src', imageUrl);
  241. }
  242. })
  243. }
  244. function encrypt(word, keyStr) {
  245. keyStr = keyStr || 'RuiChiSecurityGo' // 判断是否存在ksy,不存在就用定义好的key
  246. var key = CryptoJS.enc.Utf8.parse(keyStr)
  247. var srcs = CryptoJS.enc.Utf8.parse(word)
  248. var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
  249. return encrypted.toString()
  250. }
  251. getUserInfo();
  252. function handleClick() {
  253. stopManyClick(result);
  254. }
  255. function result() {
  256. var time = new Date().getTime()
  257. var data = {}
  258. data.userName = parameters['username'] ? parameters['username'] : null
  259. data.type = parameters['type'] ? parameters['type'] : null
  260. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  261. toastr.options = {
  262. positionClass: "toast-center-center",
  263. timeOut: 1500
  264. };
  265. var ipt_phone = $('#recv_ipt').val();
  266. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  267. var res = validator.test(ipt_phone)
  268. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  269. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  270. if (!ipt_phone) {
  271. stopManyClick(() => {
  272. toastr.error('请填写正确的手机号')
  273. })
  274. } else if (!res) {
  275. stopManyClick(() => {
  276. toastr.error('请填写正确的手机号')
  277. })
  278. } else {
  279. data.newPhone = ipt_phone
  280. $.ajax({
  281. url: baseUrl + '/api/user/v1/promote',
  282. data: JSON.stringify(data),
  283. type: 'post',
  284. contentType: "application/json",
  285. dataType: 'json',
  286. cache: false,
  287. success: function (res) {
  288. if (res.status === 0) {
  289. toastr.error('领取成功')
  290. $(window).attr('location', res.data);
  291. } else if (res.status === 1) {
  292. toastr.error(res.msg)
  293. setTimeout(function () {
  294. $(window).attr('location', 'http://www.androidscloud.com/');
  295. }, 1000)
  296. } else {
  297. toastr.error(res.msg)
  298. }
  299. }
  300. })
  301. var Sys = {};
  302. var ua = navigator.userAgent.toLowerCase();
  303. var s, browserType;
  304. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  305. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  306. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  307. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  308. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  309. if (Sys.ie) {
  310. browserType = 'IE: ' + Sys.ie
  311. }
  312. if (Sys.firefox) {
  313. browserType = 'Firefox: ' + Sys.firefox
  314. }
  315. if (Sys.chrome) {
  316. browserType = 'Chrome: ' + Sys.chrome
  317. }
  318. if (Sys.opera) {
  319. browserType = 'Opera: ' + Sys.opera
  320. }
  321. if (Sys.safari) {
  322. browserType = 'Safari: ' + Sys.safari
  323. }
  324. var form = {
  325. platform: 4,
  326. visitType: 4,
  327. time: time,
  328. phoneNum: ipt_phone,
  329. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  330. browserType: browserType
  331. }
  332. var list = []
  333. list.push(form)
  334. // 推广页面下载埋点接口
  335. $.ajax({
  336. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  337. data: JSON.stringify(list),
  338. type: 'post',
  339. contentType: "application/json",
  340. dataType: 'json',
  341. cache: false,
  342. success: function (res) {
  343. }
  344. })
  345. }
  346. }
  347. /*
  348. function handleDownload() {
  349. $.ajax({
  350. url: baseUrl + '/api/user/promote/webUrl',
  351. type: 'get',
  352. cache: false,
  353. dataType: 'text',
  354. success: function (data) {
  355. var uri;
  356. if (data.startsWith('http')) {
  357. uri = data
  358. } else {
  359. uri = 'http://' + data
  360. }
  361. $(window).attr('location',uri);
  362. }
  363. })
  364. }
  365. */
  366. function visit() {
  367. $.ajax({
  368. url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  369. type: 'get',
  370. cache: false,
  371. dataType: 'text',
  372. success: function () {
  373. }
  374. })
  375. }
  376. visit()
  377. //防止提示一秒内重复显示
  378. function stopManyClick(fn) {
  379. if (flag) {
  380. fn();
  381. }
  382. flag = false;
  383. if (timer) { clearTimeout(timer); }
  384. timer = setTimeout(() => { flag = true }, 1500);
  385. }
  386. </script>
  387. </body>
  388. <style>
  389. #toast-container>.toast-error {
  390. background-image: none !important;
  391. }
  392. .toast-error {
  393. background-color: rgba(0, 0, 0, 0.8);
  394. }
  395. #toast-container>div {
  396. font-size: 14px;
  397. min-width: 80px !important;
  398. padding: 12px !important;
  399. box-shadow: none;
  400. }
  401. @media (max-width: 480px) and (min-width: 241px) {
  402. #toast-container>div {
  403. min-width: 80px !important;
  404. width: auto;
  405. }
  406. }
  407. @media only screen and (min-width: 640px) {
  408. .toast-center-center {
  409. top: 50%;
  410. left: 50%;
  411. transform: translate(-50%, -50%);
  412. }
  413. }
  414. @media only screen and (max-width: 640px) {
  415. .toast-center-center {
  416. top: 50%;
  417. left: 50%;
  418. transform: translate(-50%, -50%);
  419. }
  420. }
  421. input::-webkit-input-placeholder {
  422. color: #BBBBBB;
  423. }
  424. input::-moz-placeholder {
  425. /* Mozilla Firefox 19+ */
  426. color: #BBBBBB;
  427. }
  428. input:-moz-placeholder {
  429. /* Mozilla Firefox 4 to 18 */
  430. color: #BBBBBB;
  431. }
  432. input:-ms-input-placeholder {
  433. /* Internet Explorer 10-11 */
  434. color: #BBBBBB;
  435. }
  436. </style>
  437. </html>