|
@@ -1,59 +0,0 @@
|
|
|
-import {axios} from '../utils/request'
|
|
|
|
|
-import {ORDER_MODULE} from './_prefix'
|
|
|
|
|
-
|
|
|
|
|
-// 创建订单
|
|
|
|
|
-export const createOrder = payload => {
|
|
|
|
|
- return axios.post(`${ORDER_MODULE}/`, payload,
|
|
|
|
|
- {headers: {'Content-Type': 'application/json'}})
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- return res
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 订单支付
|
|
|
|
|
-export const payOrder = (orderId) => {
|
|
|
|
|
- return axios.post(`${ORDER_MODULE}/pay/?orderId=${orderId}`)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- return res
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 获取全部订单(用户下订单/门店下订单/全部订单)
|
|
|
|
|
-export const getAllOrder = () => {
|
|
|
|
|
- return axios.get(`${ORDER_MODULE}/`, )
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- return res
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 根据订单Id获取单个订单
|
|
|
|
|
-export const getOrderById = orderId => {
|
|
|
|
|
- return axios.get(`${ORDER_MODULE}/${orderId}`, )
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- return res
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 订单发货
|
|
|
|
|
-export const deliverOrder = orderId => {
|
|
|
|
|
- return axios.post(`${ORDER_MODULE}/deliver/?orderId=${orderId}`)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- return res
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 订单收货
|
|
|
|
|
-export const getOrder = orderId => {
|
|
|
|
|
- return axios.post(`${ORDER_MODULE}/get/?orderId=${orderId}`)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- return res
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 评价订单
|
|
|
|
|
-export const commentOrder = payload => {
|
|
|
|
|
- return axios.post(`${ORDER_MODULE}/comment`, null, {params: payload})
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- return res
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|