register.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. $("#recv_ipt").val(phone ? phone : '');
  58. $("#recv_ipt").bind('input propertychange', function (e) {
  59. var ipt_phones = $('#recv_ipt').val();
  60. var c = $(this);
  61. if (/[^\d]/.test(c.val())) {//替换非数字字符
  62. var temp_amount = c.val().replace(/[^\d]/g, '');
  63. $(this).val(temp_amount);
  64. toastr.error('请填写正确的手机号')
  65. }
  66. if (ipt_phones.length >= 12) {
  67. toastr.error('请填写正确的手机号')
  68. var recvstr = ipt_phones.substring(0, 11)
  69. $("#recv_ipt").val(recvstr);
  70. }
  71. });
  72. function getUserInfo() {
  73. var userName = parameters['username'] ? parameters['username'] : null
  74. userName = Base64.decode(userName)
  75. $.ajax({
  76. url: baseUrl + '/api/user/v3/invitation/getNickname?username=' + userName,
  77. type: 'get',
  78. cache: false,
  79. dataType: 'text',
  80. success: function (res) {
  81. var result = JSON.parse(res)
  82. if (result.status === 0) {
  83. $(".username").text(result.data.nickName)
  84. getHead(result.data.fileId)
  85. }
  86. }
  87. })
  88. }
  89. function getHead(fileId) {
  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:baseUrl + '/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. var time = new Date().getTime()
  124. var data = {}
  125. data.userName = parameters['username'] ? parameters['username'] : null
  126. data.type = parameters['type'] ? parameters['type'] : null
  127. data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
  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. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  135. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  136. if (!ipt_phone) {
  137. toastr.error('请填写正确的手机号')
  138. } else if (!res) {
  139. toastr.error('请填写正确的手机号')
  140. } else {
  141. data.newPhone = ipt_phone
  142. $.ajax({
  143. url: baseUrl + '/api/user/v1/promote',
  144. data: JSON.stringify(data),
  145. type: 'post',
  146. contentType: "application/json",
  147. dataType: 'json',
  148. cache: false,
  149. success: function (res) {
  150. if (res.status === 0) {
  151. toastr.error('领取成功')
  152. $(window).attr('location', res.data);
  153. } else {
  154. toastr.error(res.msg)
  155. }
  156. }
  157. })
  158. var Sys = {};
  159. var ua = navigator.userAgent.toLowerCase();
  160. var s, browserType;
  161. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  162. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  163. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  164. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  165. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  166. if (Sys.ie) {
  167. browserType = 'IE: ' + Sys.ie
  168. }
  169. if (Sys.firefox) {
  170. browserType = 'Firefox: ' + Sys.firefox
  171. }
  172. if (Sys.chrome) {
  173. browserType = 'Chrome: ' + Sys.chrome
  174. }
  175. if (Sys.opera) {
  176. browserType = 'Opera: ' + Sys.opera
  177. }
  178. if (Sys.safari) {
  179. browserType = 'Safari: ' + Sys.safari
  180. }
  181. var form = {
  182. platform: 4,
  183. visitType: 4,
  184. time: time,
  185. phoneNum: ipt_phone,
  186. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  187. browserType: browserType
  188. }
  189. var list = []
  190. list.push(form)
  191. // 推广页面下载埋点接口
  192. $.ajax({
  193. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  194. data: JSON.stringify(list),
  195. type: 'post',
  196. contentType: "application/json",
  197. dataType: 'json',
  198. cache: false,
  199. success: function (res) {
  200. }
  201. })
  202. }
  203. }
  204. /*
  205. function handleDownload() {
  206. $.ajax({
  207. url: baseUrl + '/api/user/promote/webUrl',
  208. type: 'get',
  209. cache: false,
  210. dataType: 'text',
  211. success: function (data) {
  212. var uri;
  213. if (data.startsWith('http')) {
  214. uri = data
  215. } else {
  216. uri = 'http://' + data
  217. }
  218. $(window).attr('location',uri);
  219. }
  220. })
  221. }
  222. */
  223. function visit() {
  224. $.ajax({
  225. url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  226. type: 'get',
  227. cache: false,
  228. dataType: 'text',
  229. success: function () {
  230. }
  231. })
  232. }
  233. visit()
  234. </script>
  235. </body>
  236. <style>
  237. #toast-container>.toast-error {
  238. background-image: none !important;
  239. }
  240. .toast-error {
  241. background-color: rgba(0, 0, 0, 0.8);
  242. }
  243. #toast-container>div {
  244. font-size: 14px;
  245. min-width: 80px !important;
  246. padding: 12px !important;
  247. box-shadow: none;
  248. }
  249. @media (max-width: 480px) and (min-width: 241px) {
  250. #toast-container>div {
  251. min-width: 80px !important;
  252. width: auto;
  253. }
  254. }
  255. @media only screen and (min-width: 640px) {
  256. .toast-center-center {
  257. top: 50%;
  258. left: 50%;
  259. transform: translate(-50%, -50%);
  260. }
  261. }
  262. @media only screen and (max-width: 640px) {
  263. .toast-center-center {
  264. top: 50%;
  265. left: 50%;
  266. transform: translate(-50%, -50%);
  267. }
  268. }
  269. input::-webkit-input-placeholder {
  270. color: #BBBBBB;
  271. }
  272. input::-moz-placeholder {
  273. /* Mozilla Firefox 19+ */
  274. color: #BBBBBB;
  275. }
  276. input:-moz-placeholder {
  277. /* Mozilla Firefox 4 to 18 */
  278. color: #BBBBBB;
  279. }
  280. input:-ms-input-placeholder {
  281. /* Internet Explorer 10-11 */
  282. color: #BBBBBB;
  283. }
  284. </style>
  285. </html>