memberAddress.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { requestApi } from '../util/network'
  2. // 获取用户地址列表
  3. export const getAddressList =
  4. () =>
  5. requestApi(
  6. '/Memberaddress/address_list',
  7. 'POST',
  8. {
  9. },
  10. 'member'
  11. )
  12. // 获取单条用户地址信息
  13. export const getAddressInfo =
  14. (addressId) =>
  15. requestApi(
  16. '/Memberaddress/address_info',
  17. 'POST',
  18. {
  19. 'address_id': addressId
  20. },
  21. 'member'
  22. )
  23. // 新增用户收货地址
  24. export const addAddress =
  25. (data) =>
  26. requestApi(
  27. '/Memberaddress/address_add',
  28. 'POST',
  29. {
  30. 'address_realname': data.address_realname,
  31. 'area_id': data.area_id,
  32. 'city_id': data.city_id,
  33. 'area_info': data.area_info,
  34. 'address_detail': data.address_detail,
  35. 'address_longitude': data.address_longitude,
  36. 'address_latitude': data.address_latitude,
  37. 'address_tel_phone': data.address_tel_phone,
  38. 'address_mob_phone': data.address_mob_phone,
  39. 'address_is_default': data.address_is_default
  40. },
  41. 'member'
  42. )
  43. // 编辑用户收货地址
  44. export const editAddress =
  45. (data, addressId) =>
  46. requestApi(
  47. '/Memberaddress/address_edit',
  48. 'POST',
  49. {
  50. 'address_id': addressId,
  51. 'address_realname': data.address_realname,
  52. 'area_id': data.area_id,
  53. 'city_id': data.city_id,
  54. 'area_info': data.area_info,
  55. 'address_detail': data.address_detail,
  56. 'address_longitude': data.address_longitude,
  57. 'address_latitude': data.address_latitude,
  58. 'address_tel_phone': data.address_tel_phone,
  59. 'address_mob_phone': data.address_mob_phone,
  60. 'address_is_default': data.address_is_default
  61. },
  62. 'member'
  63. )
  64. // 删除用户收货地址
  65. export const delAddress =
  66. (addressId) =>
  67. requestApi(
  68. '/Memberaddress/address_del',
  69. 'POST',
  70. {
  71. 'address_id': addressId
  72. },
  73. 'member'
  74. )
  75. // 获取自提站列表
  76. export const getChainList =
  77. (parmas, areaId) =>
  78. requestApi(
  79. '/Memberaddress/chain_list',
  80. 'POST',
  81. {
  82. 'page': parmas.page,
  83. 'per_page': parmas.per_page,
  84. 'area_id': areaId
  85. },
  86. 'member'
  87. )
  88. // 添加自提站
  89. export const addChain =
  90. (data) =>
  91. requestApi(
  92. '/Memberaddress/chain_add',
  93. 'POST',
  94. data,
  95. 'member'
  96. )