register.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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. let urls = baseUrl == 'http://14.18.190.141:24380'?'http://14.18.190.141:24380':'https://wjzx.androidscloud.com:9091';
  106. $.ajax({
  107. url: `${urls}/file-center/fileOperate/getImage?id=`+fileId,
  108. type: 'get',
  109. headers: data,
  110. xhrFields: { responseType: "blob" },
  111. cache: false,
  112. success: function (res) {
  113. var xhr = new XMLHttpRequest();
  114. var imageType = xhr.getResponseHeader("Content-Type");
  115. var blob = new Blob([res], { type: imageType });
  116. var imageUrl = (window.URL || window.webkitURL).createObjectURL(blob);
  117. $('.head img').attr('src', imageUrl);
  118. }
  119. })
  120. }
  121. function encrypt(word, keyStr) {
  122. keyStr = keyStr || 'RuiChiSecurityGo' // 判断是否存在ksy,不存在就用定义好的key
  123. var key = CryptoJS.enc.Utf8.parse(keyStr)
  124. var srcs = CryptoJS.enc.Utf8.parse(word)
  125. var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
  126. return encrypted.toString()
  127. }
  128. getUserInfo();
  129. function handleClick() {
  130. stopManyClick(result);
  131. }
  132. function result() {
  133. var time = new Date().getTime()
  134. var data = {}
  135. data.userName = parameters['username'] ? parameters['username'] : null
  136. data.type = parameters['type'] ? parameters['type'] : null
  137. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  138. toastr.options = {
  139. positionClass: "toast-center-center",
  140. timeOut: 1500
  141. };
  142. var ipt_phone = $('#recv_ipt').val();
  143. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  144. var res = validator.test(ipt_phone)
  145. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  146. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  147. if (!ipt_phone) {
  148. stopManyClick(() =>{
  149. toastr.error('请填写正确的手机号')
  150. })
  151. } else if (!res) {
  152. stopManyClick(() =>{
  153. toastr.error('请填写正确的手机号')
  154. })
  155. } else {
  156. data.newPhone = ipt_phone
  157. $.ajax({
  158. url: baseUrl + '/api/user/v1/promote',
  159. data: JSON.stringify(data),
  160. type: 'post',
  161. contentType: "application/json",
  162. dataType: 'json',
  163. cache: false,
  164. success: function (res) {
  165. if (res.status === 0) {
  166. toastr.error('领取成功')
  167. $(window).attr('location', res.data);
  168. } else if (res.status === 1) {
  169. toastr.error(res.msg)
  170. setTimeout(function() {
  171. $(window).attr('location', 'http://www.androidscloud.com/');
  172. }, 1000)
  173. } else {
  174. toastr.error(res.msg)
  175. }
  176. }
  177. })
  178. var Sys = {};
  179. var ua = navigator.userAgent.toLowerCase();
  180. var s, browserType;
  181. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  182. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  183. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  184. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  185. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  186. if (Sys.ie) {
  187. browserType = 'IE: ' + Sys.ie
  188. }
  189. if (Sys.firefox) {
  190. browserType = 'Firefox: ' + Sys.firefox
  191. }
  192. if (Sys.chrome) {
  193. browserType = 'Chrome: ' + Sys.chrome
  194. }
  195. if (Sys.opera) {
  196. browserType = 'Opera: ' + Sys.opera
  197. }
  198. if (Sys.safari) {
  199. browserType = 'Safari: ' + Sys.safari
  200. }
  201. var form = {
  202. platform: 4,
  203. visitType: 4,
  204. time: time,
  205. phoneNum: ipt_phone,
  206. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  207. browserType: browserType
  208. }
  209. var list = []
  210. list.push(form)
  211. // 推广页面下载埋点接口
  212. $.ajax({
  213. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  214. data: JSON.stringify(list),
  215. type: 'post',
  216. contentType: "application/json",
  217. dataType: 'json',
  218. cache: false,
  219. success: function (res) {
  220. }
  221. })
  222. }
  223. }
  224. /*
  225. function handleDownload() {
  226. $.ajax({
  227. url: baseUrl + '/api/user/promote/webUrl',
  228. type: 'get',
  229. cache: false,
  230. dataType: 'text',
  231. success: function (data) {
  232. var uri;
  233. if (data.startsWith('http')) {
  234. uri = data
  235. } else {
  236. uri = 'http://' + data
  237. }
  238. $(window).attr('location',uri);
  239. }
  240. })
  241. }
  242. */
  243. function visit() {
  244. $.ajax({
  245. url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  246. type: 'get',
  247. cache: false,
  248. dataType: 'text',
  249. success: function () {
  250. }
  251. })
  252. }
  253. visit()
  254. //防止提示一秒内重复显示
  255. function stopManyClick(fn) {
  256. if (flag) {
  257. fn();
  258. }
  259. flag = false;
  260. if(timer){clearTimeout(timer);}
  261. timer = setTimeout(() => {flag = true}, 1500);
  262. }
  263. </script>
  264. </body>
  265. <style>
  266. #toast-container>.toast-error {
  267. background-image: none !important;
  268. }
  269. .toast-error {
  270. background-color: rgba(0, 0, 0, 0.8);
  271. }
  272. #toast-container>div {
  273. font-size: 14px;
  274. min-width: 80px !important;
  275. padding: 12px !important;
  276. box-shadow: none;
  277. }
  278. @media (max-width: 480px) and (min-width: 241px) {
  279. #toast-container>div {
  280. min-width: 80px !important;
  281. width: auto;
  282. }
  283. }
  284. @media only screen and (min-width: 640px) {
  285. .toast-center-center {
  286. top: 50%;
  287. left: 50%;
  288. transform: translate(-50%, -50%);
  289. }
  290. }
  291. @media only screen and (max-width: 640px) {
  292. .toast-center-center {
  293. top: 50%;
  294. left: 50%;
  295. transform: translate(-50%, -50%);
  296. }
  297. }
  298. input::-webkit-input-placeholder {
  299. color: #BBBBBB;
  300. }
  301. input::-moz-placeholder {
  302. /* Mozilla Firefox 19+ */
  303. color: #BBBBBB;
  304. }
  305. input:-moz-placeholder {
  306. /* Mozilla Firefox 4 to 18 */
  307. color: #BBBBBB;
  308. }
  309. input:-ms-input-placeholder {
  310. /* Internet Explorer 10-11 */
  311. color: #BBBBBB;
  312. }
  313. </style>
  314. </html>