|
@@ -39,7 +39,11 @@
|
|
|
<div class="top-title">我的奖励</div>
|
|
|
<div id="goode">
|
|
|
<div class="reward-second-title"></div>
|
|
|
- <ul class="goodFriend-title-list"><li class="tac">被邀好友帐号</li><li class="tac">获时长数(小时)</li><li class="tac">邀请时间</li></ul>
|
|
|
+ <ul class="goodFriend-title-list">
|
|
|
+ <li class="tac">被邀好友帐号</li>
|
|
|
+ <li class="tac">获时长数(小时)</li>
|
|
|
+ <li class="tac">邀请时间</li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="center-reward-con mt40">
|
|
@@ -77,7 +81,7 @@
|
|
|
toastr.options.timeOut = '1500';
|
|
|
</script>
|
|
|
<script type="text/javascript">
|
|
|
- let timer,flag = true;
|
|
|
+ let timer, flag = true;
|
|
|
var url = window.location.href;
|
|
|
url = url.split('/')
|
|
|
// var baseUrl = url[0] + '//' + url[2]
|
|
@@ -86,11 +90,18 @@
|
|
|
var n2 = loc.indexOf("=");//取得=号的位置
|
|
|
// var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
|
|
|
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 (!id) {
|
|
|
+ if (isAndroid) {
|
|
|
+ window.native.toGame('noToken');
|
|
|
+ } else if (isiOS) {
|
|
|
+ window.webkit.messageHandlers.getPackageName.postMessage('noToken');
|
|
|
+ } else {
|
|
|
+ toastr.error('请登录')
|
|
|
+ }
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
url: baseUrl + '/api/user/v3/invitation/client/getInvitationInfo',
|
|
|
type: 'get',
|
|
@@ -106,7 +117,7 @@
|
|
|
$('#passwordCopy').val($('#invitationCode').text());
|
|
|
//复制按钮
|
|
|
$('.btn-code-copy').on('click', function () {
|
|
|
- stopManyClick(() =>{
|
|
|
+ stopManyClick(() => {
|
|
|
var input = document.getElementById("passwordCopy");
|
|
|
// 选中文本
|
|
|
input.select();
|
|
@@ -141,9 +152,9 @@
|
|
|
})
|
|
|
|
|
|
$("#recv_ipt").bind('input propertychange', function (e) {
|
|
|
- stopManyClick(() =>{
|
|
|
+ stopManyClick(() => {
|
|
|
var ipt_phones = $('#recv_ipt').val();
|
|
|
- var c = $(this);
|
|
|
+ var c = $(this);
|
|
|
if (/[^\d]/.test(c.val())) {//替换非数字字符 v1/promote
|
|
|
var temp_amount = c.val().replace(/[^\d]/g, '');
|
|
|
$(this).val(temp_amount);
|
|
@@ -155,24 +166,34 @@
|
|
|
$("#recv_ipt").val(recvstr);
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
function handleShow() {
|
|
|
- $('.dialog').animate({top: '2.4rem'},"fast");
|
|
|
- $('.close').animate({top: '10.56rem'},"fast");
|
|
|
+ $('.dialog').animate({ top: '2.4rem' }, "fast");
|
|
|
+ $('.close').animate({ top: '10.56rem' }, "fast");
|
|
|
$('.mask').show();
|
|
|
- document.documentElement.style.overflow='hidden';
|
|
|
+ document.documentElement.style.overflow = 'hidden';
|
|
|
}
|
|
|
function handleClose() {
|
|
|
- $('.dialog').animate({top: '-6.96rem'},"fast");
|
|
|
- $('.close').animate({top: '-0.68rem'},"fast");
|
|
|
+ $('.dialog').animate({ top: '-6.96rem' }, "fast");
|
|
|
+ $('.close').animate({ top: '-0.68rem' }, "fast");
|
|
|
$('.mask').hide();
|
|
|
- document.documentElement.style.overflow='auto';
|
|
|
+ document.documentElement.style.overflow = 'auto';
|
|
|
}
|
|
|
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 (!id) {
|
|
|
+ if (isAndroid) {
|
|
|
+ window.native.toGame('noToken');
|
|
|
+ } else if (isiOS) {
|
|
|
+ window.webkit.messageHandlers.getPackageName.postMessage('noToken');
|
|
|
+ } else {
|
|
|
+ toastr.error('请登录')
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
if (isiOS) {
|
|
|
$.ajax({
|
|
|
url: baseUrl + '/api/user/v1/promote',
|
|
@@ -213,7 +234,7 @@
|
|
|
dataType: 'json',
|
|
|
cache: false,
|
|
|
success: function (res) {
|
|
|
- stopManyClick(() =>{
|
|
|
+ stopManyClick(() => {
|
|
|
//加载数据
|
|
|
var copyBefore = JSON.stringify(res.data.url);
|
|
|
var copyUrl = copyBefore.split('"');
|
|
@@ -233,76 +254,76 @@
|
|
|
// 查询季度排行榜
|
|
|
function getInvitationRankList() {
|
|
|
$.ajax({
|
|
|
- url: baseUrl + '/api/user/v3/invitation/getInvitationRankList',
|
|
|
- type: 'get',
|
|
|
- headers: {
|
|
|
- 'Authorization': id //id
|
|
|
- },
|
|
|
- contentType: "application/json",
|
|
|
- dataType: 'json',
|
|
|
- cache: false,
|
|
|
- success: function (res) {
|
|
|
- var str = '';
|
|
|
- if (res.status === 0) {
|
|
|
- res.data.forEach(function(item, index) {
|
|
|
- var surfaceName = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(item.surfaceName) ? item.surfaceName.substr(0, 3) + '****' + item.surfaceName.substring(7, 11) : item.surfaceName
|
|
|
- if (index === 0) {
|
|
|
- str += '<div class="rank-item">';
|
|
|
- str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no1.png" alt=""></span>'
|
|
|
- str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
- str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
- str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
- str += '</div>';
|
|
|
- } else if (index === 1) {
|
|
|
- str += '<div class="rank-item">';
|
|
|
- str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no2.png" alt=""></span>'
|
|
|
- str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
- str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
- str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
- str += '</div>';
|
|
|
- } else if (index === 2) {
|
|
|
- str += '<div class="rank-item">';
|
|
|
- str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no3.png" alt=""></span>'
|
|
|
- str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
- str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
- str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
- str += '</div>';
|
|
|
- } else if (index < 10) {
|
|
|
- str += '<div class="rank-item">';
|
|
|
- str += '<span class="tac c333">' + (index + 1) + '</span>'
|
|
|
- str += '<span class="tac">' + surfaceName + '</span>'
|
|
|
- str += '<span class="tac">' + item.invitationNum + '</span>'
|
|
|
- str += '<span class="tac">' + item.duration + '</span>'
|
|
|
- str += '</div>';
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- $('#rank').append(str);
|
|
|
+ url: baseUrl + '/api/user/v3/invitation/getInvitationRankList',
|
|
|
+ type: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ var str = '';
|
|
|
+ if (res.status === 0) {
|
|
|
+ res.data.forEach(function (item, index) {
|
|
|
+ var surfaceName = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(item.surfaceName) ? item.surfaceName.substr(0, 3) + '****' + item.surfaceName.substring(7, 11) : item.surfaceName
|
|
|
+ if (index === 0) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no1.png" alt=""></span>'
|
|
|
+ str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ } else if (index === 1) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no2.png" alt=""></span>'
|
|
|
+ str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ } else if (index === 2) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no3.png" alt=""></span>'
|
|
|
+ str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ } else if (index < 10) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac c333">' + (index + 1) + '</span>'
|
|
|
+ str += '<span class="tac">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+ $('#rank').append(str);
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
getInvitationRankList()
|
|
|
// 查询最新获得奖励
|
|
|
function getInvitationRecently() {
|
|
|
$.ajax({
|
|
|
- url: baseUrl + '/api/user/v3/invitation/getInvitationRecently',
|
|
|
- type: 'get',
|
|
|
- headers: {
|
|
|
- 'Authorization': id //id
|
|
|
- },
|
|
|
- contentType: "application/json",
|
|
|
- dataType: 'json',
|
|
|
- cache: false,
|
|
|
- success: function (res) {
|
|
|
- if (res.status === 0) {
|
|
|
- var str = '<ul class="list">'
|
|
|
- res.data.forEach(function (item) {
|
|
|
- str += '<li>恭喜' + item.username.substr(0, 3) + '*******成功获得时长' + item.duration + '小时</li>'
|
|
|
- })
|
|
|
- str += '</ul>'
|
|
|
- $('#title').append(str);
|
|
|
- }
|
|
|
+ url: baseUrl + '/api/user/v3/invitation/getInvitationRecently',
|
|
|
+ type: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.status === 0) {
|
|
|
+ var str = '<ul class="list">'
|
|
|
+ res.data.forEach(function (item) {
|
|
|
+ str += '<li>恭喜' + item.username.substr(0, 3) + '*******成功获得时长' + item.duration + '小时</li>'
|
|
|
+ })
|
|
|
+ str += '</ul>'
|
|
|
+ $('#title').append(str);
|
|
|
}
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
getInvitationRecently()
|
|
@@ -312,8 +333,8 @@
|
|
|
fn();
|
|
|
}
|
|
|
flag = false;
|
|
|
- if(timer){clearTimeout(timer);}
|
|
|
- timer = setTimeout(() => {flag = true}, 1500);
|
|
|
+ if (timer) { clearTimeout(timer); }
|
|
|
+ timer = setTimeout(() => { flag = true }, 1500);
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|