feat: temp

This commit is contained in:
2025-09-24 13:59:42 +08:00
parent 35c79930c5
commit e89ed5943c
2 changed files with 17 additions and 14 deletions

View File

@@ -64,8 +64,7 @@ function genGameNotice(order_status, start_time) {
function GameInfo(props) {
const { detail, currentLocation, orderDetail, init } = props;
// console.log(orderDetail, "orderDetail");
const { order_status, refund_status } = orderDetail;
const { order_status, refund_status, amount } = orderDetail;
const { latitude, longitude, location, location_name, start_time, end_time, weather } =
detail || {};
@@ -219,18 +218,19 @@ function GameInfo(props) {
}
}
console.log(gameNotice)
return (
<View className={styles.gameInfoContainer}>
{["progress", "expired"].includes(orderStatus) && (
<>
{["refund", "progress", "expired"].includes(orderStatus) && (
<View className={styles.paidInfo}>
{refundTextMap.get(refund_status)} ¥ 90
{refundTextMap.get(refund_status)} ¥ {amount}
</View>
)}
{["progress", "expired"].includes(orderStatus) && (
<View className={styles.gameStatus}>
<Text className={styles.statusText}>{gameNotice.title}</Text>
{gameNotice.content && <Text>{gameNotice.content}</Text>}
</View>
</>
)}
<View className={styles.gameInfo}>
{/* Date and Weather */}

View File

@@ -1,16 +1,17 @@
import { OrderStatus, CancelType } from "@/services/orderService";
import { OrderStatus, CancelType, RefundStatus } from "@/services/orderService";
export function getOrderStatus(orderData) {
const { order_status, cancel_type, order_no } = orderData
const { order_status, cancel_type, refund_status, order_no } = orderData
if (!order_no) {
return 'none'
}
const unPay = order_status === OrderStatus.PENDING && cancel_type === CancelType.NONE;
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' : expired ? 'expired' : 'progress'
return unPay ? 'unpay' : refund ? 'refund' : expired ? 'expired' : 'progress'
}
// scene: list、detail
@@ -55,6 +56,7 @@ export function generateOrderActions(orderData, actions, scene) {
const actionMap = new Map([
['expired', [deleteOrder, gameDetail]],
['progress', [quitGame, gameDetail]],
['refund', [deleteOrder, gameDetail]],
['unpay', [cancelOrder, payNow]]
])
return actionMap.get(key)
@@ -64,6 +66,7 @@ export function generateOrderActions(orderData, actions, scene) {
const actionMap = new Map([
['expired', [gameDetail, deleteOrder]],
['progress', [gameDetail, quitGame]],
['refund', [deleteOrder, gameDetail]],
['unpay', [cancelOrder]]
])
return actionMap.get(key)