api.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import request from '@/helpers/request';
  2. export const type_OrderTypes: { [_: string]: string } = {
  3. VIP: '数字化乐器AI学练工具',
  4. SCHOOL_REGISTER: '学生报名'
  5. };
  6. export const type_OrderStatus: { [_: string]: string } = {
  7. WAIT_PAY: '待支付',
  8. PAYING: '支付中',
  9. PAID: '已付款',
  10. TIMEOUT: '订单超时',
  11. FAIL: '支付失败',
  12. CLOSED: '已关闭',
  13. REFUNDED: '已退款'
  14. };
  15. export interface IApiUserPaymentOrderPage {
  16. /** 订单状态,可用值:WAIT_PAY,PAYING,PAID,TIMEOUT,FAIL,CLOSED,REFUNDED */
  17. orderStatus:
  18. | 'WAIT_PAY'
  19. | 'PAYING'
  20. | 'PAID'
  21. | 'TIMEOUT'
  22. | 'FAIL'
  23. | 'CLOSED'
  24. | 'REFUNDED';
  25. /** 分页行数 */
  26. rows: number;
  27. /** 当前页 */
  28. page: number;
  29. /** 订单年份, 类似: 2023-06 */
  30. // payMonth: string;
  31. startTime: string;
  32. endTime: string;
  33. }
  34. /** 获取开通列表 */
  35. export const api_userPaymentOrderPage = (
  36. params: IApiUserPaymentOrderPage
  37. ): Promise<any> => {
  38. return request.post('/edu-app/userPaymentOrder/studentOrderPage', {
  39. data: params
  40. });
  41. };
  42. /** 获取退款列表 */
  43. export const api_userPaymentOrderStudentRefundOrderPage = (
  44. params: any
  45. ): Promise<any> => {
  46. return request.post('/edu-app/userPaymentOrder/studentRefundOrderPage', {
  47. data: params
  48. });
  49. };
  50. /** 获取订单详情 */
  51. export const api_userPaymentOrderDetail = (params: any): Promise<any> => {
  52. return request.get(`/edu-app/userPaymentOrder/detail/${params}`);
  53. };
  54. /** 获取退款订单详情 */
  55. export const api_userPaymentOrderRefundDetail = (params: any): Promise<any> => {
  56. return request.get(`/edu-app/userPaymentOrder/refundDetail/${params}`);
  57. };
  58. /** 取消订单退款 */
  59. export const api_userPaymentOrderCancelRefund = (params: any): Promise<any> => {
  60. return request.post(`/edu-app/userPaymentOrder/cancelRefund/${params}`);
  61. };
  62. /** 申请退款 */
  63. export const api_userPaymentOrderRefundPayment = (
  64. params: any
  65. ): Promise<any> => {
  66. return request.post('/edu-app/userPaymentOrder/refundPayment', {
  67. data: params
  68. });
  69. };
  70. /** 继续支付订单 */
  71. export const api_userPaymentOrderUnpaid = (params: any): Promise<any> => {
  72. return request.get('/edu-app/userPaymentOrder/unpaid', {
  73. params
  74. });
  75. };
  76. /** 取消订单 */
  77. export const api_userPaymentOrderCancelPayment = (
  78. params: any
  79. ): Promise<any> => {
  80. return request.post('/edu-app/userPaymentOrder/cancelPayment/' + params);
  81. };