// const baseUrl = '/api-v2'
const baseUrl = '/api'
const wechat = '/wechat/:org'
const guest = '/guest/:org'
const common = '/common/:org'

const $api = {
  file: {
    image: { // 图片上传
      method: 'post',
      url: `${baseUrl}${common}/file`
    },
    base64: {
      method: 'post',
      url: `${baseUrl}${common}/file/base64`
    }
  },
  index: { // 首页
    location: { // 获取5A
      method: 'get',
      url: `${baseUrl}${guest}/cms/location`
    },
    banner: { // 获取轮播图
      method: 'get',
      url: `${baseUrl}${guest}/cms/img`
    },
    message: { // 获取最新消息
      method: 'get',
      url: `${baseUrl}${guest}/cms/info`
    },
    project: { // 获取项目专题
      method: 'get',
      url: `${baseUrl}${guest}/cms/case`
    },
    cms: { // 获取cms消息
      method: 'get',
      url: `${baseUrl}${guest}/cms/news`
    },
    getFiveAList: { // 获取5A列表
      method: 'get',
      url: `${baseUrl}${guest}/cms/course`
    },
    locationDetails: {
      method: 'get',
      url: `${baseUrl}${guest}/cms/location/detail`
    },
    getCourseList: { // 获取附近课程
      method: 'get',
      url: `${baseUrl}${guest}/course`
    }
  },
  caseForCoffee: {
    getCaseTableList: { // 获取案场桌位列表
      method: 'get',
      url: `${baseUrl}${guest}/cms/area`
    },
    getGoodsTypeList: { // 获取商品分类列表
      method: 'get',
      url: `${baseUrl}${guest}/type/goods`
    },
    getGoodsList: { // 获取商品列表
      method: 'get',
      url: `${baseUrl}${guest}/goods`
    },
    placeGoodsOrderBefore: { // 商品预下单
      method: 'post',
      url: `${baseUrl}${wechat}/order/goods`
    },
    placeGoodsOrder: { // 商品下单
      method: 'put',
      url: `${baseUrl}${wechat}/order/goods/:id`
    },
    getCouponList: { // 获取优惠券列表
      method: 'get',
      url: `${baseUrl}${wechat}/customer/coupon`
    },
    getCouponInfo: { // 获取优惠券详情
      method: 'get',
      url: `${baseUrl}${wechat}/customer/coupon/:id`
    },
  },
  majorProjects: { // 项目专题
    getCourseList: { // 获取课程列表
      method: 'get',
      url: `${baseUrl}${guest}/cms/case/:id`
    },
    getCourseDetail: { // 获取课程详情
      method: 'get',
      url: `${baseUrl}${guest}/course/:id`
    },
    placeCourseOrderBefore: { // 课程预下单
      method: 'post',
      url: `${baseUrl}${wechat}/order/course`
    },
    placeCourseOrder: { // 课程下单
      method: 'put',
      url: `${baseUrl}${wechat}/order/course/:id`
    },
  },
  card: {
    myCustomer: { // 我的客户
      method: 'get',
      url: `${baseUrl}${wechat}/customer/user`
    },
    getCardList: { // 我的体验卡列表
      method: 'get',
      url: `${baseUrl}${wechat}/customer/card`
    },
    getCardInfo: { // 我的体验卡详情
      method: 'get',
      url: `${baseUrl}${wechat}/customer/card/:id`
    },
  },
  user: {
    info: { // 获取用户信息
      method: 'get',
      url: `${baseUrl}${wechat}/customer`
    },
    case: { // 获取案场及销售列表
      method: 'get',
      url: `${baseUrl}${guest}/case`
    },
    wxsignup: { // 绑定手机号
      method: 'post',
      url: `${baseUrl}${guest}/wxsignup`
    },
    captcha: { // 获取手机验证码
      method: 'get',
      url: `${baseUrl}${guest}/captcha`
    },
    recommendCode: { // 验证推荐码
      method: 'get',
      url: `${baseUrl}${guest}/customerremark/:recommendCode`
    },
    getCaseList: { // 获取案场信息
      method: 'get',
      url: `${baseUrl}${guest}/case`
    },
    getCourseOrderList: { // 获取我的课程订单信息
      method: 'get',
      url: `${baseUrl}${wechat}/course/user`
    },
    getCourseLoactionList: { // 获取课程类型列表
      method: 'get',
      url: `${baseUrl}${guest}/cms/location`
    },
    getCourseOrderDetail: { // 获取课程订单详情
      method: 'get',
      url: `${baseUrl}${wechat}/course/user/:id`
    },
    gymCard: { // 获取健身卡列表
      method: 'get',
      url: `${baseUrl}${wechat}/gymcard`
    },
    gymCardDetail: { // 获取健身卡详情
      method: 'get',
      url: `${baseUrl}${wechat}/gymcard/:customerGymId`
    },
    getNum: { // 获取卡券数
      method: 'get',
      url: `${baseUrl}${wechat}/customer/info`
    },
    getVip: { // vip卡详情
      method: 'get',
      url: `${baseUrl}${wechat}/vip`
    },
    code: { // 获取我的推荐码
      method: 'get',
      url: `${baseUrl}${wechat}/user/code`
    }
  },
  director: {
    getSales: { // 获取销售列表
      method: 'get',
      url: `${baseUrl}${wechat}/user/:type`
    },
    getForbidList: { // 获取禁用列表
      method: 'get',
      url: `${baseUrl}${wechat}/user/forbid`
    },
    putForbidOpen: { // 打开禁用状态
      method: 'post',
      url: `${baseUrl}${wechat}/user/forbid/:userid/:type`
    },
    putForbid: { // 关闭禁用状态
      method: 'put',
      url: `${baseUrl}${wechat}/user/forbid/:userid/:type`
    },
    getSalesCardList: { // 获取销售发卡详情
      method: 'get',
      url: `${baseUrl}${wechat}/user/detail/:id`
    },
    getCardNum: {
      method: 'get',
      url: `${baseUrl}${wechat}/card/detail/:id`
    },
    getCouponNum: {
      method: 'get',
      url: `${baseUrl}${wechat}/coupon/detail/:id`
    },
  },
  sales: {
    getCardList: { // 获取我的卡列表
      method: 'get',
      url: `${baseUrl}${wechat}/card`
    },
    getCouponList: { // 获取我的券列表
      method: 'get',
      url: `${baseUrl}${wechat}/coupon`
    },
    getForbidInfo: { // 获取用户禁用信息
      method: 'get',
      url: `${baseUrl}${wechat}/user/forbid`
    },
    getCustomerList: { // 获取客户列表
      method: 'get',
      url: `${baseUrl}${wechat}/customer/user`
    },
    getCustomerCardList: { // 获取我的用户领取卡信息
      method: 'get',
      url: `${baseUrl}${wechat}/customer/sales/card/:id`
    },
    getCustomerCouponList: { // 获取我的用户领取券信息
      method: 'get',
      url: `${baseUrl}${wechat}/customer/sales/coupon/:id`
    },
  },
  login: { // 主管、销售端登陆
    login: {
      method: 'post',
      url: `${baseUrl}${guest}/wxsignin`
    }
  },
  case: {
    total: {
      method: 'get',
      url: `${baseUrl}${wechat}/goods/case/:caseid`
    },
    conf: {
      method: 'get',
      url: `${baseUrl}${wechat}/case/conf/:caseid`
    },
  },
  goods: {
    getCustOrders: {
      method: 'get',
      url: `${baseUrl}${wechat}/goods/user`
    }
  },
  share: {
    share: {
      method: 'get',
      url: `${baseUrl}${guest}/wechat/jssdk/signature`
    },
    card: {
      method: 'get',
      url: `${baseUrl}${wechat}/card/:id`
    },
    coupon: {
      method: 'get',
      url: `${baseUrl}${wechat}/coupon/:id`
    },
    setCard: {
      method: 'post',
      url: `${baseUrl}${wechat}/card/:id`
    },
    setCoupon: {
      method: 'post',
      url: `${baseUrl}${wechat}/coupon/:id`
    },
    setChannelCard: {
      method: 'post',
      url: `${baseUrl}${wechat}/channel/card/:id`
    },
    setChannelCoupon: {
      method: 'post',
      url: `${baseUrl}${wechat}/channel/coupon/:id`
    }
  },
  bodyCheck: {
    bodyCheck: {
      method: 'get',
      url: `${baseUrl}${wechat}/GetCheckByUser`
    }
  },
  remark: {
    setRemark: {
      method: 'post',
      url: `${baseUrl}${wechat}/customerremark`
    },
    getRemark: {
      method: 'get',
      url: `${baseUrl}${wechat}/customerremark/:salesId/:customerId`
    }
  },
  rush: {
    setRush: {
      method: 'post',
      url: `${baseUrl}${wechat}/flashbuy/:id`
    },
    getRush: {
      method: 'get',
      url: `${baseUrl}${wechat}/flashbuy/flash/:flashBuyId`
    },
    IsNewCustomer: { // 是否为新用户
      method: 'get',
      url: `${baseUrl}${wechat}/flashbuy/newcustomer`
    },
    AddNewFlashBuyCustomer: {
      method: 'post',
      url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
    },
    UpdateFlashBuyCustomer: {
      method: 'put',
      url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
    }
  },
  calendar: {
    calendar: {
      method: 'post',
      url: `${baseUrl}${wechat}/calendar`
    },
    getCalendarList: {
      method: 'get',
      url: `${baseUrl}${wechat}/calendar`
    },
    getCalendarDetail: {
      method: 'get',
      url: `${baseUrl}${wechat}/calendar/:calendarId`
    },
    getCalendarCustomer: {
      method: 'get',
      url: `${baseUrl}${wechat}/calendar/isattend/customer`
    }
  },
  library: {
    getNavList: { // 获取图书馆nav
      method: 'get',
      url: `${baseUrl}${wechat}/booktype/:caseid`
    },
    getRecommendBookList: { // 获取精选推荐书籍列表
      method: 'get',
      url: `${baseUrl}${wechat}/book/recommend/:caseid`
    },
    getBookList: { // 获取书籍列表
      method: 'get',
      url: `${baseUrl}${wechat}/book`
    },
    getMineRecord: {
      method: 'get',
      url: `${baseUrl}${wechat}/customer/book`
    },
    reserve: {
      method: 'post',
      url: `${baseUrl}${wechat}/book/reserve/:bookid`
    },
  }
}
export default $api
