51 lines
1.9 KiB
JavaScript
51 lines
1.9 KiB
JavaScript
import request from './request';
|
|
|
|
export default {
|
|
category:()=>request.get('/api/merchant-categories'),
|
|
list:(data)=>request.get('/api/merchant',data),
|
|
detail(id,lng,lat){
|
|
const data = {};
|
|
if(lng&&lat){
|
|
data.longitude = lng;
|
|
data.latitude = lat;
|
|
}
|
|
return request.get(`/api/merchant/${id}`,data);
|
|
},
|
|
product:{
|
|
deliveryTimeType:{
|
|
//立即送 定时达(自提)
|
|
immediate:'IMMEDIATE',scheduled:'SCHEDULED'
|
|
},
|
|
deliveryTimeTypeKV:{
|
|
IMMEDIATE:'及时达',SCHEDULED:'定时达'
|
|
},
|
|
list:(data)=>request.get('/api/merchant/product/list',data),
|
|
detail:(product_id)=>request.get(`/api/merchant/product/${product_id}`)
|
|
},
|
|
orderList:(data)=>request.get('/api/merchant-pay',data),
|
|
//计算商品订单金额
|
|
calculateOrderPrice:(merchant_product_id)=>request.post('/api/merchant/order/calculate-price',{merchant_product_id}),
|
|
//计算在线买单赠送积分
|
|
calculateOrderPoint:(merchant_id,amount)=>request.post('/api/merchant-pay/calculate-points',{merchant_id,amount}),
|
|
//创建店铺商品订单
|
|
order:(data)=>request.post('/api/merchant/order',data),
|
|
//创建在线买单订单
|
|
merchantPay:(merchant_id,amount)=>request.post('/api/merchant-pay',{merchant_id,amount}),
|
|
|
|
merchantOrderStatusKV:{
|
|
CREATED:'待支付',PENDING:'待接单',DELIVERING:'待配送',PICKUP_READY:'待自提',
|
|
COMPLETED:'已完成',CANCELLED:'已取消',REFUNDING:'退款中',REFUNDED:'已退款'
|
|
},
|
|
merchantOrderStatus:{
|
|
created:"CREATED",pending:"PENDING",
|
|
delivering:"DELIVERING",pickupReady:"PICKUP_READY",completed:"COMPLETED",
|
|
cancelled:"CANCELLED",refunding:"REFUNDING",refunded:"REFUNDED"
|
|
},
|
|
|
|
merchantPayOrderStatusKV:{
|
|
UNPAID:'未支付',PAID:'已支付',REFUNDING:'退款中',REFUNDED:'已退款'
|
|
},
|
|
merchantPayOrderStatus:{
|
|
unpaid:'UNPAID',paid:'PAID',refunding:'REFUNDING',refunded:'REFUNDED'
|
|
}
|
|
} |