Merchant.jsx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 { useCreation, useRequest } from '@umijs/hooks';
  6. import useModel from 'flooks';
  7. import Detail from './model';
  8. import { navigate } from '../../navigation/RootNavigation';
  9. export default function Merchant() {
  10. const { merchantInfo } = useModel(Detail, ['merchantInfo']);
  11. const {
  12. img,
  13. name,
  14. introduction,
  15. category,
  16. address,
  17. phone,
  18. endTime,
  19. startTime,
  20. } = merchantInfo;
  21. const imgList = useCreation(() => {
  22. return img ? img.split(',') : [];
  23. }, [img]);
  24. const categoryName = useCreation(() => {
  25. return category && category.length > 0 ? category[0].name : '';
  26. }, [category]);
  27. return (
  28. <>
  29. <Div bg="white" py={20} px={15}>
  30. <Div row>
  31. {imgList.map((item, index) => {
  32. return (
  33. <Image
  34. mr={3}
  35. mb={10}
  36. h={87}
  37. w={87}
  38. key={index}
  39. source={{ uri: item }}
  40. />
  41. );
  42. })}
  43. </Div>
  44. <Text fontSize="xl" fontWeight="bold" textAlign="left">
  45. 商家名称 -{name}
  46. </Text>
  47. <Text p={10} fontSize="xs" textAlign="left">
  48. {introduction}
  49. </Text>
  50. </Div>
  51. <Div bg="white" mt={10} py={5} px={15}>
  52. <Div row py={12}>
  53. <Text flex={1} fontSize="sm" textAlign="left">
  54. 商家品类
  55. </Text>
  56. <Text fontSize="sm" color="gray300" textAlign="left">
  57. {categoryName}
  58. </Text>
  59. </Div>
  60. <Div row py={12}>
  61. <Text flex={1} fontSize="sm" textAlign="left">
  62. 商家地址
  63. </Text>
  64. <Text fontSize="sm" color="gray300" textAlign="left">
  65. {address}
  66. </Text>
  67. </Div>
  68. <Div row py={12}>
  69. <Text flex={1} fontSize="sm" textAlign="left">
  70. 商家电话
  71. </Text>
  72. <Text fontSize="sm" color="gray300" textAlign="left">
  73. {phone}
  74. </Text>
  75. </Div>
  76. <Div row py={12}>
  77. <Text flex={1} fontSize="sm" textAlign="left">
  78. 营业时间
  79. </Text>
  80. <Text fontSize="sm" color="gray300" textAlign="left">
  81. {startTime}~{endTime}
  82. </Text>
  83. </Div>
  84. </Div>
  85. <Button
  86. bg="brand500"
  87. block
  88. mx={15}
  89. mt={10}
  90. mb={20}
  91. onPress={() => navigate('ReportBusiness')}
  92. >
  93. 举报商家
  94. </Button>
  95. </>
  96. );
  97. }