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 order_comment(data) {
	return request({
		url: '/api/order/comment',
		method: 'post',
		data
	});
}
//订单产品信息
export function product(data) {
	return request({
		url: '/api/order/product',
		method: 'post',
		data
	});
}
// 快递查询
export function express_query(data) {
	return request({
		url: '/api/order/express_query',
		method: 'get',
		data
	});
}
//上传图片
export function upload(data) {
	return upFilse({
		url: '/api/upload/image',
		method: 'post',
		data
	});
}
// 订单列表
export function orderList(data) {
	return request({
		url: '/api/diagnosis/order_list',
		method: 'get',
		data
	});
}
// 订单详细
export function orderDetail(data, orderid) {
	return request({
		url: '/api/diagnosis/details/' + orderid,
		method: 'get',
		data
	});
}

// 取消订单
export function orderCancel(data, id) {
	return request({
		url: '/api/diagnosis/cancel_order/' + id,
		method: 'post',
		data
	});
}

// 删除订单
export function orderDel(data) {
	return request({
		url: '/api/order/del',
		method: 'get',
		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 orderPay(data) {
	return request({
		url: '/api/order/pay',
		method: 'post',
		data
	});
}

// 创建订单
export function createOrderkey(data) {
	return request({
		url: '/api/diagnosis/create',
		method: 'post',
		data
	});
}

// 统计订单金额
export function computedOrderkey(data) {
	return request({
		url: '/api/order/computed/' + data.orderkey,
		method: 'post',
		data
	});
}

// 成为接单员
export function apply(data) {
	return request({
		url: '/api/user/apply',
		method: 'post',
		data
	});
}

export function Diagnosisconfirm(data) {
	return request({
		url: '/api/diagnosis/confirm',
		method: 'get',
		data
	});
}

// 申请售后
export function after_sales(data, id) {
	return request({
		url: '/api/diagnosis/after_sales/' + id,
		method: 'post',
		data
	});
}

// 确认完成
export function confirmation(data, id) {
	return request({
		url: '/api/diagnosis/confirmation/' + id,
		method: 'post',
		data
	});
}

// 修改用户信息
export function edit(data) {
	return request({
		url: '/api/user/edit',
		method: 'post',
		data
	});
}
