feat: 订单显示问题修复、修复球局开局后可加入的问题
This commit is contained in:
@@ -793,13 +793,16 @@ function Participants(props) {
|
|||||||
participant_count,
|
participant_count,
|
||||||
max_participants,
|
max_participants,
|
||||||
user_action_status = {},
|
user_action_status = {},
|
||||||
|
start_time,
|
||||||
} = detail;
|
} = detail;
|
||||||
const { can_join, can_pay, can_substitute, is_substituting, waiting_start } =
|
const { can_join, can_pay, can_substitute, is_substituting, waiting_start } =
|
||||||
user_action_status;
|
user_action_status;
|
||||||
const showApplicationEntry =
|
const showApplicationEntry =
|
||||||
[can_pay, can_substitute, is_substituting, waiting_start].every(
|
[can_pay, can_substitute, is_substituting, waiting_start].every(
|
||||||
(item) => !item
|
(item) => !item
|
||||||
) && can_join;
|
) &&
|
||||||
|
can_join &&
|
||||||
|
dayjs(start_time).isAfter(dayjs());
|
||||||
const leftCount = max_participants - participant_count;
|
const leftCount = max_participants - participant_count;
|
||||||
return (
|
return (
|
||||||
<View className="detail-page-content-participants">
|
<View className="detail-page-content-participants">
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ const OrderList = () => {
|
|||||||
const unPay =
|
const unPay =
|
||||||
item.order_status === OrderStatus.PENDING &&
|
item.order_status === OrderStatus.PENDING &&
|
||||||
item.cancel_type === CancelType.NONE;
|
item.cancel_type === CancelType.NONE;
|
||||||
|
const timeout = item.cancel_type === CancelType.TIMEOUT;
|
||||||
const { game_info } = item;
|
const { game_info } = item;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -297,17 +298,21 @@ const OrderList = () => {
|
|||||||
>
|
>
|
||||||
<View className={styles.gameTitle}>
|
<View className={styles.gameTitle}>
|
||||||
<View className={styles.title}>{item?.game_info?.title}</View>
|
<View className={styles.title}>{item?.game_info?.title}</View>
|
||||||
<View
|
{!timeout && (
|
||||||
className={classnames(
|
<View
|
||||||
styles.payNum,
|
className={classnames(
|
||||||
styles[unPay ? "pending" : "paid"]
|
styles.payNum,
|
||||||
)}
|
styles[unPay ? "pending" : "paid"]
|
||||||
>
|
)}
|
||||||
<Text>
|
>
|
||||||
{unPay ? "待支付" : refundTextMap.get(item.refund_status)}
|
<Text>
|
||||||
</Text>{" "}
|
{unPay
|
||||||
¥ <Text>{item.amount}</Text>
|
? "待支付"
|
||||||
</View>
|
: refundTextMap.get(item.refund_status)}
|
||||||
|
</Text>{" "}
|
||||||
|
¥ <Text>{item.amount}</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.gameTime}>
|
<View className={styles.gameTime}>
|
||||||
{generateTimeMsg(item.game_info || {})}
|
{generateTimeMsg(item.game_info || {})}
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ export function getOrderStatus(orderData) {
|
|||||||
if (!order_no) {
|
if (!order_no) {
|
||||||
return 'none'
|
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 refund = [RefundStatus.PENDING, RefundStatus.SUCCESS].includes(refund_status);
|
||||||
const expired =
|
const expired =
|
||||||
order_status === OrderStatus.FINISHED ||
|
order_status === OrderStatus.FINISHED ||
|
||||||
[CancelType.TIMEOUT, CancelType.USER].includes(cancel_type);
|
[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
|
// scene: list、detail
|
||||||
@@ -54,6 +54,7 @@ export function generateOrderActions(orderData, actions, scene) {
|
|||||||
|
|
||||||
if (scene === 'list') {
|
if (scene === 'list') {
|
||||||
const actionMap = new Map([
|
const actionMap = new Map([
|
||||||
|
['timeout', [deleteOrder, gameDetail]],
|
||||||
['expired', [deleteOrder, gameDetail]],
|
['expired', [deleteOrder, gameDetail]],
|
||||||
['progress', [quitGame, gameDetail]],
|
['progress', [quitGame, gameDetail]],
|
||||||
['refund', [deleteOrder, gameDetail]],
|
['refund', [deleteOrder, gameDetail]],
|
||||||
@@ -64,6 +65,7 @@ export function generateOrderActions(orderData, actions, scene) {
|
|||||||
|
|
||||||
if (scene === 'detail') {
|
if (scene === 'detail') {
|
||||||
const actionMap = new Map([
|
const actionMap = new Map([
|
||||||
|
['timeout', [deleteOrder, gameDetail]],
|
||||||
['expired', [gameDetail, deleteOrder]],
|
['expired', [gameDetail, deleteOrder]],
|
||||||
['progress', [gameDetail, quitGame]],
|
['progress', [gameDetail, quitGame]],
|
||||||
['refund', [deleteOrder, gameDetail]],
|
['refund', [deleteOrder, gameDetail]],
|
||||||
|
|||||||
Reference in New Issue
Block a user