import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Login from './views/login.vue'

Vue.use(Router)

export default new Router({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            name: 'login',
            component: Login
        },
        {
            path: '/home',
            name: 'home',
            component: Home
        },
        {
            path: '/alipay',
            name: 'alipay',
            component: () => import('./views/alipay.vue')
        },
        {
            path: '/payment',
            name: 'payment',
            component: () => import('./views/payment.vue')
        },
        {   // 协议
            path: '/protocol',
            name: 'protocol',
            component: () => import('./views/protocol.vue')
        },
        {
            // 登录
            path: '/login',
            name: 'login',
            component: Login
        },
        {
            // 注册
            path: '/register',
            name: 'register',
            component: () => import('./views/register.vue')
        },
        { 
            // 订单列表
            path: '/order',
            name: 'order',
            component: () => import('./views/order.vue')
        },
        { 
            // 登录
            path: '/loginActive',
            name: 'loginActive',
            component: () => import('./views/loginActive.vue')
        },
        { 
            // 购买
            path: '/activePay',
            name: 'activePay',
            component: () => import('./views/activePay.vue')
        },
        { 
            // 购买回调
            path: '/paymentResult',
            name: 'paymentResult',
            component: () => import('./views/paymentResult.vue')
        }
    ],
    scrollBehavior() {
        return { x: 0, y: 0 }
    }
})
