Index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. const HomeStack = createStackNavigator({
  10. SalesHome: {
  11. screen: SalesHome,
  12. navigationOptions: {
  13. title: '首页',
  14. },
  15. },
  16. ReportCustomerList: {
  17. screen: ReportCustomerList,
  18. navigationOptions: {
  19. title: '客户报备',
  20. },
  21. },
  22. ReportCustomerDetail: {
  23. screen: ReportCustomerDetail,
  24. navigationOptions: {
  25. title: '客户报备明细',
  26. },
  27. },
  28. ReportCustomerAdd: {
  29. screen: ReportCustomerAdd,
  30. navigationOptions: {
  31. title: '报备客户',
  32. },
  33. },
  34. SearchProject: {
  35. screen: SearchProject,
  36. navigationOptions: {
  37. title: '选择项目',
  38. },
  39. },
  40. },
  41. {
  42. initialRouteName: 'SalesHome',
  43. defaultNavigationOptions: NavigationOptions,
  44. //mode: 'modal',
  45. //headerMode: 'none',
  46. },
  47. );
  48. HomeStack.navigationOptions = ({navigation}) => { // ~注意~ 如果想实现隐藏Tabbar的功能要调用这个方法
  49. let tabBarVisible = true;
  50. if (navigation.state.index > 0) {
  51. tabBarVisible = false;
  52. }
  53. return {
  54. tabBarVisible,
  55. };
  56. };
  57. module.exports = HomeStack;