memberPointscart.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { requestApi } from '../util/network'
  2. // 积分商品列表
  3. export const cartGet =
  4. () =>
  5. requestApi(
  6. '/Pointcart/cart_list',
  7. 'POST',
  8. {
  9. },
  10. 'member'
  11. )
  12. // 删除购物车
  13. export const cartDelete =
  14. (pcartId) =>
  15. requestApi(
  16. '/Pointcart/cart_del',
  17. 'POST',
  18. {
  19. 'pcart_id': pcartId
  20. },
  21. 'member'
  22. )
  23. // 购物车更新
  24. export const cartUpdate =
  25. (pcartId, quantity) =>
  26. requestApi(
  27. '/Pointcart/cart_edit_quantity',
  28. 'POST',
  29. {
  30. 'pcart_id': pcartId,
  31. 'quantity': quantity
  32. },
  33. 'member'
  34. )
  35. // 积分商品加入购物车
  36. export const cartAdd =
  37. (pgid, quantity) =>
  38. requestApi(
  39. '/Pointcart/add',
  40. 'POST',
  41. {
  42. 'pgid': pgid,
  43. 'quantity': quantity
  44. },
  45. 'member'
  46. )
  47. // 购物车数量
  48. export const cartQuantity =
  49. () =>
  50. requestApi(
  51. '/Pointcart/cart_count',
  52. 'POST',
  53. {
  54. },
  55. 'member'
  56. )
  57. // 兑换积分商品步骤1
  58. export const buyStep1 =
  59. (cartId, ifcart) =>
  60. requestApi(
  61. '/Pointcart/step1',
  62. 'POST',
  63. {
  64. 'cart_id': cartId,
  65. 'ifcart': ifcart
  66. },
  67. 'member'
  68. )
  69. // 兑换积分商品步骤2
  70. export const buyStep2 =
  71. (cartId, ifcart, addressId, message) =>
  72. requestApi(
  73. '/Pointcart/step2',
  74. 'POST',
  75. {
  76. 'cart_id': cartId,
  77. 'ifcart': ifcart,
  78. 'address_options': addressId,
  79. 'pcart_message': message
  80. },
  81. 'member'
  82. )