pay.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import request from '@/utils/request/req';
  2. export interface OrderReq {
  3. money:string; // 商品价格
  4. name:string; //商品名称
  5. }
  6. export interface VoucherVO {
  7. /**
  8. * 主键
  9. */
  10. id: string | number;
  11. /**
  12. * 用户id
  13. */
  14. userId: string | number;
  15. /**
  16. * 兑换码
  17. */
  18. code: string;
  19. /**
  20. * 兑换金额
  21. */
  22. amount: number;
  23. /**
  24. * 兑换状态
  25. */
  26. status: string;
  27. /**
  28. * 兑换前余额
  29. */
  30. balanceBefore: number;
  31. /**
  32. * 兑换后余额
  33. */
  34. balanceAfter: number;
  35. /**
  36. * 备注
  37. */
  38. remark: string;
  39. }
  40. export function payUrl(params:OrderReq) {
  41. return request({
  42. url: '/pay/payUrl',
  43. method: 'post',
  44. data: params,
  45. })
  46. }
  47. export function getSPayUrl(params:OrderReq) {
  48. return request({
  49. url: '/pay/stripePay',
  50. method: 'post',
  51. data: params,
  52. })
  53. }
  54. export function getOrderInfo(orderNo:string) {
  55. return request({
  56. url: '/pay/orderInfo',
  57. method: 'post',
  58. data: {"orderNo":orderNo}
  59. });
  60. }
  61. export function redeemKey(params:VoucherVO) {
  62. return request({
  63. url: '/system/voucher/redeem',
  64. method: 'post',
  65. data: params
  66. });
  67. }
  68. export function listPlan() {
  69. return request({
  70. url: '/system/packagePlan/listPlan',
  71. method: 'get',
  72. });
  73. }