From a422d211fcf51ac4cd36a722a539515f61ada0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90=E5=8A=A0=E5=86=B0?= <11869599+addie66@user.noreply.gitee.com> Date: Mon, 5 Oct 2026 16:22:17 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(split-order):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E8=B4=A6=E8=AE=A2=E5=8D=95=E5=A4=B1=E8=B4=A5=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E8=AF=A6=E6=83=85=E5=B1=95=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 fail_reason_full 字段用于存储完整的失败原因信息 - 实现 formatFailReasonFull 方法解析微信分账失败的详细信息 - 优化前端表格展示,增加查看完整失败原因的弹窗功能 - 调整表格列宽度和样式,提升买家信息展示效果 - 修复昵称和角色ID显示逻辑,避免重复显示问题 ``` --- .../admin/controller/shopro/split/Order.php | 38 ++++++++- .../admin/view/shopro/split/order/index.html | 85 ++++++++++++------- 2 files changed, 89 insertions(+), 34 deletions(-) diff --git a/application/admin/controller/shopro/split/Order.php b/application/admin/controller/shopro/split/Order.php index 33dafeb..b494854 100644 --- a/application/admin/controller/shopro/split/Order.php +++ b/application/admin/controller/shopro/split/Order.php @@ -147,6 +147,7 @@ class Order extends Base $data['receiver_preview'] = $receiverPreview; $data['receiver_summary'] = $summaryLines ? implode(';', $summaryLines) : '—'; $data['fail_reason'] = $this->formatFailReason($data['wx_result'] ?? '', $status); + $data['fail_reason_full'] = $this->formatFailReasonFull($data['wx_result'] ?? '', $status); $diag = (new SplitCalculator())->diagnose($orderId); $data['split_source'] = $diag['final_source']; @@ -264,8 +265,8 @@ class Order extends Base $mobile = is_array($user) ? trim((string) ($user['mobile'] ?? '')) : ''; if ($nickname !== '') { $label = $nickname; - if ($roleId > 0) { - $label .= '#' . $roleId; + if ($roleId > 0 && (string) $nickname !== (string) $roleId) { + $label .= ' #' . $roleId; } if ($mobile !== '') { $label .= ' ' . $this->maskMobile($mobile); @@ -326,7 +327,38 @@ class Order extends Base return implode(' ', $parts); } } - return mb_strlen($raw) > 120 ? (mb_substr($raw, 0, 120) . '…') : $raw; + $full = $this->formatFailReasonFull($wxResult, $status); + if ($full === '') { + return ''; + } + return mb_strlen($full) > 48 ? (mb_substr($full, 0, 48) . '…') : $full; + } + + protected function formatFailReasonFull($wxResult, $status) + { + if ($status !== 4 || $wxResult === '' || $wxResult === null) { + return ''; + } + $raw = is_string($wxResult) ? $wxResult : json_encode($wxResult, JSON_UNESCAPED_UNICODE); + if ($raw === '') { + return ''; + } + if (strpos($raw, 'fund_freeze_stat=FREEZE') !== false) { + return '微信资金冻结,需发货/确认收货后再分账'; + } + $decoded = json_decode($raw, true); + if (is_array($decoded)) { + $parts = array_filter([ + $decoded['resp_desc'] ?? '', + isset($decoded['resp_code']) ? ('resp_code=' . $decoded['resp_code']) : '', + $decoded['bank_message'] ?? '', + $decoded['trans_stat'] ?? '', + ]); + if ($parts) { + return implode(',', $parts); + } + } + return $raw; } protected function formatBuyerDisplay($nickname, $mobile, $userId) diff --git a/application/admin/view/shopro/split/order/index.html b/application/admin/view/shopro/split/order/index.html index 50e1df5..9cca58c 100644 --- a/application/admin/view/shopro/split/order/index.html +++ b/application/admin/view/shopro/split/order/index.html @@ -7,14 +7,13 @@ min-height: 100%; } #splitOrderIndex .el-table .cell { - overflow: hidden; line-height: 1.5; - vertical-align: middle; + vertical-align: top; word-break: keep-all; } #splitOrderIndex .el-table .col-money .cell, - #splitOrderIndex .el-table .col-source .cell { - overflow: visible; + #splitOrderIndex .el-table .col-source .cell, + #splitOrderIndex .el-table .col-buyer .cell { white-space: nowrap; } .page-card { @@ -122,12 +121,12 @@ border-bottom: 1px dashed #ebeef5; } .recv-block:last-child { border-bottom: none; padding-bottom: 0; } - .recv-line1 { + .recv-head { display: flex; align-items: center; - gap: 6px; + justify-content: space-between; + gap: 8px; font-size: 12px; - min-width: 0; } .recv-role { flex-shrink: 0; @@ -138,33 +137,45 @@ font-size: 11px; line-height: 18px; } - .recv-name { - flex: 1; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - color: #303133; - } .recv-amt { flex-shrink: 0; color: #e1212b; font-weight: 600; + white-space: nowrap; + } + .recv-name-line { + margin-top: 4px; + font-size: 12px; + color: #303133; + white-space: nowrap; } .recv-line2 { margin-top: 3px; font-size: 11px; color: #909399; } - .fail-text { - font-size: 12px; + .fail-cell { font-size: 12px; line-height: 1.55; } + .fail-brief { color: #f56c6c; - line-height: 1.5; - word-break: break-all; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; + word-break: break-word; + white-space: normal; + } + .fail-more { + display: inline-block; + margin-top: 4px; + font-size: 11px; + color: #7438D5; + cursor: pointer; + } + .fail-pop-full { + margin: 0; + font-size: 12px; + line-height: 1.65; + color: #606266; + white-space: pre-wrap; + word-break: break-word; + max-height: 280px; + overflow-y: auto; } .diag-pop { font-size: 12px; @@ -209,12 +220,12 @@ - + - + - + - +