invite.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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>下载APP</title>
  7. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  8. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  9. <link rel="stylesheet" href="../static/css/changePhoneActivity.css">
  10. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  11. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  12. <script src="../static/js/vender/config.js"></script>
  13. </head>
  14. <body>
  15. <div class="container">
  16. <div class="header">
  17. <img class="bg_img" src="../static/img/changePhoneActivity/bg.png" />
  18. <img class="share" src="../static/img/changePhoneActivity/share.png" />
  19. <img class="logo" src="../static/img/changePhoneActivity/logo.png" />
  20. <img class="theme" src="../static/img/changePhoneActivity/theme.png" />
  21. <img class="activity-bg" src="../static/img/changePhoneActivity/activity-bg.png" />
  22. <img class="time" src="../static/img/changePhoneActivity/time.png" />
  23. <div class="login-container">
  24. <img class="login-bg" src="../static/img/changePhoneActivity/login-bg.png" />
  25. <div class="login-row-select">
  26. <div class="login-row-title">选择:</div>
  27. <input class="login-row-ipt" id="select" placeholder="请选择兑换时长的平台" disabled="true" />
  28. <img class="icon-down-img" src="../static/img/changePhoneActivity/icon-down.png" />
  29. </div>
  30. <div class="options">
  31. <div class="icon-down-first">
  32. <img class="first" src="../static/img/changePhoneActivity/icon-down-first.png" />
  33. <span class="first-text">多多云</span>
  34. </div>
  35. <div class="icon-down-second">
  36. <img class="second" src="../static/img/changePhoneActivity/icon-down-second.png" />
  37. <span class="second-text">红手指</span>
  38. </div>
  39. </div>
  40. <div class="login-row-account">
  41. <div class="login-row-title">账号:</div>
  42. <input class="login-row-ipt" id="account" placeholder="请输入兑换时长的账号" />
  43. </div>
  44. <div class="login-row-password">
  45. <div class="login-row-title">密码:</div>
  46. <input class="login-row-ipt" type="password" id="password" placeholder="请输入兑换时长的密码" />
  47. </div>
  48. <img class="login-btn" src="../static/img/changePhoneActivity/login-btn.png" />
  49. <img class="login-btn-text" src="../static/img/changePhoneActivity/login-btn-text.png" />
  50. </div>
  51. <div class="read-rule">
  52. <img class="selected" src="../static/img/changePhoneActivity/selected.png" />
  53. <img class="no-selected" src="../static/img/changePhoneActivity/no-selected.png" />
  54. <img class="rule-text" src="../static/img/changePhoneActivity/rule-text.png" />
  55. </div>
  56. <div class="entry-QQ">
  57. <img class="entry-QQ-btn" src="../static/img/changePhoneActivity/entry-QQ-btn.png" />
  58. </div>
  59. </div>
  60. <div class="middle">
  61. <img class="middle_bg_img" src="../static/img/changePhoneActivity/middle_bg_img.png" />
  62. <div class="activity-rule">
  63. <img class="activity-rule-btn" src="../static/img/changePhoneActivity/activity-rule-btn.png" />
  64. <img class="activity-rule-text" src="../static/img/changePhoneActivity/activity-rule-text.png" />
  65. </div>
  66. <img class="rule1" src="../static/img/changePhoneActivity/rule1.png" />
  67. <img class="rule2" src="../static/img/changePhoneActivity/rule2.png" />
  68. <img class="rule3" src="../static/img/changePhoneActivity/rule3.png" />
  69. </div>
  70. <div class="footer">
  71. <img class="footer_bg_img" src="../static/img/changePhoneActivity/footer_bg_img.png" />
  72. <img class="rule4" src="../static/img/changePhoneActivity/rule4.png" />
  73. </div>
  74. <div class="mask">
  75. <div class="dialog">
  76. <img class="dialog-bg" src="../static/img/changePhoneActivity/dialog.png" />
  77. <img class="title" src="../static/img/changePhoneActivity/title.png" />
  78. <img class="content" src="../static/img/changePhoneActivity/content.png" />
  79. <img class="register-btn" src="../static/img/changePhoneActivity/register-btn.png" />
  80. <img class="register-text" src="../static/img/changePhoneActivity/register-text.png" />
  81. </div>
  82. <div class="tip">
  83. <img class="tip-bg" src="../static/img/changePhoneActivity/tip-bg.png" />
  84. <div class="tip-title" id="tip-text"></div>
  85. <img class="sure-btn" src="../static/img/changePhoneActivity/sure-btn.png" />
  86. <img class="sure-text" src="../static/img/changePhoneActivity/sure-text.png" />
  87. </div>
  88. </div>
  89. <input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="inviteCopy" value="">
  90. </div>
  91. <script>
  92. toastr.options.positionClass = 'toast-center-center';
  93. toastr.options.timeOut = '1500';
  94. </script>
  95. <script type="text/javascript">
  96. let timer,flag = true;
  97. let isShow = true;
  98. let fromType = 0,
  99. account = '',
  100. password = '';
  101. var url = window.location.href;
  102. url = url.split('/')
  103. // var baseUrl = 'http://192.168.31.198'
  104. var loc = window.location.search,
  105. n1 = loc.length,//地址的总长度
  106. n2 = loc.indexOf("="),//取得=号的位置
  107. id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
  108. u = navigator.userAgent,
  109. ua = navigator.userAgent.toLowerCase(),
  110. isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  111. isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  112. //埋点
  113. operate('dt_yhs_活动页面浏览');
  114. function operate(pointName,type){
  115. $.ajax({
  116. url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
  117. type: 'post',
  118. data:JSON.stringify({
  119. pointName: pointName
  120. }),
  121. contentType:"application/json",
  122. dataType: 'json',
  123. cache: false,
  124. success: function (res) {
  125. if(type === 'click'){
  126. changePhone();
  127. }
  128. },
  129. })
  130. }
  131. //点击分享
  132. $('.share')[0].addEventListener('click',()=>{
  133. if (isiOS) {
  134. try {
  135. getMessage();
  136. } catch (error) {
  137. console.log(error)
  138. }
  139. try {
  140. window.webkit.messageHandlers.getMessage.postMessage();
  141. } catch (error) {
  142. console.log(error)
  143. }
  144. }else if (isAndroid) {
  145. window.native.onClikWebView()
  146. }else{
  147. stopManyClick(() => {
  148. //加载数据
  149. var copyBefore = JSON.stringify(window.location.href);
  150. var copyUrl = copyBefore.split('"');
  151. $('#inviteCopy').val(copyUrl[1]);
  152. var input = document.getElementById("inviteCopy");
  153. // 选中文本
  154. input.select();
  155. // 执行浏览器复制命令
  156. document.execCommand("copy");
  157. toastr.error('复制成功当前网址成功!')
  158. })
  159. }
  160. },false);
  161. //点击选择框
  162. $('.login-row-select')[0].addEventListener('click',()=>{
  163. $('.options')[0].className = 'options show';
  164. },false);
  165. //点击多多云
  166. $('.icon-down-first')[0].addEventListener('click',()=>{
  167. $('.options')[0].className = 'options';
  168. $('#select').val('多多云');
  169. fromType = 1;
  170. },false);
  171. //点击红手指
  172. $('.icon-down-second')[0].addEventListener('click',()=>{
  173. $('.options')[0].className = 'options';
  174. $('#select').val('红手指');
  175. fromType = 2;
  176. },false);
  177. //点击协议
  178. $('.read-rule')[0].addEventListener('click',()=>{
  179. if(isShow){
  180. $('.selected')[0].className = 'selected hidden';
  181. $('.no-selected')[0].className = 'no-selected show';
  182. }else{
  183. $('.no-selected')[0].className = 'no-selected hidden';
  184. $('.selected')[0].className = 'selected show';
  185. }
  186. isShow = !isShow;
  187. },false);
  188. //点击提示弹窗确定
  189. $('.sure-btn')[0].addEventListener('click',handleClose,false);
  190. $('.sure-text')[0].addEventListener('click',handleClose,false);
  191. function handleClose() {
  192. $('.tip').animate({top: '-6.96rem'},"fast");
  193. $('.mask').hide();
  194. document.documentElement.style.overflow='auto';
  195. }
  196. //点击立即注册
  197. $('.register-text')[0].addEventListener('click',registerHandle,false);
  198. $('.register-btn')[0].addEventListener('click',registerHandle,false);
  199. function registerHandle(){
  200. $('.dialog').animate({top: '-6.96rem'},"fast");
  201. $('.mask').hide();
  202. document.documentElement.style.overflow='auto';
  203. window.location.href = 'http://www.androidscloud.com';
  204. }
  205. //点击免费换机按钮
  206. $('.login-btn-text')[0].addEventListener('click',changePhoneHandle,false);
  207. $('.login-btn')[0].addEventListener('click',changePhoneHandle,false);
  208. function changePhoneHandle(){
  209. account = $('#account').val();
  210. password = $('#password').val();
  211. if(fromType === 0){
  212. $('#tip-text').text('请选择兑换时长的平台');
  213. $('.tip').animate({top: '5.27rem'},"fast");
  214. $('.mask').show();
  215. document.documentElement.style.overflow='hidden';
  216. return
  217. }
  218. if(account === ''){
  219. $('#tip-text').text('请输入兑换时长的账号');
  220. $('.tip').animate({top: '5.27rem'},"fast");
  221. $('.mask').show();
  222. document.documentElement.style.overflow='hidden';
  223. return
  224. }
  225. if(password === ''){
  226. $('#tip-text').text('请输入兑换时长的密码');
  227. $('.tip').animate({top: '5.27rem'},"fast");
  228. $('.mask').show();
  229. document.documentElement.style.overflow='hidden';
  230. return
  231. }
  232. if(!isShow){
  233. $('#tip-text').text('请勾选阅读规则按钮');
  234. $('.tip').animate({top: '5.27rem'},"fast");
  235. $('.mask').show();
  236. document.documentElement.style.overflow='hidden';
  237. return
  238. }
  239. operate('dt_yhs_点击免费换机按钮','click');
  240. }
  241. //调用免费换机接口
  242. function changePhone(){
  243. let ajaxObj = {
  244. url: baseUrl + '/api/public/v1/activity/change/phone',
  245. type: 'post',
  246. headers: {
  247. 'Authorization': id //id
  248. },
  249. data:JSON.stringify({
  250. inviteTime: new Date().Format("yyyy-MM-dd hh:mm:ss"),
  251. type: fromType,
  252. account: account,
  253. password: password
  254. }),
  255. contentType: "application/json",
  256. dataType: 'json',
  257. cache: false,
  258. success: function (res) {
  259. if(res.status === 0){
  260. $('.dialog').animate({top: '4.2rem'},"fast");
  261. $('.mask').show();
  262. document.documentElement.style.overflow='hidden';
  263. }else{
  264. $('#tip-text').text(res.msg);
  265. $('.tip').animate({top: '5.27rem'},"fast");
  266. $('.mask').show();
  267. document.documentElement.style.overflow='hidden';
  268. }
  269. },
  270. }
  271. if(!id){
  272. delete ajaxObj.headers
  273. }
  274. $.ajax(ajaxObj)
  275. }
  276. //防止提示一秒内重复显示
  277. function stopManyClick(fn) {
  278. if (flag) {
  279. fn();
  280. }
  281. flag = false;
  282. if(timer){clearTimeout(timer);}
  283. timer = setTimeout(() => {flag = true}, 1500);
  284. }
  285. Date.prototype.Format = function (fmt) { // author: meizz
  286. var o = {
  287. "M+": this.getMonth() + 1, // 月份
  288. "d+": this.getDate(), // 日
  289. "h+": this.getHours(), // 小时
  290. "m+": this.getMinutes(), // 分
  291. "s+": this.getSeconds(), // 秒
  292. "q+": Math.floor((this.getMonth() + 3) / 3), // 季度
  293. "S": this.getMilliseconds() // 毫秒
  294. };
  295. if (/(y+)/.test(fmt))
  296. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  297. for (var k in o)
  298. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  299. return fmt;
  300. }
  301. </script>
  302. </body>
  303. </html>