gift.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * 授权 API
  3. */
  4. import {
  5. http
  6. } from '../request/main.js';
  7. /**
  8. * 获取整体数据
  9. *
  10. * @returns {Promise}
  11. */
  12. export function getWrapData() {
  13. return http.post('/gift/getWrapData');
  14. }
  15. /**
  16. * 获取奖品详情
  17. *
  18. * @returns {Promise}
  19. */
  20. export function getDetail(id) {
  21. return http.post('/gift/getDetail', {
  22. id
  23. });
  24. }
  25. /**
  26. * 获取兑换预览
  27. *
  28. * @returns {Promise}
  29. */
  30. export function getPreview(gift_id, gift_spec_id) {
  31. return http.post('/gift/getPreview', {
  32. gift_id,
  33. gift_spec_id
  34. });
  35. }
  36. /**
  37. * 进行兑换
  38. *
  39. * @returns {Promise}
  40. */
  41. export function exchange(formData) {
  42. return http.post('/gift/exchange', formData);
  43. }
  44. /**
  45. * 取消订单
  46. *
  47. * @returns {Promise}
  48. */
  49. export function orderCancel(order_id) {
  50. return http.post('/gift/orderCancel', {
  51. order_id
  52. });
  53. }
  54. /**
  55. * 获取兑换列表
  56. *
  57. * @returns {Promise}
  58. */
  59. export function getOrderList(group, page, page_size) {
  60. return http.post('/gift/getOrderList', {
  61. group,
  62. page,
  63. page_size
  64. });
  65. }
  66. /**
  67. * 获取兑换详情
  68. *
  69. * @returns {Promise}
  70. */
  71. export function getOrderDetail(id) {
  72. return http.post('/gift/getOrderDetail', {
  73. id
  74. });
  75. }
  76. /**
  77. * 获取物流动态
  78. *
  79. * @returns {Promise}
  80. */
  81. export function getExpressFeed(id) {
  82. return http.post('/gift/getExpressFeed', {
  83. id
  84. });
  85. }