From 9cdbfa42ad07c87f06fdc3c3340628b594225927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Wed, 1 Oct 2025 17:26:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=90=83=E5=B1=80=E5=BC=80=E5=B1=80=E5=90=8E=E5=8F=AF=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game_pages/detail/index.tsx | 5 ++++- src/order_pages/orderList/index.tsx | 27 ++++++++++++++++----------- src/utils/orderActions.ts | 6 ++++-- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index dc11271..f8fa49e 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -793,13 +793,16 @@ function Participants(props) { participant_count, max_participants, user_action_status = {}, + start_time, } = detail; const { can_join, can_pay, can_substitute, is_substituting, waiting_start } = user_action_status; const showApplicationEntry = [can_pay, can_substitute, is_substituting, waiting_start].every( (item) => !item - ) && can_join; + ) && + can_join && + dayjs(start_time).isAfter(dayjs()); const leftCount = max_participants - participant_count; return ( diff --git a/src/order_pages/orderList/index.tsx b/src/order_pages/orderList/index.tsx index d84d896..7872d25 100644 --- a/src/order_pages/orderList/index.tsx +++ b/src/order_pages/orderList/index.tsx @@ -276,6 +276,7 @@ const OrderList = () => { const unPay = item.order_status === OrderStatus.PENDING && item.cancel_type === CancelType.NONE; + const timeout = item.cancel_type === CancelType.TIMEOUT; const { game_info } = item; const { @@ -297,17 +298,21 @@ const OrderList = () => { > {item?.game_info?.title} - - - {unPay ? "待支付" : refundTextMap.get(item.refund_status)} - {" "} - ¥ {item.amount} - + {!timeout && ( + + + {unPay + ? "待支付" + : refundTextMap.get(item.refund_status)} + {" "} + ¥ {item.amount} + + )} {generateTimeMsg(item.game_info || {})} diff --git a/src/utils/orderActions.ts b/src/utils/orderActions.ts index 2367a23..dc53dbf 100644 --- a/src/utils/orderActions.ts +++ b/src/utils/orderActions.ts @@ -5,13 +5,13 @@ export function getOrderStatus(orderData) { if (!order_no) { return 'none' } - const unPay = order_status === OrderStatus.PENDING && cancel_type === CancelType.NONE; + const unPay = order_status === OrderStatus.PENDING && ([CancelType.NONE].includes(cancel_type)); const refund = [RefundStatus.PENDING, RefundStatus.SUCCESS].includes(refund_status); const expired = order_status === OrderStatus.FINISHED || [CancelType.TIMEOUT, CancelType.USER].includes(cancel_type); - return unPay ? 'unpay' : refund ? 'refund' : expired ? 'expired' : 'progress' + return unPay ? 'unpay' : refund ? 'refund' : expired ? cancel_type === CancelType.TIMEOUT ? 'timeout' : 'expired' : 'progress' } // scene: list、detail @@ -54,6 +54,7 @@ export function generateOrderActions(orderData, actions, scene) { if (scene === 'list') { const actionMap = new Map([ + ['timeout', [deleteOrder, gameDetail]], ['expired', [deleteOrder, gameDetail]], ['progress', [quitGame, gameDetail]], ['refund', [deleteOrder, gameDetail]], @@ -64,6 +65,7 @@ export function generateOrderActions(orderData, actions, scene) { if (scene === 'detail') { const actionMap = new Map([ + ['timeout', [deleteOrder, gameDetail]], ['expired', [gameDetail, deleteOrder]], ['progress', [gameDetail, quitGame]], ['refund', [deleteOrder, gameDetail]],