2023-09-20 17:00:55 +08:00
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Author: CRMEB Team <admin@crmeb.com>
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
import request from "@/utils/request.js";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取购物车列表
|
|
|
|
|
* @param numType boolean true 购物车数量,false=购物车产品数量
|
|
|
|
|
*/
|
|
|
|
|
export function getCartCounts(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("user/cart/count", data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取购物车列表
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function getCartList(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("user/cart/lst", data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改购物车数量
|
|
|
|
|
* @param int cartId 购物车id
|
|
|
|
|
* @param int number 修改数量
|
|
|
|
|
*/
|
|
|
|
|
export function changeCartNum(cartId, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("user/cart/change/" + cartId, data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 清除购物车
|
|
|
|
|
* @param object ids
|
|
|
|
|
*/
|
|
|
|
|
export function cartDel(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('user/cart/delete', data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 订单列表
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function getOrderList(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('order/list', data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-15 19:19:16 +08:00
|
|
|
|
/**
|
|
|
|
|
* 其他订单列表
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function getOtherOrderList(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('other_order/list', data);
|
2023-12-15 19:19:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-20 17:00:55 +08:00
|
|
|
|
/**
|
|
|
|
|
* 订单产品信息
|
|
|
|
|
* @param string unique
|
|
|
|
|
*/
|
|
|
|
|
export function orderProduct(orderId) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('reply/product/' + orderId);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 订单评价
|
|
|
|
|
* @param object data
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function orderComment(id, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('reply/' + id, data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 订单支付
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function orderPay(id, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('order/pay/' + id, data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 订单统计数据
|
|
|
|
|
*/
|
|
|
|
|
export function orderData(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('order/number', data)
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
2023-12-15 19:19:16 +08:00
|
|
|
|
/**
|
|
|
|
|
* 其他订单统计数据
|
|
|
|
|
*/
|
|
|
|
|
export function otherOrderData(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('other_order/number', data)
|
2023-12-15 19:19:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-20 17:00:55 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 订单取消
|
|
|
|
|
* @param string id
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
// export function orderCancel(id){
|
|
|
|
|
// return request.post('order/cancel',{id:id});
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 未支付订单取消
|
|
|
|
|
* @param string id
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function unOrderCancel(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('order/cancel/' + id);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除已完成订单
|
|
|
|
|
* @param string uni
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function orderDel(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('order/del/' + id);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 已付款订单详情
|
|
|
|
|
* @param string uni
|
|
|
|
|
*/
|
|
|
|
|
export function getOrderDetail(uni) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('order/detail/' + uni);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-15 19:19:16 +08:00
|
|
|
|
/**
|
|
|
|
|
* 其他订单详情
|
|
|
|
|
* @param string uni
|
|
|
|
|
*/
|
|
|
|
|
export function getOtherOrderDetail(uni) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('other_order/detail/' + uni);
|
2023-12-15 19:19:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-20 17:00:55 +08:00
|
|
|
|
/**
|
|
|
|
|
* 未付款订单详情
|
|
|
|
|
* @param string uni
|
|
|
|
|
*/
|
2024-03-14 17:59:10 +08:00
|
|
|
|
export function groupOrderDetail(uni, product_type) {
|
|
|
|
|
return request.get('order/group_order_detail/' + uni + '?product_type=' + product_type);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 支付状态订单
|
|
|
|
|
export function getPayOrder(uni) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('order/status/' + uni);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 再次下单
|
|
|
|
|
* @param string uni
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function orderAgain(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('user/cart/again', data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 订单收货
|
|
|
|
|
* @param string uni
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function orderTake(uni) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('order/take/' + uni);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-15 19:19:16 +08:00
|
|
|
|
/**
|
|
|
|
|
* 其他订单收货
|
|
|
|
|
* @param string uni
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function otherOrderTake(uni) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('other_order/take/' + uni);
|
2023-12-15 19:19:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-09-20 17:00:55 +08:00
|
|
|
|
/**
|
|
|
|
|
* 订单查询物流信息
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
export function express(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("order/express/" + id);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 退款单查询物流信息
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
export function refundOrderExpress(merId, id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get(`server/${merId}/refund/express/${id}`);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取退款理由
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function ordeRefundReason() {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('order/refund/reason');
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 订单退款审核
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function orderRefundVerify(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('order/refund/verify', data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 订单确认获取订单详细信息
|
|
|
|
|
* @param string cartId
|
|
|
|
|
*/
|
|
|
|
|
export function orderConfirm(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('order/check', data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 订单确认获取订单详细信息
|
|
|
|
|
* @param string cartId
|
|
|
|
|
*/
|
|
|
|
|
export function getOrderConfirm(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('v2/order/check', data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取当前金额能使用的优惠卷
|
|
|
|
|
* @param string price
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export function getCouponsOrderPrice(price, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('coupons/order/' + price, data)
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算订单金额
|
|
|
|
|
* @param key
|
|
|
|
|
* @param data
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
export function postOrderComputed(key, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("/order/computed/" + key, data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 生成订单
|
|
|
|
|
export function orderCreate(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("order/create", data, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
// 新的生成订单
|
|
|
|
|
export function createOrder(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("v2/order/create", data, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
2023-12-15 19:19:16 +08:00
|
|
|
|
// 生成其他订单
|
|
|
|
|
export function createOtherOrder(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("other_order/create", data);
|
2023-12-15 19:19:16 +08:00
|
|
|
|
}
|
2023-09-20 17:00:55 +08:00
|
|
|
|
// 未支付订单
|
|
|
|
|
export function groupOrderList(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("order/group_order_list", data, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 批量退款列表
|
|
|
|
|
export function refundBatch(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("refund/batch_product/" + id, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退款商品
|
|
|
|
|
export function refundProduct(id, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("refund/product/" + id, data, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 申请退款
|
|
|
|
|
export function refundApply(id, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("refund/apply/" + id, data, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退款理由
|
|
|
|
|
export function refundMessage() {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("common/refund_message", {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退款列表
|
|
|
|
|
export function refundList(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("refund/list", data, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退款详情
|
|
|
|
|
export function refundDetail(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("refund/detail/" + id, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 物流列表
|
|
|
|
|
export function expressList() {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("common/express");
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退回商品提交
|
|
|
|
|
export function refundBackGoods(id, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("refund/back_goods/" + id, data, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退款记录删除
|
|
|
|
|
export function refundDel(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post("refund/del/" + id, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退款记录删除
|
|
|
|
|
export function refundExpress(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("refund/express/" + id, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 核销二维码
|
|
|
|
|
export function verifyCode(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get("order/verify_code/" + id);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 预售尾款支付
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function presellOrderPay(id, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post('presell/pay/' + id, data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 发票订单
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function receiptOrder(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('user/receipt/order', data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 发票订单
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function getReceiptOrder(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('user/receipt/order/' + id);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 发票订单
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function getCallBackUrlApi(key) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get('common/pay_key/' + key, {}, {
|
|
|
|
|
noAuth: true
|
|
|
|
|
});
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 发票订单
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function develiveryDetail(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get(`order/delivery/${id}`);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 订单申请开票
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function applyInvoiceApi(id, data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post(`order/receipt/${id}`, data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 退款单取消申请
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function refundCancelApi(id) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.post(`refund/cancel/${id}`);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 售后
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function refundlist(data) {
|
2024-03-14 17:59:10 +08:00
|
|
|
|
return request.get(`refund/list`, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 售后
|
|
|
|
|
* @param object data
|
|
|
|
|
*/
|
|
|
|
|
export function uploadVoucherApi(data) {
|
|
|
|
|
return request.get(`other_order/upload/:${data.id}`, data);
|
2023-09-20 17:00:55 +08:00
|
|
|
|
}
|