personal_navigation.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import React, {Component} from 'react';
  2. import {createStackNavigator} from '@react-navigation/stack';
  3. import personal_center_page from '../../page/personalCenter/personal_center_page';
  4. import login_head from '../../page/login/login_head';
  5. import forget_password from '../../page/login/forget_password';
  6. import personal_information from '../../page/personalInformation/personal_information';
  7. import enterprise_list from '../../page/enterpriseInfo/enterpriseList';
  8. import customer_information from '../../page/customerInformation/customer_information';
  9. import change_nick_name from '../../page/personalInformation/change_nick_name';
  10. import change_sex from '../../page/personalInformation/change_sex';
  11. import change_company from '../../page/personalInformation/change_company';
  12. import change_address from '../../page/personalInformation/change_address';
  13. import change_phone from '../../page/personalInformation/change_phone';
  14. import change_profiles from '../../page/personalInformation/change_profiles';
  15. const Stack = createStackNavigator();
  16. export default class personal_navigation extends Component {
  17. constructor(props) {
  18. super(props);
  19. }
  20. render() {
  21. return (
  22. <Stack.Navigator initialRouteName="personal_center_page">
  23. <Stack.Screen
  24. name="personal_center_page"
  25. component={personal_center_page}
  26. options={{
  27. title: '个人中心',
  28. headerTitleAlign: 'center',
  29. headerStyle: {
  30. backgroundColor: '#1199EA',
  31. },
  32. headerTintColor: '#fff',
  33. }}
  34. />
  35. <Stack.Screen
  36. name="login_head"
  37. component={login_head}
  38. options={{
  39. title: '登录',
  40. headerTitleAlign: 'center',
  41. headerStyle: {
  42. backgroundColor: '#1199EA',
  43. },
  44. headerTintColor: '#fff',
  45. }}
  46. />
  47. <Stack.Screen
  48. name="forget_password"
  49. component={forget_password}
  50. options={{
  51. title: '密码修改',
  52. headerTitleAlign: 'center',
  53. headerStyle: {
  54. backgroundColor: '#1199EA',
  55. },
  56. headerTintColor: '#fff',
  57. }}
  58. />
  59. <Stack.Screen
  60. name="personal_information"
  61. component={personal_information}
  62. options={{
  63. title: '个人信息',
  64. headerTitleAlign: 'center',
  65. headerStyle: {
  66. backgroundColor: '#1199EA',
  67. },
  68. headerTintColor: '#fff',
  69. }}
  70. />
  71. <Stack.Screen
  72. name="customer_information"
  73. component={customer_information}
  74. options={{
  75. title: '个人信息',
  76. headerTitleAlign: 'center',
  77. headerStyle: {
  78. backgroundColor: '#1199EA',
  79. },
  80. headerTintColor: '#fff',
  81. }}
  82. />
  83. <Stack.Screen
  84. name="enterprise_list"
  85. component={enterprise_list}
  86. options={{
  87. title: '企业信息',
  88. headerTitleAlign: 'center',
  89. headerStyle: {
  90. backgroundColor: '#1199EA',
  91. },
  92. headerTintColor: '#fff',
  93. }}
  94. />
  95. <Stack.Screen
  96. name="change_nick_name"
  97. component={change_nick_name}
  98. options={{
  99. title: '设置昵称',
  100. headerTitleAlign: 'center',
  101. headerStyle: {
  102. backgroundColor: '#1199EA',
  103. },
  104. headerTintColor: '#fff',
  105. }}
  106. />
  107. <Stack.Screen
  108. name="change_sex"
  109. component={change_sex}
  110. options={{
  111. title: '设置性别',
  112. headerTitleAlign: 'center',
  113. headerStyle: {
  114. backgroundColor: '#1199EA',
  115. },
  116. headerTintColor: '#fff',
  117. }}
  118. />
  119. <Stack.Screen
  120. name="change_company"
  121. component={change_company}
  122. options={{
  123. title: '设置公司名称',
  124. headerTitleAlign: 'center',
  125. headerStyle: {
  126. backgroundColor: '#1199EA',
  127. },
  128. headerTintColor: '#fff',
  129. }}
  130. />
  131. <Stack.Screen
  132. name="change_address"
  133. component={change_address}
  134. options={{
  135. title: '设置地址信息',
  136. headerTitleAlign: 'center',
  137. headerStyle: {
  138. backgroundColor: '#1199EA',
  139. },
  140. headerTintColor: '#fff',
  141. }}
  142. />
  143. <Stack.Screen
  144. name="change_phone"
  145. component={change_phone}
  146. options={{
  147. title: '修改手机号码',
  148. headerTitleAlign: 'center',
  149. headerStyle: {
  150. backgroundColor: '#1199EA',
  151. },
  152. headerTintColor: '#fff',
  153. }}
  154. />
  155. <Stack.Screen
  156. name="change_profiles"
  157. component={change_profiles}
  158. options={{
  159. title: '设置简介',
  160. headerTitleAlign: 'center',
  161. headerStyle: {
  162. backgroundColor: '#1199EA',
  163. },
  164. headerTintColor: '#fff',
  165. }}
  166. />
  167. </Stack.Navigator>
  168. );
  169. }
  170. //判断导航栏是否显示
  171. shouldComponentUpdate(
  172. nextProps: Readonly<P>,
  173. nextState: Readonly<S>,
  174. nextContext: any,
  175. ): boolean {
  176. if (nextProps.route.state.index === 0) {
  177. this.props.navigation.setOptions({
  178. tabBarVisible: true,
  179. });
  180. }
  181. return true;
  182. }
  183. }