import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

/* 活动中心模块路由 start */
let activityCenter = [
  {
    path: '/h5Flow',
    name: 'H5Flow',
    meta: {
      title: '亮健优医活动中心'
    },
    component: _ => import('./views/activityCenter/H5Flow/H5Flow.vue')    // h5引流页面
  },
  {
    path: '/friendsHelp',
    name: 'FriendsHelp',
    meta: {
      title: '好友助力页面'
    },
    component: _ => import('./views/activityCenter/friendHelp/friendHelp.vue')    // 好友助力页面
  },
  {
    path: '/myHelp',
    name: 'MyHelp',
    meta: {
      title: '我的助力页面'
    },
    component: _ => import('./views/activityCenter/friendHelp/myHelp.vue')    // 我的助力页面
  }
]
/* 活动中心模块路由 end */

/* 医生注册路由 start */
let doctorRegister = [
  {
    path: '/doctorRegister',
    name: 'DoctorRegister',
    meta: {
      title: "注册页面"
    },
    component: _ => import('./views/doctorRegister/doctorRegister/doctorRegister.vue')
  },
  {
    path: '/doctorMine',
    name: 'DoctorMine',
    meta: {
      title: "我的"
    },
    component: _ => import('./views/doctorRegister/doctorMine/doctorMine.vue')
  },
  {
    path: '/doctorFlow',
    name: 'DoctorFlow',
    meta: {
      title: "医生注册流程"
    },
    component: _ => import('./views/doctorRegister/doctorFlow/doctorFlow.vue')
  },
  {
    path: '/example',
    name: 'Example',
    meta: {
      title: "医生注册流程"
    },
    component: _ => import('./views/doctorRegister/example/example.vue')
  }
]
/* 医生注册路由 end */


/* 合伙人路由 start */
let partner = [
  {
    path: '/partnerTest',
    name: 'PartnerTest',
    meta: {
      title: "合伙人测试"
    },
    component: _ => import('./views/partner/test/test.vue')
  },
  {
    path: '/partnerQrcode',
    name: 'PartnerQrcode',
    meta: {
      title: "我的二维码"
    },
    component: _ => import('./views/partner/partnerQrcode/partnerQrcode.vue')
  },
  {
    path: '/selectRoles',
    name: 'SelectRoles',
    meta: {
      title: "选择角色"
    },
    component: _ => import('./views/partner/selectRoles/selectRoles.vue')
  },
  {
    path: '/partnerHome',
    name: 'PartnerHome',
    meta: {
      title: "合伙人主页"
    },
    component: _ => import('./views/partner/partnerHome/partnerHome.vue')
  },
  {
    path: '/juniorPartner',
    name: 'JuniorPartner',
    meta: {
      title: "我的下级"
    },
    component: _ => import('./views/partner/juniorPartner/juniorPartner.vue')
  },
  {
    path: '/partnerRegister',
    name: 'PartnerRegister',
    meta: {
      title: "合伙人注册"
    },
    component: _ => import('./views/partner/partnerRegister/partnerRegister.vue')
  },
  {
    path: '/partnerToBeCertified',
    name: 'PartnerToBeCertified',
    meta: {
      title: "合伙人主页未认证"
    },
    component: _ => import('./views/partner/partnerToBeCertified/partnerToBeCertified.vue')
  }
]

/* 合伙人路由 end */


/* 短视频路由 start */
let shortVideo = [
  {
    path: "/oneVideoPlayer",
    name: "OneVideoPlayer",
    meta: {
      title: "优医短视频"
    },
    component: () => import('./views/shortVideo/OneVideoPlayer.vue')
  },
  {
    path: "/videoPlayerTest",
    name: "VideoPlayerTest",
    meta: {
      title: "测试视频滑动"
    },
    component: () => import('./views/shortVideo/VideoPlayerTest.vue')
  },
  {
    path: "/uploadFile",
    name: "UploadFile",
    meta: {
      title: "上传视频"
    },
    component: () => import("./views/shortVideo/UploadFile.vue")
  },
  {
    path: "/myVideos",
    name: "MyVideos",
    meta: {
      title: "我上传的视频"
    },
    component: () => import("./views/shortVideo/MyVideos.vue")
  },
  {
    path: "/searchVideo",
    name: "SearchVideo",
    meta: {
      title: "搜索视频"
    },
    component: () => import("./views/shortVideo/SearchVideo.vue")
  },
  {
    path: "/doctorHome",
    name: "DoctorHome",
    meta: {
      title: "医生首页"
    },
    component: () => import("./views/shortVideo/DoctorHome.vue")
  },
  {
    path: "/shortVideo",
    name: "shortVideo",
    meta: {
      title: "优医短视频"
    },
    component: () => import("./views/shortVideo/ShortVideo.vue")
  },
  {
    path: "/VideoPlay",
    name: "videoPlay",
    meta: {
      title: "视频播放页"
    },
    component: () => import("./views/shortVideo/VideoPlay.vue")
  },
  {
    path: "/attention",
    name: "Attention",
    meta: {
      title: "我关注的医生"
    },
    component: () => import("./views/shortVideo/Attention.vue")
  },
  {
    path: "/likeVideo",
    name: "LikeVideo",
    meta: {
      title: "我喜欢的视频"
    },
    component: () => import("./views/shortVideo/LikeVideo.vue")
  },
  {
    path: "/explain",
    name: "Explain",
    meta: {
      title: "修复视频教程"
    },
    component: () => import("./views/shortVideo/Explain.vue")
  }
];
/* 短视频路由 end */

/** 手术预约路由on */
let surgeryRoutes = [
  {
    path: "/surgery",
    name: "surgery",
    meta: {
      title: "手术预约" //病人
    },
    component: () => import("./views/patient/surgery/surgery.vue")
  },
  {
    path: "/surgeryDetail",
    name: "surgeryDetail",
    meta: {
      title: "手术预约详情" //病人
    },
    component: () => import("./views/patient/surgery/surgeryDetail.vue")
  },
  {
    path: "/surgeryList",
    name: "surgeryList",
    meta: {
      title: "手术预约记录" //病人
    },
    component: () => import("./views/patient/surgery/surgeryList.vue")
  }
];
/** 手术预约路由end */
/** 视频课程 用户端 on */
let courseRoutes = [
  {
    path: "/healthyVideo",
    name: "healthyVideo",
    meta: {
      title: "专家开讲"
    },
    component: () => import("./views/patient/course/healthyVideo.vue")
  },
  {
    path: "/healthCourse",
    name: "healthCourse",
    meta: {
      title: "健康视频详情"
    },
    component: () => import("./views/patient/course/healthCourse.vue")
  },
  {
    path: "/test",
    name: "test",
    meta: {
      title: "药房" //测试
    },
    component: () => import("./views/test.vue")
  },
  {
    path: "/UploadVideo",
    name: "UploadVideo",
    meta: {
      title: "视频上传"
    },
    component: () => import("./views/doctor/UploadVideo.vue")
  }
];
/** 视频课程 用户端 end */

/** 海报裂变活动on */
let posterRoutes = [
  {
    path: "/myAddress",
    name: "myAddress",
    meta: {
      title: "我的收货地址"
    },
    component: () =>
      import("./views/activity/posterDission/address/myAddress.vue")
  },
  {
    path: "/ljluck",
    name: "ljluck",
    meta: {
      title: "亮健优医福利惠"
    },
    component: () => import("./views/activity/posterDission/ljluck.vue")
  },
  {
    path: "/ljlogin",
    name: "/ljlogin",
    meta: {
      title: "亮健优医登陆"
    },
    component: () => import("./views/activity/posterDission/ljlogin.vue")
  },
  {
    path: "/add-modify-address",
    name: "add-modify-address",
    meta: {
      title: "添加收货地址"
    },
    component: () =>
      import("./views/activity/posterDission/address/addAddress.vue")
  },
  {
    path: "/orderInfo",
    name: "orderInfo",
    meta: {
      title: "订单信息"
    },
    component: () =>
      import("./views/activity/posterDission/address/orderInfo.vue")
  },
  {
    path: "/ranking",
    name: "ranking",
    meta: {
      title: "排行榜"
    },
    component: () => import("./views/activity/posterDission/ranking.vue")
  },
  {
    path: "/rankingDetail",
    name: "rankingDetail",
    meta: {
      title: "助力详情"
    },
    component: () => import("./views/activity/posterDission/rankingDetail.vue")
  },
  {
    path: "/myPrize",
    name: "myPrize",
    meta: {
      title: "我的奖品"
    },
    component: () => import("./views/activity/posterDission/myPrize.vue")
  },
  {
    path: "/prizeDetail",
    name: "prizeDetail",
    meta: {
      title: "奖品详情"
    },
    component: () => import("./views/activity/posterDission/prizeDetail.vue")
  }
];
/** 海报活动end */

/** 用药提醒on */
let medRemind = [
  {
    path: "/addRemind",
    name: "addRemind",
    meta: {
      title: "添加用药提醒"
    },
    component: () => import("./views/remind/addRemind.vue")
  },
  {
    path: "/remind",
    name: "remind",
    meta: {
      title: "用药提醒首页"
    },
    component: () => import("./views/remind/remind.vue")
  },
  {
    path: "/drugStorehouse",
    name: "drugStorehouse",
    meta: {
      title: "药品库"
    },
    component: () => import("./views/remind/drugStorehouse.vue")
  },
  {
    path: "/share",
    name: "share",
    meta: {
      title: "分享"
    },
    component: () => import("./views/remind/share.vue")
  },
  {
    path: "/remindDetail",
    name: "remindDetail",
    meta: {
      title: "用药明细"
    },
    component: () => import("./views/remind/remindDetail.vue")
  },

];
/** 用药提醒end */

export default new Router({
  // mode: 'history',
  // base: process.env.BASE_URL,
  routes: [
    {
      path: "/SignUp",
      name: "SignUp",
      meta: {
        title: "绑定手机号"
      },
      component: () => import("./views/doctor/SignUp.vue")
    },
    {
      path: "*",
      redirect: {
        name: "specialist"
      }
    },
    {
      path: "/medicalHistoryDetail",
      name: "medicalHistoryDetail",
      component: () => import("./views/common/medicalHistoryDetail.vue"),
      meta: {
        title: "病历详情" //通用
      }
    },
    {
      path: "/InAudit",
      name: "InAudit",
      meta: {
        title: "资料验证"
      },
      component: () => import("./views/doctor/InAudit.vue")
    },
    {
      path: "/UpDateIntroduce",
      name: "UpDateIntroduce",
      meta: {
        title: "医生介绍"
      },
      component: () => import("./views/doctor/UpDateIntroduce.vue")
    },
    {
      path: "/alterAddMedicalHistory",
      name: "alterAddMedicalHistory",
      meta: {
        title: "修改病历" //病人  添加修改病历
      },
      component: () =>
        import("./views/patient/PatientUser/alterAddMedicalHistory.vue")
    },
    {
      path: "/UpLoadInfo",
      name: "UpLoadInfo",
      meta: {
        title: "认证信息"
      },
      component: () => import("./views/doctor/UpLoadInfo.vue")
    },
    {
      path: "/Appointments",
      name: "Appointments",
      meta: {
        title: "预约记录"
      },
      component: () => import("./views/doctor/Appointments.vue")
    },
    {
      path: "/DoctorInfo",
      name: "DoctorInfo",
      meta: {
        title: "认证信息"
      },
      component: () => import("./views/doctor/DoctorInfo.vue")
    },
    {
      path: "/DoctorPatientInfo",
      name: "DoctorPatientInfo",
      meta: {
        title: "患者病例"
      },
      component: () => import("./views/doctor/DoctorPatientInfo.vue")
    },
    {
      path: "/reservationDetail",
      name: "reservationDetail",
      meta: {
        title: "预约详情" // 病人
      },
      component: () =>
        import("./views/patient/reservation/reservationDetail.vue")
    },
    {
      path: "/reservationRecord",
      name: "reservationRecord",
      meta: {
        title: "预约记录" // 病人
      },
      component: () =>
        import("./views/patient/reservation/reservationRecord.vue")
    },
    {
      path: "/home",
      name: "home",
      meta: {
        title: "专家1诊" // 病人tab导航页面
      },
      component: () => import("./views/patient/home/home.vue")
    },
    {
      path: "/freeClinicDetail",
      name: "freeClinicDetail",
      meta: {
        title: "坐诊详情"
      },
      component: () => import("./views/patient/home/freeClinicDetail.vue")
    },
    {
      path: "/familyMember",
      name: "familyMember",
      meta: {
        title: "家庭成员" // 病人
      },
      component: () => import("./views/patient/PatientUser/familyMember.vue")
    },
    {
      path: "/addFamilyMember",
      name: "addFamilyMember",
      meta: {
        title: "编辑成员信息" // 病人
      },
      component: () => import("./views/patient/PatientUser/addFamilyMember.vue")
    },
    {
      path: "/specialist",
      name: "specialist",
      meta: {
        title: "专家到家" // 病人  tab导航页面
        // keepAlive: true // 通过此字段判断是否需要缓存当前组件
        // isUseCache: false, // isUseCache为false时才重新刷新获取数据
      },
      component: () => import("./views/patient/reservation/specialist.vue")
    },

    {
      path: "/doctorDetail",
      name: "doctorDetail",
      meta: {
        title: "医生主页" // 病人
      },
      component: () => import("./views/patient/home/doctorDetail.vue")
    },

    {
      path: "/join",
      name: "join",
      meta: {
        title: "预约单" // 病人
      },
      component: () => import("./views/patient/reservation/join.vue")
    },
    {
      path: "/DoctorUser",
      name: "DoctorUser",
      meta: {
        title: "医生首页" // 医生
      },
      component: () => import("./views/doctor/DoctorUser.vue")
    },
    {
      path: "/MyProfitIndex",
      name: "MyProfitIndex",
      meta: {
        title: "我的收益" // 医生
      },
      component: () => import("./views/doctor/MyProfit/MyProfitIndex.vue")
    },
    {
      path: "/subordinateMyProfitIndex",
      name: "SubordinateMyProfitIndex",
      meta: {
        title: "我的下级收益" // 医生
      },
      component: () => import("./views/doctor/MyProfit/subordinateMyProfitIndex.vue")
    },
    {
      path: "/profitInfo",
      name: "profitInfo",
      meta: {
        title: "账单明细" // 医生
      },
      component: () => import("./views/doctor/MyProfit/profitInfo.vue")
    },
    {
      path: "/bill",
      name: "bill",
      meta: {
        title: "账单" // 医生
      },
      component: () => import("./views/doctor/MyProfit/bill.vue")
    },
    {
      path: "/PatientUser",
      name: "PatientUser",
      meta: {
        title: "用户首页" // 病人
      },
      component: () => import("./views/patient/PatientUser/PatientUser.vue")
    },
    {
      path: "/memberFile",
      name: "memberFile",
      meta: {
        title: "成员档案" // 病人
      },
      component: () => import("./views/patient/PatientUser/memberFile.vue")
    },
    {
      path: "/MapSearch",
      name: "MapSearch",
      meta: {
        title: "地点搜索" // 通用
      },
      component: () => import("./views/common/MapSearch.vue")
    },
    {
      path: "/SwitchTheLogin",
      name: "SwitchTheLogin",
      meta: {
        title: "身份切换" // 通用
      },
      component: () => import("./views/common/SwitchTheLogin.vue")
    },
    {
      path: "/NoFollow",
      name: "NoFollow",
      meta: {
        title: "关注公众号" // 通用
      },
      component: () => import("./views/common/NoFollow.vue")
    },
    {
      path: "/searchExpert",
      name: "searchExpert",
      meta: {
        title: "找专家" // 病人
      },
      component: () => import("./views/patient/reservation/searchExpert.vue")
    },
    {
      path: "/friendHelp",
      name: "friendHelp",
      meta: {
        title: "义诊名额预约" // 病人
      },
      component: () => import("./views/patient/home/friendHelp.vue")
    },
    {
      path: "/HospitalDetail",
      name: "HospitalDetail",
      meta: {
        title: "医院详情" // 病人
      },
      component: () => import("./views/common/HospitalDetail.vue")
    },
    {
      path: "/nearbySpecialist",
      name: "nearbySpecialist",
      meta: {
        title: "专家到家" // 病人
      },
      component: () =>
        import("./views/patient/reservation/nearbySpecialist.vue")
    },
    {
      path: "/chooseCity",
      name: "chooseCity",
      meta: {
        title: "选择城市" // 通用
      },
      component: () => import("./views/common/chooseCity.vue")
    },
    {
      path: "/nextSpecial",
      name: "nextSpecial",
      meta: {
        title: "预约专家下次坐诊" // 病人
      },
      component: () => import("./views/patient/reservation/nextSpecial.vue")
    },
    {
      path: "/uOrderDetails",
      name: "uOrderDetails",
      meta: {
        title: "订单详情" // 病人 拼团  && 确认订单
      },
      component: () => import("./views/patient/union/uOrderDetails.vue")
    },
    {
      path: "/payDone",
      name: "payDone",
      meta: {
        title: "支付完成" // 病人 拼团
      },
      component: () => import("./views/patient/union/payDone.vue")
    },
    {
      path: "/unionDetail",
      name: "unionDetail",
      meta: {
        title: "拼优医详情" // 病人
      },
      component: () => import("./views/patient/union/unionDetail.vue")
    },
    {
      path: "/confirmPay",
      name: "confirmPay",
      meta: {
        title: "确认支付" //支付
      },
      component: () => import("./views/common/confirmPay.vue")
    },
    {
      path: "/allOrder",
      name: "allOrder",
      meta: {
        title: "坐诊订单" // 病人
      },
      component: () => import("./views/patient/order/allOrder.vue")
    },
    {
      path: "/healthInquiry",
      name: "healthInquiry",
      meta: {
        title: "健康资讯" // 病人
      },
      component: () =>
        import("./views/patient/healthArticles/healthInquiry.vue")
    },
    {
      path: "/articlesDetail",
      name: "articlesDetail",
      meta: {
        title: "资讯详情" // 病人
      },
      component: () =>
        import("./views/patient/healthArticles/articlesDetail.vue")
    },
    {
      path: "/MyFollow",
      name: "MyFollow",
      meta: {
        title: "我的关注" // 病人
      },
      component: () => import("./views/patient/PatientUser/MyFollow.vue")
    },
    {
      path: "/MyCollection",
      name: "MyCollection",
      meta: {
        title: "我的收藏" // 病人
      },
      component: () => import("./views/patient/PatientUser/MyCollection.vue")
    },
    {
      path: "/MyPayVideo",
      name: "MyPayVideo",
      meta: {
        title: "我购买的健康视频" // 病人
      },
      component: () => import("./views/patient/PatientUser/MyPayVideo.vue")
    },
    {
      path: "/newHome",
      name: "newHome",
      meta: {
        title: "优医短视频" // 短视频
      },
      component: () => import("./views/patient/reservation/newHome.vue")
    },
    ...surgeryRoutes, //手术预约路由
    ...courseRoutes, //视频课程路由
    ...posterRoutes, //海报活动路由
    ...shortVideo, //短视频
    ...medRemind, //用药提醒
    ...partner,   // 合伙人
    ...doctorRegister,    // 医生注册
    ...activityCenter,    // 活动中心模块
    ...medRemind //用药提醒
  ]
});
