Index.js 2.5 KB

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