|
|
|
@ -75,7 +75,7 @@ export const OrderDetails = () => {
|
|
|
|
|
>(); |
|
|
|
|
const [orderDetails, setOrderDetails] = useState<OrderDetailsType>(); |
|
|
|
|
const [isLoading, setIsLoading] = useState(true); |
|
|
|
|
const { deleteOrder, changeOrder, updateOrderShippingInfo } = |
|
|
|
|
const { deleteOrder, changeOrder, updateOrderShippingInfo,cancelOrder,confirmOrder } = |
|
|
|
|
useOrderListStore(); |
|
|
|
|
|
|
|
|
|
const [showPaymentModal, setShowPaymentModal] = useState(false); |
|
|
|
@ -717,6 +717,7 @@ export const OrderDetails = () => {
|
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
{/* {route.params.status} */} |
|
|
|
|
{/* 价格信息 */} |
|
|
|
|
<View style={styles.orderStatus}> |
|
|
|
|
<View style={styles.orderStatusContent}> |
|
|
|
@ -767,12 +768,13 @@ export const OrderDetails = () => {
|
|
|
|
|
</View> |
|
|
|
|
</ScrollView> |
|
|
|
|
{/* 代付款 */} |
|
|
|
|
{orderDetails.order_status === 0 && ( |
|
|
|
|
{route.params.status === 0 && ( |
|
|
|
|
<View style={styles.bottomButtons}> |
|
|
|
|
<TouchableOpacity |
|
|
|
|
style={styles.bottomButton1} |
|
|
|
|
onPress={() => { |
|
|
|
|
deleteOrder(route.params.orderId); |
|
|
|
|
cancelOrder(route.params.orderId); |
|
|
|
|
navigation.goBack(); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<Text style={styles.bottomButtonText1}> |
|
|
|
@ -790,7 +792,7 @@ export const OrderDetails = () => {
|
|
|
|
|
</View> |
|
|
|
|
)} |
|
|
|
|
{/* 待发货 */} |
|
|
|
|
{orderDetails.order_status === 1 && ( |
|
|
|
|
{route.params.status === 1 && ( |
|
|
|
|
<View style={styles.bottomButtons}> |
|
|
|
|
<TouchableOpacity |
|
|
|
|
style={styles.bottomButton1} |
|
|
|
@ -816,7 +818,7 @@ export const OrderDetails = () => {
|
|
|
|
|
</View> |
|
|
|
|
)} |
|
|
|
|
{/* 代收货 */} |
|
|
|
|
{orderDetails.order_status === 2 && ( |
|
|
|
|
{route.params.status === 2 && ( |
|
|
|
|
<View style={styles.bottomButtons}> |
|
|
|
|
<TouchableOpacity |
|
|
|
|
style={styles.bottomButton1} |
|
|
|
@ -829,14 +831,8 @@ export const OrderDetails = () => {
|
|
|
|
|
<TouchableOpacity |
|
|
|
|
style={styles.bottomButton} |
|
|
|
|
onPress={() => { |
|
|
|
|
updateOrderShippingInfo(route.params.orderId, { |
|
|
|
|
shipping_status: 0, |
|
|
|
|
shipping_info: { |
|
|
|
|
shipping_company: "string", |
|
|
|
|
shipping_no: "string", |
|
|
|
|
shipping_info: {}, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
confirmOrder(route.params.orderId); |
|
|
|
|
|
|
|
|
|
navigation.goBack(); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
@ -847,32 +843,36 @@ export const OrderDetails = () => {
|
|
|
|
|
</View> |
|
|
|
|
)} |
|
|
|
|
{/* 已完成 */} |
|
|
|
|
{orderDetails.order_status === 3 && ( |
|
|
|
|
<View style={styles.bottomButtons}> |
|
|
|
|
<TouchableOpacity |
|
|
|
|
style={styles.bottomButton1} |
|
|
|
|
onPress={() => { |
|
|
|
|
deleteOrder(route.params.orderId); |
|
|
|
|
navigation.goBack(); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<Text style={styles.bottomButtonText1}> |
|
|
|
|
{t("order.cancel")} |
|
|
|
|
</Text> |
|
|
|
|
</TouchableOpacity> |
|
|
|
|
<TouchableOpacity style={styles.bottomButton}> |
|
|
|
|
<Text style={styles.bottomButtonText}> |
|
|
|
|
{t("order.pay_now")} |
|
|
|
|
</Text> |
|
|
|
|
</TouchableOpacity> |
|
|
|
|
{route.params.status === 3 && ( |
|
|
|
|
<View> |
|
|
|
|
</View> |
|
|
|
|
// <View style={styles.bottomButtons}>
|
|
|
|
|
// <TouchableOpacity
|
|
|
|
|
// style={styles.bottomButton1}
|
|
|
|
|
// onPress={() => {
|
|
|
|
|
// addToCart(orderDetails.items);
|
|
|
|
|
// // navigation.goBack();
|
|
|
|
|
// }}
|
|
|
|
|
// >
|
|
|
|
|
// <Text style={styles.bottomButtonText1}>
|
|
|
|
|
// {t("order.add_to_cart")}
|
|
|
|
|
// </Text>
|
|
|
|
|
// </TouchableOpacity>
|
|
|
|
|
// <TouchableOpacity style={styles.bottomButton}>
|
|
|
|
|
// <Text style={styles.bottomButtonText}>
|
|
|
|
|
// {t("order.reorder")}
|
|
|
|
|
// </Text>
|
|
|
|
|
// </TouchableOpacity>
|
|
|
|
|
// </View>
|
|
|
|
|
)} |
|
|
|
|
{/* 已取消 */} |
|
|
|
|
{orderDetails.order_status === 4 && ( |
|
|
|
|
{route.params.status === 4 && ( |
|
|
|
|
<View style={styles.bottomButtons}> |
|
|
|
|
<TouchableOpacity |
|
|
|
|
style={styles.bottomButton1} |
|
|
|
|
onPress={() => {}} |
|
|
|
|
onPress={() => { |
|
|
|
|
addToCart(orderDetails.items); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<Text style={styles.bottomButtonText1}> |
|
|
|
|
{t("order.add_to_cart")} |
|
|
|
|