import request from '@/services/http.request.js'

/* 获取拼团订单详情 */
export function fetchCollageOrderDetail(params) {
	return request({
		url: '/order/collage/details',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 订单分享减免 */
export function orderReductionShare(data) {
	return request({
		url: '/order/reduction/share',
		method: 'POST',
		data,
        loading: '加载中...'
	})
}

/* 订单结算初始化 */
export function orderConfirm(params) {
	return request({
		url: '/order/confirm',
		method: 'get',
		params,
        loading: '加载中...'
	})
}

/* 提交订单 */
export function orderSubmit(data) {
	return request({
		url: '/order/submit',
		method: 'POST',
		data,
        loading: '加载中...'
	})
}

/* 普通用户订单列表 */
export function fetchUserOrderList(params) {
	return request({
		url: '/order/list',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 分销者订单列表 */
export function fetchDealerOrderList(params) {
	return request({
		url: '/order/dealer/list',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 订单详情 */
export function fetchOrderDetail(params) {
	return request({
		url: '/order/detail',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 取消订单 */
export function orderCancel(params) {
	return request({
		url: '/order/cancel',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 删除订单 */
export function orderDelete(params) {
	return request({
		url: '/order/delete',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 确认收货 */
export function confirmReceipt(params) {
	return request({
		url: '/order/affirm',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 再次购买查询操作 */
export function checkOrderBuyAgain(params) {
	return request({
		url: '/order/buyAgain',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 查询物流 */
export function fetchLogisticsDetail(params) {
	return request({
		url: '/order/logistics',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 搜索订单列表 */
export function searchOrderList(params) {
	return request({
		url: '/order/search',
		method: 'GET',
		params,
        loading: '加载中...'
	})
}

/* 获取订单搜索记录 */
export function fetchOrderSearchHistory(params) {
	return request({
		url: '/order/searchHistory',
		method: 'GET',
		params
	})
}

/* 清除订单搜索记录 */
export function clearOrderSearchHistory(params) {
	return request({
		url: '/order/searchHistory/delete',
		method: 'GET',
		params
	})
}
