import request from '@/utils/request'
import {
	upFilse
} from '@/utils/request'

// 订单确认
export function confirm(data) {
	return request({
		url: '/api/order/confirm',
		method: 'post',
		data
	});
}
//获取店铺收益
export function getEarnings(data) {
	return request({
		url: '/api/admin/order/list',
		method: 'get',
		data
	});
}
//订单个数
export function count(data) {
	return request({
		url: '/api/admin/order/count',
		method: 'get',
		data
	})
}
// 试用列表
export function recordList(data) {
	return request({
		url: '/api/activity/try/record/list',
		method: 'get',
		data
	});
}

// 订单列表
export function orderList(data) {
	return request({
		url: '/api/order/list',
		method: 'get',
		data
	});
}
// 退款列表
export function refundList(data) {
	return request({
		url: '/api/admin/order/refund',
		method: 'post',
		data
	});
}
// 订单详细
export function orderDetail(data, orderid) {
	return request({
		url: '/api/order/detail/' + orderid,
		method: 'get',
		data
	});
}

// 小店订单详细
export function orderShop(data, orderid) {
	return request({
		url: '/api/admin/order/detail/' + orderid,
		method: 'get',
		data
	});
}


// 取消订单
export function orderCancel(data) {
	return request({
		url: '/api/order/cancel',
		method: 'post',
		data
	});
}

// 删除订单
export function orderDel(data) {
	return request({
		url: '/api/combination/hide',
		method: 'post',
		data
	});
}
// 申请退款
export function refund(data) {
	return request({
		url: '/api/order/refund/verify',
		method: 'post',
		data
	});
}
// 退款理由列表
export function refundReason(data) {
	return request({
		url: '/api/order/refund/reason',
		method: 'get',
		data
	});
}

// 确认收货
export function orderTake(data) {
	return request({
		url: '/api/order/take',
		method: 'post',
		data
	});
}
// 获取拼团海报
export function getCombinationPoster(data) {
	return request({
		url: '/api/combination/poster',
		method: 'post',
		data
	});
}
// 拼团列表
export function combination(data) {
	return request({
		url: '/api/combination/order',
		method: 'get',
		data
	});
}
//提交评论
export function product(data) {
	return request({
		url: '/api/order/product',
		method: 'post',
		data
	});
}
//上传图片
export function upload(data) {
	return upFilse({
		url: '/api/upload/image',
		method: 'post',
		data
	});
}
//提交评论
export function order_comment(data) {
	return request({
		url: '/api/order/comment',
		method: 'post',
		data
	});
}

// 快递查询
export function express_query(data, id) {
	return request({
		url: '/api/order/express/' + id,
		method: 'get',
		data
	});
}
