fix: improve promotion tabs and referral layout
This commit is contained in:
1 parent
5b9f54f5ac
commit
853114a9f9
18 files changed
+127
-602
No files matched your search
+7
-202
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* 功能:
|
||||
* - 签到 panel:拉取 /signin/today,按钮触发 POST /signin
|
||||
* - 邀请 panel:拉取 /invite/me,复制邀请链接
|
||||
* - revenue panel:拉取 /revenue/me,复制推广链接
|
||||
*
|
||||
* 仅在 page-profile 页面 + 启用积分时加载。
|
||||
*/
|
||||
@@ -189,210 +189,16 @@
|
||||
});
|
||||
}
|
||||
|
||||
// ===== 邀请 =====
|
||||
function initInvite() {
|
||||
var root = document.querySelector('[data-aksrt-invite]');
|
||||
if (!root) return;
|
||||
var linkInput = root.querySelector('[data-invite-link]');
|
||||
var copyBtn = root.querySelector('[data-invite-copy]');
|
||||
var stats = root.querySelector('[data-invite-stats]');
|
||||
var codeEl = root.querySelector('[data-invite-code]');
|
||||
var listEl = root.querySelector('[data-invite-list]');
|
||||
var totalEl = root.querySelector('[data-invite-total]');
|
||||
var statusEl = root.querySelector('[data-invite-status]');
|
||||
var copyFeedback = root.querySelector('[data-invite-copy-feedback]');
|
||||
|
||||
function setStatus(text, isError) {
|
||||
if (!statusEl) return;
|
||||
statusEl.textContent = text;
|
||||
statusEl.classList.toggle('is-error', !!isError);
|
||||
}
|
||||
|
||||
function setCopyFeedback(text, isError) {
|
||||
if (!copyFeedback) return;
|
||||
copyFeedback.textContent = text;
|
||||
copyFeedback.classList.toggle('is-error', !!isError);
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value == null ? '' : value)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function formatDate(value) {
|
||||
if (!value || value === '0000-00-00 00:00:00') return '';
|
||||
var date = new Date(String(value).replace(' ', 'T') + 'Z');
|
||||
if (isNaN(date.getTime())) return String(value).slice(0, 16);
|
||||
function pad(n) { return n < 10 ? '0' + n : String(n); }
|
||||
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate()) + ' ' + pad(date.getHours()) + ':' + pad(date.getMinutes());
|
||||
}
|
||||
|
||||
function statusMeta(status) {
|
||||
if (status === 'rewarded') {
|
||||
return { label: '已奖励', text: '奖励已发放', className: 'is-rewarded' };
|
||||
}
|
||||
if (status === 'verified') {
|
||||
return { label: '已验证', text: '等待奖励发放', className: 'is-verified' };
|
||||
}
|
||||
return { label: '已注册', text: '等待完成验证', className: 'is-registered' };
|
||||
}
|
||||
|
||||
function setCopyText(text) {
|
||||
if (!copyBtn) return;
|
||||
var label = copyBtn.querySelector('span');
|
||||
if (label) label.textContent = text;
|
||||
else copyBtn.textContent = text;
|
||||
}
|
||||
|
||||
function renderInviteList(items, total) {
|
||||
if (!listEl) return;
|
||||
listEl.classList.remove('is-loading');
|
||||
if (totalEl) {
|
||||
if (total > items.length) totalEl.textContent = '最近 ' + items.length + ' 条 / 共 ' + total + ' 条';
|
||||
else totalEl.textContent = total ? '共 ' + total + ' 条' : '暂无记录';
|
||||
}
|
||||
if (!items.length) {
|
||||
listEl.innerHTML = '<div class="uc-promotion-record-empty">分享链接后,好友注册记录会显示在这里。</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
listEl.innerHTML = items.map(function (item) {
|
||||
var name = item.invitee_name || (item.invitee_id ? '用户 #' + item.invitee_id : '受邀用户');
|
||||
var first = name ? name.charAt(0).toUpperCase() : '?';
|
||||
var meta = statusMeta(item.status);
|
||||
var createdAt = formatDate(item.created_at);
|
||||
var rewardedAt = formatDate(item.rewarded_at);
|
||||
var statusText = meta.text;
|
||||
if (item.status === 'rewarded' && rewardedAt) statusText = '奖励于 ' + rewardedAt;
|
||||
var avatar = item.invitee_avatar
|
||||
? '<img src="' + escapeHtml(item.invitee_avatar) + '" alt="">'
|
||||
: '<span>' + escapeHtml(first) + '</span>';
|
||||
|
||||
return '<div class="uc-promotion-record ' + meta.className + '">' +
|
||||
'<div class="uc-promotion-record__avatar">' + avatar + '</div>' +
|
||||
'<div class="uc-promotion-record__main">' +
|
||||
'<strong>' + escapeHtml(name) + '</strong>' +
|
||||
'<span>' + (createdAt ? '注册于 ' + escapeHtml(createdAt) : '注册时间未知') + '</span>' +
|
||||
'</div>' +
|
||||
'<div class="uc-promotion-record__status">' +
|
||||
'<span class="uc-promotion-badge ' + meta.className + '">' + meta.label + '</span>' +
|
||||
'<small>' + escapeHtml(statusText) + '</small>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}).join('');
|
||||
}
|
||||
|
||||
api('/invite/me').then(function (r) {
|
||||
if (!r.ok) {
|
||||
if (linkInput) linkInput.value = '';
|
||||
if (copyBtn) copyBtn.disabled = true;
|
||||
if (codeEl) codeEl.textContent = '--';
|
||||
if (stats) {
|
||||
stats.querySelectorAll('[data-stat]').forEach(function (el) {
|
||||
el.textContent = '—';
|
||||
});
|
||||
}
|
||||
setStatus((r.json && r.json.message) || '推广数据加载失败,请稍后刷新。', true);
|
||||
return;
|
||||
}
|
||||
var j = r.json || {};
|
||||
if (linkInput) linkInput.value = j.invite_url || '';
|
||||
if (copyBtn) copyBtn.disabled = !j.invite_url;
|
||||
if (codeEl) codeEl.textContent = j.code || '--';
|
||||
if (stats && j.stats) {
|
||||
stats.querySelectorAll('[data-stat]').forEach(function (el) {
|
||||
var k = el.getAttribute('data-stat');
|
||||
el.textContent = (j.stats[k] || 0).toString();
|
||||
});
|
||||
}
|
||||
setStatus('推广数据已更新。');
|
||||
}).catch(function () {
|
||||
if (copyBtn) copyBtn.disabled = true;
|
||||
if (codeEl) codeEl.textContent = '--';
|
||||
if (stats) {
|
||||
stats.querySelectorAll('[data-stat]').forEach(function (el) {
|
||||
el.textContent = '—';
|
||||
});
|
||||
}
|
||||
setStatus('推广数据加载失败,请检查网络后重试。', true);
|
||||
});
|
||||
|
||||
if (listEl) {
|
||||
api('/invite/list?per_page=8').then(function (r) {
|
||||
if (!r.ok) {
|
||||
listEl.classList.remove('is-loading');
|
||||
listEl.innerHTML = '<div class="uc-promotion-record-empty">邀请记录加载失败,请稍后刷新。</div>';
|
||||
if (totalEl) totalEl.textContent = '加载失败';
|
||||
return;
|
||||
}
|
||||
var j = r.json || {};
|
||||
renderInviteList(j.items || [], Number(j.total || 0));
|
||||
}).catch(function () {
|
||||
listEl.classList.remove('is-loading');
|
||||
listEl.innerHTML = '<div class="uc-promotion-record-empty">邀请记录加载失败,请稍后刷新。</div>';
|
||||
if (totalEl) totalEl.textContent = '加载失败';
|
||||
});
|
||||
}
|
||||
|
||||
if (!copyBtn) return;
|
||||
var copying = false;
|
||||
copyBtn.addEventListener('click', function () {
|
||||
if (copying || !linkInput || !linkInput.value) return;
|
||||
copying = true;
|
||||
copyBtn.disabled = true;
|
||||
setCopyFeedback('正在复制…');
|
||||
|
||||
function copied() {
|
||||
setCopyText('已复制');
|
||||
setCopyFeedback('推广链接已复制到剪贴板。');
|
||||
setTimeout(function () {
|
||||
setCopyText('复制链接');
|
||||
setCopyFeedback('');
|
||||
copyBtn.disabled = false;
|
||||
copying = false;
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function copyFailed() {
|
||||
setCopyText('复制链接');
|
||||
setCopyFeedback('复制失败,请手动选择并复制链接。', true);
|
||||
copyBtn.disabled = false;
|
||||
copying = false;
|
||||
linkInput.focus();
|
||||
linkInput.select();
|
||||
}
|
||||
|
||||
if (navigator.clipboard && typeof navigator.clipboard.writeText === 'function') {
|
||||
navigator.clipboard.writeText(linkInput.value).then(copied).catch(copyFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
linkInput.focus();
|
||||
linkInput.select();
|
||||
try {
|
||||
if (document.execCommand('copy')) {
|
||||
copied();
|
||||
return;
|
||||
}
|
||||
} catch (_) {}
|
||||
copyFailed();
|
||||
});
|
||||
}
|
||||
|
||||
// ===== Forward-only affiliate promotion center =====
|
||||
function initAffiliatePromotion() {
|
||||
var root = document.querySelector('[data-aksrt-promotion-page]');
|
||||
// ===== Forward-only affiliate revenue center =====
|
||||
function initAffiliateRevenue() {
|
||||
var root = document.querySelector('[data-aksrt-revenue-page]');
|
||||
if (!root || root.dataset.affiliateBound) return;
|
||||
root.dataset.affiliateBound = '1';
|
||||
var input = root.querySelector('[data-affiliate-link]');
|
||||
var copy = root.querySelector('[data-affiliate-copy]');
|
||||
var feedback = root.querySelector('[data-affiliate-feedback]');
|
||||
function setFeedback(text, error) { if (feedback) { feedback.textContent = text; feedback.classList.toggle('is-error', !!error); } }
|
||||
api('/promotion/me').then(function (r) {
|
||||
api('/revenue/me').then(function (r) {
|
||||
if (!r.ok) { setFeedback((r.json && r.json.message) || '推广数据加载失败。', true); return; }
|
||||
var j = r.json || {}, stats = j.stats || {};
|
||||
if (input) {
|
||||
@@ -415,7 +221,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
window.AKSRTAffiliatePromotionInit = initAffiliatePromotion;
|
||||
window.AKSRTAffiliateRevenueInit = initAffiliateRevenue;
|
||||
|
||||
|
||||
|
||||
@@ -1030,8 +836,7 @@
|
||||
function bootAssets() {
|
||||
initSignin();
|
||||
initSigninGoto();
|
||||
initInvite();
|
||||
initAffiliatePromotion();
|
||||
initAffiliateRevenue();
|
||||
initVipShop();
|
||||
initVipPointsExchange();
|
||||
initCardPass();
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
/**
|
||||
* Commission center referral link and invited-user records.
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function init(root) {
|
||||
var data = window.aksrtData || {};
|
||||
if (!root || !data) return;
|
||||
|
||||
var rest = data.restUrl || data.apiUrl || ((data.siteUrl || '').replace(/\/$/, '') + '/wp-json/aksrt/v1');
|
||||
if (!rest) return;
|
||||
rest = rest.replace(/\/?$/, '');
|
||||
|
||||
function api(path) {
|
||||
return fetch(rest + path, {
|
||||
credentials: 'same-origin',
|
||||
headers: { 'X-WP-Nonce': data.restNonce || data.nonce || '' }
|
||||
}).then(function (response) {
|
||||
return response.json().catch(function () { return {}; }).then(function (json) {
|
||||
return { ok: response.ok, json: json };
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value == null ? '' : value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function formatDate(value) {
|
||||
if (!value || value === '0000-00-00 00:00:00') return '';
|
||||
var date = new Date(String(value).replace(' ', 'T') + 'Z');
|
||||
return isNaN(date.getTime()) ? String(value).slice(0, 16) : date.toLocaleString();
|
||||
}
|
||||
|
||||
var linkInput = root.querySelector('[data-invite-link]');
|
||||
var codeEl = root.querySelector('[data-invite-code]');
|
||||
var copyBtn = root.querySelector('[data-invite-copy]');
|
||||
var statusEl = root.querySelector('[data-invite-status]');
|
||||
var feedbackEl = root.querySelector('[data-invite-copy-feedback]');
|
||||
var listEl = root.querySelector('[data-invite-list]');
|
||||
var totalEl = root.querySelector('[data-invite-total]');
|
||||
|
||||
function setStatus(text, error) {
|
||||
if (!statusEl) return;
|
||||
statusEl.textContent = text || '';
|
||||
statusEl.classList.toggle('is-error', !!error);
|
||||
}
|
||||
|
||||
api('/invite/me').then(function (result) {
|
||||
if (!result.ok) {
|
||||
setStatus((result.json && result.json.message) || '推广数据加载失败', true);
|
||||
return;
|
||||
}
|
||||
var payload = result.json || {};
|
||||
if (linkInput) linkInput.value = payload.invite_url || '';
|
||||
if (codeEl) codeEl.textContent = payload.code || '--';
|
||||
if (copyBtn) copyBtn.disabled = !payload.invite_url;
|
||||
setStatus('推广数据已更新', false);
|
||||
}).catch(function () {
|
||||
setStatus('推广数据加载失败,请稍后重试', true);
|
||||
});
|
||||
|
||||
function renderPagination(total, current) {
|
||||
if (!listEl || total <= 10) return;
|
||||
var nav = root.querySelector('[data-invite-pagination]');
|
||||
if (!nav) {
|
||||
nav = document.createElement('nav');
|
||||
nav.className = 'uc-reward-pagination';
|
||||
nav.setAttribute('data-invite-pagination', 'true');
|
||||
nav.setAttribute('aria-label', '邀请记录分页');
|
||||
listEl.parentNode.appendChild(nav);
|
||||
}
|
||||
nav.innerHTML = '';
|
||||
var pages = Math.ceil(total / 10);
|
||||
for (var page = 1; page <= pages; page++) {
|
||||
var url = new URL(window.location.href);
|
||||
url.searchParams.set('reward_tab', 'users');
|
||||
if (page > 1) url.searchParams.set('invite_page', String(page));
|
||||
else url.searchParams.delete('invite_page');
|
||||
var link = document.createElement('a');
|
||||
link.href = url.toString();
|
||||
link.textContent = String(page);
|
||||
link.className = page === current ? 'is-active' : '';
|
||||
nav.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
function renderList(payload, page) {
|
||||
if (!listEl) return;
|
||||
var items = Array.isArray(payload.items) ? payload.items : [];
|
||||
var total = Number(payload.total || 0);
|
||||
listEl.classList.remove('is-loading');
|
||||
if (totalEl) totalEl.textContent = total ? total + ' 条' : '暂无记录';
|
||||
if (!items.length) {
|
||||
listEl.innerHTML = '<p class="uc-reward-empty">分享链接后,邀请记录会显示在这里。</p>';
|
||||
return;
|
||||
}
|
||||
listEl.innerHTML = items.map(function (item) {
|
||||
var name = item.invitee_name || (item.invitee_id ? '用户 #' + item.invitee_id : '受邀用户');
|
||||
var avatar = item.invitee_avatar ? '<img src="' + escapeHtml(item.invitee_avatar) + '" alt="">' : '<span>' + escapeHtml(name.charAt(0)) + '</span>';
|
||||
var status = item.status === 'rewarded' ? '已奖励' : (item.status === 'verified' ? '已验证' : '已注册');
|
||||
return '<article class="uc-invite-record"><span class="uc-invite-record__avatar">' + avatar + '</span><span class="uc-invite-record__main"><strong>' + escapeHtml(name) + '</strong><span>' + escapeHtml(formatDate(item.created_at)) + '</span></span><span class="uc-invite-record__status">' + status + '</span></article>';
|
||||
}).join('');
|
||||
var currentPage = Number(payload.page || page);
|
||||
renderPagination(total, isNaN(currentPage) ? 1 : currentPage);
|
||||
}
|
||||
|
||||
if (listEl) {
|
||||
var invitePage = 1;
|
||||
try {
|
||||
var requestedPage = parseInt(new URLSearchParams(window.location.search).get('invite_page') || '1', 10);
|
||||
invitePage = isNaN(requestedPage) ? 1 : Math.max(1, requestedPage);
|
||||
} catch (_) {}
|
||||
api('/invite/list?per_page=10&page=' + invitePage).then(function (result) {
|
||||
if (!result.ok) {
|
||||
listEl.classList.remove('is-loading');
|
||||
listEl.innerHTML = '<p class="uc-reward-empty">邀请记录加载失败,请稍后重试。</p>';
|
||||
return;
|
||||
}
|
||||
renderList(result.json || {}, invitePage);
|
||||
}).catch(function () {
|
||||
listEl.classList.remove('is-loading');
|
||||
listEl.innerHTML = '<p class="uc-reward-empty">邀请记录加载失败,请稍后重试。</p>';
|
||||
});
|
||||
}
|
||||
|
||||
if (copyBtn && linkInput) {
|
||||
copyBtn.addEventListener('click', function () {
|
||||
if (!linkInput.value) return;
|
||||
var done = function () {
|
||||
if (feedbackEl) feedbackEl.textContent = '推广链接已复制';
|
||||
copyBtn.disabled = false;
|
||||
};
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(linkInput.value).then(done).catch(function () { linkInput.select(); document.execCommand('copy'); done(); });
|
||||
} else {
|
||||
linkInput.select();
|
||||
document.execCommand('copy');
|
||||
done();
|
||||
}
|
||||
});
|
||||
}
|
||||
function reloadRevenuePanel() {
|
||||
var current = document.querySelector('[data-aksrt-revenue-page]');
|
||||
if (!current) return Promise.resolve();
|
||||
var panelUrl = rest + '/user-center/panel/promotion';
|
||||
var query = new URL(window.location.href).searchParams;
|
||||
query.delete('tab');
|
||||
panelUrl += '?' + query.toString();
|
||||
return fetch(panelUrl, {
|
||||
credentials: 'same-origin',
|
||||
headers: { 'X-WP-Nonce': data.restNonce || data.nonce || '' }
|
||||
}).then(function (response) {
|
||||
return response.json().then(function (payload) {
|
||||
if (!response.ok || !payload.success || !payload.data || !payload.data.html) throw new Error('revenue-refresh-failed');
|
||||
var wrapper = document.createElement('div');
|
||||
wrapper.innerHTML = payload.data.html;
|
||||
var next = wrapper.firstElementChild;
|
||||
if (!next) throw new Error('revenue-html-empty');
|
||||
current.replaceWith(next);
|
||||
window.AKSRTRevenueCenterInit(next);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initRewardNavigation(root, rest, data) {
|
||||
var rewardTabs = root.querySelectorAll('.uc-reward-tabs a, .uc-reward-pagination a');
|
||||
rewardTabs.forEach(function (link) {
|
||||
link.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
var targetUrl = new URL(link.href, window.location.href);
|
||||
var panelUrl = rest + '/user-center/panel/promotion?' + targetUrl.searchParams.toString();
|
||||
fetch(panelUrl, {
|
||||
credentials: 'same-origin',
|
||||
headers: { 'X-WP-Nonce': data.restNonce || data.nonce || '' }
|
||||
}).then(function (response) {
|
||||
return response.json().then(function (payload) {
|
||||
if (!response.ok || !payload.success || !payload.data || !payload.data.html) throw new Error('revenue-load-failed');
|
||||
var current = document.querySelector('[data-aksrt-revenue-page]');
|
||||
if (!current) return;
|
||||
var wrapper = document.createElement('div');
|
||||
wrapper.innerHTML = payload.data.html;
|
||||
var next = wrapper.firstElementChild;
|
||||
if (!next) throw new Error('revenue-html-empty');
|
||||
current.replaceWith(next);
|
||||
window.history.pushState({}, '', targetUrl);
|
||||
window.AKSRTRevenueCenterInit(next);
|
||||
if (typeof window.AKSRTAffiliatePromotionInit === 'function') window.AKSRTAffiliatePromotionInit();
|
||||
if (typeof window.AKSRTWithdrawInit === 'function') window.AKSRTWithdrawInit();
|
||||
});
|
||||
}).catch(function () {
|
||||
if (typeof showToast === 'function') showToast('加载失败,请重试');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
window.AKSRTRevenueCenterInit = function (root) {
|
||||
init(root);
|
||||
var data = window.aksrtData || {};
|
||||
var rest = data.restUrl || data.apiUrl || '';
|
||||
if (root && rest) initRewardNavigation(root, rest.replace(/\/$/, ''), data);
|
||||
};
|
||||
window.AKSRTRevenueCenterInit(document.querySelector('[data-aksrt-revenue-page]'));
|
||||
})();
|
||||
@@ -82,10 +82,10 @@
|
||||
}
|
||||
target.classList.add('is-loading');
|
||||
var url = restUrl.replace(/\/$/, '') + '/user-center/panel/' + encodeURIComponent(name);
|
||||
if (name === 'creator' || name === 'promotion' || name === 'posts' || name === 'follow') {
|
||||
if (name === 'creator' || name === 'revenue' || name === 'posts' || name === 'follow') {
|
||||
var params = queryParams || new URLSearchParams(window.location.search);
|
||||
var allowedParams = name === 'creator' ? ['income_page'] :
|
||||
(name === 'promotion' ? ['reward_tab', 'commission_page', 'user_page'] :
|
||||
(name === 'revenue' ? ['reward_tab', 'commission_page', 'user_page'] :
|
||||
(name === 'posts' ? ['post_status', 'posts_page'] : ['follow_list', 'follow_page']));
|
||||
allowedParams.forEach(function(key) {
|
||||
if (params.get(key)) url += (url.indexOf('?') === -1 ? '?' : '&') + key + '=' + encodeURIComponent(params.get(key));
|
||||
@@ -120,8 +120,9 @@
|
||||
return loadPanel(name, forceLoad, queryParams).then(function() {
|
||||
switchTo(name);
|
||||
if (updateHistory) updateUrl(name);
|
||||
if (name === 'promotion' && typeof window.AKSRTRevenueCenterInit === 'function') window.AKSRTRevenueCenterInit(panels[name].panel);
|
||||
if (name === 'promotion' && typeof window.AKSRTAffiliatePromotionInit === 'function') window.AKSRTAffiliatePromotionInit();
|
||||
if (name === 'revenue' && typeof window.AKSRTRevenueCenterInit === 'function') window.AKSRTRevenueCenterInit(panels[name].panel);
|
||||
if (name === 'revenue' && typeof window.AKSRTAffiliateRevenueInit === 'function') window.AKSRTAffiliateRevenueInit();
|
||||
if (name === 'revenue' && typeof window.AKSRTWithdrawInit === 'function') window.AKSRTWithdrawInit();
|
||||
}).catch(function() {
|
||||
if (typeof showToast === 'function') showToast(i18n.networkError || '加载失败,请重试');
|
||||
});
|
||||
@@ -139,7 +140,7 @@
|
||||
if (!window.history.replaceState) return;
|
||||
var pathTab = name === 'credits' ? 'balance' : name;
|
||||
var u = new URL('/user/' + pathTab + '/', window.location.origin);
|
||||
if (sourceUrl) {
|
||||
if (sourceUrl && name !== 'revenue') {
|
||||
var source = new URL(sourceUrl, window.location.href);
|
||||
source.searchParams.forEach(function(value, key) { u.searchParams.set(key, value); });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user