index.html 11 KB

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