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]],