import React from 'react'; import { View, Text, ScrollView, StyleSheet, TouchableOpacity, } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import BackIcon from '../../components/BackIcon'; import fontSize from '../../utils/fontsizeUtils'; export function ConfirmOrder() { const navigation = useNavigation>(); // 模拟订单数据 const orderInfo = { order_no: 'SO2024031500001', status: 'pending', payment_method: 'Brainnel Pay(Mobile Money)', payment_operator: 'MobiCash', total_amount: 486.92, items: [ { id: 1, product_name: 'Classic Cotton T-Shirt', attributes: [ { attribute_name: 'Color', value: 'White' }, { attribute_name: 'Size', value: 'L' } ], quantity: 2, price: 89.96, total_price: 179.92 }, { id: 2, product_name: 'Casual Denim Jeans', attributes: [ { attribute_name: 'Style', value: 'Slim Fit' }, { attribute_name: 'Size', value: '32' } ], quantity: 1, price: 297.00, total_price: 297.00 } ], shipping: { method: 'sea', domestic_fee: 25.50, international_fee: 45.00, estimated_arrival: '15-20 days' }, recipient: { name: 'John Doe', phone: '+225 0123456789', address: 'Abidjan, Côte d\'Ivoire' } }; return ( {/* Header */} navigation.goBack()}> 确认订单 {/* Order Number */} 📋 订单编号 {orderInfo.order_no} {/* Payment Method */} 💳 支付方式 {orderInfo.payment_method} {orderInfo.payment_operator} {/* Shipping Info */} 🚢 物流信息 配送方式: {orderInfo.shipping.method === 'sea' ? '海运' : '空运'} 预计到达: {orderInfo.shipping.estimated_arrival} {/* Recipient Info */} 👤 收件人信息 {orderInfo.recipient.name} {orderInfo.recipient.phone} {orderInfo.recipient.address} {/* Order Items */} 📦 商品清单 {orderInfo.items.map((item) => ( {item.product_name} {item.attributes.map((attr) => ( {attr.attribute_name}: {attr.value} ))} x{item.quantity} ${item.total_price} ))} {/* Price Summary */} 商品总价 ${orderInfo.items.reduce((sum, item) => sum + item.total_price, 0)} 国内运费 ${orderInfo.shipping.domestic_fee} 国际运费 ${orderInfo.shipping.international_fee} 实付金额 ${orderInfo.total_amount} {/* Bottom Button */} 立即支付 ); } const styles = StyleSheet.create({ mainContainer: { flex: 1, backgroundColor: '#fff', }, container: { flex: 1, backgroundColor: '#fff', }, header: { flexDirection: 'row', alignItems: 'center', padding: 16, backgroundColor: '#fff', elevation: 3, }, title: { fontSize: fontSize(18), fontWeight: '500', flex: 1, textAlign: 'center', }, section: { backgroundColor: '#fff', padding: 16, }, sectionHeader: { flexDirection: 'row', alignItems: 'center', marginBottom: 12, }, sectionIcon: { fontSize: fontSize(18), marginRight: 8, }, sectionTitle: { fontSize: fontSize(16), fontWeight: '500', }, border: { height: 6, backgroundColor: '#f5f5f5', }, orderNumber: { fontSize: fontSize(16), color: '#666', }, paymentInfo: { backgroundColor: '#f8f8f8', padding: 12, borderRadius: 8, }, paymentMethod: { fontSize: fontSize(16), fontWeight: '500', marginBottom: 4, }, paymentOperator: { fontSize: fontSize(14), color: '#666', }, shippingInfo: { backgroundColor: '#f8f8f8', padding: 12, borderRadius: 8, }, shippingRow: { flexDirection: 'row', marginBottom: 8, }, shippingLabel: { fontSize: fontSize(14), color: '#666', width: 80, }, shippingValue: { fontSize: fontSize(14), flex: 1, }, recipientInfo: { backgroundColor: '#f8f8f8', padding: 12, borderRadius: 8, }, recipientName: { fontSize: fontSize(16), fontWeight: '500', marginBottom: 4, }, recipientPhone: { fontSize: fontSize(14), color: '#666', marginBottom: 4, }, recipientAddress: { fontSize: fontSize(14), color: '#666', }, orderItems: { gap: 12, }, orderItem: { flexDirection: 'row', padding: 12, backgroundColor: '#f8f8f8', borderRadius: 8, }, itemDetails: { flex: 1, }, itemName: { fontSize: fontSize(14), marginBottom: 4, }, itemAttribute: { fontSize: fontSize(12), color: '#666', marginBottom: 2, }, itemQuantity: { fontSize: fontSize(12), color: '#999', marginTop: 4, }, itemPrice: { justifyContent: 'center', }, priceText: { fontSize: fontSize(16), fontWeight: '500', color: '#ff6000', }, priceSummary: { backgroundColor: '#f8f8f8', padding: 16, borderRadius: 8, }, priceRow: { flexDirection: 'row', justifyContent: 'space-between', marginBottom: 12, }, priceLabel: { fontSize: fontSize(14), color: '#666', }, priceValue: { fontSize: fontSize(14), color: '#333', }, totalRow: { marginTop: 8, paddingTop: 12, borderTopWidth: 1, borderTopColor: '#eee', }, totalLabel: { fontSize: fontSize(16), fontWeight: '500', }, totalAmount: { fontSize: fontSize(18), fontWeight: '600', color: '#ff6000', }, bottomButton: { width: '100%', padding: 16, backgroundColor: '#fff', }, bottomButtonContent: { backgroundColor: '#ff6000', padding: 16, borderRadius: 25, alignItems: 'center', }, bottomButtonText: { color: '#fff', fontSize: fontSize(16), fontWeight: '500', }, });