import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import(/* 首页（一日游） */ '../views/home/home.vue'),
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* 登录 */ '../views/login/login.vue')
  },
  {
    path: '/news',
    name: 'News',
    component: () => import(/* 消息 */ '../views/news/news.vue')
  },
  {
    path: '/shopping',
    name: 'Shopping',
    component: () => import(/* 购物车 */ '../views/shopping/shopping.vue')
  },
  {
    path: '/personal',
    name: 'Personal',
    component: () => import(/* 个人中心 */ '../views/personal/personal.vue')
  },
  {
    path: '/productDetails',
    name: 'ProductDetails',
    component: () => import(/* 商品详情 */ '../views/home/pages/productDetails/productDetails.vue')
  },
  {
    path: '/specialArea',
    name: 'SpecialArea',
    component: () => import(/* 首页专区综合列表 */ '../views/home/pages/specialArea/specialArea.vue')
  },
  {
    path: '/confirmOrder',
    name: 'ConfirmOrder',
    component: () => import(/* 确认订单 */ '../views/home/pages/confirmOrder/confirmOrder.vue')
  },
  {
    path: '/details',
    name: 'Details',
    component: () => import(/* 消息-详情 */ '../views/news/pages/details/details.vue')
  },
  {
    path: '/perfect',
    name: 'Perfect',
    component: () => import(/* 个人中心-完善信息 */ '../views/personal/pages/perfect/perfect.vue')
  },
  {
    path: '/dstributionDescription',
    name: 'DstributionDescription',
    component: () => import(/* 个人中心-分销说明 */ '../views/personal/pages/dstributionDescription/dstributionDescription.vue')
  },
  {
    path: '/distributionRecord',
    name: 'DistributionRecord',
    component: () => import(/* 个人中心-分销说明 */ '../views/personal/pages/distributionRecord/distributionRecord.vue')
  },
  {
    path: '/distributionCode',
    name: 'DistributionCode',
    component: () => import(/* 个人中心-分销二维码 */ '../views/personal/pages/distributionCode/distributionCode.vue')
  },
  {
    path: '/couponDescription',
    name: 'CouponDescription',
    component: () => import(/* 个人中心-优惠券说明 */ '../views/personal/pages/couponDescription/couponDescription.vue')
  },
  {
    path: '/coupon',
    name: 'Coupon',
    component: () => import(/* 个人中心-优惠券综合 */ '../views/personal/pages/coupon/coupon.vue')
  },
  {
    path: '/integralDescription',
    name: 'IntegralDescription',
    component: () => import(/* 个人中心-积分说明 */ '../views/personal/pages/integralDescription/integralDescription.vue')
  },
  {
    path: '/integralRecord',
    name: 'IntegralRecord',
    component: () => import(/* 个人中心-积分记录 */ '../views/personal/pages/integralRecord/integralRecord.vue')
  },
  {
    path: '/transferPoints',
    name: 'TransferPoints',
    component: () => import(/* 个人中心-积分转让 */ '../views/personal/pages/transferPoints/transferPoints.vue')
  },
  {
    path: '/myCollection',
    name: 'MyCollection',
    component: () => import(/* 个人中心-我的收藏 */ '../views/personal/pages/myCollection/myCollection.vue')
  },
  {
    path: '/myTracks',
    name: 'MyTracks',
    component: () => import(/* 个人中心-我的足迹 */ '../views/personal/pages/myTracks/myTracks.vue')
  },
  {
    path: '/toBePaid',
    name: 'ToBePaid',
    component: () => import(/* 个人中心-待付款 */ '../views/personal/pages/toBePaid/toBePaid.vue')
  },
  {
    path: '/detailTtoBePaid',
    name: 'DetailTtoBePaid',
    component: () => import(/* 个人中心-待付款 */ '../views/personal/pages/detailTtoBePaid/detailTtoBePaid.vue')
  },
  {
    path: '/linePayConfirm',
    name: 'LinePayConfirm',
    component: () => import(/* LINE 确认订单 */ '../views/home/pages/linePay/confirm.vue')
  },
  {
    path: '/linePayCancel',
    name: 'LinePayCancel',
    component: () => import(/* LINE 确认订单 */ '../views/home/pages/linePay/cancel.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  scrollBehavior(to,from,savePosition){
    return {x:0,y:0}
  }
})

export default router
