'use strict';

import {createStackNavigator} from 'react-navigation-stack';
import NavigationOptions from '../../components/NavbarOptions';
import SalesHome from './Home';
import ReportCustomerList from './ReportCustomerList';
import ReportCustomerDetail from './ReportCustomerDetail';
import ReportCustomerAdd from './ReportCustomerAdd';
import SearchProject from './SearchProject';
import ReviewTodayList from './ReviewTodayList';
import ReviewDetail from './ReviewDetail';
import WriteTrackReport from './WriteTrackReport';
import EditCustomer from './EditCustomer';
import WriteInternalReport from './WriteInternalReport';
import CheckCustomerList from './CheckCustomerList';
import CheckCustomerDetail from './CheckCustomerDetail';
import CheckCustomer from './CheckCustomer';
import UpdateProcess from './UpdateProcess';
import ProcessList from './ProcessList';
import ProcessDetail from './ProcessDetail';
import DispatchProcess from './DispatchProcess';
import BrowseImage from './BrowseImage';
import SearchProcess from './SearchProcess';

const HomeStack = createStackNavigator({
        SalesHome: {
            screen: SalesHome,
            navigationOptions: {
                title: '首页',
            },
        },
        ReportCustomerList: {
            screen: ReportCustomerList,
            navigationOptions: {
                title: '客户报备',
            },
        },
        ReportCustomerDetail: {
            screen: ReportCustomerDetail,
            navigationOptions: {
                title: '客户报备明细',
            },
        },
        ReportCustomerAdd: {
            screen: ReportCustomerAdd,
            navigationOptions: {
                title: '报备客户',
            },
        },
        SearchProject: {
            screen: SearchProject,
            navigationOptions: {
                title: '选择项目',
            },
        },
        ReviewTodayList: {
            screen: ReviewTodayList,
            navigationOptions: {
                title: '客户跟踪',
            },
        },
        ReviewDetail: {
            screen: ReviewDetail,
            navigationOptions: {
                title: '客户详情',
            },
        },
        WriteTrackReport: {
            screen: WriteTrackReport,
            navigationOptions: {
                title: '填写跟踪报告',
            },
        },
        EditCustomer: {
            screen: EditCustomer,
            navigationOptions: {
                title: '修改客户信息',
            },
        },
        WriteInternalReport: {
            screen: WriteInternalReport,
            navigationOptions: {
                title: '内部跟踪',
            },
        },
        CheckCustomerList: {
            screen: CheckCustomerList,
            navigationOptions: {
                title: '跟踪审核',
            },
        },
        CheckCustomerDetail: {
            screen: CheckCustomerDetail,
            navigationOptions: {
                title: '审核详情',
            },
        },
        CheckCustomer: {
            screen: CheckCustomer,
            navigationOptions: {
                title: '跟踪审核',
            },
        },
        UpdateProcess: {
            screen: UpdateProcess,
            navigationOptions: {
                title: '更新进度',
            },
        },
        ProcessList: {
            screen: ProcessList,
            navigationOptions: {
                title: '进度跟踪',
            },
        },
        ProcessDetail: {
            screen: ProcessDetail,
            navigationOptions: {
                title: '进度详情',
            },
        },
        DispatchProcess: {
            screen: DispatchProcess,
            navigationOptions: {
                title: '分配进度',
            },
        },
        BrowseImage: {
            screen: BrowseImage,
            navigationOptions: {
                title: '资料图片',
            },
        },
        SearchProcess: {
            screen: SearchProcess,
            navigationOptions: {
                title: '进度统计',
            },
        },
    },
    {
        initialRouteName: 'SalesHome',
        defaultNavigationOptions: NavigationOptions,
        //mode: 'modal',
        //headerMode: 'none',
    },
);

HomeStack.navigationOptions = ({navigation}) => {  // ~注意~ 如果想实现隐藏Tabbar的功能要调用这个方法
    let tabBarVisible = true;
    if (navigation.state.index > 0) {
        tabBarVisible = false;
    }
    return {
        tabBarVisible,
    };
};


module.exports = HomeStack;
