fix: improve promotion tabs and referral layout
This commit is contained in:
@@ -395,7 +395,13 @@
|
||||
api('/promotion/me').then(function (r) {
|
||||
if (!r.ok) { setFeedback((r.json && r.json.message) || '推广数据加载失败。', true); return; }
|
||||
var j = r.json || {}, stats = j.stats || {};
|
||||
if (input) input.value = j.url || '';
|
||||
if (input) {
|
||||
input.value = j.url || '';
|
||||
/* Keep the complete ref URL readable on desktop; mobile CSS still caps it. */
|
||||
var linkLength = String(j.url || '').length;
|
||||
input.setAttribute('size', String(Math.max(28, Math.min(96, linkLength || 28))));
|
||||
input.style.width = Math.max(28, Math.min(96, linkLength || 28)) + 'ch';
|
||||
}
|
||||
if (copy) copy.disabled = !j.url;
|
||||
var ratio = root.querySelector('[data-affiliate-ratio]'); if (ratio) ratio.textContent = String(j.ratio || 0) + '%';
|
||||
var promoters = root.querySelector('[data-affiliate-promoters]'); if (promoters) promoters.textContent = String(stats.promoters || 0);
|
||||
|
||||
Reference in New Issue
Block a user