You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

258 lines
5.0 KiB

11 months ago
import {CartBatchAdd, ComputedPrice, PayPayment, RefundApply, ReplyProductFrom} from '~/types/order'
import {ItemObject, PageQuery} from "~/types/global";
/**
*
*
*/
export const cartListApi = (isValid: string) => {
return $request.get({ url: `front/cart/list?isValid=${isValid}` })
}
/**
*
*
*/
export const cartDeleteApi = (params: { ids: number[] }) => {
return $request.post({ url: `front/cart/delete`, params })
}
/**
*
*
*/
export const cartToCollectApi = (params: { ids: number[] }) => {
return $request.post({ url: `front/cart/to/collect`, params })
}
/**
*
*
*/
export const cartNumApi = (params: { id: number; number: number }) => {
return $request.post({ url: `front/cart/num`, params })
}
/**
*
*
*/
export const preOrderApi = (params) => {
return $request.post({ url: `front/order/pre/order`, params })
}
/**
*
*
*/
export const orderLoadPreApi = (preOrderNo: string) => {
return $request.get({ url: `front/order/load/pre/${preOrderNo}` })
}
/**
*
*
*/
export const orderDetailApi = (orderNo: string) => {
return $request.get({ url: `front/order/detail/${orderNo}` })
}
/**
*
*
*/
export const computedPriceApi = (params: ComputedPrice) => {
return $request.post({ url: `front/order/computed/price`, params })
}
/**
*
*
*/
export const addressDetailApi = (id: number) => {
return $request.get({ url: `front/address/detail/${id}` })
}
/**
*
*
*/
export const addressListApi = () => {
return $request.get({ url: `front/address/list` })
}
/**
*
*
*/
export const orderCreateApi = (params: ComputedPrice) => {
return $request.post({ url: `front/order/create`, params })
}
/**
*
*
*/
export const payConfigApi = () => {
return $request.get({ url: `front/pay/get/config` })
}
/**
*
*
*/
export const payPaymentApi = (params: PayPayment) => {
return $request.post({ url: `front/pay/payment`, params })
}
/**
*
*
*/
export const orderReplyApi = (params: ReplyProductFrom) => {
return $request.post({ url: `front/order/reply/product`, params })
}
/**
*
*
*/
export const orderListApi = (params) => {
return $request.get({ url: `front/order/list`, params })
}
/**
*
*
*/
export const orderTakeDeliveryApi = (orderNo: string) => {
return $request.post({ url: `front/order/take/delivery/${orderNo}` })
}
/**
*
*
*/
export const orderCancelApi = (orderNo: string) => {
return $request.post({ url: `front/order/cancel/${orderNo}` })
}
/**
*
*
*/
export const orderDeleteApi = (orderNo: string) => {
return $request.post({ url: `front/order/delete/${orderNo}` })
}
/**
*
*
*/
export const cartBatchAddApi = (params:Array<CartBatchAdd>) => {
return $request.post({ url: `front/cart/batch/add`, params })
}
/**
*
*
*/
export const invoiceListApi = (orderNo:string) => {
return $request.get({ url: `front/order/${orderNo}/invoice/list` })
}
/**
*
*
*/
export const orderLogisticsApi = (invoiceId:number) => {
return $request.get({ url: `front/order/logistics/${invoiceId}` })
}
/**
*
*
*/
export const payGetCashierApi = (orderNo:string) => {
return $request.get({ url: `front/pay/get/cashier/${orderNo}` })
}
/**
*
*
*/
export const aliPayResultApi = (orderNo:string) => {
return $request.get({ url: `front/pay/query/ali/pay/result/${orderNo}` })
}
/**
*
*
*/
export const wechatPayResultApi = (orderNo:string) => {
return $request.get({ url: `front/pay/query/wechat/pay/result/${orderNo}` })
}
/**
* ()
*
*/
export const refundApplyListApi = (params:PageQuery) => {
return $request.get({ url: `front/refund/after/sale/apply/list`,params })
}
/**
* 退
*
*/
export const refundApplyApi = (params:RefundApply) => {
return $request.post({ url: `front/refund/apply`,params })
}
/**
* 退
*
*/
export const refundDetailApi = (refundOrderNo:string) => {
return $request.get({ url: `front/refund/detail/${refundOrderNo}` })
}
/**
* 退
*
*/
export const refundListApi = (params:PageQuery) => {
return $request.get({ url: `front/refund/list`,params })
}
/**
* 退
*
*/
export const refundReasonApi = () => {
return $request.get({ url: `front/refund/reason` })
}
/**
* 退退
*
*/
export const refundReturningGoodsApi = (params:ItemObject) => {
return $request.post({ url: `front/refund/returning/goods`,params })
}
/**
* 退
*
*/
export const refundRevokeApi = (refundOrderNo:string) => {
return $request.post({ url: `front/refund/revoke/${refundOrderNo}` })
}
/**
*
*
*/
export const expressAllApi = () => {
return $request.get({ url: `front/express/all` })
}