2024-09-19 07:20:14 +08:00
|
|
|
"use strict";
|
2024-10-01 09:15:35 +08:00
|
|
|
const modules_mall_sheep_request_index = require("../../request/index.js");
|
2024-09-19 07:20:14 +08:00
|
|
|
const AddressApi = {
|
|
|
|
// 获得用户收件地址列表
|
|
|
|
getAddressList: () => {
|
2024-10-01 09:15:35 +08:00
|
|
|
return modules_mall_sheep_request_index.request({
|
2024-09-19 07:20:14 +08:00
|
|
|
url: "/member/address/list",
|
|
|
|
method: "GET"
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 创建用户收件地址
|
|
|
|
createAddress: (data) => {
|
2024-10-01 09:15:35 +08:00
|
|
|
return modules_mall_sheep_request_index.request({
|
2024-09-19 07:20:14 +08:00
|
|
|
url: "/member/address/create",
|
|
|
|
method: "POST",
|
|
|
|
data,
|
|
|
|
custom: {
|
|
|
|
showSuccess: true,
|
|
|
|
successMsg: "保存成功"
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 更新用户收件地址
|
|
|
|
updateAddress: (data) => {
|
2024-10-01 09:15:35 +08:00
|
|
|
return modules_mall_sheep_request_index.request({
|
2024-09-19 07:20:14 +08:00
|
|
|
url: "/member/address/update",
|
|
|
|
method: "PUT",
|
|
|
|
data,
|
|
|
|
custom: {
|
|
|
|
showSuccess: true,
|
|
|
|
successMsg: "更新成功"
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 获得用户收件地址
|
|
|
|
getAddress: (id) => {
|
2024-10-01 09:15:35 +08:00
|
|
|
return modules_mall_sheep_request_index.request({
|
2024-09-19 07:20:14 +08:00
|
|
|
url: "/member/address/get",
|
|
|
|
method: "GET",
|
|
|
|
params: { id }
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 删除用户收件地址
|
|
|
|
deleteAddress: (id) => {
|
2024-10-01 09:15:35 +08:00
|
|
|
return modules_mall_sheep_request_index.request({
|
2024-09-19 07:20:14 +08:00
|
|
|
url: "/member/address/delete",
|
|
|
|
method: "DELETE",
|
|
|
|
params: { id }
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
exports.AddressApi = AddressApi;
|