promote.html 8.2 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="stylesheet" href="../static/css/verify.css">
  8. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  9. <link rel="stylesheet" href="../static/js/vender/bootstrap/css/bootstrap.min.css">
  10. <link rel="stylesheet" href="../static/css/normalize.css">
  11. <link rel="stylesheet" href="../static/css/promote.css">
  12. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  13. <script>
  14. (function () {
  15. if (!window.Promise) {
  16. document.writeln('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.min.js"><' + '/' + 'script>');
  17. }
  18. })();
  19. </script>
  20. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  21. <script src="../static/js/vender/bootstrap/js/bootstrap.min.js"></script>
  22. <script src="../static/js/vender/crypto-js.js"></script>
  23. <script src="../static/js/vender/ase.js"></script>
  24. <script src="../static/js/vender/verify.js"></script>
  25. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  26. <script src="../static/js/vender/config.js"></script>
  27. <script>
  28. toastr.options.positionClass = 'toast-center-center';
  29. </script>
  30. </head>
  31. <body>
  32. <div class="top free-code-con" style="position:relative;">
  33. <div>
  34. <img src="../static/img/experienceBg2.png" alt="" class="bottom-img">
  35. </div>
  36. <div class="center-pic">
  37. <div class="recv-cont" id="recv_cont">
  38. <div style="position: relative;">
  39. <input type="tel" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码">
  40. </div>
  41. <div>
  42. <div class="recv-btn" id="recv_btn">
  43. <span style="position: relative;">
  44. 领取体验时长并下载
  45. <img src="../static/img/xing_icon.png" alt="">
  46. </span>
  47. </div>
  48. </div>
  49. <div id="mpanel2"></div>
  50. </div>
  51. </div>
  52. </div>
  53. <script type="text/javascript" th:inline="javascript">
  54. toastr.options = {
  55. positionClass: "toast-center-center",
  56. timeOut: 1500
  57. };
  58. var parameters = GetRequest();
  59. var toast = toastr;
  60. var html = document.documentElement;
  61. var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
  62. var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
  63. var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
  64. $('#mpanel2').eq(0).text('');
  65. $('#mpanel2').slideVerify({
  66. baseUrl: baseUrl + '/api/activity', //服务器请求地址, 默认地址为安吉服务器;
  67. mode: 'pop', //展示模式
  68. containerId: 'recv_btn', //pop模式 必填 被点击之后出现行为验证码的元素id
  69. imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
  70. width: imgWidth,
  71. height: imgHeight
  72. },
  73. barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
  74. width: imgWidth,
  75. height: barHeight
  76. },
  77. beforeCheck: function () {
  78. var tel = $("#recv_ipt").val()
  79. if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(tel)) {
  80. stopManyClick(() => {
  81. toastr.error('请填写正确的手机号')
  82. })
  83. return false
  84. } else {
  85. return true
  86. }
  87. },
  88. ready: function () { }, //加载完毕的回调
  89. success: function (params) { //成功的回调
  90. // params为返回的二次验证参数 需要在接下来的实现逻辑回传服务器
  91. // 例如: login($.extend({}, params))
  92. handleClick(params.captchaVerification)
  93. },
  94. error: function () {
  95. console.log('error');
  96. } //失败的回调
  97. });
  98. $("#recv_ipt").bind('input propertychange', function (e) {
  99. var ipt_phones = $('#recv_ipt').val();
  100. var c = $(this);
  101. if (/[^\d]/.test(c.val())) {//替换非数字字符
  102. var temp_amount = c.val().replace(/[^\d]/g, '');
  103. $(this).val(temp_amount);
  104. stopManyClick(() => {
  105. toastr.error('请填写正确的手机号')
  106. })
  107. }
  108. if (ipt_phones.length >= 12) {
  109. stopManyClick(() => {
  110. toastr.error('请填写正确的手机号')
  111. })
  112. var recvstr = ipt_phones.substring(0, 11)
  113. $("#recv_ipt").val(recvstr);
  114. }
  115. });
  116. function handleClick(captchaVerification) {
  117. var time = new Date().getTime()
  118. var data = {}
  119. toastr.options = {
  120. positionClass: "toast-center-center"
  121. };
  122. var ipt_phone = $('#recv_ipt').val();
  123. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  124. var res = validator.test(ipt_phone)
  125. if (!ipt_phone) {
  126. stopManyClick(() => {
  127. toastr.error('请填写正确的手机号')
  128. })
  129. } else if (!res) {
  130. stopManyClick(() => {
  131. toastr.error('请填写正确的手机号')
  132. })
  133. } else {
  134. data.newPhone = ipt_phone
  135. data.type =parameters['type']
  136. data.code = parameters['code']
  137. data.username = parameters['userName']
  138. data.captchaVerification = captchaVerification
  139. $.ajax({
  140. url: baseUrl + '/api/activity/api/pro/commitPhone',
  141. data: JSON.stringify(data),
  142. type: 'post',
  143. contentType: "application/json",
  144. dataType: 'json',
  145. cache: false,
  146. success: function (res) {
  147. if (res.status === 0) {
  148. toastr.error('领取成功')
  149. $(window).attr('location', res.data);
  150. } else if (res.status === 1) {
  151. toastr.error(res.msg)
  152. setTimeout(function () {
  153. $(window).attr('location', 'http://www.androidscloud.com');
  154. }, 1000)
  155. } else {
  156. toastr.error(res.msg)
  157. }
  158. }
  159. })
  160. var Sys = {};
  161. var ua = navigator.userAgent.toLowerCase();
  162. var s, browserType;
  163. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  164. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  165. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  166. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  167. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  168. if (Sys.ie) {
  169. browserType = 'IE: ' + Sys.ie
  170. }
  171. if (Sys.firefox) {
  172. browserType = 'Firefox: ' + Sys.firefox
  173. }
  174. if (Sys.chrome) {
  175. browserType = 'Chrome: ' + Sys.chrome
  176. }
  177. if (Sys.opera) {
  178. browserType = 'Opera: ' + Sys.opera
  179. }
  180. if (Sys.safari) {
  181. browserType = 'Safari: ' + Sys.safari
  182. }
  183. var form = {
  184. platform: 4,
  185. visitType: 4,
  186. time: time,
  187. phoneNum: ipt_phone,
  188. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  189. browserType: browserType
  190. }
  191. var list = []
  192. list.push(form)
  193. // 推广页面下载埋点接口
  194. $.ajax({
  195. url: baseUrl + '/api/activity/user/access/burialSiteLog',
  196. data: JSON.stringify(list),
  197. type: 'post',
  198. contentType: "application/json",
  199. dataType: 'json',
  200. cache: false,
  201. success: function (res) {
  202. }
  203. })
  204. }
  205. }
  206. function visit() {
  207. $.ajax({
  208. url: baseUrl + '/promote/addInviteData',
  209. type: 'get',
  210. cache: false,
  211. dataType: 'text',
  212. success: function () {
  213. }
  214. })
  215. }
  216. var timer, flag = true;
  217. //防止提示一秒内重复显示
  218. function stopManyClick(fn) {
  219. if (flag) {
  220. fn();
  221. }
  222. flag = false;
  223. if (timer) { clearTimeout(timer); }
  224. timer = setTimeout(() => { flag = true }, 1500);
  225. }
  226. // visit()
  227. </script>
  228. </body>
  229. <style>
  230. #toast-container>.toast-error {
  231. background-image: none !important;
  232. }
  233. .toast-error {
  234. background-color: rgba(0, 0, 0, 0.8);
  235. }
  236. #toast-container>div {
  237. font-size: 14px;
  238. min-width: 80px !important;
  239. padding: 12px !important;
  240. box-shadow: none;
  241. }
  242. .toast-center-center {
  243. position: fixed;
  244. min-width: 220px;
  245. top: 50%;
  246. left: 50%;
  247. text-align: center;
  248. transform: translateX(-50%);
  249. color: #FFFFFF;
  250. border-radius: 0.2rem;
  251. }
  252. @media (max-width: 480px) and (min-width: 241px) {
  253. #toast-container>div {
  254. min-width: 80px !important;
  255. width: auto;
  256. }
  257. }
  258. @media only screen and (min-width: 640px) {
  259. .toast-center-center {
  260. top: 50%;
  261. left: 50%;
  262. transform: translate(-50%, -50%);
  263. }
  264. }
  265. @media only screen and (max-width: 640px) {
  266. .toast-center-center {
  267. top: 50%;
  268. left: 50%;
  269. transform: translate(-50%, -50%);
  270. }
  271. }
  272. input::-webkit-input-placeholder {
  273. color: #BBBBBB;
  274. }
  275. input::-moz-placeholder {
  276. /* Mozilla Firefox 19+ */
  277. color: #BBBBBB;
  278. }
  279. input:-moz-placeholder {
  280. /* Mozilla Firefox 4 to 18 */
  281. color: #BBBBBB;
  282. }
  283. input:-ms-input-placeholder {
  284. /* Internet Explorer 10-11 */
  285. color: #BBBBBB;
  286. }
  287. </style>
  288. </html>