beforeSale.js 2.92 KB
import { http, http_brand } 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_brand({
    url: 'rop-scrm-carlife/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

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

const getCarSeriesListApi = params => {
  params.method = 'scrm.api.carlife.common.getCarSeriesList'
  return http_brand({
    url: 'rop-scrm-carlife/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const getCarTypeListApi = params => {
  params.method = 'scrm.api.carlife.common.getCarTypeList'
  return http_brand({
    url: 'rop-scrm-carlife/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

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

const updateHotlineApi = params => {
  params.method = `${defaultPath}merchant.hotline.update`
  return http({
    url: 'rop-scrm-equity/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 getEquityApi = params => {
  params.method = `${orderPath}detail`
  return http({
    url: 'rop-scrm-equity/router',
    method: 'POST',
    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, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, updateHotlineApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi }