mineApi.js 5.27 KB
import api from '~/utils/request/request'
const path = 'scrm.api.shopmall.weapp.'
const carlife = 'scrm.api.carlife.weapp.'
const carlifeApi = {
  /** 获取车品牌列表 */
  getCarBrandList() {
    return api.post({
      method: 'scrm.api.carlife.common.getOnlyCarBrandList'
    })
  },
  /** 获取车系列表 */
  getCarSeriesList(data) {
    return api.post({
      method: 'scrm.api.carlife.common.getCarSeriesList',
      ...data
    })
  },
  /** 获取车型 */
  getCarTypeList(carSeriesId) {
    return api.post({
      method: 'scrm.api.carlife.common.getCarTypeList',
      carSeriesId
    })
  },
  /** 获取当前用户的车辆列表 */
  getUserCarList(data) {
    return api.post({
        method: `${carlife}userCar.list`,
        ...data
      },
      true
    )
  },
  /**新增用户车辆 */
  addUserCar(data) {
    return api.post({
      method: `${carlife}userCar.add`,
      ...data
    })
  },
  /** 更新用户车辆 */
  updateUserCar(data) {
    return api.post({
      method: `${carlife}userCar.update`,
      ...data
    })
  },
  /** 获取用户车辆 */
  getUserCar(carId) {
    return api.post({
      method: `${carlife}userCar.getById`,
      carId
    })
  },
  /**删除用户车辆 */
  delUserCar(carId) {
    return api.post({
      method: `${carlife}userCar.delete`,
      carId
    })
  },
  /**获取当前用户的收货地址列表 */
  getUserAddressList(data) {
    return api.post({
      method: `${carlife}userAddress.list`,
      ...data
    })
  },
  /**根据ID获取用户收货地址 */
  getUserAddress(data) {
    return api.post({
      method: `${carlife}userAddress.getById`,
      ...data
    })
  },
  /** 新增用户收货地址 */
  addUserAddress(data) {
    return api.post({
      method: `${carlife}userAddress.add`,
      ...data
    })
  },
  /**编辑用户收货地址  */
  updateUserAddress(data) {
    return api.post({
      method: `${carlife}userAddress.update`,
      ...data
    })
  },
  /** 更改为默认收货地址 */
  setUserAddressDefault(data) {
    return api.post({
      method: `${carlife}userAddress.updateDefault`,
      ...data
    })
  },
  /** 删除用户收货地址 */
  delUserAddress(data) {
    return api.post({
      method: `${carlife}userAddress.delete`,
      ...data
    })
  },
  /** 获取用户默认收货地址 */
  getUserAddressDefault() {
    return api.post({
        method: `${carlife}userAddress.getDefault`
      },
      true
    )
  },
  /** 获取智享车生活APP二维码图片地址 */
  getAppQrcode() {
    return api.post({
      method: `${carlife}config.getAppQrcode`
    })
  },
  /** 预约历史 */
  getAppointmentList(pageNum) {
    return api.post({
      method: 'scrm.api.carlife.cgacar.commom.list.appointment',
      pageNum
    })
  }
}
module.exports = {
  ...carlifeApi,
  /**获取集团或者门店详细信息  */
  getMerchantDetail(data) {
    return api.post({
      method: 'scrm.api.carlife.merchant.detail',
      ...data
    })
  },
  /**. 分页查询订单 */
  getOrderList(data) {
    return api.post({
      method: `${path}order.page`,
      pageSize: 99999,
      ...data
    })
  },
  /** 获取用户卷列表 */
  getUserCouponList() {
    return api.post({
      method: 'scrm.api.coupon.user.list',
      discountTypes: [3, 7]
    })
  },
  /** 广汇车辆列表接口 */
  getGHUserCarList() {
    return api.post({
        method: 'scrm.api.carlife.cgacar.commom.list.veh'
      },
      true
    )
  },
  /** 广汇客户车辆绑定接口 */
  bindGHVehicle(data) {
    return api.post({
        method: 'scrm.api.carlife.cgacar.commom.vehicle.bind',
        ...data
      },
      true
    )
  },
  /** 获取广汇用户信息 */
  getGHUserInfo() {
    return api.post({
        method: 'scrm.api.carlife.cgacar.commom.user.info.get'
      },
      true
    )
  },

  /** 获取当前用户顾问配置 */
  getConsultantInfo(data) {
    return api.post({
        method: 'scrm.api.carlife.config.consultant.get',
        ...data
      },
      true
    )
  },

  /** 获取顾问列表*/
  getConsultantList(data) {
    return api.post({
        method: 'scrm.api.carlife.config.consultant.list',
        ...data
      },
      true
    )
  },
  // 服务顾问配置更新
  updateConsultant(data) {
    return api.post({
      method: 'scrm.api.carlife.config.consultant.update',
      ...data
    })
  },
  /** 嘀加通用版新增维保预约线索 */
  createMaintainOrder(data) {
    return api.post({
      method: 'scrm.api.carlife.weapp.clue.maintain',
      ...data
    })
  },
  // 获取订单状态数量
  getOrderNumberList(data) {
    return api.post({
      method: 'scrm.api.shopmall.weapp.order.statis',
      ...data
    })
  },
  // 查询用户是否存在待领取的国壬积分
  searchUserForGR(data) {
    return api.post({
      method: 'scrm.api.shopmall.weapp.gr.integral.search',
      ...data
    })
  },
  // 领取国任积分
  getUserForGR(data) {
    return api.post({
      method: 'scrm.api.shopmall.weapp.gr.integral.get',
      ...data
    })
  },

  /** 获取门店主营车品牌 */
  getMerchantCarBrandList(merchantIdList) {
    return api.post({
      method: 'merchants.api.open.merchant.info',
      projectName: 'rop-merchants',
      merchantIdList,
      merchantInfoSwitch: {
        brandFlag: true
      }
    }, false, false, 'merchant')
  }
}