import Layout from '@/components/layout'
import page401 from '@/views/error/401'
import page403 from '@/views/error/403'
import page404 from '@/views/error/404'
import page500 from '@/views/error/500'
//积分商城
import mall from '../views/mall/index';
import couponList from '../views/mall/coupon/list';
import couponExchange from '../views/mall/coupon/exchange';
import couponInfo from '../views/mall/coupon/info.vue';
import giftList from '../views/mall/gift/list';
import giftExchange from '../views/mall/gift/exchange';
import giftInfo from '../views/mall/gift/info.vue';
import goodsList from '../views/mall/goods/list';


export default [{
        path: '/',
        name: 'layout',
        component: Layout,
        redirect: '/mall',
        children: [{
            path: 'mall',
            name: '积分商城',
            component: mall,
            redirect: '/coupon',
            meta: {},
            children: [{
                    path: '/coupon',
                    name: '优惠券',
                    component: couponList,
                    meta: {
                        menu: 'coupon'
                    }
                },
                {
                    path: '/coupon/exchange/:id',
                    name: '优惠券兑换记录',
                    component: couponExchange,
                    meta: {
                        menu: 'coupon'
                    }
                },
                {
                    path: '/coupon/info',
                    name: '新增优惠券',
                    component: couponInfo,
                    meta: {
                        type: 'add',
                        menu: 'coupon'
                    }
                },
                {
                    path: '/coupon/info/:id',
                    name: '编辑优惠券',
                    component: couponInfo,
                    meta: {
                        type: 'edit',
                        menu: 'coupon'
                    }
                },
                {
                    path: '/coupon/queryinfo/:id',
                    name: '优惠券详情',
                    component: couponInfo,
                    meta: {
                        type: 'info',
                        menu: 'coupon'
                    }
                },
                {
                    path: '/gift',
                    name: '礼品',
                    component: giftList,
                    meta: {
                        menu: 'gift'
                    }
                },
                {
                    path: '/gift/exchange/:id',
                    name: '礼品兑换记录',
                    component: giftExchange,
                    meta: {
                        menu: 'gift'
                    }
                },
                {
                    path: '/gift/wxexchange/:id',
                    name: '微信兑换券兑换记录',
                    component: giftExchange,
                    meta: {
                        menu: 'gift',
                        type: 'wx'
                    }
                },
                {
                    path: '/gift/info',
                    name: '新增礼品',
                    component: giftInfo,
                    meta: {
                        type: 'add',
                        menu: 'gift'
                    }
                },
                {
                    path: '/gift/info/:id',
                    name: '编辑礼品',
                    component: giftInfo,
                    meta: {
                        type: 'edit',
                        menu: 'gift'
                    }
                },
                {
                    path: '/gift/queryinfo/:id',
                    name: '礼品详情',
                    component: giftInfo,
                    meta: {
                        type: 'info',
                        menu: 'gift'
                    }
                },


                {
                    path: '/goods',
                    name: '待发货',
                    component: goodsList,
                    meta: {
                        menu: 'goods'
                    }
                },
            ]
        }]
    },
    {
        path: '/401',
        name: '未授权',
        component: page401
    },
    {
        path: '/403',
        name: '禁止访问',
        component: page403
    },
    {
        path: '/500',
        name: '系统错误',
        component: page500
    },
    {
        path: '*',
        name: '未知领域',
        component: page404
    },
]