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.

306 lines
6.2 KiB

6 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:any) => {
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 loadTurnFlowerOrderApi = (params:any) => {
return $request.post({ url: `front/order/turnFlowerOrder/${params}` })
}
/**
*
*
*/
export const createFlowerWoodApi = (params: ComputedPrice) => {
return $request.post({ url: `front/order/createFlowerWood`, 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:any) => {
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` })
}
// 接订单
export const getReceiveOrderList = (params:any) => {
console.log(params,'params');
let str = ''
for (const key in params) {
str += `&${key}=${params[key]}`
}
console.log(str.replace('&', ''));
return $request.get({ url: `front/shop/receiveOrder/pageList?${str.replace('&', '')}` })
}
// 订单详情
export const getOrderInfo = (id:any) => {
return $request.get({ url: `front/shop/receiveOrder/orderDetail?orderNo=${id}` })
}
// 检查商家是否可以报价
export const verifyOffers = (params:any) => {
return $request.get({ url: `front/shop/merchant/offerlist/checkIsCanOffer`,params })
}
// 商家报价
export const merchantOffers = (params:any) => {
return $request.post({ url: `front/shop/merchant/offerlist/save`,params})
}
// 立即接单
export const takeOrdersNow = (params:any) => {
return $request.post({ url: `front/shop/merchant/offerlist/takingOrder`,params})
}