MineScreen.tsx 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. import { StackScreenProps } from '@react-navigation/stack';
  2. import * as React from 'react';
  3. import { Div, Button, Image, Text, Avatar, Icon } from 'react-native-magnus';
  4. import { ScrollView } from 'react-native-gesture-handler';
  5. import { RootStackParamList } from '../types';
  6. import { useTranslation } from 'react-i18next';
  7. import useModel from 'flooks';
  8. import User from '../stores/User';
  9. import { connect } from '../utils/SystemUtils';
  10. const logo = require('../assets/images/logo.png');
  11. export default function RegisterScreen({ navigation }: StackScreenProps) {
  12. const { userInfo, riderInfo } = useModel(User, ['userInfo']);
  13. const { avatar, nickname, money } = userInfo;
  14. const { jobNumber } = riderInfo;
  15. const { t } = useTranslation();
  16. return (
  17. <Div bg="yellow500" flex={1}>
  18. <ScrollView
  19. contentContainerStyle={{ flexGrow: 1, backgroundColor: '#f2f2f2' }}
  20. >
  21. <Div h={112} bg="yellow500" justifyContent="flex-end" p={20}>
  22. <Button
  23. p={0}
  24. bg="transparent"
  25. onPress={() =>
  26. navigation.navigate('MineStack', {
  27. screen: 'MineInfo',
  28. })
  29. }
  30. >
  31. <Div flex={1} row alignItems="center">
  32. <Image w={53} h={53} source={avatar ? { uri: avatar } : logo} />
  33. <Div flex={1} ml={14}>
  34. <Div row alignItems="center">
  35. <Text fontSize="xl" fontWeight="bold" flex={1}>
  36. {nickname}
  37. </Text>
  38. <Icon color="black" name="right" ml={10} fontSize="xl" />
  39. </Div>
  40. <Text fontSize="sm" mt={5}>
  41. {t('gong-hao')}:{jobNumber}
  42. </Text>
  43. </Div>
  44. </Div>
  45. </Button>
  46. </Div>
  47. <Div bg="gray100" p={10}>
  48. <Button
  49. block
  50. bg="white"
  51. p={10}
  52. rounded="sm"
  53. onPress={() =>
  54. navigation.navigate('MineStack', { screen: 'Wallet' })
  55. }
  56. >
  57. <Div flex={1} row>
  58. <Div flex={1}>
  59. <Text>{t('wo-de-ding-dong-bi')}</Text>
  60. <Div row alignItems="center" mt={5}>
  61. <Text fontSize="xl" color="yellow400">
  62. 578.63
  63. </Text>
  64. <Text fontSize="sm" color="gray700" ml={6}>
  65. {t('jin-ri-shou-ru')}
  66. </Text>
  67. <Text fontSize="xl" color="yellow400" ml={35}>
  68. 578.63
  69. </Text>
  70. <Text fontSize="sm" color="gray700" ml={6}>
  71. {t('jin-ri-shou-ru')}
  72. </Text>
  73. </Div>
  74. </Div>
  75. <Icon name="right" />
  76. </Div>
  77. </Button>
  78. </Div>
  79. <Button
  80. block
  81. bg="white"
  82. p={20}
  83. rounded="sm"
  84. mb={10}
  85. onPress={() =>
  86. navigation.navigate('MineStack', {
  87. screen: 'Heat3D',
  88. })
  89. }
  90. >
  91. <Div flex={1} row>
  92. <Text flex={1}>{t('dan-liang-re-li-tu')}</Text>
  93. <Icon name="right" />
  94. </Div>
  95. </Button>
  96. <Button
  97. block
  98. bg="white"
  99. p={20}
  100. rounded="sm"
  101. mb={10}
  102. onPress={() =>
  103. navigation.navigate('MineStack', {
  104. screen: 'MineAppraisal',
  105. })
  106. }
  107. >
  108. <Div flex={1} row>
  109. <Text flex={1}>{t('wo-de-ping-jia')}</Text>
  110. <Icon name="right" />
  111. </Div>
  112. </Button>
  113. <Button
  114. block
  115. bg="white"
  116. p={20}
  117. rounded="sm"
  118. mb={10}
  119. onPress={() =>
  120. navigation.navigate('MineStack', {
  121. screen: 'MineComplaint',
  122. })
  123. }
  124. >
  125. <Div flex={1} row>
  126. <Text flex={1}>{t('wo-de-tou-su')}</Text>
  127. <Icon name="right" />
  128. </Div>
  129. </Button>
  130. <Button block bg="white" p={20} rounded="sm" mb={10}>
  131. <Div flex={1} row>
  132. <Text flex={1}>{t('pei-xun-zhong-xin')}</Text>
  133. <Icon name="right" />
  134. </Div>
  135. </Button>
  136. <Button
  137. block
  138. bg="white"
  139. p={20}
  140. rounded="sm"
  141. mb={10}
  142. onPress={() => {
  143. connect(navigation);
  144. }}
  145. >
  146. <Div flex={1} row>
  147. <Text flex={1}>{t('lian-xi-ke-fu')}</Text>
  148. <Icon name="right" />
  149. </Div>
  150. </Button>
  151. <Button
  152. block
  153. bg="white"
  154. p={20}
  155. rounded="sm"
  156. mb={10}
  157. onPress={() => {
  158. navigation.navigate('MineStack', {
  159. screen: 'Setting',
  160. });
  161. }}
  162. >
  163. <Div flex={1} row>
  164. <Text flex={1}>{t('she-zhi')}</Text>
  165. <Icon name="right" />
  166. </Div>
  167. </Button>
  168. </ScrollView>
  169. </Div>
  170. );
  171. }