// 独立功能页面单独写，如下
export const indexRouter = {
  path: '/',
  name: 'index',
  component: () => import('page/Index')
}

export const sliderRouter = {
  path: '/slider',
  name: 'slider',
  component: () => import('page/slider/Slider')
}

export const loginRouter = {
  path: '/login',
  name: 'login',
  component: () => import('page/login/Login')
}

export const advertisementRouter = {
  path: '/advertisement',
  name: 'advertisement',
  component: () => import('page/advertisement/Advertisement')
}

// ui
export const uiRouters = [
  {
    path: '/ui/toast',
    name: 'toast',
    component: (resolve) => {
      import('modules/ui/toast/Toast').then((module) => {
        resolve(module)
      })
    }
  },
  {
    path: '/ui/indicator',
    name: 'indicator',
    component: () => import('modules/ui/indicator/Indicator')
  },
  {
    path: '/ui/loadmore',
    name: 'loadmore',
    component: () => import('modules/ui/loadmore/Loadmore')
  },
  {
    path: '/ui/infinite-scroll',
    name: 'infiniteScroll',
    component: () => import('modules/ui/infiniteScroll/InfiniteScroll')
  },
  {
    path: '/ui/message-box',
    name: 'messageBox',
    component: () => import('modules/ui/messageBox/MessageBox')
  },
  {
    path: '/ui/action-sheet',
    name: 'actionSheet',
    component: () => import('modules/ui/actionSheet/ActionSheet')
  },
  {
    path: '/ui/popup',
    name: 'popup',
    component: () => import('modules/ui/popup/Popup')
  }, {
    path: '/ui/swipe',
    name: 'swipe',
    component: () => import('modules/ui/swipe/Swipe')
  }, {
    path: '/ui/lazyLoad',
    name: 'lazyLoad',
    component: () => import('modules/ui/lazyLoad/LazyLoad')
  },
  {
    path: '/ui/range',
    name: 'range',
    component: () => import('modules/ui/range/Range')
  },
  {
    path: '/ui/progress',
    name: 'progress',
    component: () => import('modules/ui/progress/Progress')
  },
  {
    path: '/ui/picker',
    name: 'picker',
    component: () => import('modules/ui/picker/Picker')
  },
  {
    path: '/ui/datetime-picker',
    name: 'datetimePicker',
    component: () => import('modules/ui/datetimePicker/DatetimePicker')
  },
  {
    path: '/ui/index-list',
    name: 'indexList',
    component: () => import('modules/ui/indexList/IndexList')
  },
  {
    path: '/ui/palette-button',
    name: 'paletteButton',
    component: () => import('modules/ui/paletteButton/PaletteButton')
  },
  {
    path: '/ui/header',
    name: 'header',
    component: () => import('modules/ui/header/Header')
  },
  {
    path: '/ui/button',
    name: 'button',
    component: () => import('modules/ui/button/Button')
  },
  {
    path: '/ui/cell',
    name: 'cell',
    component: () => import('modules/ui/cell/Cell')
  }, {
    path: '/ui/spinner',
    name: 'spinner',
    component: () => import('modules/ui/spinner/Spinner')
  }, {
    path: '/ui/search',
    name: 'search',
    component: () => import('modules/ui/search/Search')
  },
  {
    path: '/ui/switch',
    name: 'switch',
    component: () => import('modules/ui/switch/Switch')
  }, {
    path: '/ui/checklist',
    name: 'checklist',
    component: () => import('modules/ui/checklist/Checklist')
  }, {
    path: '/ui/radio',
    name: 'radio',
    component: () => import('modules/ui/radio/Radio')
  },
  {
    path: '/ui/field',
    name: 'field',
    component: () => import('modules/ui/field/Field')
  },
  {
    path: '/ui/badge',
    name: 'badge',
    component: () => import('modules/ui/badge/Badge')
  }
]

export const plusRouters = [
  {
    path: '/plus/camera',
    name: 'camera',
    component: () => import('modules/plus/camera/Camera')
  },
  {
    path: '/plus/geolocation',
    name: 'geolocation',
    component: () => import('modules/plus/geolocation/Geolocation')
  },
  {
    path: '/plus/accelerometer',
    name: 'accelerometer',
    component: () => import('modules/plus/accelerometer/Accelerometer')
  },
  {
    path: '/plus/resumeCallback',
    name: 'resumeCallback',
    component: () => import('modules/plus/resumeCallback/ResumeCallback')
  },
  {
    path: '/plus/payment',
    name: 'payment',
    component: () => import('modules/plus/payment/Payment')
  },
  {
    path: '/plus/router',
    name: 'router',
    component: () => import('modules/plus/router/Router'),
    children: [
      {
        path: 'routerChildren:id',
        component: () => import('modules/plus/router/RouterChildren')
      },
    ]
  }
]

export const routers = [
  indexRouter,
  loginRouter,
  sliderRouter,
  advertisementRouter,
  ...uiRouters,
  ...plusRouters
]
