style(payment): 订单详情弹窗售后记录改为卡片式 UI
This commit is contained in:
@@ -179,10 +179,19 @@
|
||||
html += '<section class="aksrt-order-detail__group"><h4 class="aksrt-order-detail__group-title">售后记录</h4><ul class="aksrt-order-detail__after-sales">';
|
||||
afterSales.forEach(function (item) {
|
||||
var labels = { pending: "待审核", processing: "处理中", approved: "已通过", rejected: "已拒绝", cancelled: "已取消", completed: "已完成" };
|
||||
html += "<li><strong>" + escapeHtml(labels[item.status] || item.status || "") + "</strong><span>" + escapeHtml(item.reason || "") + "</span><small>退款金额:" + escapeHtml(afterSaleAmount(item.refund_amount, order)) + "</small>";
|
||||
if (item.admin_note) html += "<small>处理备注:" + escapeHtml(item.admin_note) + "</small>";
|
||||
if (item.gateway_result) html += "<small>渠道结果:" + escapeHtml(gatewayResultText(item.gateway_result)) + "</small>";
|
||||
if (item.status === "pending") html += '<button class="btn-ghost" type="button" data-aksrt-after-sale-cancel="' + escapeHtml(order.order_number) + '">取消申请</button>';
|
||||
var asStatus = String(item.status || "");
|
||||
var asLabel = labels[asStatus] || asStatus;
|
||||
html += '<li class="aksrt-order-detail__after-sale is-' + escapeHtml(asStatus) + '">';
|
||||
html += '<div class="aksrt-order-detail__after-sale-head"><span class="aksrt-order-detail__after-sale-badge is-' + escapeHtml(asStatus) + '">' + escapeHtml(asLabel) + "</span>";
|
||||
if (item.created_at) html += "<time>" + escapeHtml(item.created_at) + "</time>";
|
||||
html += "</div>";
|
||||
if (item.reason) html += '<p class="aksrt-order-detail__after-sale-reason">' + escapeHtml(item.reason).replace(/\r\n|\r|\n/g, "<br>") + "</p>";
|
||||
html += '<dl class="aksrt-order-detail__after-sale-meta">';
|
||||
html += "<div><dt>退款金额</dt><dd>" + escapeHtml(afterSaleAmount(item.refund_amount, order)) + "</dd></div>";
|
||||
if (item.admin_note) html += "<div><dt>处理备注</dt><dd>" + escapeHtml(item.admin_note) + "</dd></div>";
|
||||
if (item.gateway_result) html += "<div><dt>渠道结果</dt><dd>" + escapeHtml(gatewayResultText(item.gateway_result)) + "</dd></div>";
|
||||
html += "</dl>";
|
||||
if (asStatus === "pending") html += '<button class="btn-ghost aksrt-order-detail__after-sale-cancel" type="button" data-aksrt-after-sale-cancel="' + escapeHtml(order.order_number) + '">取消申请</button>';
|
||||
html += "</li>";
|
||||
});
|
||||
html += "</ul></section>";
|
||||
|
||||
Reference in New Issue
Block a user