/**
 * 这是与购物有关的业务逻辑的服务
 */
export default class OrderService {
	constructor(AjaxService) {
		Object.assign(this, { AjaxService })
		this.name = 'OrderService'
	}
	/* 查询订单列表 */
	QueryOrderList (data = {}) {
		return this.AjaxService.get({ url:'/order/list', data, isLoading: true })
	}
	/* 查询订单详情 */
	QueryOrderDetails (data = {}) {
		return this.AjaxService.get({ url:'/order/detail', data, isLoading: true })
	}
	/* 操作取消订单 */
	CancelOrder (data = {}) {
		return this.AjaxService.get({ url:'/order/cancel', data, isLoading: true })
	}
	/* 操作删除订单 */
	DeleteOrder (data = {}) {
		return this.AjaxService.get({ url:'/order/delete', data, isLoading: true })
	}
	/* 确认订单操作 */
	AffirmOrder (data = {}) {
		return this.AjaxService.post({ url:'/order/affirmOrder', data, isLoading: true })
	}
	/* 确认收货操作 */
	ConfirmReceipt (data = {}) {
		return this.AjaxService.get({ url:'/order/affirm', data, isLoading: true })
	}
	/* 确认收货操作 */
	QueryLogistics (data = {}) {
		return this.AjaxService.get({ url:'/order/logistics', data, isLoading: true })
	}
	/**
	 *获取订单分享码
	 * @param orderID
	 */
	QueryOrderShareCode (data = {}) {
		return this.AjaxService.get({ url:'/order/share', data, isLoading: true })
	}
	/**
	 *获取订单分享码
	 * @param orderID
	 */
	OrderShareCode (data = {}) {
		return this.AjaxService.get({ url:'/order/shareCode', data, isLoading: true })
	}
	/**
	 *机构搜索订单
	 *@param searchWord 关键词
	 *@param userId		用户ID
	 *@param pageNum	页码
	 *@param pageSize	条数
	 */
	SearchOrderInfo (data = {}) {
		return this.AjaxService.get({ url:'/order/search', data, isLoading: true })
	}
	/**
	 *搜索订单历史记录
	 * @param orderID
	 */
	SearchOrderHistory (data = {}) {
		return this.AjaxService.get({ url:'/order/searchHistory', data, isLoading: false })
	}
	/**
	 *清楚订单历史记录
	 * @param orderID
	 */
	ClearOrderHistory (data = {}) {
		return this.AjaxService.get({ url:'/order/searchHistory/delete', data, isLoading: true })
	}
	/**
	 *@机构-确认订单初始化数据
	 *@param userId 用户ID
	 *@param count	商品数量
	 *@param productIds 商品IDs
	 */
	CreateOrderInfo (data = {}) {
		return this.AjaxService.get({ url:'/order/confirm', data, isLoading: true })
	}
	/**
	 *@确认订单-获取邮费信息
	 *@param productIds 商品ID【”,”分割】
	 *@param totalPrice	商品总额
	 *@param userId		用户ID
	 *@param townID		地址区ID
	 */
	GetOrderPostage (data = {}) {
		return this.AjaxService.get({ url:'/order/postage', data, isLoading: false })
	}
	/**
	 *@确认订单-获取发票信息
	 *@param userId		用户ID
	 */
	GetFindInvoice (data = {}) {
		return this.AjaxService.get({ url:'/personalCenter/findInvoice', data, isLoading: false })
	}
	/**
	 *@确认订单-保存发票信息
	 *@param userId		用户ID
	 */
	UpdateInvoice (data = {}) {
		return this.AjaxService.post({ url:'/personalCenter/invoice', data, isLoading: true })
	}
	/* 提交订单 orderId 订单ID */
	CreatedOrderSubmit (data = {}) {
		return this.AjaxService.post({ url:'/order/submit', data, isLoading: true })
	}
	/* 订单支付,效验付款规则 orderId 订单ID */
	OrderPaymentValidation (data = {}) {
		return this.AjaxService.get({ url:'/order/paymentValidation', data, isLoading: false })
	}
	/* 余额抵扣 orderId 订单ID */
	OrderBalanceDeduction (data = {}) {
		return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
	}
	/* 分享订单初始化查询 orderId 订单ID */
	OrderCommodityData (data = {}) {
		return this.AjaxService.get({ url:'/order/commodityData', data, isLoading: true })
	}
	/*二手订单 打款供应商 */
	confirmpayment (data = {}) {
		return this.AjaxService.post({ url:'/order/affirm/payment', data, isLoading: true })
	}
}
