/**
 * Web唐明明
 * 匆匆数载恍如梦，岁月迢迢华发增。
 * 碌碌无为枉半生，一朝惊醒万事空。
 * moduleName: 订单管理
 */

import { request } from '../index'

// 订单列表
const orders = data => {
	return request({
		url: 'mall/orders',
		data
	})
}

// 订单详情
const info = id => {
	return request({
		url: 'mall/orders/' + id
	})
}

// 删除订单
const del = id => {
	return request({
		url: 'mall/orders/' + id,
		method: 'DELETE'
	})
}

// 取消订单
const cancel = id => {
	return request({
		url: 'mall/orders/' + id + '/cancel',
		method: 'PUT'
	})
}

// 签收订单
const sign = id => {
	return request({
		url: 'mall/orders/' + id + '/sign',
		method: 'PUT'
	})
}

// 物流查询
const logistic = id => {
	return request({
		url: 'mall/orders/' + id + '/logistic'
	})
}

export {
	orders,
	info,
	del,
	cancel,
	sign,
	logistic
}
