invite1.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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/toastr/toastr.min.css">
  9. <link rel="stylesheet" href="../static/css/invite.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. <style>
  14. .my-tips{
  15. position: fixed;
  16. top: 50%;
  17. left: 50%;
  18. transform: translate(-50%, -50%);
  19. font-size: 0.28rem;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div class="my-tips">当前功能维护中,暂无法使用</div>
  25. <!-- <div class="invite-container">
  26. <div class="pr">
  27. <picture>
  28. <source media="(max-width: 640px)" srcset="../static/img/inviteTop.png 640w" />
  29. <source media="(min-width: 640px)" srcset="../static/img/inviteTop.png 1366w" />
  30. <img src="../static/img/inviteTop.png" class="bottom-img" alt="">
  31. </picture>
  32. <div class="recv-cont">
  33. <div class="recv-ipt" id="recv_ipt">
  34. <span id="invitationCode"></span>
  35. <span class="copy-btn-style btn-code-copy">复制</span>
  36. </div>
  37. <div onclick="appDown()" class="mt40">
  38. <div class="recv-btn" id="recv_btn"></div>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="load-menu">
  43. <div class="center-reward-con">
  44. <div class="top-title">你的奖励</div>
  45. <div class="reward-second-title">好友购机,返时长奖励</div>
  46. <div id="goode"></div>
  47. </div>
  48. <div>
  49. <div style="display: flex;justify-content: center;">
  50. <div class="code-title-font"></div>
  51. </div>
  52. <div class="tb-codes">
  53. <p class="fw500 fs28">好友购机,买一送一</p>
  54. <p class="fs26">被邀好友购买任意套餐,您可获其等额时长返现(仅限首单);邀请越多返现越多,返现无上限;</p>
  55. <p class="fs26 mb45">请在参与活动前认真阅读规则,因未按规则参与活动而造成的损失,由用户自行承担</p>
  56. <p class="fw500 fs26">规则</p>
  57. <p class="fs26">1. 好友购机前,邀请人账户内无云手机(无云机购买记录者),或仅有2小时免费体验时长的用户,则无法获时长奖励;</p>
  58. <p class="fs26">2. 邀请成功后,双方自动成为好友,邀请奖励将通过好友消息的方式进行发放,邀请方需要点击【领取】,才可领取成功。邀请奖励领取期限为24小时,超过领取期限则无法领取奖励。</p>
  59. <p class="fs26">3. 如发现有刷单等行为用户,将对该账号及其所关联账号进行冻结处理;</p>
  60. <p class="fs26">4. 本活动最终解释权归双子星云手机所有。</p>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="passwordCopy" value="">
  66. <input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="inviteCopy" value="">
  67. <script>
  68. toastr.options.positionClass = 'toast-center-center';
  69. toastr.options.timeOut = '3000';
  70. </script>
  71. <script type="text/javascript">
  72. var url = window.location.href;
  73. url = url.split('/')
  74. // var baseUrl = url[0] + '//' + url[2]
  75. var loc = window.location.search;
  76. var n1 = loc.length;//地址的总长度
  77. var n2 = loc.indexOf("=");//取得=号的位置
  78. var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
  79. var u = navigator.userAgent;
  80. var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
  81. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  82. if (isiOS) {
  83. var btnMsg = '立即邀请'
  84. } else if (isAndroid) {
  85. btnMsg = '立即邀请'
  86. } else {
  87. btnMsg = '复制邀请链接'
  88. }
  89. $('#recv_btn').append(btnMsg)
  90. $.ajax({
  91. url: baseUrl + '/api/user/v3/invitation/client/getInvitationInfo',
  92. type: 'get',
  93. headers: {
  94. 'Authorization': id //id
  95. },
  96. contentType: "application/json",
  97. dataType: 'json',
  98. cache: false,
  99. success: function (res) {
  100. $('#invitationCode').text(res.data.invitationCode)
  101. //加载数据
  102. $('#passwordCopy').val($('#invitationCode').text());
  103. //复制按钮
  104. $('.btn-code-copy').on('click', function () {
  105. var input = document.getElementById("passwordCopy");
  106. // 选中文本
  107. input.select();
  108. // 执行浏览器复制命令
  109. document.execCommand("copy");
  110. toastr.error('复制成功', 0)
  111. });
  112. if (res.data.friendList.length > 0) {
  113. var str = '<ul class="goodFriend-title-list"><li class="tal">被邀请好友帐号</li><li class="tac">获时长数(小时)</li><li class="tar">邀请时间</li></ul>'
  114. for (var i = 0; i < res.data.friendList.length; i++) {
  115. var phone = res.data.friendList[i].newPhone
  116. var inviteMsg = res.data.friendList[i].duration
  117. var registerTime = res.data.friendList[i].createTime
  118. var nPhone = phone.substr(0, 3) + '****' + phone.substring(7, 11)
  119. str += '<div class="goodFriend-item">'
  120. str += '<span class="tal">' + nPhone + '</span>'
  121. str += Number(inviteMsg) && inviteMsg > 0 ? '<span class="tac cF04646">' + inviteMsg + '</span>' : '<span class="tac">' + inviteMsg + '</span>'
  122. str += '<span class="tar">' + registerTime + '</span>'
  123. str += '</div>';
  124. }
  125. } else if (res.data.friendList.length === 0) {
  126. str = '<div class="no-data">还没有邀请到好友哦~</div>'
  127. }
  128. $('#goode').append(str);
  129. },
  130. error: function () {
  131. str = '<div class="no-data">还没有邀请到好友哦~</div>'
  132. $('#goode').append(str)
  133. }
  134. })
  135. $("#recv_ipt").bind('input propertychange', function (e) {
  136. var ipt_phones = $('#recv_ipt').val();
  137. var c = $(this);
  138. if (/[^\d]/.test(c.val())) {//替换非数字字符
  139. var temp_amount = c.val().replace(/[^\d]/g, '');
  140. $(this).val(temp_amount);
  141. toastr.error('请输入正确的手机号')
  142. }
  143. if (ipt_phones.length >= 12) {
  144. toastr.error('请输入正确的手机号')
  145. var recvstr = ipt_phones.substring(0, 11)
  146. $("#recv_ipt").val(recvstr);
  147. }
  148. });
  149. function appDown() {
  150. var u = navigator.userAgent;
  151. var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
  152. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  153. if (isiOS) {
  154. $.ajax({
  155. url: baseUrl + '/api/user/v1/promote',
  156. type: 'get',
  157. headers: {
  158. 'Authorization': id //id
  159. },
  160. contentType: "application/json",
  161. dataType: 'json',
  162. cache: false,
  163. success: function (res) {
  164. var jsonStr = JSON.stringify(res.data)
  165. var jsonObj = JSON.parse(jsonStr)
  166. // WKWebView使用
  167. // 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
  168. try {
  169. getMessage(jsonObj);
  170. } catch (error) {
  171. console.log(error)
  172. }
  173. try {
  174. window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
  175. } catch (error) {
  176. console.log(error)
  177. }
  178. }
  179. })
  180. } else if (isAndroid) {
  181. window.native.onClikWebView()
  182. } else {
  183. $.ajax({
  184. url: baseUrl + '/api/user/v1/promote',
  185. type: 'get',
  186. headers: {
  187. 'Authorization': id //id
  188. },
  189. contentType: "application/json",
  190. dataType: 'json',
  191. cache: false,
  192. success: function (res) {
  193. //加载数据
  194. var copyBefore = JSON.stringify(res.data.url);
  195. var copyUrl = copyBefore.split('"');
  196. $('#inviteCopy').val(copyUrl[1]);
  197. var input = document.getElementById("inviteCopy");
  198. // 选中文本
  199. input.select();
  200. // 执行浏览器复制命令
  201. document.execCommand("copy");
  202. toastr.error('复制成功')
  203. }
  204. })
  205. }
  206. }
  207. </script> -->
  208. </body>
  209. </html>