OrderDetailListScreen.jsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import * as WebBrowser from 'expo-web-browser';
  2. import * as React from 'react';
  3. import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
  4. import { ScrollView } from 'react-native-gesture-handler';
  5. import { useRequest, useCreation, useMount } from '@umijs/hooks';
  6. import useModel from 'flooks';
  7. import Header from '../../components/Header';
  8. export default function OrderDetailListScreen({ route }) {
  9. const { params } = route;
  10. const { orderId } = params;
  11. const { data } = useRequest(`/orderInfo/get/${orderId}`, {
  12. refreshDeps: [orderId],
  13. initialData: {},
  14. });
  15. const { orderTime, timeOfArrival } = data;
  16. return (
  17. <>
  18. <Header title="订单追踪" />
  19. <ScrollView
  20. contentContainerStyle={{
  21. flexGrow: 1,
  22. backgroundColor: '#eee',
  23. }}
  24. >
  25. <Div bg="white" py={5}>
  26. {!!orderTime && (
  27. <Div row justifyContent="space-between" py={5} px={15}>
  28. <Text fontSize="sm" color="gray600">
  29. 下单时间
  30. </Text>
  31. <Text fontSize="sm" color="gray500">
  32. {orderTime}
  33. </Text>
  34. </Div>
  35. )}
  36. {!!timeOfArrival && (
  37. <Div row justifyContent="space-between" py={5} px={15}>
  38. <Text fontSize="sm" color="gray600">
  39. 用户收到时间
  40. </Text>
  41. <Text fontSize="sm" color="gray500">
  42. {timeOfArrival}
  43. </Text>
  44. </Div>
  45. )}
  46. </Div>
  47. </ScrollView>
  48. </>
  49. );
  50. }