import wechat from '../../views/wechat/index';
import record from '../../views/wechat/record';
import wechatTemp from '../../views/wechat/temp';
import imgTextTemp from '../../components/libs/imgTextTemp';
import imgTemp from '../../components/libs/imgTemp';
import audioTemp from '../../views/wechat/audio/index.vue';
import videoTemp from '../../views/wechat/video/index.vue';
import videoAddEdit from '../../views/wechat/video/addEdit';
import form from '../../views/wechat/form';
import editor from '../../views/wechat/editor';

export default {
  path: 'wechat',
  name: '微信营销',
  component: wechat,
  redirect: 'wechat/record',
  meta: {},
  children: [
    {
      path: 'record',
      name: '发送记录',
      component: record,
      meta: {
        path: '/wechat/record'
      }
    },
    {
      path: 'record/add',
      name: '新建群发',
      component: form,
      meta: {
        type: 'add',
        path: '/wechat/record'
      }
    },
    {
      path: 'record/edit/:id',
      name: '编辑群发',
      component: form,
      meta: {
        type: 'edit',
        path: '/wechat/record'
      }
    },
    {
      path: 'record/info/:id',
      name: '群发详情',
      component: form,
      meta: {
        type: 'info',
        path: '/wechat/record'
      }
    },
    {
      path: 'record/add/:id',
      name: '使用图文群发',
      component: form,
      meta: {
        type: 'imgText',
        path: '/wechat/temp/imgtext'
      }
    },
    {
      path: 'editor/:id',
      name: '编辑图文',
      component: editor,
      meta: {
        type: 'edit',
        path: '/wechat/temp/imgtext'
      }
    },
    {
      path: 'editor',
      name: '新建图文',
      component: editor,
      meta: {
        type: 'add',
        path: '/wechat/temp/imgtext'
      }
    },
    {
      path: 'temp',
      name: '素材库',
      component: wechatTemp,
      redirect: 'temp/imgtext',
      meta: {},
      children: [
        {
          path: 'imgtext',
          name: '图文',
          component: imgTextTemp,
          meta: {
            path: '/wechat/temp/imgtext'
          }
        },
        {
          path: 'img',
          name: '图片',
          component: imgTemp,
          meta: {
            path: '/wechat/temp/img'
          }
        },
        {
          path: 'audio',
          name: '语音',
          component: audioTemp,
          meta: {
            path: '/wechat/temp/audio'
          }
        },
        {
          path: 'video',
          name: '视频',
          component: videoTemp,
          meta: {
            path: '/wechat/temp/video'
          }
        },
        {
          path: 'video/add',
          name: '新增视频',
          component: videoAddEdit,
          meta: {
            type: 'add',
            path: '/wechat/temp/video'
          }
        },
        {
          path: 'video/edit/:id',
          name: '编辑视频',
          component: videoAddEdit,
          meta: {
            type: 'edit',
            path: '/wechat/temp/video'
          }
        }
      ]
    }
  ]
};
