pack.js 2.94 KB
Newer Older
lxyang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
import request from '@/utils/request'

/**
 * 人群客户管理-用户列表
 */
export function getPackList(data) {
  return request({
    url: '/tools/ads_dmp/customer/search',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-获取客户下拉列表
 */
export function getPackOption({
  ...data
}) {
  return request({
    url: '/tools/ads_dmp/customer/add/select',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-确认添加
 */
export function addCustomer(data) {
  return request({
    url: '/tools/ads_dmp/customer/add',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-配置
 */
export function updateCustomer(data) {
  return request({
    url: '/tools/ads_dmp/customer/config',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-配置-详情
 */
export function getCustomerInfo({
  ...data
}) {
  return request({
    url: '/tools/ads_dmp/customer/config/get',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-充值
 */
export function rechargeCustomer(data) {
  return request({
    url: '/tools/ads_dmp/customer/recharge',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-充值-明细
 */
export function getRechargeDetail({
  ...data
}) {
  return request({
    url: '/tools/ads_dmp/customer/amount_journal/search',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-人群客户投放账号添加接口
 */
export const addMedia = ({
  ...data
}) => {
  return request({
    url: '/user/yun_jing/customer/media_account/add',
    method: 'POST',
    data
  })
}
/**
 * 人群客户管理-模板下载
 */
export const Downloads = () => {
  return request({
      method: 'POST',
      url: '/user/yun_jing/customer/media_account/template/download',
      responseType: 'arraybuffer',
      data: {}
  })
}
/**
 * 人群客户管理-列表
 */
export const getLists = (data) => {
  return request({
      method: 'POST',
      url: '/user/yun_jing/customer/media_account/search',
      data
  })
}
/**
 * 人群客户管理-修改
 */
export const updateMedia = (data) => {
  return request({
      method: 'POST',
      url: '/user/yun_jing/customer/media_account/edit',
      data
  })
}
/**
 * 人群客户管理-删除
 */
export const deleteMedia = (data) => {
  return request({
      method: 'POST',
      url: '/user/dmp/media_account/delete',
      data
  })
}
/**
 * 人群客户管理-上传
 */
export const trackUpload = (formData) => {
  return request({
    method: 'POST',
    url: '/user/yun_jing/customer/media_account/template/upload',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
}
// 二进制流下载
export const hackDownloadFile = (data, filename) => {
  if (!data) {
    return
	}
  let url = window.URL.createObjectURL(new Blob([data]))
  let link = document.createElement('a')
  link.style.display = 'none'
  link.href = url
  link.setAttribute('download', filename || `模板.xls`)
  document.body.appendChild(link)
  link.click()
}