promote.html 8.4 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="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. if(baseUrl.includes('prese.phone.androidscloud.com')){
  154. $(window).attr('location', 'http://14.18.190.144:18888');
  155. }else{
  156. $(window).attr('location', 'http://www.androidscloud.com');
  157. }
  158. }, 1000)
  159. } else {
  160. toastr.error(res.msg)
  161. }
  162. }
  163. })
  164. var Sys = {};
  165. var ua = navigator.userAgent.toLowerCase();
  166. var s, browserType;
  167. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  168. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  169. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  170. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  171. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  172. if (Sys.ie) {
  173. browserType = 'IE: ' + Sys.ie
  174. }
  175. if (Sys.firefox) {
  176. browserType = 'Firefox: ' + Sys.firefox
  177. }
  178. if (Sys.chrome) {
  179. browserType = 'Chrome: ' + Sys.chrome
  180. }
  181. if (Sys.opera) {
  182. browserType = 'Opera: ' + Sys.opera
  183. }
  184. if (Sys.safari) {
  185. browserType = 'Safari: ' + Sys.safari
  186. }
  187. var form = {
  188. platform: 4,
  189. visitType: 4,
  190. time: time,
  191. phoneNum: ipt_phone,
  192. downLoaderCount: Number(localStorage.getItem('downLoaderCount')),
  193. browserType: browserType
  194. }
  195. var list = []
  196. list.push(form)
  197. // 推广页面下载埋点接口
  198. $.ajax({
  199. url: baseUrl + '/api/activity/user/access/burialSiteLog',
  200. data: JSON.stringify(list),
  201. type: 'post',
  202. contentType: "application/json",
  203. dataType: 'json',
  204. cache: false,
  205. success: function (res) {
  206. }
  207. })
  208. }
  209. }
  210. function visit() {
  211. $.ajax({
  212. url: baseUrl + '/promote/addInviteData',
  213. type: 'get',
  214. cache: false,
  215. dataType: 'text',
  216. success: function () {
  217. }
  218. })
  219. }
  220. var timer, flag = true;
  221. //防止提示一秒内重复显示
  222. function stopManyClick(fn) {
  223. if (flag) {
  224. fn();
  225. }
  226. flag = false;
  227. if (timer) { clearTimeout(timer); }
  228. timer = setTimeout(() => { flag = true }, 1500);
  229. }
  230. // visit()
  231. </script>
  232. </body>
  233. <style>
  234. #toast-container>.toast-error {
  235. background-image: none !important;
  236. }
  237. .toast-error {
  238. background-color: rgba(0, 0, 0, 0.8);
  239. }
  240. #toast-container>div {
  241. font-size: 14px;
  242. min-width: 80px !important;
  243. padding: 12px !important;
  244. box-shadow: none;
  245. }
  246. .toast-center-center {
  247. position: fixed;
  248. min-width: 220px;
  249. top: 50%;
  250. left: 50%;
  251. text-align: center;
  252. transform: translateX(-50%);
  253. color: #FFFFFF;
  254. border-radius: 0.2rem;
  255. }
  256. @media (max-width: 480px) and (min-width: 241px) {
  257. #toast-container>div {
  258. min-width: 80px !important;
  259. width: auto;
  260. }
  261. }
  262. @media only screen and (min-width: 640px) {
  263. .toast-center-center {
  264. top: 50%;
  265. left: 50%;
  266. transform: translate(-50%, -50%);
  267. }
  268. }
  269. @media only screen and (max-width: 640px) {
  270. .toast-center-center {
  271. top: 50%;
  272. left: 50%;
  273. transform: translate(-50%, -50%);
  274. }
  275. }
  276. input::-webkit-input-placeholder {
  277. color: #BBBBBB;
  278. }
  279. input::-moz-placeholder {
  280. /* Mozilla Firefox 19+ */
  281. color: #BBBBBB;
  282. }
  283. input:-moz-placeholder {
  284. /* Mozilla Firefox 4 to 18 */
  285. color: #BBBBBB;
  286. }
  287. input:-ms-input-placeholder {
  288. /* Internet Explorer 10-11 */
  289. color: #BBBBBB;
  290. }
  291. </style>
  292. </html>