invite4.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  6. <title>免费换机</title>
  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/verify.css">
  10. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  11. <link rel="stylesheet" href="../static/css/replacementActivities.css">
  12. <script>
  13. (function () {
  14. if (!window.Promise) {
  15. document.writeln('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.min.js"><' + '/' + 'script>');
  16. }
  17. })();
  18. </script>
  19. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  20. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  21. <script src="../static/js/vender/config.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. </head>
  26. <body>
  27. <div class="container">
  28. <div class="share-node">
  29. <img class="share" onclick="share()" src="../static/img/replacementActivities/share.png" alt="">
  30. <div class="line"></div>
  31. <img class="qq" onclick="urlToQQ()" src="../static/img/replacementActivities/qq.png" alt="">
  32. <!-- <div class="line"></div>
  33. <a href="qq://mqqwpa://im/chat?chat_type=wpa&uin=800183764&version=1&src_type=web&web_src=oicqzone.com"><img
  34. class="cs" src="../static/img/replacementActivities/cs.png" alt=""></a> -->
  35. </div>
  36. <div class="date">2022.1.4-2022.2.8</div>
  37. <div class="header">
  38. <div class="login-container">
  39. <div class="login-bar">仅限2000份</div>
  40. <div class="ipt"></div>
  41. <div class="input-container">
  42. <div class="login-row-select">
  43. <div class="login-row-title">选择</div>
  44. <input class="login-row-ipt" id="select" placeholder="请选择平台" readonly />
  45. <img class="icon-down-img" src="../static/img/replacementActivities/arrow.png" />
  46. </div>
  47. <div class="options">
  48. <div class="icon-down-second">红手指</div>
  49. <div class="icon-down-first">多多云</div>
  50. <div class="icon-down-third">爱云兔</div>
  51. </div>
  52. <div class="login-row-account">
  53. <div class="login-row-title">账户</div>
  54. <input class="login-row-ipt" id="account" placeholder="请输入11位手机号码" />
  55. </div>
  56. <div class="tip-text1"></div>
  57. <div class="login-row-password">
  58. <div class="login-row-title">密码</div>
  59. <input class="login-row-ipt" type="password" id="password" placeholder="请输入密码" />
  60. </div>
  61. <div class="tip-text2"></div>
  62. <div class="login-row-password">
  63. <div class="login-row-title">确认密码</div>
  64. <input class="login-row-ipt" type="password" id="check" placeholder="请重新输入密码" />
  65. </div>
  66. <div class="tip-text3"></div>
  67. <div class="form-btn" id="form-btn" onclick="handleOnClick()"></div>
  68. <div id="mpanel2"></div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="mt55">
  73. <img class="w666h874" src="../static/img/replacementActivities/activityReward.png" alt="">
  74. </div>
  75. <div class="mt50">
  76. <img class="w670h476" src="../static/img/replacementActivities/inviteeReward.png" alt="">
  77. </div>
  78. <div class="mt50" style="margin-bottom: 0.71rem;">
  79. <img class="w666h864" src="../static/img/replacementActivities/mattersNeedAttention.png" alt="">
  80. </div>
  81. <div class="mask1">
  82. <div class="dialog1">
  83. <img class="dialog-bg" src="../static/img/replacementActivities/dialog.png" />
  84. <div class="title1">已经注册过双子星</div>
  85. <img class="register-btn" src="../static/img/replacementActivities/register-btn.png" />
  86. <div class="register-text">您已是注册用户,可分享活动邀请有奖</div>
  87. <img class="close" onclick="registerHandle()" src="../static/img/replacementActivities/close.png" alt="">
  88. </div>
  89. <div class="tip">
  90. <img class="dialog2-bg" src="../static/img/replacementActivities/dialog2.png" />
  91. <div class="title1" style="left: 1.77rem;">已提交兑换申请</div>
  92. <div class="register-text">审核通过者,将在3个工作日内收到短<br />信通知并发放奖励,请留意短信消息。</div>
  93. <img class="close" onclick="handleClose('tip')" src="../static/img/replacementActivities/close.png" alt="">
  94. </div>
  95. <div class="tip1">
  96. <img class="dialog3-bg" src="../static/img/replacementActivities/dialog3.png" />
  97. <div class="title1" style="left: 1.75rem;text-align: center;">该账号已经申请<br />请等待审核</div>
  98. <img class="close" onclick="handleClose('tip1')" src="../static/img/replacementActivities/close.png" alt="">
  99. </div>
  100. </div>
  101. </div>
  102. <script>
  103. toastr.options.positionClass = 'toast-center-center';
  104. toastr.options.timeOut = '1500';
  105. </script>
  106. <script type="text/javascript">
  107. Date.prototype.Format = function (fmt) { // author: meizz
  108. var o = {
  109. "M+": this.getMonth() + 1, // 月份
  110. "d+": this.getDate(), // 日
  111. "h+": this.getHours(), // 小时
  112. "m+": this.getMinutes(), // 分
  113. "s+": this.getSeconds(), // 秒
  114. "q+": Math.floor((this.getMonth() + 3) / 3), // 季度
  115. "S": this.getMilliseconds() // 毫秒
  116. };
  117. if (/(y+)/.test(fmt))
  118. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  119. for (var k in o)
  120. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  121. return fmt;
  122. }
  123. let timer, flag = true;
  124. let entryPageTime = new Date().Format("yyyy-MM-dd hh:mm:ss");
  125. let fromType = 0, account = '', password = '', checkPass = '';
  126. var url = window.location.href;
  127. url = url.split('/')
  128. var loc = window.location.search,
  129. n1 = loc.length,//地址的总长度
  130. n2 = loc.indexOf("="),//取得=号的位置
  131. id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
  132. u = navigator.userAgent,
  133. ua = navigator.userAgent.toLowerCase(),
  134. isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  135. isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  136. //埋点
  137. operate('dt_yhs_活动页面浏览');
  138. function operate(pointName, type, captchaVerification) {
  139. $.ajax({
  140. url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
  141. type: 'post',
  142. data: JSON.stringify({
  143. pointName: pointName
  144. }),
  145. contentType: "application/json",
  146. dataType: 'json',
  147. cache: false,
  148. success: function (res) {
  149. if (type === 'click') {
  150. changePhone(captchaVerification);
  151. }
  152. },
  153. })
  154. }
  155. // 跳转至QQ群
  156. function urlToQQ() {
  157. stopManyClick(() => {
  158. var oInput = document.createElement('input'); //创建一个input
  159. oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  160. oInput.value = '595757816';
  161. $('.ipt')[0].appendChild(oInput);//将input插入到body
  162. // oInput.select(); // 选择对象 ios不支持
  163. selectText(oInput, 0, oInput.value.length);
  164. document.execCommand("Copy"); // 执行浏览器复制命令
  165. toastr.error('QQ群号复制成功');
  166. oInput.style.display = 'none'; // 将input隐藏
  167. oInput.blur();
  168. oInput.remove(); // 将input销毁
  169. // window.location.href = 'https://jq.qq.com/?_wv=1027&k=6KwBYb7o';
  170. })
  171. }
  172. //点击分享
  173. $('.register-btn')[0].addEventListener('click', () => {
  174. if (!id) {
  175. copyUrl();
  176. } else if (isiOS) {
  177. $.ajax({
  178. url: baseUrl + '/api/user/v1/promote',
  179. type: 'get',
  180. headers: {
  181. 'Authorization': id //id
  182. },
  183. contentType: "application/json",
  184. dataType: 'json',
  185. cache: false,
  186. success: function (res) {
  187. var jsonStr = JSON.stringify(res.data)
  188. var jsonObj = JSON.parse(jsonStr)
  189. // WKWebView使用
  190. // 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
  191. try {
  192. getMessage(jsonObj);
  193. } catch (error) {
  194. console.log(error)
  195. }
  196. try {
  197. window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
  198. } catch (error) {
  199. copyUrl();
  200. }
  201. }
  202. })
  203. } else if (isAndroid) {
  204. if (window.native) {
  205. window.native.onClikWebView()
  206. } else {
  207. copyUrl();
  208. }
  209. } else {
  210. copyUrl();
  211. }
  212. }, false);
  213. function share() {
  214. if (!id) {
  215. copyUrl();
  216. } else if (isiOS) {
  217. $.ajax({
  218. url: baseUrl + '/api/user/v1/promote',
  219. type: 'get',
  220. headers: {
  221. 'Authorization': id //id
  222. },
  223. contentType: "application/json",
  224. dataType: 'json',
  225. cache: false,
  226. success: function (res) {
  227. var jsonStr = JSON.stringify(res.data)
  228. var jsonObj = JSON.parse(jsonStr)
  229. // WKWebView使用
  230. // 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
  231. try {
  232. getMessage(jsonObj);
  233. } catch (error) {
  234. console.log(error)
  235. }
  236. try {
  237. window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
  238. } catch (error) {
  239. copyUrl();
  240. }
  241. }
  242. })
  243. } else if (isAndroid) {
  244. if (window.native) {
  245. window.native.onClikWebView()
  246. } else {
  247. copyUrl();
  248. }
  249. } else {
  250. copyUrl();
  251. }
  252. }
  253. //复制
  254. function copyUrl() {
  255. stopManyClick(() => {
  256. var oInput = document.createElement('input'); //创建一个input
  257. oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
  258. oInput.value = window.location.href || 'https://client.androidscloud.com/h5/microserviceUserH5/vcloud/invite.html';
  259. $('.ipt')[0].appendChild(oInput);//将input插入到body
  260. // oInput.select(); // 选择对象 ios不支持
  261. selectText(oInput, 0, oInput.value.length);
  262. document.execCommand("Copy"); // 执行浏览器复制命令
  263. toastr.error('复制当前网址成功!');
  264. oInput.style.display = 'none'; // 将input隐藏
  265. oInput.blur();
  266. oInput.remove(); // 将input销毁
  267. })
  268. }
  269. // input自带的select()方法在苹果端无法进行选择,所以需要自己去写一个类似的方法
  270. // 选择文本。createTextRange(setSelectionRange)是input方法
  271. function selectText(textbox, startIndex, stopIndex) {
  272. if (textbox.createTextRange) {//ie
  273. const range = textbox.createTextRange();
  274. range.collapse(true);
  275. range.moveStart('character', startIndex);//起始光标
  276. range.moveEnd('character', stopIndex - startIndex);//结束光标
  277. range.select();//不兼容苹果
  278. } else {//firefox/chrome
  279. textbox.setSelectionRange(startIndex, stopIndex);
  280. textbox.focus();
  281. }
  282. }
  283. // 默认选中红手指
  284. function handleClick() {
  285. $('.options')[0].className = 'options';
  286. $('#select').val('红手指');
  287. fromType = 2;
  288. };
  289. handleClick();
  290. //点击选择框
  291. $('.login-row-select')[0].addEventListener('click', () => {
  292. $('.options')[0].className = 'options show';
  293. }, false);
  294. //点击多多云
  295. $('.icon-down-first')[0].addEventListener('click', () => {
  296. $('.options')[0].className = 'options';
  297. $('#select').val('多多云');
  298. fromType = 1;
  299. }, false);
  300. //点击红手指
  301. $('.icon-down-second')[0].addEventListener('click', handleClick, false);
  302. //点击爱云兔
  303. $('.icon-down-third')[0].addEventListener('click', () => {
  304. $('.options')[0].className = 'options';
  305. $('#select').val('爱云兔');
  306. fromType = 3;
  307. }, false);
  308. //点击弹窗关闭按钮
  309. function handleClose(str) {
  310. $('.' + str).animate({ top: '-6.96rem' }, "fast");
  311. $('.mask1').hide();
  312. document.documentElement.style.overflow = 'auto';
  313. }
  314. //点击关闭
  315. function registerHandle() {
  316. $('.dialog1').animate({ top: '-6.96rem' }, "fast");
  317. $('.mask1').hide();
  318. document.documentElement.style.overflow = 'auto';
  319. }
  320. var html = document.documentElement;
  321. var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
  322. var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
  323. var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
  324. // validate(); // 生成验证码
  325. function handleOnClick() {
  326. console.log(595757816)
  327. stopManyClick(()=>{toastr.error('活动已结束!')})
  328. }
  329. function validate() {
  330. $('#mpanel2').slideVerify({
  331. baseUrl: baseUrl + '/api/activity', //服务器请求地址, 默认地址为安吉服务器;
  332. mode: 'pop', //展示模式
  333. containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
  334. imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
  335. width: imgWidth,
  336. height: imgHeight
  337. },
  338. barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
  339. width: imgWidth,
  340. height: barHeight
  341. },
  342. beforeCheck: function () {
  343. account = $('#account').val();
  344. account = account.replace(/\s+/g, "");
  345. password = $('#password').val();
  346. password = password.replace(/\s+/g, "");
  347. checkPass = $('#check').val();
  348. checkPass = checkPass.replace(/\s+/g, "");
  349. if (!account) {
  350. $('.tip-text1').text('账号格式不正确,请重新输入!');
  351. $('#account').addClass('br');
  352. return false
  353. } else {
  354. $('.tip-text1').text('');
  355. $('#account').removeClass('br')
  356. }
  357. if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(account)) {
  358. $('.tip-text1').text('账号格式不正确,请重新输入!');
  359. $('#account').addClass('br');
  360. return false
  361. } else {
  362. $('.tip-text1').text('');
  363. $('#account').removeClass('br')
  364. }
  365. if (!password) {
  366. $('.tip-text2').text('密码为空,请重新输入');
  367. $('#password').addClass('br');
  368. return false
  369. } else {
  370. $('.tip-text2').text('');
  371. $('#password').removeClass('br');
  372. }
  373. if (checkPass !== password) {
  374. $('.tip-text3').text('两次密码不一致,请重新输入!');
  375. $('#check').addClass('br');
  376. return false
  377. } else {
  378. $('.tip-text3').text('');
  379. $('#check').removeClass('br');
  380. return true
  381. }
  382. },
  383. ready: function () { }, //加载完毕的回调
  384. success: function (params) { //成功的回调
  385. operate('dt_yhs_点击免费换机按钮', 'click', params.captchaVerification);
  386. },
  387. error: function () {}
  388. });
  389. }
  390. //调用免费换机接口
  391. function changePhone(captchaVerification) {
  392. let data = {
  393. inviteTime: entryPageTime,
  394. type: fromType,
  395. account: account,
  396. password: password,
  397. captchaVerification: captchaVerification
  398. }
  399. if (!id) {
  400. delete data.inviteTime
  401. }
  402. let ajaxObj = {
  403. url: baseUrl + '/api/public/v1/activity/change/phone',
  404. type: 'post',
  405. headers: {
  406. 'Authorization': id //id
  407. },
  408. data: JSON.stringify(data),
  409. contentType: "application/json",
  410. dataType: 'json',
  411. cache: false,
  412. success: function (res) {
  413. if (res.status === 0) {
  414. $('.tip').animate({ top: '46vh' }, "fast");
  415. $('.mask1').show();
  416. $('.dialog1').animate({ top: '-6.96rem' }, "fast");
  417. $('.tip1').animate({ top: '-6.96rem' }, "fast");
  418. document.documentElement.style.overflow = 'hidden';
  419. } else if (res.status === 2002) {
  420. $('.tip1').animate({ top: '48vh' }, "fast");
  421. $('.mask1').show();
  422. $('.dialog1').animate({ top: '-6.96rem' }, "fast");
  423. $('.tip').animate({ top: '-6.96rem' }, "fast");
  424. document.documentElement.style.overflow = 'hidden';
  425. } else if (res.status === 2001) {
  426. $('.dialog1').animate({ top: '48vh' }, "fast");
  427. $('.mask1').show();
  428. $('.tip').animate({ top: '-6.96rem' }, "fast");
  429. $('.tip1').animate({ top: '-6.96rem' }, "fast");
  430. document.documentElement.style.overflow = 'hidden';
  431. }
  432. }
  433. }
  434. if (!id) {
  435. delete ajaxObj.headers
  436. }
  437. $.ajax(ajaxObj)
  438. }
  439. //防止提示一秒内重复显示
  440. function stopManyClick(fn) {
  441. if (flag) {
  442. fn();
  443. }
  444. flag = false;
  445. if (timer) { clearTimeout(timer); }
  446. timer = setTimeout(() => { flag = true }, 1500);
  447. }
  448. </script>
  449. </body>
  450. <style>
  451. #toast-container>.toast-error {
  452. background-image: none !important;
  453. }
  454. .toast-error {
  455. background-color: rgba(0, 0, 0, 0.8);
  456. }
  457. #toast-container>div {
  458. font-size: 14px;
  459. min-width: 80px !important;
  460. padding: 12px !important;
  461. box-shadow: none;
  462. }
  463. .toast-center-center {
  464. position: fixed;
  465. min-width: 220px;
  466. top: 50%;
  467. left: 50%;
  468. text-align: center;
  469. transform: translateX(-50%);
  470. color: #FFFFFF;
  471. border-radius: 0.2rem;
  472. }
  473. @media (max-width: 480px) and (min-width: 241px) {
  474. #toast-container>div {
  475. min-width: 80px !important;
  476. width: auto;
  477. }
  478. }
  479. @media only screen and (min-width: 640px) {
  480. .toast-center-center {
  481. top: 50%;
  482. left: 50%;
  483. transform: translate(-50%, -50%);
  484. }
  485. }
  486. @media only screen and (max-width: 640px) {
  487. .toast-center-center {
  488. top: 50%;
  489. left: 50%;
  490. transform: translate(-50%, -50%);
  491. }
  492. }
  493. input::-webkit-input-placeholder {
  494. color: #BBBBBB;
  495. }
  496. input::-moz-placeholder {
  497. /* Mozilla Firefox 19+ */
  498. color: #BBBBBB;
  499. }
  500. input:-moz-placeholder {
  501. /* Mozilla Firefox 4 to 18 */
  502. color: #BBBBBB;
  503. }
  504. input:-ms-input-placeholder {
  505. /* Internet Explorer 10-11 */
  506. color: #BBBBBB;
  507. }
  508. </style>
  509. </html>