fix(user-center): 调整提现记录金额展示
This commit is contained in:
@@ -915,8 +915,7 @@ body.uc-modal-open {
|
||||
font-weight: 700;
|
||||
}
|
||||
.uc-withdraw-history__number,
|
||||
.uc-withdraw-history__meta,
|
||||
.uc-withdraw-history__note {
|
||||
.uc-withdraw-history__meta {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -927,9 +926,6 @@ body.uc-modal-open {
|
||||
.uc-withdraw-history__meta {
|
||||
flex: 0 1 190px;
|
||||
}
|
||||
.uc-withdraw-history__note {
|
||||
flex: 0 1 160px;
|
||||
}
|
||||
.uc-withdraw-history__pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -978,9 +974,6 @@ body.uc-modal-open {
|
||||
.uc-withdraw-history__meta {
|
||||
flex-basis: 120px;
|
||||
}
|
||||
.uc-withdraw-history__note {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Points tasks tab */
|
||||
|
||||
+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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,6 +71,11 @@ test('user withdrawal history uses one paginated ten-item endpoint', () => {
|
||||
assert.match(script, /\/earnings\/withdrawals\?page=/)
|
||||
assert.match(script, /&per_page=10/)
|
||||
assert.match(script, /data-aksrt-withdraw-history-page/)
|
||||
assert.match(script, /实际到账:/)
|
||||
assert.match(script, /元)/)
|
||||
assert.match(script, /appendText\(row, text\(item && item\.created_at\)/)
|
||||
assert.doesNotMatch(script, /item\.note/)
|
||||
assert.doesNotMatch(styles, /uc-withdraw-history__note/)
|
||||
assert.match(styles, /\.uc-withdraw-history-modal__dialog\s*\{[\s\S]*?max-width: min\(860px/)
|
||||
assert.match(styles, /\.uc-withdraw-history__item\s*\{[\s\S]*?display: flex/)
|
||||
assert.match(styles, /\.uc-withdraw-history-modal__dialog\s*\{[\s\S]*?overflow: hidden/)
|
||||
|
||||
Reference in New Issue
Block a user