From 80fb4068d136617ac4552e6b83e0e37ba567c9ea Mon Sep 17 00:00:00 2001 From: kate522 Date: Wed, 7 Oct 2026 08:42:07 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=94=AE=E5=90=8E=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=88=97=E6=94=B9=E4=B8=BA=20WP=20=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=BC=8F=20row-actions=20=E6=82=AC=E5=81=9C?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E6=93=8D=E4=BD=9C=EF=BC=88JS=20POST=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=EF=BC=8C=E6=8B=92=E7=BB=9D=E6=97=B6=20prompt?= =?UTF-8?q?=20=E5=A1=AB=E5=A4=87=E6=B3=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Admin/Native/PayOrders.php | 40 +++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/Admin/Native/PayOrders.php b/src/Admin/Native/PayOrders.php index 66642f7a..0bd290d7 100644 --- a/src/Admin/Native/PayOrders.php +++ b/src/Admin/Native/PayOrders.php @@ -437,15 +437,28 @@ class PayOrders { } $images_cell = $thumbs ? implode('', $thumbs) : '—'; echo '' . esc_html((string) $id) . '
' . esc_html((string) ($item['created_at'] ?? '')) . '' . esc_html($number) . '
' . esc_html($type_label) . ($order ? ' · ' . esc_html(\AKSRT\Payment\UserOrders::get_instance()->decorate_order_view($order, false)['product_name'] ?? '') : '') . '' . esc_html($user ? $user->display_name . ' (#' . $uid . ')' : '#' . $uid) . '' . $reason_cell . '' . $materials_cell . '' . $desc_cell . '' . $images_cell . '' . esc_html($refund_amount) . '' . esc_html($status_labels[(string) $item['status']] ?? (string) $item['status']) . ''; - if ((string) $item['status'] === 'pending') foreach (['approve' => '通过', 'reject' => '拒绝'] as $decision => $label) { - echo '
'; wp_nonce_field('aksrt_after_sale_review_' . $id); echo '
'; - } - if ((string) $item['status'] === 'processing') { + // 快捷操作:仿 WP 文章列表 row-actions(悬停显示),点击经 JS 以 POST 提交 + $quick_actions = []; + if ((string) $item['status'] === 'pending') { + $quick_actions = ['approve' => __('通过', 'aksrt'), 'reject' => __('拒绝', 'aksrt')]; + } elseif ((string) $item['status'] === 'processing') { $gateway_result = json_decode((string) ($item['gateway_result'] ?? ''), true); $manual_refund = is_array($gateway_result) && sanitize_key((string) ($gateway_result['status'] ?? '')) === 'manual'; - foreach (($manual_refund ? ['complete' => '确认线下退款完成', 'reject' => '确认未退款并拒绝'] : ['approve' => '同步退款状态']) as $decision => $label) { - echo '
'; wp_nonce_field('aksrt_after_sale_review_' . $id); echo '
'; + $quick_actions = $manual_refund + ? ['complete' => __('确认线下退款完成', 'aksrt'), 'reject' => __('确认未退款并拒绝', 'aksrt')] + : ['approve' => __('同步退款状态', 'aksrt')]; + } + if ($quick_actions) { + $links = []; + foreach ($quick_actions as $decision => $label) { + $links[] = '' . esc_html($label) . ''; } + echo '
' . implode(' | ', $links) . '
'; } if (!empty($item['admin_note'])) echo '' . esc_html__('备注:', 'aksrt') . esc_html((string) $item['admin_note']) . '
'; if (!empty($item['gateway_result'])) { @@ -456,6 +469,21 @@ class PayOrders { echo ''; } echo ''; + echo ''; } public function handle_after_sale_review(): void {