register.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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 ? 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 data = {}
  121. data.userName = parameters['username'] ? parameters['username'] : null
  122. data.type = parameters['type'] ? parameters['type'] : null
  123. toastr.options = {
  124. positionClass: "toast-center-center"
  125. };
  126. var ipt_phone = $('#recv_ipt').val();
  127. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  128. var res = validator.test(ipt_phone)
  129. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  130. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  131. if (!ipt_phone) {
  132. toastr.error('请填写正确的手机号')
  133. } else if (!res) {
  134. toastr.error('请填写正确的手机号')
  135. } else {
  136. data.newPhone = ipt_phone
  137. $.ajax({
  138. url: baseUrl + '/api/user/v1/promote',
  139. data: JSON.stringify(data),
  140. type: 'post',
  141. contentType: "application/json",
  142. dataType: 'json',
  143. cache: false,
  144. success: function (res) {
  145. if (res.status === 0) {
  146. //$('#myModal').modal('show');
  147. toastr.error('领取成功')
  148. $(window).attr('location', res.data);
  149. } else {
  150. toastr.error(res.msg)
  151. }
  152. }
  153. })
  154. var Sys = {};
  155. var ua = navigator.userAgent.toLowerCase();
  156. var s, browserType;
  157. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  158. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  159. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  160. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  161. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  162. if (Sys.ie) {
  163. browserType = 'IE: ' + Sys.ie
  164. }
  165. if (Sys.firefox) {
  166. browserType = 'Firefox: ' + Sys.firefox
  167. }
  168. if (Sys.chrome) {
  169. browserType = 'Chrome: ' + Sys.chrome
  170. }
  171. if (Sys.opera) {
  172. browserType = 'Opera: ' + Sys.opera
  173. }
  174. if (Sys.safari) {
  175. browserType = 'Safari: ' + Sys.safari
  176. }
  177. var form = {
  178. platform: 4,
  179. visitType: 4,
  180. time: time,
  181. phoneNum: ipt_phone,
  182. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  183. browserType: browserType
  184. }
  185. var list = []
  186. list.push(form)
  187. // 推广页面下载埋点接口
  188. $.ajax({
  189. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  190. data: JSON.stringify(list),
  191. type: 'post',
  192. contentType: "application/json",
  193. dataType: 'json',
  194. cache: false,
  195. success: function (res) {
  196. }
  197. })
  198. }
  199. }
  200. /*
  201. function handleDownload() {
  202. $.ajax({
  203. url: baseUrl + '/api/user/promote/webUrl',
  204. type: 'get',
  205. cache: false,
  206. dataType: 'text',
  207. success: function (data) {
  208. var uri;
  209. if (data.startsWith('http')) {
  210. uri = data
  211. } else {
  212. uri = 'http://' + data
  213. }
  214. $(window).attr('location',uri);
  215. }
  216. })
  217. }
  218. */
  219. function visit() {
  220. $.ajax({
  221. url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
  222. type: 'get',
  223. cache: false,
  224. dataType: 'text',
  225. success: function () {
  226. }
  227. })
  228. }
  229. visit()
  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>