jd.ts 3.4 KB

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