feat: 新增售后详情页面并优化售后列表交互

- 新增售后详情页面 aftersale-detail.vue
- 优化售后列表 UI 样式,增加加载/空态/错误状态处理
- 修复售后列表跳转逻辑,新增下拉刷新功能
- 修复师傅入驻接口数组参数 500 崩溃问题
- 优化竞价单选定报价流程,修复订单状态错误问题
- 新增订单售后相关展示逻辑,包括售后状态、操作入口等
- 更新版本号至 1.0.88,配置微信小程序 AppID
这个提交包含在:
2026-11-19 10:48:39 +08:00
父节点 31addddd5f
当前提交 a608ef6506
共有 19 个文件被更改,包括 1810 次插入 和 404 次删除

查看文件

@@ -3,6 +3,7 @@
namespace app\admin\controller;
use app\common\controller\Backend;
use app\common\library\OrderDetailDisplay;
use app\common\library\CommissionService;
use app\common\library\OrderStatus;
use think\Db;
@@ -584,7 +585,14 @@ class Order extends Backend
}
// 1. 多商品/多工项明细
$goodsList = Db::name('order_goods')->where('order_id', $row['id'])->select();
$goodsList = Db::name('order_goods')->where('order_id', $row['id'])->order('id asc')->select();
$goodsPayload = json_decode((string)$row['goods_images'], true);
$goodsSnapshots = is_array($goodsPayload) && isset($goodsPayload['goods_list']) && is_array($goodsPayload['goods_list']) ? $goodsPayload['goods_list'] : [];
foreach ($goodsList as $index => &$goods) {
$snapshot = isset($goodsSnapshots[$index]) && is_array($goodsSnapshots[$index]) ? $goodsSnapshots[$index] : [];
$goods['service_text'] = OrderDetailDisplay::services($goods['addon_services'] ?? '', $snapshot);
}
unset($goods);
// 2. 现场施工取证图片 (区分签到、过程、完工、报损)
$mediaList = Db::name('order_media')->where('order_id', $row['id'])->order('id asc')->select();
@@ -594,6 +602,7 @@ class Order extends Backend
$logList = Db::name('order_log')->where('order_id', $row['id'])->order('createtime asc, id asc')->select();
foreach ($logList as &$lg) {
$lg['status_label'] = isset($statusMap[(int)$lg['status']]) ? $statusMap[(int)$lg['status']] : '状态变更';
$lg['operator_label'] = OrderDetailDisplay::operator($lg['operator_type'] ?? '');
}
unset($lg);
@@ -605,6 +614,10 @@ class Order extends Backend
->where('q.order_id', $row['id'])
->order('q.id desc')
->select();
foreach ($quoteList as &$quote) {
$quote['display_status'] = OrderDetailDisplay::quoteStatus($quote['status'] ?? '');
}
unset($quote);
// 5. 客户评价与回复(兼容 JSON 数组或逗号分隔标签)
$review = Db::name('review')->where('order_id', $row['id'])->find();
@@ -650,6 +663,11 @@ class Order extends Backend
->field('a.*, m.realname as master_name')
->order('a.id desc')
->select();
$appealStatus = ['wait' => '待处理', 'handling' => '处理中', 'done' => '已处理', 'reject' => '已驳回'];
foreach ($appealList as &$appeal) {
$appeal['display_status'] = $appealStatus[$appeal['status']] ?? '未知状态';
}
unset($appeal);
// 10. 微信支付与原路退款交易流水(含失败错误码及中文诊断原因)
$sceneMap = [
@@ -666,11 +684,20 @@ class Order extends Backend
$poItem['scene_text'] = $sceneMap[$poItem['scene'] ?? ''] ?? ($poItem['scene'] ?? '-');
$poItem['status_text'] = \app\common\library\PaymentService::payOrderStatusLabel($poItem['status'] ?? '');
$poItem['refund_status_text'] = \app\common\library\PaymentService::refundStatusLabel($poItem['refund_status'] ?? 'none');
$poItem['payment_type_text'] = OrderDetailDisplay::paymentRecordType($poItem);
$poItem['is_balance'] = $poItem['payment_type_text'] === '余额支付';
}
unset($poItem);
$payGroups = OrderDetailDisplay::groupPaymentRecords($payOrders);
$paySections = [
['type' => 'settled', 'items' => $payGroups['settled']],
['type' => 'attempts', 'items' => $payGroups['attempts']],
];
$this->view->assign([
'row' => $row,
'amountLabel' => OrderDetailDisplay::amountLabel($row->toArray()),
'paymentTypeLabel' => OrderDetailDisplay::paymentType($row['pay_type'] ?? ''),
'goodsList' => $goodsList,
'mediaList' => $mediaList,
'logList' => $logList,
@@ -682,6 +709,8 @@ class Order extends Backend
'invoiceInfo' => $invoiceInfo,
'appealList' => $appealList,
'payOrders' => $payOrders,
'payGroups' => $payGroups,
'paySections' => $paySections,
]);
return $this->view->fetch();

查看文件

@@ -92,10 +92,38 @@
.od-card-title i { color: #f97316; }
.od-card-body { padding: 16px; }
.od-grid-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
.od-item { display: flex; align-items: baseline; font-size: 13px; line-height: 1.5; }
.od-item-k { min-width: 84px; color: #64748b; flex-shrink: 0; }
.od-item-v { color: #0f172a; font-weight: 500; word-break: break-all; }
.od-grid-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.od-item { display: flex; align-items: baseline; min-width: 0; font-size: 13px; line-height: 1.5; }
.od-item-k { min-width: 70px; padding-right: 8px; color: #64748b; flex-shrink: 0; white-space: nowrap; }
.od-item-v { min-width: 0; color: #0f172a; font-weight: 500; overflow-wrap: anywhere; }
.od-item-v.od-datetime { white-space: nowrap; }
.od-table-scroll { overflow-x: auto; }
.od-table-scroll .table { width: 100%; }
.od-table-scroll .table th, .od-table-scroll .table td { padding: 6px 8px; }
.od-table-scroll .table td { white-space: nowrap; }
.order-detail-container .table th { white-space: nowrap; }
.od-pay-scroll { overflow-x: auto; }
.od-pay-table { width: 100%; min-width: 820px; table-layout: fixed; }
.order-detail-container .od-pay-table > thead > tr > th,
.order-detail-container .od-pay-table > tbody > tr > td { padding: 9px 8px; vertical-align: top; }
.od-pay-table .od-pay-id { width: 48px; }
.od-pay-table .od-pay-scene { width: 92px; white-space: nowrap; }
.od-pay-table .od-pay-number { width: 210px; overflow-wrap: anywhere; }
.od-pay-table .od-pay-amount { width: 80px; white-space: nowrap; }
.od-pay-table .od-pay-status { width: 100px; }
.od-pay-table .od-pay-action { width: 130px; }
.od-pay-table code { white-space: normal; overflow-wrap: anywhere; }
.od-pay-note { border-radius: 6px; padding: 6px 8px; line-height: 1.5; background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; overflow-wrap: anywhere; }
.od-pay-note.is-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.od-pay-attempts { margin-top: 14px; border: 1px solid #e2e8f0; border-radius: 8px; }
.od-pay-attempts > summary { padding: 10px 12px; cursor: pointer; color: #334155; font-weight: 600; }
.od-pay-attempts > summary:focus-visible { outline: 2px solid #ea580c; outline-offset: 2px; }
.od-pay-attempts .od-pay-scroll { padding: 0 10px 10px; }
.od-pay-warning { color: #b45309; font-weight: 500; margin-left: 8px; }
@media (max-width: 520px) {
.od-grid-list { grid-template-columns: minmax(0, 1fr); }
.od-grid-list .od-item { grid-column: auto !important; }
}
.od-gallery-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.od-gallery-item { position: relative; width: 108px; height: 108px; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; background: #f8fafc; }
@@ -135,7 +163,7 @@
<div class="v-code">{$row.verify_code|default='--'}</div>
</div>
<div class="od-price-box">
<div class="od-price-label">订单实付金额</div>
<div class="od-price-label">{$amountLabel|htmlentities}</div>
<div class="od-price-val">¥{$row.pay_amount}</div>
</div>
</div>
@@ -146,7 +174,7 @@
<div class="alert alert-warning" style="border-radius:10px; margin-bottom:16px;">
<i class="fa fa-ban"></i> <strong>该工单已取消终止</strong>
{if !empty($row.cancel_reason)} · 取消原因:{$row.cancel_reason|htmlentities}{/if}
{if $row.refund_amount > 0} · 已原路退款:<strong>¥{$row.refund_amount}</strong>{/if}
{if $row.refund_amount > 0} · 订单退款金额:<strong>¥{$row.refund_amount}</strong>(请核对下方退款状态){/if}
</div>
{elseif $row.status == 10 /}
<div class="alert alert-danger" style="border-radius:10px; margin-bottom:16px;">
@@ -176,7 +204,7 @@
</div>
<div class="od-step-item {if $row.status == 8}passed active{/if}">
<div class="od-step-dot">{if $row.status == 8}<i class="fa fa-check"></i>{else/}6{/if}</div>
<div class="od-step-name">已完成结算</div>
<div class="od-step-name">服务完成</div>
</div>
</div>
{/if}
@@ -187,26 +215,26 @@
<div class="col-xs-12 col-sm-6">
<div class="od-card">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-wrench"></i> 服务项目、到货物流与上门地址</h4>
<h4 class="od-card-title"><i class="fa fa-wrench"></i> 服务与地址</h4>
</div>
<div class="od-card-body">
<div class="od-grid-list">
<div class="od-item"><span class="od-item-k">服务名称:</span><span class="od-item-v"><strong>{$row.service_name|htmlentities}</strong></span></div>
<div class="od-item">
<span class="od-item-k">预约上门:</span>
<span class="od-item-v" style="color:#ea580c; font-weight:700;">
<span class="od-item-v od-datetime" style="color:#ea580c; font-weight:700;">
{if $row.appoint_time > 0}{$row.appoint_time|datetime}{else/}未指定(尽快上门){/if}
</span>
</div>
<div class="od-item"><span class="od-item-k">现场联系人:</span><span class="od-item-v">{$row.contact|htmlentities}</span></div>
<div class="od-item"><span class="od-item-k">联系人:</span><span class="od-item-v">{$row.contact|htmlentities}</span></div>
<div class="od-item"><span class="od-item-k">联系电话:</span><span class="od-item-v"><strong>{$row.mobile|htmlentities}</strong></span></div>
<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">上门地址:</span><span class="od-item-v">{$row.province|htmlentities}{$row.city|htmlentities}{$row.district|htmlentities}{$row.address|htmlentities}</span></div>
<div class="od-item"><span class="od-item-k">楼层电梯:</span><span class="od-item-v">{$row.floor} 层 · {if $row.has_elevator}有电梯{else/}无电梯(步梯){/if}</span></div>
<div class="od-item"><span class="od-item-k">施工规格:</span><span class="od-item-v">{$row.goods_model|default='标准通用款'|htmlentities} × {$row.goods_num}</span></div>
<div class="od-item"><span class="od-item-k">施工规格:</span><span class="od-item-v">{$row.goods_model|default='未记录'|htmlentities} × {$row.goods_num}</span></div>
<div class="od-item">
<span class="od-item-k">货品到货:</span>
<span class="od-item-v">
{if $row.goods_arrived == 1}<span class="label label-success">已到货可装</span>{else/}<span class="label label-default">物流在途/未登记</span>{/if}
{if $row.goods_arrived == 1}<span class="label label-success">已到货</span>{elseif $row.goods_arrived === 0 || $row.goods_arrived === '0'/}<span class="label label-default">未到货</span>{else/}<span class="label label-default">未记录</span>{/if}
</span>
</div>
<div class="od-item">
@@ -230,25 +258,7 @@
{/if}
</div>
{if !empty($goodsList)}
<div style="margin-top: 14px; border-top: 1px dashed #e2e8f0; padding-top: 12px;">
<div style="font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 8px;">多商品及增项服务清单:</div>
<table class="table table-bordered table-condensed" style="margin-bottom: 0; font-size: 12px;">
<thead><tr class="active"><th>商品名称</th><th>规格型号</th><th>数量</th><th>加选增项</th><th>单价</th></tr></thead>
<tbody>
{foreach name="goodsList" item="g"}
<tr>
<td><strong>{$g.goods_name|default='-'|htmlentities}</strong></td>
<td>{$g.goods_model|default='-'|htmlentities}</td>
<td>{$g.goods_num}</td>
<td>{$g.addon_services|default='无'|htmlentities}</td>
<td>¥{$g.base_price}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
</div>
</div>
</div>
@@ -257,7 +267,7 @@
<div class="col-xs-12 col-sm-6">
<div class="od-card">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-user-circle"></i> 承接师傅与关键履约时间轴</h4>
<h4 class="od-card-title"><i class="fa fa-user-circle"></i> 师傅与履约</h4>
</div>
<div class="od-card-body">
{if $row.master_id && $row.master}
@@ -292,11 +302,35 @@
</div>
</div>
{if !empty($goodsList)}
<div class="od-card">
<div class="od-card-header"><h4 class="od-card-title"><i class="fa fa-list-alt"></i> 商品与服务</h4></div>
<div class="od-card-body">
<div class="od-table-scroll">
<table class="table table-bordered table-condensed" style="margin-bottom: 0; font-size: 12px;">
<thead><tr class="active"><th>商品</th><th>规格</th><th>数量</th><th>服务项目</th><th>单价</th></tr></thead>
<tbody>
{foreach name="goodsList" item="g"}
<tr>
<td><strong>{$g.goods_name|default='-'|htmlentities}</strong></td>
<td>{$g.goods_model|default='-'|htmlentities}</td>
<td>{$g.goods_num}</td>
<td>{$g.service_text|default='未记录'|htmlentities}</td>
<td>¥{$g.base_price}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
{/if}
<!-- 师傅竞标报价记录(针对报价单或有报价记录的工单) -->
{if !empty($quoteList)}
<div class="od-card">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-gavel"></i> 师傅竞标报价记录 ({:count($quoteList)})</h4>
<h4 class="od-card-title"><i class="fa fa-gavel"></i> 师傅报价 ({:count($quoteList)})</h4>
</div>
<div class="od-card-body" style="padding: 12px 16px;">
<table class="table table-bordered table-hover table-condensed" style="margin-bottom:0; font-size:12px;">
@@ -306,7 +340,7 @@
<th>联系电话</th>
<th>服务评分</th>
<th>报价金额</th>
<th>施工方案与报价说明</th>
<th>报价说明</th>
<th>状态</th>
<th>报价时间</th>
</tr>
@@ -320,9 +354,7 @@
<td><strong style="color:#ea580c;">¥{$qt.amount}</strong></td>
<td>{$qt.description|default='-'|htmlentities}</td>
<td>
{if $qt.status == 'accept'}<span class="label label-success">已中标采纳</span>
{elseif $qt.status == 'reject'/}<span class="label label-default">未中标</span>
{else/}<span class="label label-warning">待雇主确认</span>{/if}
<span class="label {if $qt.status == 'accept' || $qt.status == 'selected'}label-success{elseif $qt.status == 'wait'/}label-warning{else/}label-default{/if}">{$qt.display_status|htmlentities}</span>
</td>
<td>{$qt.createtime|datetime}</td>
</tr>
@@ -338,13 +370,14 @@
<div class="col-xs-12 col-sm-6">
<div class="od-card">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-cny"></i> 资金构成、结算分成与发票状态</h4>
<h4 class="od-card-title"><i class="fa fa-cny"></i> 费用与结算</h4>
</div>
<div class="od-card-body">
<div class="od-grid-list">
<div class="od-item"><span class="od-item-k">基础服务费:</span><span class="od-item-v">¥{$row.base_amount}</span></div>
<div class="od-item"><span class="od-item-k">步梯楼层费:</span><span class="od-item-v">¥{$row.floor_amount}</span></div>
<div class="od-item"><span class="od-item-k">远程/加急费:</span><span class="od-item-v">¥{:number_format($row.distance_amount + $row.urgent_amount, 2, '.', '')}</span></div>
<div class="od-item"><span class="od-item-k">远程费:</span><span class="od-item-v">¥{$row.distance_amount}</span></div>
<div class="od-item"><span class="od-item-k">加急费:</span><span class="od-item-v">¥{$row.urgent_amount}</span></div>
<div class="od-item"><span class="od-item-k">优惠券抵扣:</span><span class="od-item-v" style="color:#16a34a;">-¥{$row.discount_amount}</span></div>
<div class="od-item">
<span class="od-item-k">现场补差价:</span>
@@ -355,17 +388,18 @@
{else/}无{/if}
</span>
</div>
<div class="od-item"><span class="od-item-k">实付总金额:</span><span class="od-item-v" style="color:#ea580c; font-size:15px; font-weight:700;">¥{$row.pay_amount}</span></div>
<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">{$amountLabel|htmlentities}:</span><span class="od-item-v" style="color:#ea580c; font-size:15px; font-weight:700;">¥{$row.pay_amount}</span></div>
{if $row.refund_amount > 0}<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">退款金额:</span><span class="od-item-v">¥{$row.refund_amount}(请核对下方退款状态)</span></div>{/if}
</div>
<div style="margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e2e8f0;">
<div class="od-grid-list">
<div class="od-item"><span class="od-item-k">支付状态:</span><span class="od-item-v"><span class="label {if $row.pay_status==1}label-success{elseif $row.pay_status==2/}label-danger{else/}label-default{/if}">{$row.pay_status_text}</span></span></div>
<div class="od-item"><span class="od-item-k">支付渠道:</span><span class="od-item-v">{$row.pay_type|default='微信支付'|htmlentities}</span></div>
<div class="od-item"><span class="od-item-k">支付渠道:</span><span class="od-item-v">{$paymentTypeLabel|htmlentities}</span></div>
<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">交易流水号:</span><span class="od-item-v"><code>{$row.transaction_id|default='-'|htmlentities}</code></span></div>
<div class="od-item"><span class="od-item-k">抽佣规则快照:</span><span class="od-item-v"><span class="label label-info">{if !empty($settle)}{$settle.commission_rate|htmlentities}%{else/}{$settlePreview.commission_rate|default='10.00'|htmlentities}%{/if}</span> <small class="text-muted">{$settlePreview.rule_name|default=''|htmlentities}</small></span></div>
<div class="od-item"><span class="od-item-k">抽佣比例:</span><span class="od-item-v"><span class="label label-info">{if !empty($settle)}{$settle.commission_rate|htmlentities}%{else/}{$settlePreview.commission_rate|htmlentities}%(预计){/if}</span> <small class="text-muted">{$settlePreview.rule_name|default=''|htmlentities}</small></span></div>
<div class="od-item"><span class="od-item-k">结算状态:</span><span class="od-item-v">{$row.settle_status_text}</span></div>
<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">师傅结算款:</span><span class="od-item-v" style="color:#10b981; font-weight:700;">{if !empty($settle)}¥{$settle.settle_amount}(平台抽佣 ¥{$settle.commission}){elseif $row.settle_status == 1/}¥{$row.settle_amount}{else/}预计 ¥{:number_format($settlePreview.settle_amount, 2, '.', '')}(预计抽佣 ¥{:number_format($settlePreview.commission, 2, '.', '')}){/if}</span></div>
<div class="od-item" style="grid-column: span 2;"><span class="od-item-k">师傅结算款:</span><span class="od-item-v" style="color:#10b981; font-weight:700;">{if !empty($settle)}实际 ¥{$settle.settle_amount}(平台抽佣 ¥{$settle.commission}){elseif $row.settle_status == 1/}实际 ¥{$row.settle_amount}{else/}预计 ¥{:number_format($settlePreview.settle_amount, 2, '.', '')}(预计抽佣 ¥{:number_format($settlePreview.commission, 2, '.', '')}){/if}</span></div>
<div class="od-item" style="grid-column: span 2;">
<span class="od-item-k">发票状态:</span>
<span class="od-item-v">
@@ -390,7 +424,7 @@
<div class="col-xs-12 col-sm-6">
<div class="od-card">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-star"></i> 雇主评价与售后记录</h4>
<h4 class="od-card-title"><i class="fa fa-star"></i> 评价与售后</h4>
</div>
<div class="od-card-body">
{if !empty($review)}
@@ -428,7 +462,7 @@
<div style="font-size: 12px; font-weight: 700; color: #dc2626; margin-bottom: 6px;"><i class="fa fa-shield"></i> 关联申诉争议记录:</div>
{foreach name="appealList" item="ap"}
<div style="background:#fef2f2; border:1px solid #fecaca; border-radius:6px; padding:8px 10px; font-size:12px; margin-bottom:6px;">
<div><strong>师傅:</strong>{$ap.master_name|default='-'|htmlentities} · <strong>状态:</strong>{$ap.status|htmlentities}</div>
<div><strong>师傅:</strong>{$ap.master_name|default='-'|htmlentities} · <strong>状态:</strong>{$ap.display_status|htmlentities}</div>
<div style="margin-top:2px;"><strong>申诉理由:</strong>{$ap.content|htmlentities}</div>
{if !empty($ap.reply)}<div style="margin-top:2px;color:#15803d;"><strong>平台裁决:</strong>{$ap.reply|htmlentities}</div>{/if}
</div>
@@ -443,32 +477,39 @@
<!-- 3.5 微信支付与原路退款交易流水诊断 -->
<div class="od-card">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-wechat"></i> 微信支付与原路退款交易流水 ({:count($payOrders)})</h4>
<span class="text-muted" style="font-size:12px;">展示网关真实回执、异常中文诊断与人工同步/重退入口</span>
<h4 class="od-card-title"><i class="fa fa-wechat"></i> 支付与退款记录</h4>
<span class="text-muted" style="font-size:12px;">已支付及退款记录</span>
</div>
<div class="od-card-body">
{if !empty($payOrders)}
<div class="table-responsive">
<table class="table table-bordered table-condensed" style="margin-bottom:0; font-size:12.5px;">
{if empty($payGroups.settled)}<div class="text-muted" style="margin-bottom: 10px;">暂无已支付记录</div>{/if}
{foreach name="paySections" item="section"}
{if !empty($section.items)}
{if $section.type == 'attempts'}
<details class="od-pay-attempts">
<summary>支付尝试记录({:count($section.items)}){if $payGroups.needs_review > 0}<span class="od-pay-warning">有待支付或状态未确认的记录,请核实</span>{/if}</summary>
{/if}
<div class="od-pay-scroll">
<table class="table table-bordered table-condensed od-pay-table" style="margin-bottom:0; font-size:12.5px;">
<thead>
<tr style="background:#f8fafc;">
<th style="width:55px;">ID</th>
<th style="width:105px;">支付场景</th>
<th>商户单号 / 微信单号 / 退款单号</th>
<th style="width:90px;">金额</th>
<th style="width:130px;">流水 / 退款状态</th>
<th>失败错误码与中文诊断</th>
<th style="width:140px;">操作</th>
<th class="od-pay-id">ID</th>
<th class="od-pay-scene">支付场景</th>
<th class="od-pay-number">交易单号</th>
<th class="od-pay-amount">金额</th>
<th class="od-pay-status">交易状态</th>
<th>状态说明</th>
<th class="od-pay-action">操作</th>
</tr>
</thead>
<tbody>
{foreach name="payOrders" item="po"}
{foreach name="section.items" item="po"}
<tr>
<td>#{$po.id}</td>
<td>{$po.scene_text|htmlentities}</td>
<td>
<td class="od-pay-scene">{$po.scene_text|htmlentities}<div><span class="label {if $po.is_balance}label-info{else/}label-default{/if}">{$po.payment_type_text|htmlentities}</span></div></td>
<td class="od-pay-number">
<div>商户:<code>{$po.out_trade_no|htmlentities}</code></div>
{if !empty($po.transaction_id)}<div style="margin-top:2px;">微信:<code>{$po.transaction_id|htmlentities}</code></div>{/if}
{if !empty($po.transaction_id) && !$po.is_balance}<div style="margin-top:2px;">微信:<code>{$po.transaction_id|htmlentities}</code></div>{/if}
{if !empty($po.refund_no)}<div style="margin-top:2px;">退款单:<code>{$po.refund_no|htmlentities}</code>{if !empty($po.refund_id)}({$po.refund_id|htmlentities}){/if}</div>{/if}
</td>
<td>
@@ -490,16 +531,16 @@
</td>
<td>
{if !empty($po.fail_reason) || !empty($po.fail_code)}
<div style="background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; border-radius:6px; padding:6px 8px; line-height:1.5;">
{if !empty($po.fail_code)}<div><strong>错误码:</strong><code>{$po.fail_code|htmlentities}</code></div>{/if}
<div><strong>原因:</strong>{$po.fail_reason|default='未知异常'|htmlentities}</div>
<div class="od-pay-note {if $po.status == 'pay_failed' || $po.status == 'refund_failed'}is-error{/if}">
{if !empty($po.fail_reason)}<div>{$po.fail_reason|htmlentities}</div>{/if}
{if !empty($po.fail_code)}<div>代码:<code>{$po.fail_code|htmlentities}</code></div>{/if}
</div>
{else /}
<span class="text-muted">-</span>
{/if}
</td>
<td>
{if $po.status == 'pending' || $po.status == 'pay_failed' || $po.status == 'refunding' || $po.status == 'refund_failed'}
{if !$po.is_balance && ($po.status == 'pending' || $po.status == 'pay_failed' || $po.status == 'refunding' || $po.status == 'refund_failed')}
<button type="button" class="btn btn-xs btn-warning js-sync-pay-order" data-id="{$po.id}" style="margin-bottom:4px;">
<i class="fa fa-refresh"></i> 同步微信状态
</button>
@@ -518,9 +559,12 @@
</tbody>
</table>
</div>
{if $section.type == 'attempts'}</details>{/if}
{/if}
{/foreach}
{elseif $row.pay_status == 1 && ($row.pay_type == 'wechat' || $row.pay_type == '')/}
<div style="background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; border-radius:6px; padding:10px 12px;">
<i class="fa fa-exclamation-triangle"></i> <strong>资金流水缺失告警:</strong>当前订单显示已支付(渠道:{$row.pay_type|default='未记录'|htmlentities}),但未关联任何 <code>fa_pay_order</code> 微信交易单,系统已禁止自动假退款,如需退款请先核查微信商户平台流水。
<i class="fa fa-exclamation-triangle"></i> <strong>缺少支付记录:</strong>订单显示已支付,但未找到对应的微信支付记录。如需退款,请先核查微信商户平台流水。
</div>
{else /}
<div class="text-muted" style="padding:8px 0;">暂无微信支付交易流水记录</div>
@@ -531,7 +575,7 @@
<!-- 4. 现场施工取证照片画廊 -->
<div class="od-card">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-camera"></i> 现场施工与验收取证图集 ({:count($mediaList)})</h4>
<h4 class="od-card-title"><i class="fa fa-camera"></i> 现场照片 ({:count($mediaList)})</h4>
<span class="text-muted" style="font-size:12px;"><i class="fa fa-search-plus"></i> 点击图片查看原图</span>
</div>
<div class="od-card-body">
@@ -561,14 +605,14 @@
<!-- 5. 完整操作日志时间轴 -->
<div class="od-card" style="margin-bottom:0;">
<div class="od-card-header">
<h4 class="od-card-title"><i class="fa fa-history"></i> 工单全生命周期操作日志 ({:count($logList)})</h4>
<h4 class="od-card-title"><i class="fa fa-history"></i> 操作日志 ({:count($logList)})</h4>
</div>
<div class="od-card-body">
{if !empty($logList)}
<div class="od-timeline">
{foreach name="logList" item="log"}
<div class="od-tl-item">
<div class="od-tl-time">{$log.createtime|datetime} · 操作端:{$log.operator_type|default='system'|htmlentities}</div>
<div class="od-tl-time">{$log.createtime|datetime} · 操作方:{$log.operator_label|htmlentities}</div>
<div class="od-tl-title">{$log.status_label|htmlentities}</div>
<div class="od-tl-desc">{$log.remark|htmlentities}</div>
</div>