import request from "/utils/request.js";
export function useOrderApi() { 
	return {
		GetOrderById: (data) => {
			return request.request({
				url: '/ClientOrder/GetOrderById',
				method: 'get',
				data,
			});
		},
		GetOrderList: (data) => {
			return request.request({
				url: '/ClientOrder/GetOrderList',
				method: 'get',
				data,
			});
		},
		AddOrder: (data) => {
			return request.request({
				url: '/ClientOrder/AddOrder',
				method: 'post',
				data,
			});
		},
		AddOrder2: (data) => {
			return request.request({
				url: '/ClientOrder/AddOrder2',
				method: 'post',
				data,
			});
		},
		UploaderImage: (data) => {
			return request.uploadFile({
				url: '/ClientImages/UploadFileByALiYun',
				method: 'post',
				data,
				headers:{'Content-Type':'multipart/form-data'}
			});
		},
		ApplyForRefundLocker: (data) => {
			return request.request({
				url: '/ClientOrder/ApplyForRefundLocker',
				method: 'post',
				data,
			});
		},
		CancelApplyForRefundLocker: (data) => {
			return request.request({
				url: `/ClientOrder/CancelApplyForRefundLocker?orderId=${data}`,
				method: 'post',
				data,
			});
		},
		SubmitOrderEvaluate: (data) => {
			return request.request({
				url: '/ClientOrder/SubmitOrderEvaluate',
				method: 'post',
				data,
			});
		},
		//续租订单价格
		ContinuationOrderPrice:(data)=>{
			return request.request({
				url: '/ClientOrder/ContinuationOrderPrice',
				method: 'get',
				data,
			})
		},
		//续租订单价格
		ContinuationOrderPricePost:(data)=>{
			return request.request({
				url: '/ClientOrder/ContinuationOrderPrice',
				method: 'post',
				data,
			})
		},
		//续租订单	
		ContinuationOrder:(data)=>{
			return request.request({
				url: '/ClientOrder/ContinuationOrder',
				method: 'post',
				data,
			})
		},
		//续租订单
		ContinuationOrderH5:(data)=>{
			return request.request({
				url: '/ClientOrder/ContinuationOrderH5',
				method: 'post',
				data,
			})
		},
		// 关闭支付
		CloseWeChatPayment:(data)=>{
			return request.request({
				url: `/ClientOrder/CloseWeChatPayment?out_trade_no=${data.out_trade_no}`,
				method: 'post',
				data,
			})
		},
		//授权
		OrderAuthorization:(data)=>{
			return request.request({
				url: '/ClientOrder/OrderAuthorization',
				method: 'post',
				data,
			})
		},
		// 获取信息
		GetOrderAuthorizationFace:(data)=>{
			return request.request({
				url: '/ClientOrder/GetOrderAuthorizationFace',
				method: 'get',
				data,
			})
		},
		// 申请退押金
		WeChatMerchantRefund:(data)=>{
			return request.request({
				url: '/ClientOrder/WeChatMerchantRefund',
				method: 'get',
				data,
			})
		},
		// 获取起租天数
		GetStartDateRntalByKey: () => {
			return request.request({
				url: '/sysconfig/GetStartDateRntalByKey',
				method: 'get'
			});
		},
		GenerateQuotation : (data) => {
			return request.request({
				url: '/ClientSite/GenerateQuotation',
				method: 'post',
				data,
				responseType: 'arraybuffer'
			});
		},
		// 获取锁订单时间
		GetLockOrderTime: (data) => {
			return request.request({
				url: '/ClientOrder/GetLockOrderTime',
				method: 'post',
				params: data,
			});
		},
		// 取消支付
		OrderCountdownTime: (data) => {
			return request.request({
				url: '/ClientOrder/OrderCountdownTime',
				method: 'post',
				params: data,
			});
		},
		// 继续支付
		ContinueOrderPay: (data) => {
			return request.request({
				url: '/ClientOrder/ContinueOrderPay',
				method: 'post',
				params: data,
			});
		},
		GetAppText: (data) => {
			return request.request({
				url: '/APP/GetAppText',
				method: 'get',
				data
			});
		},
		GetCancelOrder: (data) => {
			return request.request({
				url: '/ClientOrder/GetCancelOrder',
				method: 'get',
				data
			})
		}
	}
}