OrderCom.tsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import * as React from 'react';
  2. import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
  3. export default function OrderCom({
  4. info,
  5. type,
  6. goDetail,
  7. receiverOrder,
  8. goMap,
  9. changeStatus,
  10. }) {
  11. const {
  12. user,
  13. userAddress,
  14. merchant,
  15. riderStatus,
  16. timeOfArrival,
  17. deliveryAmount,
  18. merShowName,
  19. merAddress,
  20. } = info;
  21. return (
  22. <Button bg="white" p={0} block mb={15} onPress={goDetail}>
  23. <Div flex={1}>
  24. <Div px={10} py={15}>
  25. <Div row alignItems="center">
  26. <Text fontSize="xl" color="red500" fontWeight="bold">
  27. 43分钟内
  28. </Text>
  29. <Text fontSize="xl">送达</Text>
  30. <Text
  31. fontSize="xl"
  32. color="red500"
  33. fontWeight="bold"
  34. flex={1}
  35. textAlign="right"
  36. >
  37. {deliveryAmount}
  38. </Text>
  39. </Div>
  40. <Div row mt={10}>
  41. <Text fontSize="sm" color="gray600">
  42. 1.5Km
  43. </Text>
  44. <Div flex={1} ml={12}>
  45. <Text fontSize="sm" pb={3}>
  46. {merShowName || merchant.showName}
  47. </Text>
  48. <Text fontSize="xs">{merAddress || merchant.address}</Text>
  49. </Div>
  50. </Div>
  51. <Div row mt={10}>
  52. <Text fontSize="sm" color="gray600">
  53. 1.5Km
  54. </Text>
  55. <Div flex={1} ml={12}>
  56. {user.nickName && (
  57. <Text fontSize="sm" pb={5}>
  58. {user.nickName}
  59. </Text>
  60. )}
  61. <Text fontSize="xs">{userAddress}</Text>
  62. </Div>
  63. </Div>
  64. </Div>
  65. {riderStatus === 'NOT_RECEIVED' && (
  66. <Button block mx={15} mb={20} bg="yellow500" onPress={receiverOrder}>
  67. 接单
  68. </Button>
  69. )}
  70. {riderStatus != 'NOT_RECEIVED' && (
  71. <Div row mx={15} mb={20}>
  72. <Button
  73. flex={1}
  74. color="black"
  75. bg="white"
  76. borderColor="yellow500"
  77. borderWidth={1}
  78. onPress={goMap}
  79. >
  80. 查看导航
  81. </Button>
  82. {riderStatus === 'RECEIVED' && (
  83. <Button ml={20} flex={1} bg="yellow500" onPress={changeStatus}>
  84. 我已到店
  85. </Button>
  86. )}
  87. {riderStatus === 'ARRIVE' && (
  88. <Button ml={20} flex={1} bg="yellow500" onPress={goDetail}>
  89. 拍照取货
  90. </Button>
  91. )}
  92. {riderStatus === 'TAKE_MEAL' && (
  93. <Button ml={20} flex={1} bg="yellow500" onPress={changeStatus}>
  94. 确认送达
  95. </Button>
  96. )}
  97. </Div>
  98. )}
  99. </Div>
  100. </Button>
  101. );
  102. }