import Vue from "vue";
import Router from "vue-router";
import '../public-path';
Vue.use(Router);

/* Layout */
import Layout from "@/views/layout/Layout";

/** note: Submenu only appear when children.length>=1
 *  detail see  https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 **/

/**
* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
*                                if not set alwaysShow, only more than one route under the children
*                                it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect           if `redirect:noredirect` will no redirect in the breadcrumb
* name:'router-name'             the name is used by <keep-alive> (must set!!!)
* meta : {
    perms: ['GET /aaa','POST /bbb']     will control the page perms (you can set multiple perms)
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
    noCache: true                if true ,the page will no be cached(default is false)
  }
**/
export const constantRouterMap = [
  // {
  //   path: "/redirect",
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: "/redirect/:path*",
  //       component: () => import("@/views/redirect/index")
  //     }
  //   ]
  // },
  {
    path: "/",
    redirect: "/login"
},
  {
    path: "/login",
    component: () => import("@/views/login/index"),
    hidden: true
  },
  {
    path: "/addressCheck",
    component: () => import("@/views/address/addresscheck"),
    hidden: true
  },
  {
    path: "/auth-redirect",
    component: () => import("@/views/login/authredirect"),
    hidden: true
  },
  {
    path: "/404",
    component: () => import("@/views/errorPage/404"),
    hidden: true
  },
  {
    path: "/401",
    component: () => import("@/views/errorPage/401"),
    hidden: true
  },
  {
    path: "",
    component: Layout,
    redirect: "dashboard",
    children: [
      {
        path: "dashboard",
        component: () => import("@/views/dashboard/index"),
        name: "Dashboard",
        meta: {
          title: "首页",
          icon: "dashboard",
          affix: true
          //perms: ['GET admin/dashboard'],
        }
      }
    ]
  },


// ];



// export const asyncRouterMap = [
  {
    path: "/user",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "userManage",
    meta: {
      title: "会员中心",
      icon: "people"
    },
    children: [
      {
        path: "user",
        component: () => import("@/views/user/user"),
        name: "user",
        meta: {
          perms: ["GET /admin/user/list"],
          title: "会员管理",
          noCache: true,
          icon: "user",
          keepAlive: true
        }
      },
      {
        path: "address",
        component: () => import("@/views/user/address"),
        name: "address",
        meta: {
          perms: ["GET /admin/address/list"],
          title: "收货地址",
          noCache: true,
          icon: "tree",
          keepAlive: true
        }
      },
      {
        path: "collect",
        component: () => import("@/views/user/collect"),
        name: "collect",
        meta: {
          perms: ["GET /admin/collect/list"],
          title: "会员收藏",
          noCache: true,
          icon: "clipboard",
          keepAlive: true
        }
      },
      {
        path: "footprint",
        component: () => import("@/views/user/footprint"),
        name: "footprint",
        meta: {
          perms: ["GET /admin/footprint/list"],
          title: "会员足迹",
          noCache: true,
          icon: "eye",
          keepAlive: true
        }
      },
      {
        path: "history",
        component: () => import("@/views/user/history"),
        name: "history",
        meta: {
          perms: ["GET /admin/history/list"],
          title: "搜索历史",
          noCache: true,
          icon: "marker",
          keepAlive: true
        }
      },
      {
        path: "feedback",
        component: () => import("@/views/user/feedback"),
        name: "feedback",
        meta: {
          perms: ["GET /admin/feedback/list"],
          title: "意见反馈",
          noCache: true,
          icon: "email",
          keepAlive: true
        }
      }
    ]
  },
  {
    path: "/order",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "mallManage",
    meta: {
      title: "订单中心",
      icon: "shopping"
    },
    children: [
      {
        path: "order",
        component: () => import("@/views/order/order"),
        name: "order",
        meta: {
          perms: [
            "GET /admin/order/list",
            "POST /admin/order/commission",
            "POST /admin/order/modifyStatus",
            "GET /admin/order/export",
            "POST /admin/order/import",
            "POST /admin/order/applyRefund",
            "POST /admin/order/delete",
            "POST /admin/order/reply",
            "POST /admin/order/createMemo",
            'POST /admin/hmInterst/addInterst',
            'POST /admin/orderbookdetail/changeWorker',
            'GET /admin/orderbook/cancelBook',
            'GET /admin/orderbook/finish',
            "POST /admin/sms/send",
            'GET /admin/order/ishandle',
            'POST /admin/order/cancelOrder',
            'POST /admin/order/mtOrderTypeChange'
          ],
          title: "订单管理",
          noCache: true,
          icon: "order",
          keepAlive: true
        }
      },
      // {
      //   path: "schedulingP",
      //   component: () => import("@/views/order/schedulingP"),
      //   name: "schedulingP",
      //   meta: {
      //     perms: [
      //       'POST /admin/workerOccupy/selectOccupyByQuery'
      //     ],
      //     title: "档期管理",
      //     noCache: true,
      //     icon: "form",
      //     keepAlive: true
      //   }
      // },
      {
        path: "addressCheck",
        component: () => import("@/views/order/addressCheck"),
        name: "addressCheck",
        meta: {
          perms: [
            'GET /admin/addressCheck/getCalendarStockByAddress'
          ],
          title: "服务区域查询",
          noCache: true,
          icon: "guide",
          keepAlive: true
        }
      },
      {
        path: "schedulingCalendar",
        component: () => import("@/views/order/schedulingCalendar"),
        name: "schedulingCalendar",
        meta: {
          perms: [
            'POST /admin/workerOccupy/getCalendarStock'
          ],
          title: "档期日历",
          noCache: true,
          icon: "order",
          keepAlive: true
        }
      },
      {
        path: "serviceBook",
        component: () => import("@/views/order/serviceBook"),
        name: "serviceBook",
        meta: {
          perms: [
            'GET /admin/orderbookdetail/list',
            'POST /admin/orderbookdetail/notify',
            'GET /admin/orderbookdetail/tranBookToFra',
            'POST /admin/orderbookdetail/modifyFee',
          ],
          title: "服务工单",
          noCache: true,
          icon: "form",
          keepAlive: true
        }
      },
      {
        path: "serviceorder",
        component: () => import("@/views/order/serviceorder"),
        name: "serviceorder",
        meta: {
          perms: [
            "GET /admin/orderbook/list",
            "GET /admin/orderbook/detail",
            "POST /admin/orderbookdetail/changeWorker",
            "GET /admin/orderbook/cancelBook"
          ],
          title: "服务订单",
          noCache: true,
          icon: "sms-flash",
          keepAlive: true
        }
      },
      {
        path: "serviceorderonce",
        component: () => import("@/views/order/serviceorderonce"),
        name: "serviceorderonce",
        meta: {
          perms: [
            "GET /admin/orderbook/oncelist",
            "POST /admin/orderbookdetail/changeWorker",
            "GET /admin/orderbook/cancelBook"
          ],
          title: "单次服务订单",
          noCache: true,
          icon: "one",
          keepAlive: true
        }
      },
      {
        path: "serviceordercycle",
        component: () => import("@/views/order/serviceordercycle"),
        name: "serviceordercycle",
        meta: {
          perms: [
            "GET /admin/orderbook/cyclelist",
            "POST /admin/orderbookdetail/changeWorker",
            "GET /admin/orderbook/cancelBook"
          ],
          title: "周期服务订单",
          noCache: true,
          icon: "refresh",
          keepAlive: true
        }
      },
      {
        path: "serviceordercategory",
        component: () => import("@/views/order/serviceordercategory"),
        name: "serviceordercategory",
        meta: {
          perms: [
            "GET /admin/orderbook/categorylist",
            "POST /admin/orderbookdetail/changeWorker",
            "GET /admin/orderbook/cancelBook"
          ],
          title: "品类服务订单",
          noCache: true,
          icon: "product-cate",
          keepAlive: true
        }
      },
      {
        path: "orderServant",
        component: () => import("@/views/order/orderServant"),
        name: "orderServant",
        meta: {
          perms: [
            "GET /admin/orderServant/getBookList",
          ],
          title: "服务者看板",
          noCache: true,
          icon: "cnpc",
          keepAlive: true
        }
      },
      {
        path: "orderBookBoard",
        component: () => import("@/views/order/orderBookBoard"),
        name: "orderBookBoard",
        meta: {
          perms: [
            "GET /admin/orderbook/list",
          ],
          title: "服务单看板",
          noCache: true,
          icon: "clipboard",
          keepAlive: true
        }
      },
      {
        path: "aftersale",
        component: () => import("@/views/order/aftersale"),
        name: "aftersale",
        meta: {
          perms: [
            "GET /admin/aftersale/list",
            "GET /admin/aftersale/detail",
            "POST /admin/order/receive",
            "POST /admin/aftersale/complete",
            "POST /admin/aftersale/reject",
            'GET /admin/aftersale/getAftersaleLog'
          ],
          title: "售后管理",
          noCache: true,
          icon: "order-return",
          keepAlive: true
        }
      },
      {
        path: "orderVerify",
        component: () => import("@/views/order/orderVerify"),
        name: "orderVerify",
        meta: {
          perms: [
            "POST /admin/orderVerify/verify",
          ],
          title: "工单核销",
          noCache: true,
          icon: "sms-flash",
          keepAlive: true
        }
      },
      // {
      //   path: "orderQinGe",
      //   component: () => import("@/views/order/orderQinGe"),
      //   name: "orderQinGe",
      //   meta: {
      //     perms: ["GET /admin/qgOrder/export",'GET /admin/qgOrder/list'],
      //     title: "勤鸽订单",
      //     noCache: true,
      //     icon: "cnpc",
      //     keepAlive:true
      //   }
      // },
      // {
      //   path: "pet",
      //   component: () => import("@/views/order/pet"),
      //   name: "pet",
      //   meta: {
      //     perms: [
      //       "GET /admin/pet/list",
      //       "GET /admin/pet/detail",
      //       "POST /admin/pet/pose",
      //       "POST /admin/pet/reject"
      //     ],
      //     title: "宠物保险",
      //     noCache: true,
      //     icon: "ums",
      //     keepAlive:true
      //   }
      // },
      {
        path: "orderImport",
        component: () => import("@/views/order/orderImport"),
        name: "orderImport",
        meta: {
          perms: ["POST /admin/order/import"],
          title: "订单导入",
          noCache: true,
          icon: "product-add",
          keepAlive: true
        }
      },
      {
        path: "distance",
        component: () => import("@/views/order/distance"),
        name: "distance",
        meta: {
          perms: ["GET /admin/distance/distance"],
          title: "归属门店查询",
          noCache: true,
          icon: "product-add",
          keepAlive: true
        }
      },
      {
        path: "orderQinGe",
        component: () => import("@/views/order/orderQinGe"),
        name: "orderQinGe",
        meta: {
          perms: ["GET /admin/qgOrder/list", "GET /admin/qgOrder/export"],
          title: "勤鸽订单",
          noCache: true,
          icon: "product-cate",
          keepAlive: true
        }
      }
    ]
  },
  {
    path: "/storage",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "storage",
    meta: {
      title: "收纳订单",
      icon: "product-brand"
    },
    children: [
      {
        path: "storageBookList",
        component: () => import("@/views/order/storage/storageBookList"),
        name: "storageBookList",
        meta: {
          perms: [
            "GET /admin/orderStorage/list",
            "POST /admin/orderStorage/reassign",
            "POST /admin/orderStorage/cancelBook",
            "POST /admin/orderStorage/finish"
          ],
          title: "服务工单",
          noCache: true,
          icon: "product-cate",
          keepAlive: true
        }
      },
      {
        path: "storageOrderList",
        component: () => import("@/views/order/storage/storageOrderList"),
        name: "storageOrderList",
        meta: {
          perms: [
            "GET /admin/orderStorage/orderList",
          ],
          title: "收纳订单",
          noCache: true,
          icon: "product-list",
          keepAlive: true
        }
      },
    ]
  },
  // {
  //   path: "/referee",
  //   component: Layout,
  //   redirect: "noredirect",
  //   alwaysShow: true,
  //   name: "refereeManager",
  //   meta: {
  //     title: "商城分销",
  //     icon: "referee"
  //   },
  //   children: [
  //     {
  //       path: "referee",
  //       component: () => import("@/views/referee/referee"),
  //       name: "referee",
  //       meta: {
  //         perms: [
  //           "GET /admin/referee/list",
  //           "GET /admin/referee/detail",
  //           "POST /admin/refree/create",
  //           "POST /admin/referee/delete",
  //           "POST /admin/referee/header"
  //         ],
  //         title: "团长",
  //         noCache: true,
  //         icon: "referee-m",
  //         keepAlive: true
  //       }
  //     },
  //     {
  //       path: "refereeApply",
  //       component: () => import("@/views/referee/apply"),
  //       name: "refereeApply",
  //       meta: {
  //         perms: [
  //           "GET /admin/commissionApply/list",
  //           "POST /admin/commissionApply/pass",
  //           "POST /admin/commissionApply/reject",
  //           "GET /admin/commissionApply/blance"
  //         ],
  //         title: "提现申请",
  //         noCache: true,
  //         icon: "referee-apply",
  //         keepAlive: true
  //       }
  //     }
  //   ]
  // },
  // {
  //   path: "/parter",
  //   component: Layout,
  //   redirect: "noredirect",
  //   alwaysShow: true,
  //   name: "disManage",
  //   meta: {
  //     title: "服务者小程序",
  //     icon: "star"
  //   },
  //   children: [
  //     {
  //       path: "commission",
  //       component: () => import("@/views/parter/commission"),
  //       name: "commission",
  //       meta: {
  //         perms: [
  //           "GET /admin/commission/list",
  //           "GET /admin/commission/detail",
  //           "GET /admin/commission/relation"
  //         ],
  //         title: "分佣明细",
  //         noCache: true,
  //         icon: "list",
  //         keepAlive: true
  //       }
  //     },
  //     {
  //       path: "cashout",
  //       component: () => import("@/views/parter/cashout"),
  //       name: "cashout",
  //       meta: {
  //         perms: [
  //           "GET /admin/cashout/list",
  //           "POST /admin/cashout/pass",
  //           "GET /admin/cashout/reject"
  //         ],
  //         title: "提现审核",
  //         noCache: true,
  //         icon: "money",
  //         keepAlive: true
  //       }
  //     },
  //     {
  //       path: "servant",
  //       component: () => import("@/views/parter/servant"),
  //       name: "servant",
  //       meta: {
  //         perms: [
  //           "GET /admin/servant/list",
  //           "POST /admin/servant/create",
  //           "POST /admin/servant/update",
  //           "GET /admin/servant/delete",
  //           "GET /admin/servant/usable"
  //         ],
  //         title: "使用申请",
  //         noCache: true,
  //         icon: "guide 2"
  //       }
  //     },
  //     {
  //       path: "nucleic",
  //       component: () => import("@/views/parter/nucleic"),
  //       name: "nucleic",
  //       meta: {
  //         perms: [
  //           "GET /admin/nucleic/list"
  //         ],
  //         title: "核酸记录",
  //         noCache: true,
  //         icon: "example"
  //       }
  //     }
  //   ]
  // },
  {
    path: "/goods",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "goodsManage",
    meta: {
      title: "商品管理",
      icon: "product"
    },
    children: [
      {
        path: "category",
        component: () => import("@/views/goods/category"),
        name: "category",
        meta: {
          perms: [
            "GET /admin/category/list",
            "POST /admin/category/create",
            "GET /admin/category/read",
            "POST /admin/category/update",
            "POST /admin/category/delete"
          ],
          title: "商品类目",
          noCache: true,
          icon: "product-attr",
          keepAlive: true
        }
      },
      {
        path: "list",
        component: () => import("@/views/goods/list"),
        name: "goodsList",
        meta: {
          perms: ["GET /admin/goods/list","GET /admin/goods/dyUrl", "POST /admin/goods/delete","GET /admin/goods/goodsChannelQrCode"],
          title: "商品列表",
          noCache: true,
          icon: "product-list",
          keepAlive: true
        }
      },
      {
        path: "create",
        component: () => import("@/views/goods/create"),
        name: "goodsCreate",
        meta: {
          perms: ["POST /admin/goods/create"],
          title: "商品添加",
          noCache: true,
          icon: "product-add",
          keepAlive: true
        }
      },
      {
        path: "audit",
        component: () => import("@/views/goods/audit"),
        name: "goodsAudit",
        meta: {
          perms: ["GET /admin/goods/auditList"],
          title: "商品审核",
          noCache: true,
          icon: "product-attr",
          keepAlive: true
        }
      },
      {
        path: "edit",
        component: () => import("@/views/goods/edit"),
        name: "goodsEdit",
        meta: {
          perms: [
            "GET /admin/goods/detail",
            "POST /admin/goods/update",
            "POST /admin/goods/catAndBrand"
          ],
          title: "商品编辑",
          noCache: true,
          keepAlive: true
        },
        hidden: true
      },
      {
        path: "comment",
        component: () => import("@/views/goods/comment"),
        name: "goodsComment",
        meta: {
          perms: ["GET /admin/comment/list", "POST /admin/comment/delete"],
          title: "商品评论",
          noCache: true,
          icon: "product-comment"
        }
      },
      {
        path: "statisticsCategory",
        component: () => import("@/views/goods/statisticsCategory"),
        name: "statisticsCategory",
        meta: {
          perms: [
            "GET /admin/statisticsCategory/list",
            "POST /admin/statisticsCategory/create",
            "POST /admin/statisticsCategory/update"
          ],
          title: "商品统计分类",
          noCache: true,
          icon: "product-attr"
        }
      },
      {
        path: "serviceFee",
        component: () => import("@/views/goods/serviceFee"),
        name: "serviceFee",
        meta: {
          perms: [
            "GET /admin/goodsServiceFee/getFeeList",
            "POST /admin/goodsServiceFee/addFee",
            "POST /admin/goodsServiceFee/batchCopy",
          ],
          title: "商品计提",
          noCache: true,
          icon: "product-comment"
        },
        hidden: true
      },
      {
        path: "wxVideoConfig",
        component: () => import("@/views/goods/wxVideoConfig"),
        name: "wxVideoConfig",
        meta: {
          perms: [
            "GET /admin/localLive/getGoodsList",
            "GET /admin/localLive/addLocalLiveGoods",
            "GET /admin/localLive/getGoodsProduct",
            "GET /admin/localLive/refreshStatus",
            "GET /admin/localLive/spuListing",
          ],
          title: "视频号商品",
          noCache: true,
          icon: "order-setting"
        }
      },

    ]
  },
  {
    path: "/douyin",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "douyin",
    meta: {
      title: "抖音生活",
      icon: "dy"
    },
    children: [
      {
        path: "goodsExternalConfig",
        component: () => import("@/views/dy/goodsExternalConfig"),
        name: "goodsExternalConfig",
        meta: {
          perms: [
            "GET /admin/goodsExternal/list",
            "POST /admin/goodsExternal/insert",
            "GET /admin/goodsExternal/delete"
          ],
          title: "商品审核",
          noCache: true,
          icon: "product-comment",
          keepAlive: true
        }
      },
      {
        path: "dySnow",
        component: () => import("@/views/dy/dySnow"),
        name: "dySnow",
        meta: {
          perms: [
            "GET /admin/snow/list"
          ],
          title: "小雪花配置",
          noCache: true,
          icon: "drag",
          keepAlive: true
        }
      },
      {
        path: "dyPoi",
        component: () => import("@/views/dy/dyPoiApply"),
        name: "dyPoi",
        meta: {
          perms: [
            "GET /admin/dyshop/goodsApply"
          ],
          title: "POI批量更新",
          noCache: true,
          icon: "international",
          keepAlive: true
        }
      },
      {
        path: "dyorder",
        component: () => import("@/views/dy/dyorder"),
        name: "dyorder",
        meta: {
          perms: [
            "GET /admin/dyOrderVerify/douyinVerifyOrder",
            "GET /admin/dyOrderVerify/getList",
          ],
          title: "订单核销",
          noCache: true,
          icon: "list",
          keepAlive: true
        }
      },
      {
        path: "dyTalent",
        component: () => import("@/views/dy/dyTalent"),
        name: "dyTalent",
        meta: {
          perms: [
            "GET /admin/dytalent/talentList",
            "POST /admin/dytalent/addNewTalent",
            "POST /admin/dytalent/batchAdd",
            "GET /admin/dytalent/cancelPlanTalent",
          ],
          title: "抖音达人",
          noCache: true,
          icon: "people",
          keepAlive: true
        }
      },
      {
        path: "dyPlan",
        component: () => import("@/views/dy/dyPlan"),
        name: "dyPlan",
        meta: {
          perms: [
            "POST /admin/dyplan/queryPlanList",
            "POST /admin/dyplan/createCommonPlan",
            "POST /admin/dyplan/createNonCommonPlan",
            "GET /admin/dyplan/queryPlanDetail",
            "POST /admin/dyplan/updatePlanStatus",
            "GET /admin/dytalent/cancelPlanTalent",
          ],
          title: "抖音计划",
          noCache: true,
          icon: "nested",
          keepAlive: true
        }
      },
      {
        path: "douyinPlanDetail",
        component: () => import("@/views/dy/compent/douyinPlanDetail"),
        name: "douyinPlanDetail",
        meta: {
          perms: [
            "GET /admin/dyplan/queryPlanDetail",
          ],
          title: "抖音计划详情",
          noCache: true,
          keepAlive: true
        },
        hidden: true
      },
      {
        path: "dyCoupon",
        component: () => import("@/views/dy/dyCoupon"),
        name: "dyCoupon",
        meta: {
          perms: [
            'GET /admin/dyCoupon/list',
            'GET /admin/dyCoupon/read',
            'POST /admin/dyCoupon/create',
            'GET /admin/dyCoupon/increase',
            'POST /admin/dyCoupon/delete',
            'POST /admin/dyCoupon/allocation'
          ],
          icon: "sms-coupon",
          title: "抖音优惠券",
          noCache: true,
          keepAlive: true
        }
      },
      {
        path: "dyCouponDetail",
        component: () => import("@/views/dy/dyCouponDetail"),
        name: "dyCouponDetail",
        meta: {
          perms: [
            "GET /admin/dyCoupon/listCouponUser",
            'GET /admin/dyCoupon/listCouponTalent'
          ],
          title: "抖音优惠券详情",
          noCache: true,
          keepAlive: true
        },
        hidden: true
      },
      {
        path: "telecomCardOrder",
        component: () => import("@/views/order/telecomCard/telecomCardOrder"),
        name: "telecomCardOrder",
        meta: {
          perms: [
            "POST /admin/telecomCardOrder/getPageList",
          ],
          title: "抖音电商卡订单",
          noCache: true,
          keepAlive: true
        },
        hidden: true
      },
      {
        path: "broadbandService",
        component: () => import("@/views/order/telecomCard/broadbandService"),
        name: "broadbandService",
        meta: {
          perms: [
            "POST /admin/telecomOrder/getList",
          ],
          title: "宽带业务",
          noCache: true,
          keepAlive: true
        },
        hidden: true
      },
      {
        path: "numberCardService",
        component: () => import("@/views/order/telecomCard/numberCardService"),
        name: "numberCardService",
        meta: {
          perms: [
            "POST /admin/telecomOrder/getList",
          ],
          title: "号卡业务",
          noCache: true,
          keepAlive: true
        },
        hidden: true
      },
    ]
  },
  {
    path: "/ks",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "ks",
    meta: {
      title: "快手",
      icon: "ks"
    },
    children: [
      {
        path: "ksTalent",
        component: () => import("@/views/ks/ksTalent"),
        name: "ksTalent",
        meta: {
          perms: [
            "GET /admin/kstalent/talentList",
            "POST /admin/kstalent/addNewTalent",
            "POST /admin/kstalent/batchAdd",
            "GET /admin/kstalent/cancelPlanTalent",
          ],
          title: "快手达人",
          noCache: true,
          icon: "people",
          keepAlive: true
        }
      },
    ]
  },
  {
    path: "/zfb",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "zfb",
    meta: {
      title: "支付宝",
      icon: "zfb"
    },
    children: [
      {
        path: "zfbOrderVocher",
        component: () => import("@/views/zfb/zfbOrderVocher"),
        name: "zfbOrderVocher",
        meta: {
          perms: [
            "GET /admin/zfbOrderVocher/list",
          ],
          title: "支付宝团购",
          noCache: true,
          icon: "zfb",
          keepAlive: true
        }
      },
    ]
  },
  {
    path: "/promotion",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "promotionManage",
    meta: {
      title: "商城营销",
      icon: "sms"
    },
    children: [
      {
        path: "ad",
        component: () => import("@/views/promotion/ad"),
        name: "ad",
        meta: {
          perms: [
            "GET /admin/ad/list",
            "POST /admin/ad/create",
            "GET /admin/ad/read",
            "POST /admin/ad/update",
            "POST /admin/ad/delete"
          ],
          title: "广告管理",
          noCache: true,
          icon: "sms-ad",
          keepAlive: true
        }
      },
      {
        path: "couponPackage",
        component: () => import("@/views/promotion/couponPackage"),
        name: "couponPackage",
        meta: {
          perms: [
            "GET /admin/couponpackage/list",
            "GET /admin/couponpackage/real",
            "POST /admin/couponpackage/delete",
            "POST /admin/couponpackage/create"
          ],
          title: "卡券包管理",
          noCache: true,
          icon: "sms-coupon",
          keepAlive: true
        }
      },
      {
        path: "couponPackageDetail",
        component: () => import("@/views/promotion/couponPackageDetail"),
        name: "couponPackageDetail",
        meta: {
          perms: [
            "GET /admin/couponPackageDetail/list",
            "GET /admin/couponPackageDetail/read",
            "GET /admin/couponPackageDetail/send",
            "GET /admin/couponPackageDetail/rsend",
            "POST /admin/couponPackageDetail/import",
            "GET /admin/couponPackageDetail/delete"
          ],
          title: "卡券包明细管理",
          noCache: true,
          icon: "sms-coupon",
          keepAlive: true
        },
      },
      {
        path: "coupon",
        component: () => import("@/views/promotion/coupon"),
        name: "coupon",
        meta: {
          perms: [
            "GET /admin/coupon/list",
            "POST /admin/coupon/create",
            "POST /admin/coupon/update",
            "POST /admin/coupon/delete"
          ],
          title: "优惠券管理",
          noCache: true,
          icon: "sms-coupon",
          keepAlive: true
        }
      },
      {
        path: "spdBank",
        component: () => import("@/views/promotion/spdBank"),
        name: "spdBank",
        meta: {
          perms: [
            "GET /admin/spdBank/list",
            "GET /admin/spdBank/send",
            "POST /admin/spdBank/update",
            "POST /admin/spdBank/import",
            "POST /admin/spdBank/delete"
          ],
          title: "浦发券管理",
          noCache: true,
          icon: "sms-subject",
          keepAlive: true
        }
      },
      {
        path: "icbc",
        component: () => import("@/views/promotion/icbc"),
        name: "icbc",
        meta: {
          perms: [
            "GET /admin/icbc/list",
            "GET /admin/icbc/send",
            "POST /admin/icbc/delete"
          ],
          title: "工行券管理",
          noCache: true,
          icon: "sms-subject",
          keepAlive: true
        }
      },
      {
        path: "sq",
        component: () => import("@/views/promotion/saicgroup"),
        name: "sq",
        meta: {
          perms: [
            "GET /admin/saicgroup/list",
            "POST /admin/saicgroup/import",
            "POST /admin/saicgroup/createConfig",
            "POST /admin/spdBank/delete"
          ],
          title: "上汽员工码管理",
          noCache: true,
          icon: "sms-subject",
          keepAlive: true
        }
      },
      {
        path: "couponDetail",
        component: () => import("@/views/promotion/couponDetail"),
        name: "couponDetail",
        meta: {
          perms: [
            "GET /admin/coupon/list",
            "GET /admin/coupon/listuser",
            "POST /admin/coupon/export",
            "POST /admin/coupon/batchCollection"
          ],
          title: "优惠券详情",
          noCache: true,
          keepAlive: true
        },
        hidden: true
      },
      // {
      //   path: "topic",
      //   component: () => import("@/views/promotion/topic"),
      //   name: "topic",
      //   meta: {
      //     perms: [
      //       "GET /admin/topic/list",
      //       "POST /admin/topic/create",
      //       "GET /admin/topic/read",
      //       "POST /admin/topic/update",
      //       "POST /admin/topic/delete"
      //     ],
      //     title: "专题管理",
      //     noCache: true,
      //     icon: "sms-hot"
      //   }
      // },
      // {
      //   path: "topic-create",
      //   component: () => import("@/views/promotion/topicCreate"),
      //   name: "topicCreate",
      //   meta: {
      //     perms: ["POST /admin/topic/create"],
      //     title: "专题创建",
      //     noCache: true
      //   },
      //   hidden: true
      // },
      // {
      //   path: "topic-edit",
      //   component: () => import("@/views/promotion/topicEdit"),
      //   name: "topicEdit",
      //   meta: {
      //     perms: ["GET /admin/topic/read", "POST /admin/topic/update"],
      //     title: "专题编辑",
      //     noCache: true
      //   },
      //   hidden: true
      // },
      // {
      //   path: "groupon-rule",
      //   component: () => import("@/views/promotion/grouponRule"),
      //   name: "grouponRule",
      //   meta: {
      //     perms: [
      //       "GET /admin/groupon/list",
      //       "POST /admin/groupon/create",
      //       "POST /admin/groupon/update",
      //       "POST /admin/groupon/delete"
      //     ],
      //     title: "团购活动",
      //     noCache: true,
      //     icon: "peoples"
      //   }
      // },
      // {
      //   path: "memberCoupon",
      //   component: () => import("@/views/promotion/memberCoupon"),
      //   name: "memberCoupon",
      //   meta: {
      //     perms: [
      //       "GET /admin/memberCoupon/list",
      //       "GET /admin/memberCoupon/batchNoAssigned",
      //       "POST /admin/memberCoupon/export",
      //       "GET /admin/memberCoupon/useExplain",
      //       "POST /admin/memberCoupon/create"
      //     ],
      //     title: "会员兑换券",
      //     noCache: true,
      //     icon: "member-card"
      //   }
      // },
      {
        path: "activity",
        component: () => import("@/views/promotion/activity"),
        name: "activity",
        meta: {
          perms: ["GET /admin/activity/create"],
          title: "商详活动设置",
          noCache: true,
          icon: "member-card"
        },
        hidden: false
      },
      // {
      //     path: 'memberManage',
      //     component: () =>
      //         import ('@/views/promotion/memberManage'),
      //     name: 'memberManage',
      //     meta: {
      //         perms: ['GET /admin/memberCoupon/listcard'],
      //         title: '会员卡管理',
      //         noCache: true,
      //         icon: 'sms-subject'
      //     }
      // },

    ]
  },
  // {
  //   path: "/previewing",
  //   component: Layout,
  //   redirect: "noredirect",
  //   alwaysShow: true,
  //   name: "previewing",
  //   meta: {
  //     title: "品类预检",
  //     icon: "component"
  //   },
  //   children: [
  //     {
  //       path: "ticketEntry",
  //       component: () => import("@/views/previewing/category"),
  //       name: "ticketEntry",
  //       meta: {
  //         perms: [
  //           "GET /admin/preCategory/list",
  //           "GET /admin/preCategory/detail"
  //         ],
  //         title: "服务项",
  //         noCache: true,
  //         icon: "form"
  //       }
  //     },
  //     {
  //       path: "pre",
  //       component: () => import("@/views/previewing/pre"),
  //       name: "pre",
  //       meta: {
  //         perms: [
  //           "GET /admin/pre/list",
  //           "GET /admin/pre/detail",
  //           "POST /admin/pre/create",
  //           "GET /admin/pre/read",
  //           "POST /admin/pre/update",
  //           "POST /admin/pre/delete"
  //         ],
  //         title: "预检结果",
  //         noCache: true,
  //         icon: "example"
  //       }
  //     }
  //   ]
  // },
  {
    path: "/config",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "configManage",
    meta: {
      title: "配置管理",
      icon: "edit"
    },
    children: [
      {
        path: "refundtype",
        component: () => import("@/views/config/refundtype"),
        name: "refundtype",
        meta: {
          perms: [
            "GET /admin/dmRefund/list",
            "POST /admin/dmRefund/create",
            "POST /admin/dmRefund/update"
          ],
          title: "退款原因配置",
          noCache: true,
          icon: "order-return",
          keepAlive: true
        }
      },
      {
        path: "shop",
        component: () => import("@/views/config/shop"),
        name: "shop",
        meta: {
          perms: [
            "GET /admin/shop/list",
            "POST /admin/shop/create",
            "GET /admin/shop/read",
            "POST /admin/shop/update",
            "POST /admin/shop/delete"
          ],
          title: "门店配置",
          noCache: true,
          icon: "password",
          keepAlive: true
        }
      },
      {
        path: "serviceTimeRange",
        component: () => import("@/views/config/timerange"),
        name: "serviceTimeRange",
        meta: {
          perms: [
            "GET /admin/serviceTimeRange/list",
            "POST /admin/serviceTimeRange/create",
            "POST /admin/serviceTimeRange/update"
          ],
          title: "服务时间段配置",
          noCache: true,
          icon: "sms-flash",
          keepAlive: true
        }
      },
      {
        path: "city",
        component: () => import("@/views/config/city"),
        name: "city",
        meta: {
          perms: [
            "GET /admin/shop/list",
            "POST /admin/city/create",
            "GET /admin/city/read",
            "POST /admin/city/update",
            "POST /admin/city/delete"
          ],
          title: "业务城市",
          noCache: true,
          icon: "international"
        }
      },
      {
        path: "channel",
        component: () => import("@/views/config/channel"),
        name: "configChannel",
        meta: {
          perms: ["GET /admin/channel/list", "POST /admin/channel/create", "GET /admin/channel/qrcode"],
          title: "渠道配置",
          noCache: true,
          icon: "guide",
          keepAlive: true
        }
      },
      {
        path: "config",
        component: () => import("@/views/config/order"),
        name: "configOrder",
        meta: {
          perms: ["GET /admin/config/order", "POST /admin/config/order"],
          title: "订单配置",
          noCache: true,
          icon: "order-setting"
        }
      },
      {
        path: "mall",
        component: () => import("@/views/config/mall"),
        name: "configMall",
        meta: {
          perms: ["GET /admin/config/mall", "POST /admin/config/mall"],
          title: "商场配置",
          noCache: true,
          icon: "home"
        }
      },
      {
        path: "express",
        component: () => import("@/views/config/express"),
        name: "configExpress",
        meta: {
          perms: ["GET /admin/config/express", "POST /admin/config/express"],
          title: "运费配置",
          noCache: true,
          icon: "guide"
        }
      },
      {
        path: "wx",
        component: () => import("@/views/config/wx"),
        name: "configWx",
        meta: {
          perms: ["GET /admin/config/wx", "POST /admin/config/wx"],
          title: "小程序配置",
          noCache: true,
          icon: "form"
        }
      },
      {
        path: "keyword",
        component: () => import("@/views/config/keyword"),
        name: "keyword",
        meta: {
          perms: [
            "GET /admin/keyword/list",
            "POST /admin/keyword/create",
            "GET /admin/keyword/read",
            "POST /admin/keyword/update",
            "POST /admin/keyword/delete"
          ],
          title: "搜索关键词",
          noCache: true,
          icon: "product-attr"
        }
      },
      {
        path: "mtBrushPerson",
        component: () => import("@/views/config/mtBrushPerson"),
        name: "mtBrushPerson",
        meta: {
          perms: [
            "GET /admin/orderBrushPerson/getPageList",
            "POST /admin/orderBrushPerson/add",
            "POST /admin/orderBrushPerson/update",

          ],
          title: "美团刷单人员",
          noCache: true,
          icon: "form"
        }
      },
      {
        path: "mtShopPerson",
        component: () => import("@/views/config/mtShopPerson"),
        name: "mtShopPerson",
        meta: {
          perms: [
            "POST /admin/mtShopPerson/getMtShopPerson",
          ],
          title: "美团服务人员",
          noCache: true,
          icon: "form"
        }
      },
    ]
  },

  {
    path: "/stat",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "statManage",
    meta: {
      title: "统计报表",
      icon: "dashboard"
    },
    children: [
      {
        path: "user",
        component: () => import("@/views/stat/user"),
        name: "statUser",
        meta: {
          perms: ["GET /admin/stat/user"],
          title: "用户统计",
          noCache: true
        }
      },
      {
        path: "order",
        component: () => import("@/views/stat/order"),
        name: "statOrder",
        meta: {
          perms: ["GET /admin/stat/order"],
          title: "订单统计",
          noCache: true
        }
      },
      {
        path: "goods",
        component: () => import("@/views/stat/goods"),
        name: "statGoods",
        meta: {
          perms: ["GET /admin/stat/goods"],
          title: "商品统计",
          noCache: true
        }
      },
      {
        path: "serviceGmv",
        component: () => import("@/views/stat/serviceGmv"),
        name: "serviceGmv",
        meta: {
          perms: ["GET /admin/stat/gmvlist"],
          title: "销售GMV",
          noCache: true
        }
      },
      {
        path: "changeAnalyse",
        component: () => import("@/views/stat/changeAnalyse"),
        name: "changeAnalyse",
        meta: {
          perms: [
            "GET /admin/report/changeReport",
            "GET /admin/report/changeReportExport"
          ],
          title: "转化分析报表",
          noCache: true
        }
      }
    ]
  },
  {
    path: "/sys",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    name: "sysManage",
    meta: {
      title: "系统管理",
      icon: "ums"
    },
    children: [
      {
        path: "admin",
        component: () => import("@/views/sys/admin"),
        name: "admin",
        meta: {
          perms: [
            "GET /admin/admin/list",
            "POST /admin/admin/create",
            "POST /admin/admin/update",
            "POST /admin/admin/delete"
          ],
          title: "管理员",
          noCache: true,
          icon: "ums-admin"
        }
      },
      {
        path: "butler",
        component: () => import("@/views/sys/butler"),
        name: "admin",
        meta: {
          perms: ["GET /admin/sysbutler/butlerlist"],
          title: "管家信息",
          noCache: true,
          icon: "ums-admin"
        }
      },
      {
        path: "notice",
        component: () => import("@/views/sys/notice"),
        name: "sysNotice",
        meta: {
          perms: [
            "GET /admin/notice/list",
            "POST /admin/notice/create",
            "POST /admin/notice/update",
            "POST /admin/notice/delete"
          ],
          title: "通知管理",
          noCache: true,
          icon: "message"
        }
      },
      {
        path: "log",
        component: () => import("@/views/sys/log"),
        name: "log",
        meta: {
          perms: ["GET /admin/log/list"],
          title: "操作日志",
          noCache: true,
          icon: "icon"
        }
      },
      {
        path: "role",
        component: () => import("@/views/sys/role"),
        name: "role",
        meta: {
          perms: [
            "GET /admin/role/list",
            "POST /admin/role/create",
            "POST /admin/role/update",
            "POST /admin/role/delete",
            "GET /admin/role/permissions",
            "POST /admin/role/permissions"
          ],
          title: "角色管理",
          noCache: true,
          icon: "ums-menu"
        }
      },
      {
        path: "os",
        component: () => import("@/views/sys/os"),
        name: "os",
        meta: {
          perms: [
            "GET /admin/storage/list",
            "POST /admin/storage/create",
            "POST /admin/storage/update",
            "POST /admin/storage/delete"
          ],
          title: "对象存储",
          noCache: true,
          icon: "documentation"
        }
      }
    ]
  },
  {
    path: "/profile",
    component: Layout,
    redirect: "noredirect",
    alwaysShow: true,
    children: [
      {
        path: "password",
        component: () => import("@/views/profile/password"),
        name: "password",
        meta: { title: "修改密码", noCache: true }
      },
      {
        path: "notice",
        component: () => import("@/views/profile/notice"),
        name: "notice",
        meta: { title: "通知中心", noCache: true }
      }
    ],
    hidden: true
  },

  // { path: "*", redirect: "/404", hidden: true }
];


export const asyncRouterMap = [];
export default new Router({
  base: window.__POWERED_BY_QIANKUN__ ? '/jzmall' : '/',
  mode: 'history',  //去掉url中的#
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
});
