jd.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import axios from 'axios';
  2. import type { ListRes, FormRes } from './base';
  3. export interface UpdateCookieModel {
  4. cookie: string;
  5. union_cookies: string;
  6. user_agent: string;
  7. h5st: string;
  8. }
  9. export function updateCookies(data: UpdateCookieModel) {
  10. return axios.post<FormRes>('/api/JdUnion/updateCookies', data);
  11. }
  12. // list
  13. export interface JdPoolRecord {
  14. id: number;
  15. pin: string;
  16. name: string;
  17. company: string;
  18. phone: string;
  19. create_time: Date;
  20. daily_income_limit: number;
  21. current_amt: number;
  22. daily_calls_limit: number;
  23. current_hourly_calls: number;
  24. hourly_calls_limit: number;
  25. current_daily_calls: number;
  26. draw_balance: number;
  27. description: string;
  28. floorId: string;
  29. last_time: Date;
  30. login_time: Date;
  31. refpid: string;
  32. status: boolean;
  33. work_mode: boolean;
  34. end_point: string;
  35. nodeName: string;
  36. enable_parse: boolean;
  37. enable_coupon: boolean;
  38. enable_sync_report: boolean;
  39. enable_sync_order: boolean;
  40. site_id: number;
  41. unionid: string;
  42. app_key: string;
  43. app_secret: string;
  44. user_agent: string;
  45. cookies: string;
  46. union_cookies: string;
  47. time_range: number;
  48. }
  49. export interface JdPoolParams extends Partial<JdPoolRecord> {
  50. current: number;
  51. pageSize: number;
  52. show_hide: boolean;
  53. sort?: string;
  54. order?: string;
  55. getTotal: boolean;
  56. }
  57. export interface JdPoolRes extends ListRes {
  58. list: JdPoolRecord[];
  59. }
  60. export function queryJdPool(data: JdPoolParams) {
  61. return axios.post<JdPoolRes>('/api/JdUnion/list', data);
  62. }
  63. export interface JdSettleBillRecord {
  64. id: number;
  65. accountName: string;
  66. report_date: Date;
  67. create_time: Date;
  68. last_time: Date;
  69. clickNum: number;
  70. cosFee: number;
  71. cosPrice: number;
  72. finishCosFee: number;
  73. finishCosPrice: number;
  74. finishOrderNum: number;
  75. orderNum: number;
  76. }
  77. export interface JdSettleBillsParams extends Partial<JdSettleBillRecord> {
  78. keyword?: string;
  79. query_date?: string[]; // 覆盖 report_date 的类型为字符串数组
  80. current: number;
  81. pageSize: number;
  82. sort?: string;
  83. order?: string;
  84. }
  85. export interface JdSettleBillsRes extends ListRes {
  86. list: JdSettleBillRecord[];
  87. }
  88. export function queryJdSettleBillsTotal(data: JdSettleBillsParams) {
  89. return axios.post<JdSettleBillsRes>(
  90. '/api/JdUnion/settle_bills_total',
  91. data
  92. );
  93. }
  94. export function queryJdSettleBills(data: JdSettleBillsParams) {
  95. return axios.post<JdSettleBillsRes>('/api/JdUnion/settle_bills', data);
  96. }
  97. export interface JdEstimateCommRecord {
  98. id: number;
  99. accountName: string;
  100. report_date: Date;
  101. create_time: Date;
  102. last_time: Date;
  103. cosFee: number;
  104. status: number;
  105. feeType: number;
  106. feeTypeStr: string;
  107. platform: number;
  108. platformStr: string;
  109. unionType: number;
  110. unionTypeStr: string;
  111. }
  112. export interface JdEstimateCommParams extends Partial<JdEstimateCommRecord> {
  113. keyword?: string;
  114. query_date?: string[]; // 覆盖 report_date 的类型为字符串数组
  115. current: number;
  116. pageSize: number;
  117. sort?: string;
  118. order?: string;
  119. }
  120. export interface JdEstimateCommRes extends ListRes {
  121. list: JdEstimateCommRecord[];
  122. }
  123. export function queryJdEstimateCommTotal(data: JdEstimateCommParams) {
  124. return axios.post<JdEstimateCommRes>(
  125. '/api/JdUnion/estimate_comm_total',
  126. data
  127. );
  128. }
  129. export function queryJdEstimateComm(data: JdEstimateCommParams) {
  130. return axios.post<JdEstimateCommRes>('/api/JdUnion/estimate_comm', data);
  131. }