2020-08-13 08:12:57 +00:00
|
|
|
import request from "@/utils/request.js";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取购物车列表
|
|
|
|
* @param numType boolean true 购物车数量,false=购物车产品数量
|
|
|
|
*/
|
|
|
|
export function getCartCounts(numType) {
|
2020-08-17 07:28:28 +00:00
|
|
|
return request.get("cart/count", {
|
|
|
|
numType: numType === undefined ? true : numType
|
|
|
|
});
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* 获取购物车列表
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
export function getCartList(data) {
|
2020-08-17 07:28:28 +00:00
|
|
|
return request.get("cart/list", data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改购物车数量
|
|
|
|
* @param int cartId 购物车id
|
|
|
|
* @param int number 修改数量
|
|
|
|
*/
|
|
|
|
export function changeCartNum(cartId, number) {
|
2020-08-17 07:28:28 +00:00
|
|
|
return request.post("cart/num", {
|
|
|
|
id: cartId,
|
|
|
|
number: number
|
|
|
|
}, {}, 1);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* 清除购物车
|
|
|
|
* @param object ids join(',') 切割成字符串
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function cartDel(ids) {
|
|
|
|
if (typeof ids === 'object')
|
|
|
|
ids = ids.join(',');
|
|
|
|
return request.post('cart/delete', {
|
|
|
|
ids: ids
|
|
|
|
}, {}, 1);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 购物车重选提交
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function getResetCart(data) {
|
|
|
|
return request.post('cart/resetcart', data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单列表
|
|
|
|
* @param object data
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function getOrderList(data) {
|
|
|
|
return request.get('order/list', data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单产品信息
|
|
|
|
* @param string unique
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderProduct(data) {
|
|
|
|
return request.post('order/product', data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单评价
|
|
|
|
* @param object data
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderComment(data) {
|
|
|
|
return request.post('order/comment', data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单支付
|
|
|
|
* @param object data
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderPay(data) {
|
|
|
|
return request.post('order/pay', data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单统计数据
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderData() {
|
|
|
|
return request.get('order/data')
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单取消
|
|
|
|
* @param string id
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderCancel(id) {
|
|
|
|
return request.post('order/cancel', {
|
|
|
|
id: id
|
|
|
|
}, {}, 1);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除已完成订单
|
|
|
|
* @param string uni
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderDel(uni) {
|
|
|
|
return request.post('order/del', {
|
|
|
|
id: uni
|
|
|
|
}, {}, 1);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单详情
|
|
|
|
* @param string uni
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function getOrderDetail(uni) {
|
|
|
|
return request.get('order/detail/' + uni);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 再次下单
|
|
|
|
* @param string uni
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderAgain(uni) {
|
|
|
|
return request.post('order/again', {
|
2021-01-19 02:16:45 +00:00
|
|
|
orderNo: uni
|
2020-08-17 07:28:28 +00:00
|
|
|
});
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单收货
|
|
|
|
* @param string uni
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderTake(uni) {
|
|
|
|
return request.post('order/take', {
|
|
|
|
id: uni
|
|
|
|
}, {}, 1);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单查询物流信息
|
|
|
|
* @returns {*}
|
|
|
|
*/
|
|
|
|
export function express(uni) {
|
2020-08-17 07:28:28 +00:00
|
|
|
return request.get("order/express/" + uni);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取退款理由
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function ordeRefundReason() {
|
|
|
|
return request.get('order/refund/reason');
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单退款审核
|
|
|
|
* @param object data
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderRefundVerify(data) {
|
2021-01-19 02:16:45 +00:00
|
|
|
return request.post('order/refund', data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单确认获取订单详细信息
|
|
|
|
* @param string cartId
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
2020-12-23 07:56:45 +00:00
|
|
|
export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain) {
|
2020-08-17 07:28:28 +00:00
|
|
|
return request.post('order/confirm', {
|
|
|
|
cartIds: cartId,
|
2020-09-15 08:13:25 +00:00
|
|
|
isNew: isNew,
|
2020-11-05 08:21:06 +00:00
|
|
|
addAgain: addAgain,
|
2020-12-23 07:56:45 +00:00
|
|
|
secKill: secKill,
|
|
|
|
combination:combination,
|
|
|
|
bargain:bargain
|
2021-01-19 02:16:45 +00:00
|
|
|
});
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前金额能使用的优惠卷
|
|
|
|
* @param string price
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function getCouponsOrderPrice(data) {
|
|
|
|
return request.get('coupons/order', data)
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单创建
|
|
|
|
* @param string key
|
|
|
|
* @param object data
|
|
|
|
*
|
2020-08-17 07:28:28 +00:00
|
|
|
*/
|
|
|
|
export function orderCreate(key, data) {
|
|
|
|
return request.post('order/create/' + key, data);
|
2020-08-13 08:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 计算订单金额
|
|
|
|
* @param key
|
|
|
|
* @param data
|
|
|
|
* @returns {*}
|
|
|
|
*/
|
|
|
|
export function postOrderComputed(key, data) {
|
2020-08-17 07:28:28 +00:00
|
|
|
return request.post("order/computed/" + key, data);
|
|
|
|
}
|
2020-09-15 08:13:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 将字符串 转base64
|
|
|
|
* @param object data
|
|
|
|
*/
|
|
|
|
export function qrcodeApi(data) {
|
|
|
|
return request.post('qrcode/str2base64', data, {}, 1);
|
2021-01-19 02:16:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 微信订单支付
|
|
|
|
* @param object data
|
|
|
|
*/
|
|
|
|
export function wechatOrderPay(data) {
|
|
|
|
return request.post('pay/payment', data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 微信查询支付结果
|
|
|
|
* @param object data
|
|
|
|
*/
|
|
|
|
export function wechatQueryPayResult(data) {
|
|
|
|
return request.get('pay/queryPayResult', data);
|
2020-09-15 08:13:25 +00:00
|
|
|
}
|