lilishop-uniapp/api/after-sale.js

221 lines
4.0 KiB
JavaScript
Raw Normal View History

2021-05-13 11:03:32 +08:00
/**
* 申请售后相关API
*/
import { http, Method } from "@/utils/request.js";
/**
* 获取售后列表
* @param params
* @returns {AxiosPromise}
*/
export function getAfterSale(params) {
return http.request({
url: "after-sales/refunds",
method: Method.GET,
needToken: true,
loading: false,
params,
});
}
/******************* 以下为新方法 ***********************/
/**
* 申请取消订单
* @param params
*/
export function applyCancelOrder(params) {
return http.request({
url: "after-sales/apply/cancel/order",
method: Method.POST,
needToken: true,
params,
});
}
/**
2021-05-13 11:03:32 +08:00
/**
* 获取商家售后收件地址
*/
export function getStoreAfterSaleAddress(sn) {
2021-05-13 11:03:32 +08:00
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/getStoreAfterSaleAddress/${sn}`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 取消售后
*/
export function cancelAfterSale(afterSaleSn) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/cancel/${afterSaleSn}`,
method: Method.POST,
needToken: true,
});
}
2021-05-13 11:03:32 +08:00
/**
* 获取售后服务记录相关数据
* @param params 参数
*/
export function getAfterSaleList(params) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/page`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
params,
});
}
/**
* 查看售后服务详情
* @param sn 售后服务单编号
*/
export function getServiceDetail(sn) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/get/${sn}`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 添加投诉
*/
export function addComplain(params) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/complain`,
2021-05-13 11:03:32 +08:00
method: Method.POST,
needToken: true,
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
data: params,
});
}
/**
* 取消投诉
*/
export function clearComplain(id, params) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/complain/status/${id}`,
2021-05-13 11:03:32 +08:00
method: Method.PUT,
needToken: true,
params,
});
}
/**
* 取消投诉
*/
export function getAfterSaleLog(sn) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/get/getAfterSaleLog/${sn}`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 投诉列表
*/
export function getComplain(params) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/complain`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
params,
});
}
/**
* 获取申请原因
*/
export function getAfterSaleReason(serviceType) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/get/afterSaleReason/${serviceType}`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 获取取消原因
*/
export function getClearReason() {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/get/afterSaleReason/CANCEL`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 获取投诉原因
*/
export function getComplainReason() {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/get/afterSaleReason/COMPLAIN`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 获取投诉详情
*/
export function getComplainDetail(id) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/complain/${id}`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 获取申请售后页面信息
*/
export function getAfterSaleInfo(sn) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/applyAfterSaleInfo/${sn}`,
2021-05-13 11:03:32 +08:00
method: Method.GET,
needToken: true,
});
}
/**
* 申请退货服务
* @param params
*/
export function applyReturn(orderItemSn, params) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/save/${orderItemSn}`,
2021-05-13 11:03:32 +08:00
method: Method.POST,
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
data: params,
});
}
/**
* 填充物流信息
* @param afterSaleSn 售后服务单号
* @param params 参数信息
*/
export function fillShipInfo(afterSaleSn, params) {
return http.request({
2022-02-10 18:57:17 +08:00
url: `/order/afterSale/delivery/${afterSaleSn}`,
2021-05-13 11:03:32 +08:00
method: Method.POST,
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
data: params,
});
}