changePhoneActivity.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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" 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="rule-text" src="../static/img/changePhoneActivity/rule-text.png" />
  54. </div>
  55. <div class="entry-QQ">
  56. <img class="entry-QQ-btn" src="../static/img/changePhoneActivity/entry-QQ-btn.png" />
  57. <img class="entry-QQ-text" src="../static/img/changePhoneActivity/entry-QQ-text.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>
  75. <script>
  76. toastr.options.positionClass = 'toast-center-center';
  77. toastr.options.timeOut = '1500';
  78. </script>
  79. <script type="text/javascript">
  80. let timer,flag = true;
  81. let fromType = 0,
  82. account = '',
  83. password = '';
  84. var url = window.location.href;
  85. url = url.split('/')
  86. var baseUrl = 'http://192.168.31.198'
  87. var loc = window.location.search,
  88. n1 = loc.length,//地址的总长度
  89. n2 = loc.indexOf("="),//取得=号的位置
  90. id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
  91. u = navigator.userAgent,
  92. ua = navigator.userAgent.toLowerCase(),
  93. isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  94. isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  95. //埋点
  96. operate('10月换机活动');
  97. function operate(pointName,type){
  98. $.ajax({
  99. url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
  100. type: 'post',
  101. data:JSON.stringify({
  102. pointName: pointName
  103. }),
  104. contentType:"application/json",
  105. dataType: 'json',
  106. cache: false,
  107. success: function (res) {
  108. if(type === 'click'){
  109. changePhone();
  110. }
  111. },
  112. })
  113. }
  114. //点击选择框
  115. $('.login-row-select')[0].addEventListener('click',()=>{
  116. $('.options')[0].className = 'options show';
  117. },false);
  118. //点击多多云
  119. $('.icon-down-first')[0].addEventListener('click',()=>{
  120. $('.options')[0].className = 'options';
  121. $('#select').val('多多云');
  122. fromType = 1;
  123. },false);
  124. //点击红手指
  125. $('.icon-down-second')[0].addEventListener('click',()=>{
  126. $('.options')[0].className = 'options';
  127. $('#select').val('红手指');
  128. fromType = 2;
  129. },false);
  130. //点击免费换机按钮
  131. $('.login-btn-text')[0].addEventListener('click',changePhoneHandle,false);
  132. $('.login-btn')[0].addEventListener('click',changePhoneHandle,false);
  133. function changePhoneHandle(){
  134. account = $('#account').val();
  135. password = $('#password').val();
  136. if(fromType === 0){
  137. stopManyClick(() =>{
  138. toastr.error('请选择兑换时常的平台')
  139. })
  140. return
  141. }
  142. if(account === ''){
  143. stopManyClick(() =>{
  144. toastr.error('请输入兑换时常的账号')
  145. })
  146. return
  147. }
  148. if(password === ''){
  149. stopManyClick(() =>{
  150. toastr.error('请输入兑换时常的密码')
  151. })
  152. return
  153. }
  154. operate('10月换机活动','click');
  155. }
  156. //调用免费换机接口
  157. function changePhone(){
  158. $.ajax({
  159. url: baseUrl + '/api/public/v1/activity/change/phone',
  160. type: 'post',
  161. data:JSON.stringify({
  162. type: fromType,
  163. account: account,
  164. password: password
  165. }),
  166. contentType: "application/json",
  167. dataType: 'json',
  168. cache: false,
  169. success: function (res) {
  170. if(res.status === 0){
  171. window.location.href = 'https://wjzx.androidscloud.com:9091/file-center/fileOperate/downloadFile?id=573420181';
  172. }else{
  173. stopManyClick(() =>{
  174. toastr.error(res.msg)
  175. })
  176. }
  177. },
  178. })
  179. }
  180. //防止提示一秒内重复显示
  181. function stopManyClick(fn) {
  182. if (flag) {
  183. fn();
  184. }
  185. flag = false;
  186. if(timer){clearTimeout(timer);}
  187. timer = setTimeout(() => {flag = true}, 1500);
  188. }
  189. </script>
  190. </body>
  191. </html>