ComplaintScreen.jsx 4.3 KB

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