spread.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. toastr.options.positionClass = 'toast-center-center';
  18. </script>
  19. </head>
  20. <body>
  21. <!-- 从推广系统跳转至此页面 -->
  22. <div class="top free-code-con" style="position:relative;">
  23. <div>
  24. <img src="../static/img/experienceBg3.png" alt="" class="bottom-img">
  25. </div>
  26. <div class="center-pic">
  27. <div class="recv-cont" id="recv_cont">
  28. <div style="position: relative;">
  29. <input type="tel" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码">
  30. </div>
  31. <div onclick="handleClick()" style="position: relative">
  32. <div class="recv-btn" id="recv_btn">
  33. <span style="position: relative;">
  34. 领取体验时长并下载
  35. <img src="../static/img/xing_icon.png" alt="">
  36. </span>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <script type="text/javascript" th:inline="javascript">
  43. var parameters = GetRequest();
  44. var phone = parameters["phone"];
  45. $("#recv_ipt").val(phone ? phone : '');
  46. $("#recv_ipt").bind('input propertychange', function (e) {
  47. var ipt_phones = $('#recv_ipt').val();
  48. var c = $(this);
  49. if (/[^\d]/.test(c.val())) {//替换非数字字符
  50. var temp_amount = c.val().replace(/[^\d]/g, '');
  51. $(this).val(temp_amount);
  52. toastr.error('请填写正确的手机号')
  53. }
  54. if (ipt_phones.length >= 12) {
  55. toastr.error('请填写正确的手机号')
  56. var recvstr = ipt_phones.substring(0, 11)
  57. $("#recv_ipt").val(recvstr);
  58. }
  59. });
  60. function handleClick() {
  61. var time = new Date().getTime()
  62. var data = {}
  63. data.userName = parameters['username'] ? parameters['username'] : null
  64. data.type = parameters['type'] ? parameters['type'] : null
  65. data.code = parameters['code'] ? parameters['code'] : null
  66. toastr.options = {
  67. positionClass: "toast-center-center"
  68. };
  69. var ipt_phone = $('#recv_ipt').val();
  70. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  71. var res = validator.test(ipt_phone)
  72. var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
  73. downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
  74. if (!ipt_phone) {
  75. toastr.error('请填写正确的手机号')
  76. } else if (!res) {
  77. toastr.error('请填写正确的手机号')
  78. } else {
  79. data.newPhone = ipt_phone
  80. $.ajax({
  81. url: baseUrl + ':8050/promote/commitPhone',
  82. data: JSON.stringify(data),
  83. type: 'post',
  84. contentType: "application/json",
  85. dataType: 'json',
  86. cache: false,
  87. success: function (res) {
  88. if (res.status === 0) {
  89. toastr.error('领取成功')
  90. $(window).attr('location', res.data);
  91. } else {
  92. toastr.error(res.msg)
  93. }
  94. }
  95. })
  96. var Sys = {};
  97. var ua = navigator.userAgent.toLowerCase();
  98. var s, browserType;
  99. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  100. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  101. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  102. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  103. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  104. if (Sys.ie) {
  105. browserType = 'IE: ' + Sys.ie
  106. }
  107. if (Sys.firefox) {
  108. browserType = 'Firefox: ' + Sys.firefox
  109. }
  110. if (Sys.chrome) {
  111. browserType = 'Chrome: ' + Sys.chrome
  112. }
  113. if (Sys.opera) {
  114. browserType = 'Opera: ' + Sys.opera
  115. }
  116. if (Sys.safari) {
  117. browserType = 'Safari: ' + Sys.safari
  118. }
  119. var form = {
  120. platform: 4,
  121. visitType: 4,
  122. time: time,
  123. phoneNum: ipt_phone,
  124. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  125. browserType: browserType
  126. }
  127. var list = []
  128. list.push(form)
  129. // 推广页面下载埋点接口
  130. $.ajax({
  131. url: baseUrl + '/api/public/v4/access/user/burialSiteLog',
  132. data: JSON.stringify(list),
  133. type: 'post',
  134. contentType: "application/json",
  135. dataType: 'json',
  136. cache: false,
  137. success: function (res) {
  138. }
  139. })
  140. }
  141. }
  142. </script>
  143. </body>
  144. <style>
  145. #toast-container>.toast-error {
  146. background-image: none !important;
  147. }
  148. .toast-error {
  149. background-color: rgba(0, 0, 0, 0.8);
  150. }
  151. #toast-container>div {
  152. font-size: 14px;
  153. min-width: 80px !important;
  154. padding: 12px !important;
  155. box-shadow: none;
  156. }
  157. @media (max-width: 480px) and (min-width: 241px) {
  158. #toast-container>div {
  159. min-width: 80px !important;
  160. width: auto;
  161. }
  162. }
  163. @media only screen and (min-width: 640px) {
  164. .toast-center-center {
  165. top: 50%;
  166. left: 50%;
  167. transform: translate(-50%, -50%);
  168. }
  169. }
  170. @media only screen and (max-width: 640px) {
  171. .toast-center-center {
  172. top: 50%;
  173. left: 50%;
  174. transform: translate(-50%, -50%);
  175. }
  176. }
  177. input::-webkit-input-placeholder {
  178. color: #BBBBBB;
  179. }
  180. input::-moz-placeholder {
  181. /* Mozilla Firefox 19+ */
  182. color: #BBBBBB;
  183. }
  184. input:-moz-placeholder {
  185. /* Mozilla Firefox 4 to 18 */
  186. color: #BBBBBB;
  187. }
  188. input:-ms-input-placeholder {
  189. /* Internet Explorer 10-11 */
  190. color: #BBBBBB;
  191. }
  192. </style>
  193. </html>