MineScreen.tsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 useModel from 'flooks';
  7. import User from '../stores/User';
  8. import { connect } from '../utils/SystemUtils';
  9. const logo = require('../assets/images/logo.png');
  10. export default function RegisterScreen({ navigation }: StackScreenProps) {
  11. const { userInfo, riderInfo } = useModel(User, ['userInfo']);
  12. const { avatar, nickname, money } = userInfo;
  13. const { jobNumber } = riderInfo;
  14. return (
  15. <Div bg="yellow500" flex={1}>
  16. <ScrollView
  17. contentContainerStyle={{ flexGrow: 1, backgroundColor: '#f2f2f2' }}
  18. >
  19. <Div h={112} bg="yellow500" justifyContent="flex-end" p={20}>
  20. <Button
  21. p={0}
  22. bg="transparent"
  23. onPress={() =>
  24. navigation.navigate('MineStack', {
  25. screen: 'MineInfo',
  26. })
  27. }
  28. >
  29. <Div flex={1} row alignItems="center">
  30. <Image w={53} h={53} source={avatar || logo} />
  31. <Div flex={1} ml={14}>
  32. <Div row alignItems="center">
  33. <Text fontSize="xl" fontWeight="bold" flex={1}>
  34. {nickname}
  35. </Text>
  36. <Icon color="black" name="right" ml={10} fontSize="xl" />
  37. </Div>
  38. <Text fontSize="sm" mt={5}>
  39. 工号:{jobNumber}
  40. </Text>
  41. </Div>
  42. </Div>
  43. </Button>
  44. </Div>
  45. <Div bg="gray100" p={10}>
  46. <Button
  47. block
  48. bg="white"
  49. p={10}
  50. rounded="sm"
  51. onPress={() =>
  52. navigation.navigate('MineStack', { screen: 'Wallet' })
  53. }
  54. >
  55. <Div flex={1} row>
  56. <Div flex={1}>
  57. <Text>我的叮咚币</Text>
  58. <Div row alignItems="center" mt={5}>
  59. <Text fontSize="xl" color="yellow400">
  60. 578.63
  61. </Text>
  62. <Text fontSize="sm" color="gray700" ml={6}>
  63. 今日收入
  64. </Text>
  65. <Text fontSize="xl" color="yellow400" ml={35}>
  66. 578.63
  67. </Text>
  68. <Text fontSize="sm" color="gray700" ml={6}>
  69. 今日收入
  70. </Text>
  71. </Div>
  72. </Div>
  73. <Icon name="right" />
  74. </Div>
  75. </Button>
  76. </Div>
  77. <Button block bg="white" p={20} rounded="sm" mb={10}>
  78. <Div flex={1} row>
  79. <Text flex={1}>单量热力图</Text>
  80. <Icon name="right" />
  81. </Div>
  82. </Button>
  83. <Button
  84. block
  85. bg="white"
  86. p={20}
  87. rounded="sm"
  88. mb={10}
  89. onPress={() =>
  90. navigation.navigate('MineStack', {
  91. screen: 'MineAppraisal',
  92. })
  93. }
  94. >
  95. <Div flex={1} row>
  96. <Text flex={1}>我的评价</Text>
  97. <Icon name="right" />
  98. </Div>
  99. </Button>
  100. <Button
  101. block
  102. bg="white"
  103. p={20}
  104. rounded="sm"
  105. mb={10}
  106. onPress={() =>
  107. navigation.navigate('MineStack', {
  108. screen: 'MineComplaint',
  109. })
  110. }
  111. >
  112. <Div flex={1} row>
  113. <Text flex={1}>我的投诉</Text>
  114. <Icon name="right" />
  115. </Div>
  116. </Button>
  117. <Button block bg="white" p={20} rounded="sm" mb={10}>
  118. <Div flex={1} row>
  119. <Text flex={1}>培训中心</Text>
  120. <Icon name="right" />
  121. </Div>
  122. </Button>
  123. <Button
  124. block
  125. bg="white"
  126. p={20}
  127. rounded="sm"
  128. mb={10}
  129. onPress={() => {
  130. connect(navigation);
  131. }}
  132. >
  133. <Div flex={1} row>
  134. <Text flex={1}>联系客服</Text>
  135. <Icon name="right" />
  136. </Div>
  137. </Button>
  138. <Button block bg="white" p={20} rounded="sm" mb={10}>
  139. <Div flex={1} row>
  140. <Text flex={1}>设置</Text>
  141. <Icon name="right" />
  142. </Div>
  143. </Button>
  144. </ScrollView>
  145. </Div>
  146. );
  147. }