beforeSale.js 1.75 KB
import { http } from '@/main'

const defaultPath = 'scrm.api.equity.service.package.'
const orderPath = 'scrm.api.equity.service.order.'

const getListApi = params => {
  params.method = `${defaultPath}order.list.get`
  return http({
    url: 'rop-scrm-equity/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const getExportApi = params => {
  params.method = `${defaultPath}order.export.get`
  return http({
    url: 'rop-scrm-equity/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const getCarBrandListApi = params => {
  // params.method = 'dj.api.car.series.list'
  params.method = 'scrm.api.carlife.common.getCarBrandList'
  return http({
    url: 'rop-scrm-carlife/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const updateHotlineApi = params => {
  params.method = `${defaultPath}merchant.hotline.update`
  return http({
    url: 'rop-scrm-shopmall/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

// 获取无忧卡套餐列表
const getPackageListApi = params => {
  params.method = `${defaultPath}list.get`
  return http({
    url: 'rop-scrm-equity/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const updateEquityApi = params => {
  params.method = `${orderPath}insert.or.update`
  return http({
    url: 'rop-scrm-equity/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

// 获取合同号
const createCodeApi = params => {
  params.method = `${orderPath}code.create`
  return http({
    url: 'rop-scrm-equity/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

export default { getListApi, getExportApi, getCarBrandListApi, updateHotlineApi, getPackageListApi, updateEquityApi, createCodeApi }