ComplaintScreen.jsx 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import * as WebBrowser from 'expo-web-browser';
  2. import * as React from 'react';
  3. import { StyleSheet, View } from 'react-native';
  4. import { Flex } from '@ant-design/react-native';
  5. import { TouchableRipple, Divider } from 'react-native-paper';
  6. import { ScrollView } from 'react-native-gesture-handler';
  7. import { Div } from 'react-native-magnus';
  8. import Icon from 'react-native-vector-icons/FontAwesome';
  9. import { useTranslation } from 'react-i18next';
  10. import { useRoute } from '@react-navigation/native';
  11. import { useRequest } from '@umijs/hooks';
  12. import Header from './Header'; // 头部
  13. import Text from '../../components/Text';
  14. import Button from '../../components/Button';
  15. const Types = new Map([
  16. ['MERCHANT', ['商家少送/漏送商品', '食品品质/安全问题']],
  17. [
  18. 'RIDER',
  19. [
  20. '等待时间过长,超市配送',
  21. '提前点击确认送达',
  22. '错送商品',
  23. '商品破损',
  24. '错送商品',
  25. '威胁/辱骂/殴打',
  26. '骚扰顾客',
  27. ],
  28. ],
  29. ]);
  30. export default function ComplaintScreen({ navigation }) {
  31. const { t } = useTranslation();
  32. const route = useRoute();
  33. const { params } = route;
  34. const { orderId } = params || 0;
  35. const [orderInfo, setorderInfo] = React.useState({ merchant: {} });
  36. const { merchant } = orderInfo;
  37. useRequest(() => `/orderInfo/get/${orderId}`, {
  38. refreshDeps: [orderId],
  39. onSuccess: (result) => {
  40. setorderInfo(result);
  41. },
  42. });
  43. return (
  44. <>
  45. <Header title={t('ding-dan-tou-su')} />
  46. <ScrollView contentContainerStyle={styles.scroll}>
  47. <View style={styles.card}>
  48. <Text size="c2" type="info">
  49. {t('tou-su-shang-jia')}
  50. </Text>
  51. <Text size="s1">{merchant.showName || ' '}</Text>
  52. <Divider />
  53. <View style={styles.main}>
  54. {Types.get('MERCHANT').map((item, index) => {
  55. return (
  56. <TouchableRipple
  57. key={index}
  58. onPress={() => {
  59. navigation.navigate('ComplaintNext', {
  60. orderId,
  61. type: item,
  62. target: 'MERCHANT',
  63. });
  64. }}
  65. >
  66. <Flex style={styles.item}>
  67. <Flex.Item>
  68. <Text size="c2" type="info">
  69. {item}
  70. </Text>
  71. </Flex.Item>
  72. <Icon name="angle-right" color="#B4B4B4" />
  73. </Flex>
  74. </TouchableRipple>
  75. );
  76. })}
  77. </View>
  78. </View>
  79. <View style={styles.card}>
  80. <Text size="c2" type="info">
  81. {t('tou-su-qi-shou')}
  82. </Text>
  83. <Text size="s1">胖待还</Text>
  84. <Divider />
  85. <View style={styles.main}>
  86. {Types.get('RIDER').map((item, index) => {
  87. return (
  88. <TouchableRipple
  89. key={index}
  90. onPress={() => {
  91. navigation.navigate('ComplaintNext', {
  92. orderId,
  93. type: item,
  94. target: 'RIDER',
  95. });
  96. }}
  97. >
  98. <Flex style={styles.item}>
  99. <Flex.Item>
  100. <Text size="c2" type="info">
  101. {item}
  102. </Text>
  103. </Flex.Item>
  104. <Icon name="angle-right" color="#B4B4B4" />
  105. </Flex>
  106. </TouchableRipple>
  107. );
  108. })}
  109. </View>
  110. <Divider />
  111. <Flex style={styles.bottom}>
  112. <Flex.Item>
  113. <Text size="c2" type="info">
  114. {t('wei-zhao-dao-tou-su-xiang')}
  115. </Text>
  116. </Flex.Item>
  117. <Button size="small" outline>
  118. {t('lian-xi-ke-fu')}
  119. </Button>
  120. </Flex>
  121. </View>
  122. </ScrollView>
  123. </>
  124. );
  125. }
  126. const styles = StyleSheet.create({
  127. scroll: {
  128. paddingVertical: 10,
  129. },
  130. card: {
  131. paddingHorizontal: 15,
  132. paddingVertical: 20,
  133. backgroundColor: '#fff',
  134. marginBottom: 10,
  135. },
  136. item: {
  137. paddingVertical: 5,
  138. },
  139. main: {
  140. paddingVertical: 5,
  141. },
  142. bottom: {
  143. paddingVertical: 10,
  144. },
  145. });