|
|
@@ -13,6 +13,7 @@ interface OrderButtonBarProps {
|
|
|
order: Order
|
|
|
onViewDetail: (order: Order) => void
|
|
|
onCancelOrder?: () => void
|
|
|
+ hideViewDetail?: boolean
|
|
|
}
|
|
|
|
|
|
interface ActionButton {
|
|
|
@@ -21,7 +22,7 @@ interface ActionButton {
|
|
|
onClick: () => void
|
|
|
}
|
|
|
|
|
|
-export default function OrderButtonBar({ order, onViewDetail, onCancelOrder }: OrderButtonBarProps) {
|
|
|
+export default function OrderButtonBar({ order, onViewDetail, onCancelOrder, hideViewDetail = false }: OrderButtonBarProps) {
|
|
|
const queryClient = useQueryClient()
|
|
|
const [showCancelDialog, setShowCancelDialog] = useState(false)
|
|
|
|
|
|
@@ -202,12 +203,14 @@ export default function OrderButtonBar({ order, onViewDetail, onCancelOrder }: O
|
|
|
const getActionButtons = (order: Order): ActionButton[] => {
|
|
|
const buttons: ActionButton[] = []
|
|
|
|
|
|
- // 查看详情按钮 - 所有状态都显示
|
|
|
- buttons.push({
|
|
|
- text: '查看详情',
|
|
|
- type: 'outline',
|
|
|
- onClick: () => onViewDetail(order)
|
|
|
- })
|
|
|
+ // 查看详情按钮 - 所有状态都显示,除非明确隐藏
|
|
|
+ if (!hideViewDetail) {
|
|
|
+ buttons.push({
|
|
|
+ text: '查看详情',
|
|
|
+ type: 'outline',
|
|
|
+ onClick: () => onViewDetail(order)
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
// 根据支付状态和订单状态显示不同的操作按钮
|
|
|
if (order.payState === 0) {
|