fix(user-center): 调整提现记录金额展示
This commit is contained in:
1 parent
6bbb79213b
commit
2c4bd3eb2a
3 files changed
+21
-15
No files matched your search
+15
-7
@@ -831,6 +831,14 @@
|
||||
return node;
|
||||
}
|
||||
|
||||
function formatGrossAmount(value) {
|
||||
return text(value).replace(/\.00$/, '');
|
||||
}
|
||||
|
||||
function formatNetAmount(value) {
|
||||
return text(value);
|
||||
}
|
||||
|
||||
function renderItems(items) {
|
||||
if (!list) return;
|
||||
list.textContent = '';
|
||||
@@ -849,21 +857,21 @@
|
||||
row.className = 'uc-withdraw-history__item';
|
||||
var badge = appendText(row, statusLabels[status] || status, 'badg badg-sm uc-withdraw-history__status');
|
||||
badge.classList.add(status === 'rejected' ? 'c-red' : (status === 'completed' ? 'c-green' : 'c-blue'));
|
||||
appendText(row, item && (item.gross_amount || item.amount), 'uc-withdraw-history__amount em12');
|
||||
var gross = text(item && (item.gross_amount || item.amount));
|
||||
var net = text(item && item.amount);
|
||||
var amountText = formatGrossAmount(gross);
|
||||
if (net !== '') amountText += '(实际到账:' + formatNetAmount(net) + '元)';
|
||||
appendText(row, amountText, 'uc-withdraw-history__amount em12');
|
||||
var number = document.createElement('span');
|
||||
number.className = 'uc-withdraw-history__number muted-2-color em09';
|
||||
var numberLabel = document.createElement('span');
|
||||
numberLabel.textContent = '提现单号:';
|
||||
number.appendChild(numberLabel);
|
||||
number.appendChild(numberLabel);
|
||||
var code = document.createElement('code');
|
||||
code.textContent = text(item && item.withdrawal_number);
|
||||
number.appendChild(code);
|
||||
row.appendChild(number);
|
||||
var meta = appendText(row, text(item && item.created_at), 'uc-withdraw-history__meta muted-2-color em09');
|
||||
var gross = text(item && (item.gross_amount || item.amount));
|
||||
var net = text(item && item.amount);
|
||||
if (gross !== net && net !== '') meta.appendChild(document.createTextNode(' · 到账 ' + net));
|
||||
if (item && item.note) appendText(row, item.note, 'uc-withdraw-history__note muted-2-color em09');
|
||||
appendText(row, text(item && item.created_at), 'uc-withdraw-history__meta muted-2-color em09');
|
||||
list.appendChild(row);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user