Index.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. 'use strict';
  2. import {createStackNavigator} from 'react-navigation-stack';
  3. import NavigationOptions from '../../components/NavbarOptions';
  4. import SalesHome from './Home';
  5. import ReportCustomerList from './ReportCustomerList';
  6. import ReportCustomerDetail from './ReportCustomerDetail';
  7. import ReportCustomerAdd from './ReportCustomerAdd';
  8. import SearchProject from './SearchProject';
  9. import ReviewTodayList from './ReviewTodayList';
  10. import ReviewDetail from './ReviewDetail';
  11. import WriteTrackReport from './WriteTrackReport';
  12. import EditCustomer from './EditCustomer';
  13. import WriteInternalReport from './WriteInternalReport';
  14. const HomeStack = createStackNavigator({
  15. SalesHome: {
  16. screen: SalesHome,
  17. navigationOptions: {
  18. title: '首页',
  19. },
  20. },
  21. ReportCustomerList: {
  22. screen: ReportCustomerList,
  23. navigationOptions: {
  24. title: '客户报备',
  25. },
  26. },
  27. ReportCustomerDetail: {
  28. screen: ReportCustomerDetail,
  29. navigationOptions: {
  30. title: '客户报备明细',
  31. },
  32. },
  33. ReportCustomerAdd: {
  34. screen: ReportCustomerAdd,
  35. navigationOptions: {
  36. title: '报备客户',
  37. },
  38. },
  39. SearchProject: {
  40. screen: SearchProject,
  41. navigationOptions: {
  42. title: '选择项目',
  43. },
  44. },
  45. ReviewTodayList: {
  46. screen: ReviewTodayList,
  47. navigationOptions: {
  48. title: '客户跟踪',
  49. },
  50. },
  51. ReviewDetail: {
  52. screen: ReviewDetail,
  53. navigationOptions: {
  54. title: '客户详情',
  55. },
  56. },
  57. WriteTrackReport: {
  58. screen: WriteTrackReport,
  59. navigationOptions: {
  60. title: '填写跟踪报告',
  61. },
  62. },
  63. EditCustomer: {
  64. screen: EditCustomer,
  65. navigationOptions: {
  66. title: '修改客户信息',
  67. },
  68. },
  69. WriteInternalReport: {
  70. screen: WriteInternalReport,
  71. navigationOptions: {
  72. title: '内部跟踪',
  73. },
  74. },
  75. },
  76. {
  77. initialRouteName: 'SalesHome',
  78. defaultNavigationOptions: NavigationOptions,
  79. //mode: 'modal',
  80. //headerMode: 'none',
  81. },
  82. );
  83. HomeStack.navigationOptions = ({navigation}) => { // ~注意~ 如果想实现隐藏Tabbar的功能要调用这个方法
  84. let tabBarVisible = true;
  85. if (navigation.state.index > 0) {
  86. tabBarVisible = false;
  87. }
  88. return {
  89. tabBarVisible,
  90. };
  91. };
  92. module.exports = HomeStack;