123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>邀请有礼</title>
- <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
- <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
- <link rel="stylesheet" href="../static/css/invite.css">
- <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
- <script src="../static/js/vender/toastr/toastr.min.js"></script>
- <script src="../static/js/vender/config.js"></script>
- </head>
- <body>
- <div class="invite-container">
- <div class="pr">
- <picture>
- <source media="(max-width: 640px)" srcset="../static/img/inviteTop.png 640w" />
- <source media="(min-width: 640px)" srcset="../static/img/inviteTop.png 1366w" />
- <img src="../static/img/inviteTop.png" class="bottom-img" alt="">
- </picture>
- <div class="recv-cont">
- <div class="recv-ipt" id="recv_ipt">
- <span id="invitationCode"></span>
- <span class="copy-btn-style btn-code-copy">复制</span>
- </div>
- <div onclick="appDown()" class="mt40">
- <div class="recv-btn" id="recv_btn"></div>
- </div>
- </div>
- </div>
- <div class="load-menu">
- <div class="center-reward-con">
- <div class="top-title">你的奖励</div>
- <div class="reward-second-title">好友购机,返时长奖励</div>
- <div id="goode"></div>
- </div>
- <div>
- <div class="code-title-font">活动规则</div>
- <div class="tb-codes">
- <p class="fw500 fs28">一.邀好友,赚时长</p>
- <p class="fs26">邀请好友成功注册账号,即可获 24小时时长奖励;每月仅限获 500天奖励;</p>
- <p class="fw500 fs28">二.好友购机,买一送一</p>
- <p class="fs26 mb45">被邀好友购买任意套餐,您可获其等额时长返现(仅限首单);邀请越多返现越多,返现无上限;</p>
- <p class="fw500 fs26">规则</p>
- <p class="fs26">1. 账户内无云手机,或仅有2小时免费体验时长的用户,则无法获时长奖励;</p>
- <p class="fs26">2. 时长奖励直接下发至您账户内时长最多的云手机;</p>
- <p class="fs26">3. 如发现有刷单等行为用户,将对该账号及其所关联账号进行冻结处理;</p>
- <p class="fs26">4. 本活动最终解释权归双子星云手机所有。</p>
- </div>
- </div>
- </div>
- </div>
- <input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="passwordCopy" value="">
- <input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="inviteCopy" value="">
- <script>
- window.onload = window.onresize = function () {
- verticalAlign()
- }
- function verticalAlign() {
- var html = document.documentElement;
- var BodyWidth = html.getBoundingClientRect().width;
- if (BodyWidth > 750) {
- html.style.fontSize = 750 / 7.5 + 'px';
- } else {
- html.style.fontSize = BodyWidth / 7.5 + 'px';
- }
- }
- </script>
- <script>
- toastr.options.positionClass = 'toast-center-center';
- toastr.options.timeOut = '3000';
- </script>
- <script type="text/javascript" th:inline="javascript">
- var url = window.location.href;
- url = url.split('/')
- // var baseUrl = url[0] + '//' + url[2]
- var loc = window.location.search;
- var n1 = loc.length;//地址的总长度
- var n2 = loc.indexOf("=");//取得=号的位置
- var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
- var u = navigator.userAgent;
- var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
- if (isiOS) {
- var btnMsg = '立即邀请'
- } else if (isAndroid) {
- btnMsg = '立即邀请'
- } else {
- btnMsg = '复制邀请链接'
- }
- $('#recv_btn').append(btnMsg)
- $.ajax({
- url: baseUrl + '/api/user/v3/invitation/client/getInvitationInfo',
- type: 'get',
- headers: {
- 'Authorization': id //id
- },
- contentType: "application/json",
- dataType: 'json',
- success: function (res) {
- $('#invitationCode').text(res.data.invitationCode)
- //加载数据
- $('#passwordCopy').val($('#invitationCode').text());
- //复制按钮
- $('.btn-code-copy').on('click', function () {
- var input = document.getElementById("passwordCopy");
- // 选中文本
- input.select();
- // 执行浏览器复制命令
- document.execCommand("copy");
- toastr.error('复制成功', 0)
- });
- if (res.data.friendList.length > 0) {
- var str = '<ul class="goodFriend-title-list"><li class="tal">被邀请好友帐号</li><li class="tac">获时长数(小时)</li><li class="tar">邀请时间</li></ul>'
- for (var i = 0; i < res.data.friendList.length; i++) {
- var phone = res.data.friendList[i].newPhone
- var inviteMsg = res.data.friendList[i].duration
- var registerTime = res.data.friendList[i].createTime
- var nPhone = phone.substr(0, 3) + '****' + phone.substring(7, 11)
- str += '<div class="goodFriend-item">'
- str += '<span class="tal">' + nPhone + '</span>'
- str += Number(inviteMsg) && inviteMsg > 0 ? '<span class="tac cF04646">' + inviteMsg + '</span>' : '<span class="tac">' + inviteMsg + '</span>'
- str += '<span class="tar">' + registerTime + '</span>'
- str += '</div>';
- }
- } else if (res.data.friendList.length === 0) {
- str = '<div class="no-data">还没有邀请到好友哦~</div>'
- }
- $('#goode').append(str);
- }, error: function () {
- str = '<div class="no-data">还没有邀请到好友哦~</div>'
- $('#goode').append(str)
- }
- })
- $("#recv_ipt").bind('input propertychange', function (e) {
- var ipt_phones = $('#recv_ipt').val();
- var c = $(this);
- if (/[^\d]/.test(c.val())) {//替换非数字字符
- var temp_amount = c.val().replace(/[^\d]/g, '');
- $(this).val(temp_amount);
- toastr.error('请输入正确的手机号')
- }
- if (ipt_phones.length >= 12) {
- toastr.error('请输入正确的手机号')
- var recvstr = ipt_phones.substring(0, 11)
- $("#recv_ipt").val(recvstr);
- }
- });
- function appDown() {
- var u = navigator.userAgent;
- var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
- if (isiOS) {
- $.ajax({
- url: baseUrl + '/api/user/v1/promote',
- type: 'get',
- headers: {
- 'Authorization': id //id
- },
- contentType: "application/json",
- dataType: 'json',
- cache: false,
- success: function (res) {
- var jsonStr = JSON.stringify(res.data)
- var jsonObj = JSON.parse(jsonStr)
- // WKWebView使用
- // 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
- try {
- getMessage(jsonObj);
- } catch (error) {
- console.log(error)
- }
- try {
- window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
- } catch (error) {
- console.log(error)
- }
- }
- })
- } else if (isAndroid) {
- window.native.onClikWebView()
- } else {
- $.ajax({
- url: baseUrl + '/api/user/v1/promote',
- type: 'get',
- headers: {
- 'Authorization': id //id
- },
- contentType: "application/json",
- dataType: 'json',
- cache: false,
- success: function (res) {
- //加载数据
- var copyBefore = JSON.stringify(res.data.url);
- var copyUrl = copyBefore.split('"');
- $('#inviteCopy').val(copyUrl[1]);
- var input = document.getElementById("inviteCopy");
- // 选中文本
- input.select();
- // 执行浏览器复制命令
- document.execCommand("copy");
- toastr.error('复制成功')
- }
- })
- }
- }
- </script>
- </body>
- </html>
|