feat: temp
This commit is contained in:
@@ -64,8 +64,7 @@ function genGameNotice(order_status, start_time) {
|
|||||||
|
|
||||||
function GameInfo(props) {
|
function GameInfo(props) {
|
||||||
const { detail, currentLocation, orderDetail, init } = props;
|
const { detail, currentLocation, orderDetail, init } = props;
|
||||||
// console.log(orderDetail, "orderDetail");
|
const { order_status, refund_status, amount } = orderDetail;
|
||||||
const { order_status, refund_status } = orderDetail;
|
|
||||||
const { latitude, longitude, location, location_name, start_time, end_time, weather } =
|
const { latitude, longitude, location, location_name, start_time, end_time, weather } =
|
||||||
detail || {};
|
detail || {};
|
||||||
|
|
||||||
@@ -219,18 +218,19 @@ function GameInfo(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(gameNotice)
|
||||||
return (
|
return (
|
||||||
<View className={styles.gameInfoContainer}>
|
<View className={styles.gameInfoContainer}>
|
||||||
{["progress", "expired"].includes(orderStatus) && (
|
{["refund", "progress", "expired"].includes(orderStatus) && (
|
||||||
<>
|
|
||||||
<View className={styles.paidInfo}>
|
<View className={styles.paidInfo}>
|
||||||
{refundTextMap.get(refund_status)} ¥ 90
|
{refundTextMap.get(refund_status)} ¥ {amount}
|
||||||
</View>
|
</View>
|
||||||
|
)}
|
||||||
|
{["progress", "expired"].includes(orderStatus) && (
|
||||||
<View className={styles.gameStatus}>
|
<View className={styles.gameStatus}>
|
||||||
<Text className={styles.statusText}>{gameNotice.title}</Text>
|
<Text className={styles.statusText}>{gameNotice.title}</Text>
|
||||||
{gameNotice.content && <Text>{gameNotice.content}</Text>}
|
{gameNotice.content && <Text>{gameNotice.content}</Text>}
|
||||||
</View>
|
</View>
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
<View className={styles.gameInfo}>
|
<View className={styles.gameInfo}>
|
||||||
{/* Date and Weather */}
|
{/* Date and Weather */}
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
import { OrderStatus, CancelType } from "@/services/orderService";
|
import { OrderStatus, CancelType, RefundStatus } from "@/services/orderService";
|
||||||
|
|
||||||
export function getOrderStatus(orderData) {
|
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) {
|
if (!order_no) {
|
||||||
return 'none'
|
return 'none'
|
||||||
}
|
}
|
||||||
const unPay = order_status === OrderStatus.PENDING && cancel_type === CancelType.NONE;
|
const unPay = order_status === OrderStatus.PENDING && cancel_type === CancelType.NONE;
|
||||||
|
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' : expired ? 'expired' : 'progress'
|
return unPay ? 'unpay' : refund ? 'refund' : expired ? 'expired' : 'progress'
|
||||||
}
|
}
|
||||||
|
|
||||||
// scene: list、detail
|
// scene: list、detail
|
||||||
@@ -55,6 +56,7 @@ export function generateOrderActions(orderData, actions, scene) {
|
|||||||
const actionMap = new Map([
|
const actionMap = new Map([
|
||||||
['expired', [deleteOrder, gameDetail]],
|
['expired', [deleteOrder, gameDetail]],
|
||||||
['progress', [quitGame, gameDetail]],
|
['progress', [quitGame, gameDetail]],
|
||||||
|
['refund', [deleteOrder, gameDetail]],
|
||||||
['unpay', [cancelOrder, payNow]]
|
['unpay', [cancelOrder, payNow]]
|
||||||
])
|
])
|
||||||
return actionMap.get(key)
|
return actionMap.get(key)
|
||||||
@@ -64,6 +66,7 @@ export function generateOrderActions(orderData, actions, scene) {
|
|||||||
const actionMap = new Map([
|
const actionMap = new Map([
|
||||||
['expired', [gameDetail, deleteOrder]],
|
['expired', [gameDetail, deleteOrder]],
|
||||||
['progress', [gameDetail, quitGame]],
|
['progress', [gameDetail, quitGame]],
|
||||||
|
['refund', [deleteOrder, gameDetail]],
|
||||||
['unpay', [cancelOrder]]
|
['unpay', [cancelOrder]]
|
||||||
])
|
])
|
||||||
return actionMap.get(key)
|
return actionMap.get(key)
|
||||||
|
|||||||
Reference in New Issue
Block a user