This commit is contained in:
2026-03-06 13:41:22 +08:00
commit f39c6a705f
394 changed files with 159599 additions and 0 deletions

206
src/api/order.js Normal file
View File

@ -0,0 +1,206 @@
import request from "@/utils/request"
import * as URL from "@/api/url";
//获取订单列表
export const getOrderList = (data) => {
return request({
url: URL.ORDER_LIST,
method: "post",
data
});
};
export const getOrderDetail = (id) => {
return request({
url: URL.ORDER_DETAIL,
method: "post",
data: {
order_id: id
},
});
};
// 获取订单详情(通用接口)
export const getOrderWideDetail = (data) => {
return request({
url: URL.ORDERS_WIDE_DETAIL,
method: "post",
data: data
});
};
// 卡片列表
export const getCardList = (id) => {
return request({
url: URL.CARD_LIST,
method: "post",
data: {
member_id: id
},
});
};
export const getYuYueTimeList = (time) => {
return request({
url: URL.RESERVATION_TIME_LIST,
method: "post",
data: {
date: time,
},
});
};
export const createOrder = (data) => {
return request({
url: URL.CREATE_ORDER,
method: "post",
data: data,
});
};
export const cancelOrder = (id) => {
return request({
url: URL.CANCEL_ORDER,
method: "post",
data: {
order_id: id
},
});
};
// 取消宠物订单
export const cancelPetOrder = (data) => {
return request({
url: URL.CANCEL_PET_ORDER,
method: "post",
data: data,
});
};
export const payOrder = (data) => {
return request({
url: URL.PAY_ORDER,
method: "post",
data,
});
};
export const addServicePay = (id, weightId) => {
return request({
url: URL.ADD_SERVICE_FEE,
method: "post",
data: {
order_id: id,
new_weight_id: weightId
},
});
};
// 城市是否开通服务
export const getCityIsOpen = (cityId) => {
return request({
url: URL.ADDRESS_IS_SERVICE,
method: "post",
data: {
area_id: cityId,
},
showErrToast: false,
});
};
// 创建训练订单(上门训练/寄养训练)
export const createTrainingOrder = (data) => {
return request({
url: URL.HOMETRAINING_ORDERS,
method: "post",
data,
});
};
// 创建上门喂养订单
export const createFeedOrder = (data) => {
return request({
url: URL.HOME_FEED_ORDERS,
method: "post",
data,
});
};
// 创建上门遛宠订单
export const createWalkOrder = (data) => {
return request({
url: URL.HOME_WALK_ORDERS,
method: "post",
data,
});
};
// 取消上门训练订单
export const cancelTrainingOrder = (data) => {
return request({
url: URL.HOMETRAINING_ORDERS_CANCEL,
method: "post",
data,
});
};
// 取消上门服务订单
export const cancelHomeOrder = (order_id) => {
return request({
url: URL.HOME_ORDERS_CANCEL,
method: "post",
data: {
order_id
},
});
};
// 支付完成后添加附加项
export const appendAdditionalServices = (data) => {
return request({
url: URL.ADDITIONAL_SERVICES_APPEND,
method: "post",
data: data,
});
};
// 获取宠物服务记录列表
export const getPetServiceRecords = (data) => {
return request({
url: URL.PET_SERVICE_RECORDS,
method: "post",
data: data,
});
};
// 获取宠物预检记录列表
export const getPetPrecheckRecords = (data) => {
return request({
url: URL.PET_PRECHECK_QUERY,
method: "post",
data: data,
});
};
// 校验服务码是否存在
export const checkWaExists = (data) => {
return request({
url: URL.CHECK_WA_EXISTS,
method: "post",
data: data,
});
};
// 校验节假日费用(参数 date
export const checkHolidayFee = (data) => {
return request({
url: URL.CHECK_HOLIDAY_FEE,
method: "post",
data: data,
});
};