register.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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>
  17. window.onload = window.onresize = function () {
  18. verticalAlign()
  19. }
  20. function verticalAlign() {
  21. // alert($('body').css('font-size'));
  22. var logo_w = $('body').width();
  23. var logo_t = $('#bottom_img').height() * 0.05;
  24. if (logo_w <= 640) {
  25. $('#logo').css('top', '50px');
  26. $('#logo').width('25%');
  27. } else {
  28. $('#logo').css('top', logo_t);
  29. $('#logo').width(logo_w * 0.1178);
  30. }
  31. var ipt_w = $('#recv_ipt').width();
  32. var ipt_h = ipt_w * 0.18;
  33. var font_sz = ipt_w * 0.06 + 'px';
  34. $('#recv_ipt').height(ipt_h);
  35. $('#recv_ipt').css('font-size', font_sz);
  36. $('#recv_btn').css('font-size', font_sz);
  37. $('#recv_btn2').css('font-size', font_sz);
  38. // $('#recv_ipt').css('line-height', ipt_h);
  39. $('#icon').height(ipt_h);
  40. var icon_w = $('#recv_cont').width() * 0.053333
  41. $('#icon').width(icon_w);
  42. var icon_t = 'calc(' + ipt_h / 6 + 'px' + ' + 3rem)';
  43. $('#icon').css('top', icon_t);
  44. $('#recv_btn').css('padding', ipt_w * 0.01 + 'px');
  45. $('#recv_btn2').css('padding', ipt_w * 0.01 + 'px');
  46. var btn_h = $('#recv_ipt').height() - ipt_w * 0.01 - 15;
  47. $('#recv_btn').height(btn_h);
  48. $('#recv_btn').css('line-height', btn_h + 'px');
  49. $('#recv_btn2').height(btn_h);
  50. }
  51. </script>
  52. <script>
  53. toastr.options.positionClass = 'toast-center-center';
  54. </script>
  55. </head>
  56. <body>
  57. <header>
  58. <div class="top free-code-con" style="position:relative;">
  59. <div>
  60. <div>
  61. <picture>
  62. <source media="(max-width: 640px)" srcset="../static/img/experienceBg1.png 640w" />
  63. <source media="(min-width: 640px)" srcset="../static/img/experienceBg2.png 1366w" />
  64. <img src="../static/img/experienceBg1.png" alt="" class="bottom-img" id="bottom_img">
  65. </picture>
  66. </div>
  67. <div class="center-pic">
  68. <div class="recv-cont" id="recv_cont">
  69. <div style="padding: 0 8%">
  70. <div style="position: relative;">
  71. <input type="tel" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码">
  72. </div>
  73. <div onclick="handleClick()" style="position: relative">
  74. <div class="recv-btn" id="recv_btn">
  75. <img src="../static/img/experienceBtn.png" alt="" style="width: 100%">
  76. <span class="btn-bg-style">
  77. <span>领取体验时长并下载</span>
  78. <img src="../static/img/xing_icon.png" alt="">
  79. </span>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  88. aria-hidden="true">
  89. <div class="modal-dialog tip-suc-con">
  90. <div class="modal-content">
  91. <div class="tip-suc-title">领取成功</div>
  92. <!--<div class="modal-body tip-suc-context">
  93. 激活码将以短信的形式发送至领取手机号,请留意短信。
  94. </div>
  95. <button type="button" class="btn btn-default tip-suc-btn" data-dismiss="modal">知道了</button>-->
  96. </div>
  97. </div>
  98. </div>
  99. </header>
  100. <script type="text/javascript" th:inline="javascript">
  101. var parameters = GetRequest();
  102. var phone = parameters["phone"];
  103. $("#recv_ipt").val(phone)
  104. $("#recv_ipt").bind('input propertychange', function (e) {
  105. var ipt_phones = $('#recv_ipt').val();
  106. var c = $(this);
  107. if (/[^\d]/.test(c.val())) {//替换非数字字符
  108. var temp_amount = c.val().replace(/[^\d]/g, '');
  109. $(this).val(temp_amount);
  110. toastr.error('请填写正确的手机号')
  111. }
  112. if (ipt_phones.length >= 12) {
  113. toastr.error('请填写正确的手机号')
  114. var recvstr = ipt_phones.substring(0, 11)
  115. $("#recv_ipt").val(recvstr);
  116. }
  117. });
  118. function handleClick() {
  119. var time = new Date().getTime()
  120. var query = window.location.search.substring(1);
  121. console.log(query)
  122. var vars = query.split("&");
  123. var data = {}
  124. var username = vars.find(e => {
  125. return e.startsWith('username')
  126. })
  127. var type = vars.find(e => {
  128. return e.startsWith('type')
  129. })
  130. data.userName = username.substring(9, username.length)
  131. data.type = type.substring(5, username.length)
  132. toastr.options = {
  133. positionClass: "toast-center-center"
  134. };
  135. var ipt_phone = $('#recv_ipt').val();
  136. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  137. var res = validator.test(ipt_phone)
  138. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  139. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  140. if (!ipt_phone) {
  141. toastr.error('请填写正确的手机号')
  142. } else if (!res) {
  143. toastr.error('请填写正确的手机号')
  144. } else {
  145. data.newPhone = ipt_phone
  146. $.ajax({
  147. url: baseUrl + '/api/user/v1/promote',
  148. data: JSON.stringify(data),
  149. type: 'post',
  150. contentType: "application/json",
  151. dataType: 'json',
  152. cache: false,
  153. success: function (res) {
  154. if (res.status === 0) {
  155. //$('#myModal').modal('show');
  156. toastr.error('领取成功')
  157. $(window).attr('location', res.data);
  158. } else {
  159. toastr.error(res.msg)
  160. }
  161. }
  162. })
  163. var Sys = {};
  164. var ua = navigator.userAgent.toLowerCase();
  165. var s, browserType;
  166. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  167. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  168. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  169. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  170. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  171. if (Sys.ie) {
  172. browserType = 'IE: ' + Sys.ie
  173. }
  174. if (Sys.firefox) {
  175. browserType = 'Firefox: ' + Sys.firefox
  176. }
  177. if (Sys.chrome) {
  178. browserType = 'Chrome: ' + Sys.chrome
  179. }
  180. if (Sys.opera) {
  181. browserType = 'Opera: ' + Sys.opera
  182. }
  183. if (Sys.safari) {
  184. browserType = 'Safari: ' + Sys.safari
  185. }
  186. var form = {
  187. platform: 4,
  188. visitType: 4,
  189. time: time,
  190. phoneNum: ipt_phone,
  191. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  192. browserType: browserType
  193. }
  194. var list = []
  195. list.push(form)
  196. // 推广页面下载埋点接口
  197. $.ajax({
  198. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  199. data: JSON.stringify(list),
  200. type: 'post',
  201. contentType: "application/json",
  202. dataType: 'json',
  203. cache: false,
  204. success: function (res) {
  205. }
  206. })
  207. }
  208. }
  209. /*
  210. function handleDownload() {
  211. $.ajax({
  212. url: baseUrl + '/api/user/promote/webUrl',
  213. type: 'get',
  214. cache: false,
  215. dataType: 'text',
  216. success: function (data) {
  217. var uri;
  218. if (data.startsWith('http')) {
  219. uri = data
  220. } else {
  221. uri = 'http://' + data
  222. }
  223. $(window).attr('location',uri);
  224. }
  225. })
  226. }
  227. */
  228. function visit() {
  229. $.ajax({
  230. url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  231. type: 'get',
  232. cache: false,
  233. dataType: 'text',
  234. success: function () {
  235. }
  236. })
  237. }
  238. visit()
  239. </script>
  240. </body>
  241. <style>
  242. #toast-container>.toast-error {
  243. background-image: none !important;
  244. }
  245. .toast-error {
  246. background-color: rgba(0, 0, 0, 0.8);
  247. }
  248. #toast-container>div {
  249. font-size: 14px;
  250. min-width: 80px !important;
  251. padding: 12px !important;
  252. box-shadow: none;
  253. }
  254. @media (max-width: 480px) and (min-width: 241px) {
  255. #toast-container>div {
  256. min-width: 80px !important;
  257. width: auto;
  258. }
  259. }
  260. @media only screen and (min-width: 640px) {
  261. .toast-center-center {
  262. top: 50%;
  263. left: 50%;
  264. transform: translate(-50%, -50%);
  265. }
  266. }
  267. @media only screen and (max-width: 640px) {
  268. .toast-center-center {
  269. top: 50%;
  270. left: 50%;
  271. transform: translate(-50%, -50%);
  272. }
  273. }
  274. input::-webkit-input-placeholder {
  275. color: #BBBBBB;
  276. }
  277. input::-moz-placeholder {
  278. /* Mozilla Firefox 19+ */
  279. color: #BBBBBB;
  280. }
  281. input:-moz-placeholder {
  282. /* Mozilla Firefox 4 to 18 */
  283. color: #BBBBBB;
  284. }
  285. input:-ms-input-placeholder {
  286. /* Internet Explorer 10-11 */
  287. color: #BBBBBB;
  288. }
  289. </style>
  290. </html>