adWeChat.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. import useFetch from '@/Hook/useFetch'
  2. import { launchApi, api } from '../api'
  3. import { request } from 'umi';
  4. /**查询号 */
  5. export async function getAccApi() {
  6. return request(`${api}/adlaunch/wechatInfo/listAllWechatInfo`, {
  7. method: 'GET'
  8. })
  9. }
  10. /**获取定向包 */
  11. export interface OrientProps {
  12. pageNum: number,
  13. pageSize: number,
  14. serviceName: string, // 服务商
  15. wechatName: string, // 公众号
  16. humanPackageName?: string // 人群包名称
  17. }
  18. export async function getOrientApi(params: OrientProps) {
  19. return request(`${api}/adlaunch/humanInfo/list`, {
  20. method: 'POST',
  21. data: params
  22. })
  23. }
  24. /** 推广页 */
  25. export async function setPromotionPageAjax(params: { userId: string | number, name: string, typesetting: string }) {
  26. return request(`${api}/adlaunch/layoutTypesetting`, {
  27. method: 'POST',
  28. data: params
  29. })
  30. }
  31. /**查询落地页 */
  32. export async function getLayoutLocalApi(params: { pageNum: number, pageSize: number, name?: string | undefined, updateStartDate?: string | undefined, updateEndDate?: string | undefined }) {
  33. return request(`${api}/adlaunch/layoutTypesetting/list`, {
  34. method: 'POST',
  35. data: params
  36. })
  37. }
  38. /** 删除落地页 */
  39. export async function delLayoutLocalApi(params: { userId: string | number, name: string }) {
  40. return request(`${api}/adlaunch/layoutTypesetting/remove`, {
  41. method: 'POST',
  42. data: params
  43. })
  44. }
  45. /** 删除计划 */
  46. export async function delAdPlanLocalApi(params: { objectName: string, serviceName: string, wechatName: string }) {
  47. return request(`${api}/adlaunch/actionRecord/remove`, {
  48. method: 'POST',
  49. data: params
  50. })
  51. }
  52. /** 获取计划列表 */
  53. export interface PlanProps {
  54. pageNum: number,
  55. pageSize: number,
  56. serviceName?: string | undefined, // 服务商
  57. status?: string | undefined, // 状态
  58. planName?: string | undefined, // 计划名称
  59. wechatName?: string | undefined, // 广告主名称
  60. taskName?: string | undefined, // 任务名称
  61. startData?: string | undefined, // 创建开始时间
  62. endData?: string | undefined // 创建截止时间
  63. }
  64. export async function getPlanActionRecordApi(params: PlanProps) {
  65. return request(`${api}/adlaunch/actionRecord/listPlan`, {
  66. method: 'POST',
  67. data: params
  68. })
  69. }
  70. /**创建计划*/
  71. export async function createAd(params: { planList: any[], userId: string }) {
  72. return request(`${api}/adlaunch/actionRecord/createAdPlan`, {
  73. method: 'POST',
  74. data: params
  75. })
  76. }
  77. /** 获取服务商 */
  78. export async function getAdWechatServiceNameApi() {
  79. return request(`${api}/adlaunch/wechatInfo/getAllServiceName`, {
  80. method: 'GET'
  81. })
  82. }
  83. /** 获取广告主名称 */
  84. export async function getAdWechatWechatNameApi(params: { serviceName: string }) {
  85. return request(`${api}/adlaunch/wechatInfo/getAllWechat/${params?.serviceName}`, {
  86. method: 'GET'
  87. })
  88. }
  89. /** 获取任务列表 */
  90. export interface TaskProps {
  91. serviceName?: string | undefined,
  92. // status?: string | undefined,
  93. createTime?: string | undefined,
  94. taskName?: string | undefined,
  95. wechatName?: string | undefined,
  96. objectName?: string | undefined,
  97. local?: string | undefined,
  98. channel?: string | undefined,
  99. pageNum: number,
  100. pageSize: number
  101. }
  102. export async function getTaskListApi(params: TaskProps) {
  103. return request(`${api}/adlaunch/actionRecord/list`, {
  104. method: 'POST',
  105. data: params
  106. })
  107. }
  108. /** 刷新 */
  109. export async function refreshDataApi(params: { userId: number, is_refresh: string }) {
  110. return request(`${api}/adlaunch/wechatInfo/refresh/${params?.userId}/${params?.is_refresh}`, {
  111. method: 'GET'
  112. })
  113. }
  114. /** 扫码回调 */
  115. export async function getScanStatusApi() {
  116. return request(`${api}/adlaunch/wechatCookie/getScanStatus`, {
  117. method: 'GET'
  118. })
  119. }
  120. /**个人概览 */
  121. // export async function overview(params: Params) {
  122. // return useFetch({ url: '/data/pitcher_panel/overview', params, method: 'POST' })
  123. // }
  124. /**MP收藏*/
  125. export async function adqCollect(parmas: { accountId: any, collect: any }) {
  126. return request(`${api}/ads/adsChannelAccount/collect/adq/${parmas.accountId}/${parmas.collect}`, {
  127. method: 'POST'
  128. })
  129. }
  130. /**ADQ收藏*/
  131. export async function mpCollect(parmas: { accountId: any, collect: any }) {
  132. return request(`${api}/ads/adsChannelAccount/collect/mp/${parmas.accountId}/${parmas.collect}`, {
  133. method: 'POST'
  134. })
  135. }