register.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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. console.log(params);
  101. var time = new Date().getTime()
  102. var data = {}
  103. data.userName = parameters['username'] ? parameters['username'] : null
  104. data.type = parameters['type'] ? parameters['type'] : null
  105. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  106. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  107. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  108. data.newPhone = ipt_phone
  109. data.captchaVerification = params.captchaVerification
  110. $.ajax({
  111. url: baseUrl + '/api/user/v1/promote',
  112. data: JSON.stringify(data),
  113. type: 'post',
  114. contentType: "application/json",
  115. dataType: 'json',
  116. cache: false,
  117. success: function (res) {
  118. if (res.status === 0) {
  119. toast.error('领取成功')
  120. $(window).attr('location', res.data);
  121. } else if (res.status === 1) {
  122. toast.error(res.msg)
  123. setTimeout(function () {
  124. $(window).attr('location', 'http://www.androidscloud.com');
  125. }, 1000)
  126. } else {
  127. toast.error(res.msg)
  128. }
  129. }
  130. })
  131. var Sys = {};
  132. var ua = navigator.userAgent.toLowerCase();
  133. var s, browserType;
  134. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  135. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  136. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  137. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  138. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  139. if (Sys.ie) {
  140. browserType = 'IE: ' + Sys.ie
  141. }
  142. if (Sys.firefox) {
  143. browserType = 'Firefox: ' + Sys.firefox
  144. }
  145. if (Sys.chrome) {
  146. browserType = 'Chrome: ' + Sys.chrome
  147. }
  148. if (Sys.opera) {
  149. browserType = 'Opera: ' + Sys.opera
  150. }
  151. if (Sys.safari) {
  152. browserType = 'Safari: ' + Sys.safari
  153. }
  154. var form = {
  155. platform: 4,
  156. visitType: 4,
  157. time: time,
  158. phoneNum: ipt_phone,
  159. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  160. browserType: browserType
  161. }
  162. var list = []
  163. list.push(form)
  164. // 推广页面下载埋点接口
  165. $.ajax({
  166. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  167. data: JSON.stringify(list),
  168. type: 'post',
  169. contentType: "application/json",
  170. dataType: 'json',
  171. cache: false,
  172. success: function (res) {
  173. }
  174. })
  175. },
  176. error: function () {
  177. console.log('error');
  178. } //失败的回调
  179. });
  180. var parameters = GetRequest();
  181. var phone = parameters["phone"];
  182. var timer, flag = true;
  183. $("#recv_ipt").val(phone ? phone : '');
  184. $("#recv_ipt").bind('input propertychange', function (e) {
  185. var ipt_phones = $('#recv_ipt').val();
  186. var c = $(this);
  187. if (/[^\d]/.test(c.val())) {//替换非数字字符
  188. var temp_amount = c.val().replace(/[^\d]/g, '');
  189. $(this).val(temp_amount);
  190. stopManyClick(() => {
  191. toastr.error('请填写正确的手机号')
  192. })
  193. }
  194. if (ipt_phones.length >= 12) {
  195. var recvstr = ipt_phones.substring(0, 11)
  196. $("#recv_ipt").val(recvstr);
  197. stopManyClick(() => {
  198. toastr.error('请填写正确的手机号')
  199. })
  200. }
  201. });
  202. function getUserInfo() {
  203. var userName = parameters['username'] ? parameters['username'] : null
  204. userName = Base64.decode(userName)
  205. $.ajax({
  206. url: baseUrl + '/api/user/v3/invitation/getNickname?username=' + userName,
  207. type: 'get',
  208. cache: false,
  209. dataType: 'text',
  210. success: function (res) {
  211. var result = JSON.parse(res)
  212. if (result.status === 0) {
  213. $(".username").text(result.data.nickName)
  214. getHead(result.data.fileId)
  215. }
  216. }
  217. })
  218. }
  219. function getHead(fileId) {
  220. $('.head img').attr('src', '../static/img/invite/header-img.png');
  221. var timestamp = new Date().getTime()
  222. var encrypts = encrypt(
  223. 'RuiChiSecurityGo' + timestamp,
  224. 'RuiChiSecurityGo'
  225. )
  226. var data = {
  227. keyType: 2,
  228. security: encrypts
  229. }
  230. $.ajax({
  231. url: baseUrl + '/file-center/fileOperate/getImage?id=' + fileId,
  232. type: 'get',
  233. headers: data,
  234. xhrFields: { responseType: "blob" },
  235. cache: false,
  236. success: function (res) {
  237. var xhr = new XMLHttpRequest();
  238. var imageType = xhr.getResponseHeader("Content-Type");
  239. var blob = new Blob([res], { type: imageType });
  240. var imageUrl = (window.URL || window.webkitURL).createObjectURL(blob);
  241. $('.head img').attr('src', imageUrl);
  242. }
  243. })
  244. }
  245. function encrypt(word, keyStr) {
  246. keyStr = keyStr || 'RuiChiSecurityGo' // 判断是否存在ksy,不存在就用定义好的key
  247. var key = CryptoJS.enc.Utf8.parse(keyStr)
  248. var srcs = CryptoJS.enc.Utf8.parse(word)
  249. var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
  250. return encrypted.toString()
  251. }
  252. getUserInfo();
  253. function handleClick() {
  254. stopManyClick(result);
  255. }
  256. function result() {
  257. var time = new Date().getTime()
  258. var data = {}
  259. data.userName = parameters['username'] ? parameters['username'] : null
  260. data.type = parameters['type'] ? parameters['type'] : null
  261. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  262. toastr.options = {
  263. positionClass: "toast-center-center",
  264. timeOut: 1500
  265. };
  266. var ipt_phone = $('#recv_ipt').val();
  267. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  268. var res = validator.test(ipt_phone)
  269. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  270. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  271. if (!ipt_phone) {
  272. stopManyClick(() => {
  273. toastr.error('请填写正确的手机号')
  274. })
  275. } else if (!res) {
  276. stopManyClick(() => {
  277. toastr.error('请填写正确的手机号')
  278. })
  279. } else {
  280. data.newPhone = ipt_phone
  281. $.ajax({
  282. url: baseUrl + '/api/user/v1/promote',
  283. data: JSON.stringify(data),
  284. type: 'post',
  285. contentType: "application/json",
  286. dataType: 'json',
  287. cache: false,
  288. success: function (res) {
  289. if (res.status === 0) {
  290. toastr.error('领取成功')
  291. $(window).attr('location', res.data);
  292. } else if (res.status === 1) {
  293. toastr.error(res.msg)
  294. setTimeout(function () {
  295. $(window).attr('location', 'http://www.androidscloud.com/');
  296. }, 1000)
  297. } else {
  298. toastr.error(res.msg)
  299. }
  300. }
  301. })
  302. var Sys = {};
  303. var ua = navigator.userAgent.toLowerCase();
  304. var s, browserType;
  305. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  306. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  307. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  308. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  309. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  310. if (Sys.ie) {
  311. browserType = 'IE: ' + Sys.ie
  312. }
  313. if (Sys.firefox) {
  314. browserType = 'Firefox: ' + Sys.firefox
  315. }
  316. if (Sys.chrome) {
  317. browserType = 'Chrome: ' + Sys.chrome
  318. }
  319. if (Sys.opera) {
  320. browserType = 'Opera: ' + Sys.opera
  321. }
  322. if (Sys.safari) {
  323. browserType = 'Safari: ' + Sys.safari
  324. }
  325. var form = {
  326. platform: 4,
  327. visitType: 4,
  328. time: time,
  329. phoneNum: ipt_phone,
  330. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  331. browserType: browserType
  332. }
  333. var list = []
  334. list.push(form)
  335. // 推广页面下载埋点接口
  336. $.ajax({
  337. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  338. data: JSON.stringify(list),
  339. type: 'post',
  340. contentType: "application/json",
  341. dataType: 'json',
  342. cache: false,
  343. success: function (res) {
  344. }
  345. })
  346. }
  347. }
  348. /*
  349. function handleDownload() {
  350. $.ajax({
  351. url: baseUrl + '/api/user/promote/webUrl',
  352. type: 'get',
  353. cache: false,
  354. dataType: 'text',
  355. success: function (data) {
  356. var uri;
  357. if (data.startsWith('http')) {
  358. uri = data
  359. } else {
  360. uri = 'http://' + data
  361. }
  362. $(window).attr('location',uri);
  363. }
  364. })
  365. }
  366. */
  367. function visit() {
  368. $.ajax({
  369. url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  370. type: 'get',
  371. cache: false,
  372. dataType: 'text',
  373. success: function () {
  374. }
  375. })
  376. }
  377. visit()
  378. //防止提示一秒内重复显示
  379. function stopManyClick(fn) {
  380. if (flag) {
  381. fn();
  382. }
  383. flag = false;
  384. if (timer) { clearTimeout(timer); }
  385. timer = setTimeout(() => { flag = true }, 1500);
  386. }
  387. </script>
  388. </body>
  389. <style>
  390. #toast-container>.toast-error {
  391. background-image: none !important;
  392. }
  393. .toast-error {
  394. background-color: rgba(0, 0, 0, 0.8);
  395. }
  396. #toast-container>div {
  397. font-size: 14px;
  398. min-width: 80px !important;
  399. padding: 12px !important;
  400. box-shadow: none;
  401. }
  402. @media (max-width: 480px) and (min-width: 241px) {
  403. #toast-container>div {
  404. min-width: 80px !important;
  405. width: auto;
  406. }
  407. }
  408. @media only screen and (min-width: 640px) {
  409. .toast-center-center {
  410. top: 50%;
  411. left: 50%;
  412. transform: translate(-50%, -50%);
  413. }
  414. }
  415. @media only screen and (max-width: 640px) {
  416. .toast-center-center {
  417. top: 50%;
  418. left: 50%;
  419. transform: translate(-50%, -50%);
  420. }
  421. }
  422. input::-webkit-input-placeholder {
  423. color: #BBBBBB;
  424. }
  425. input::-moz-placeholder {
  426. /* Mozilla Firefox 19+ */
  427. color: #BBBBBB;
  428. }
  429. input:-moz-placeholder {
  430. /* Mozilla Firefox 4 to 18 */
  431. color: #BBBBBB;
  432. }
  433. input:-ms-input-placeholder {
  434. /* Internet Explorer 10-11 */
  435. color: #BBBBBB;
  436. }
  437. </style>
  438. </html>