fix: improve promotion tabs and referral layout

This commit is contained in:
2026-08-16 20:52:15 +08:00
parent ff730ab593
commit 5b9f54f5ac
5 changed files with 20 additions and 8 deletions
+7 -1
View File
@@ -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);