register.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  13. <script src="../static/js/vender/bootstrap/js/bootstrap.min.js"></script>
  14. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  15. <script src="../static/js/vender/config.js"></script>
  16. <script src="../static/js/vender/crypto-js.js"></script>
  17. <script src="../static/js/vender/base64.js"></script>
  18. <script>
  19. toastr.options.positionClass = 'toast-center-center';
  20. </script>
  21. </head>
  22. <body>
  23. <div class="top free-code-con" style="position:relative;">
  24. <div>
  25. <img src="../static/img/register/bg.png" alt="" class="bottom-img">
  26. <div class="user-info">
  27. <div class="head"><img src="" alt="" /></div>
  28. <div class="username"></div>
  29. <div class="txt">
  30. <div style="width: 2.97rem;"><img src="../static/img/register/tuoguan_icon.png" class="icon" alt="">7*24h智能托管</div>
  31. <div style="width: 1.76rem;"><img src="../static/img/register/haodian_icon.png" class="icon" alt="">0耗电</div>
  32. <div><img src="../static/img/register/liuliang_icon.png" class="icon" alt="">0流量</div>
  33. <div style="width: 2.97rem;"><img src="../static/img/register/wang_icon.png" class="icon" alt="">应用 24h 不断网</div>
  34. <div style="width: 1.76rem;"><img src="../static/img/register/shou_icon.png" class="icon" alt="">解放双手</div>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="center-pic">
  39. <div class="recv-cont" id="recv_cont">
  40. <div style="position: relative;">
  41. <input type="tel" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码">
  42. <div class="tip">该手机号仅用于验证并绑定账号</div>
  43. </div>
  44. <div onclick="handleClick()" style="position: relative">
  45. <div class="recv-btn" id="recv_btn">立即加入</div>
  46. </div>
  47. <div class="bottom">
  48. <div class="mb8">双子星</div>
  49. <div class="wl">云智能 · 享未来</div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <script type="text/javascript" th:inline="javascript">
  55. var parameters = GetRequest();
  56. var phone = parameters["phone"];
  57. var timer, flag = true;
  58. $("#recv_ipt").val(phone ? phone : '');
  59. $("#recv_ipt").bind('input propertychange', function (e) {
  60. var ipt_phones = $('#recv_ipt').val();
  61. var c = $(this);
  62. if (/[^\d]/.test(c.val())) {//替换非数字字符
  63. var temp_amount = c.val().replace(/[^\d]/g, '');
  64. $(this).val(temp_amount);
  65. stopManyClick(() =>{
  66. toastr.error('请填写正确的手机号')
  67. })
  68. }
  69. if (ipt_phones.length >= 12) {
  70. var recvstr = ipt_phones.substring(0, 11)
  71. $("#recv_ipt").val(recvstr);
  72. stopManyClick(() =>{
  73. toastr.error('请填写正确的手机号')
  74. })
  75. }
  76. });
  77. function getUserInfo() {
  78. var userName = parameters['username'] ? parameters['username'] : null
  79. userName = Base64.decode(userName)
  80. $.ajax({
  81. url: baseUrl + '/api/user/v3/invitation/getNickname?username=' + userName,
  82. type: 'get',
  83. cache: false,
  84. dataType: 'text',
  85. success: function (res) {
  86. var result = JSON.parse(res)
  87. if (result.status === 0) {
  88. $(".username").text(result.data.nickName)
  89. getHead(result.data.fileId)
  90. }
  91. }
  92. })
  93. }
  94. function getHead(fileId) {
  95. $('.head img').attr('src', '../static/img/invite/header-img.png');
  96. var timestamp = new Date().getTime()
  97. var encrypts = encrypt(
  98. 'RuiChiSecurityGo' + timestamp,
  99. 'RuiChiSecurityGo'
  100. )
  101. var data = {
  102. keyType: 2,
  103. security: encrypts
  104. }
  105. $.ajax({
  106. url:baseUrl + '/file-center/fileOperate/getImage?id='+fileId,
  107. type: 'get',
  108. headers: data,
  109. xhrFields: { responseType: "blob" },
  110. cache: false,
  111. success: function (res) {
  112. var xhr = new XMLHttpRequest();
  113. var imageType = xhr.getResponseHeader("Content-Type");
  114. var blob = new Blob([res], { type: imageType });
  115. var imageUrl = (window.URL || window.webkitURL).createObjectURL(blob);
  116. $('.head img').attr('src', imageUrl);
  117. }
  118. })
  119. }
  120. function encrypt(word, keyStr) {
  121. keyStr = keyStr || 'RuiChiSecurityGo' // 判断是否存在ksy,不存在就用定义好的key
  122. var key = CryptoJS.enc.Utf8.parse(keyStr)
  123. var srcs = CryptoJS.enc.Utf8.parse(word)
  124. var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
  125. return encrypted.toString()
  126. }
  127. getUserInfo();
  128. function handleClick() {
  129. stopManyClick(result);
  130. }
  131. function result() {
  132. var time = new Date().getTime()
  133. var data = {}
  134. data.userName = parameters['username'] ? parameters['username'] : null
  135. data.type = parameters['type'] ? parameters['type'] : null
  136. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  137. toastr.options = {
  138. positionClass: "toast-center-center",
  139. timeOut: 1500
  140. };
  141. var ipt_phone = $('#recv_ipt').val();
  142. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  143. var res = validator.test(ipt_phone)
  144. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  145. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  146. if (!ipt_phone) {
  147. stopManyClick(() =>{
  148. toastr.error('请填写正确的手机号')
  149. })
  150. } else if (!res) {
  151. stopManyClick(() =>{
  152. toastr.error('请填写正确的手机号')
  153. })
  154. } else {
  155. data.newPhone = ipt_phone
  156. $.ajax({
  157. url: baseUrl + '/api/user/v1/promote',
  158. data: JSON.stringify(data),
  159. type: 'post',
  160. contentType: "application/json",
  161. dataType: 'json',
  162. cache: false,
  163. success: function (res) {
  164. if (res.status === 0) {
  165. toastr.error('领取成功')
  166. $(window).attr('location', res.data);
  167. } else if (res.status === 1) {
  168. toastr.error(res.msg)
  169. setTimeout(function() {
  170. $(window).attr('location', 'http://www.androidscloud.com/');
  171. }, 1000)
  172. } else {
  173. toastr.error(res.msg)
  174. }
  175. }
  176. })
  177. var Sys = {};
  178. var ua = navigator.userAgent.toLowerCase();
  179. var s, browserType;
  180. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  181. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  182. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  183. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  184. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  185. if (Sys.ie) {
  186. browserType = 'IE: ' + Sys.ie
  187. }
  188. if (Sys.firefox) {
  189. browserType = 'Firefox: ' + Sys.firefox
  190. }
  191. if (Sys.chrome) {
  192. browserType = 'Chrome: ' + Sys.chrome
  193. }
  194. if (Sys.opera) {
  195. browserType = 'Opera: ' + Sys.opera
  196. }
  197. if (Sys.safari) {
  198. browserType = 'Safari: ' + Sys.safari
  199. }
  200. var form = {
  201. platform: 4,
  202. visitType: 4,
  203. time: time,
  204. phoneNum: ipt_phone,
  205. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  206. browserType: browserType
  207. }
  208. var list = []
  209. list.push(form)
  210. // 推广页面下载埋点接口
  211. $.ajax({
  212. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  213. data: JSON.stringify(list),
  214. type: 'post',
  215. contentType: "application/json",
  216. dataType: 'json',
  217. cache: false,
  218. success: function (res) {
  219. }
  220. })
  221. }
  222. }
  223. /*
  224. function handleDownload() {
  225. $.ajax({
  226. url: baseUrl + '/api/user/promote/webUrl',
  227. type: 'get',
  228. cache: false,
  229. dataType: 'text',
  230. success: function (data) {
  231. var uri;
  232. if (data.startsWith('http')) {
  233. uri = data
  234. } else {
  235. uri = 'http://' + data
  236. }
  237. $(window).attr('location',uri);
  238. }
  239. })
  240. }
  241. */
  242. function visit() {
  243. $.ajax({
  244. url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  245. type: 'get',
  246. cache: false,
  247. dataType: 'text',
  248. success: function () {
  249. }
  250. })
  251. }
  252. visit()
  253. //防止提示一秒内重复显示
  254. function stopManyClick(fn) {
  255. if (flag) {
  256. fn();
  257. }
  258. flag = false;
  259. if(timer){clearTimeout(timer);}
  260. timer = setTimeout(() => {flag = true}, 1500);
  261. }
  262. </script>
  263. </body>
  264. <style>
  265. #toast-container>.toast-error {
  266. background-image: none !important;
  267. }
  268. .toast-error {
  269. background-color: rgba(0, 0, 0, 0.8);
  270. }
  271. #toast-container>div {
  272. font-size: 14px;
  273. min-width: 80px !important;
  274. padding: 12px !important;
  275. box-shadow: none;
  276. }
  277. @media (max-width: 480px) and (min-width: 241px) {
  278. #toast-container>div {
  279. min-width: 80px !important;
  280. width: auto;
  281. }
  282. }
  283. @media only screen and (min-width: 640px) {
  284. .toast-center-center {
  285. top: 50%;
  286. left: 50%;
  287. transform: translate(-50%, -50%);
  288. }
  289. }
  290. @media only screen and (max-width: 640px) {
  291. .toast-center-center {
  292. top: 50%;
  293. left: 50%;
  294. transform: translate(-50%, -50%);
  295. }
  296. }
  297. input::-webkit-input-placeholder {
  298. color: #BBBBBB;
  299. }
  300. input::-moz-placeholder {
  301. /* Mozilla Firefox 19+ */
  302. color: #BBBBBB;
  303. }
  304. input:-moz-placeholder {
  305. /* Mozilla Firefox 4 to 18 */
  306. color: #BBBBBB;
  307. }
  308. input:-ms-input-placeholder {
  309. /* Internet Explorer 10-11 */
  310. color: #BBBBBB;
  311. }
  312. </style>
  313. </html>