Index.js 1.4 KB

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