import {
	ApiHttp
} from '@/utils/request.js'

//修改微信用户
const updateUserMsg = (params) => {
	return ApiHttp('/xinrenli/wxUser',params,'PUT')
}
//用户需求广场
const userNeedSquare = (params) => {
	return ApiHttp('/xinrenli/order/userDemandSquare',params,'GET')
}
// 获取订单列表
const orderDetailList = (params) => {
	return ApiHttp('/xinrenli/order/listUser',params,'GET')
}

// 获取订单详细信息
const orderDetailMsg = (params) => {
	return ApiHttp('/xinrenli/order/',params,'GET')
}
// 获取订单详细信息(最新首页详情)
const orderDetailMsgNew = (params) => {
	return ApiHttp('/xinrenli/order/particulars',params,'GET')
}

//我的需求
const myNeedList = (params) => {
	return ApiHttp('/xinrenli/order/MyNeeds',params,'GET')
}

// 新增订单（发布）
const addOrderFunction = (params) =>{
	return ApiHttp('/xinrenli/order/add',params,'POST')
}

// 修改订单（发布）
const updateOrderFunction = (params) =>{
	return ApiHttp('/xinrenli/order/edit',params,'POST')
}
// 重新发布接口
const againSubmitOrder = (params) =>{
	return ApiHttp('/xinrenli/order/edit',params,'POST')
}

//取消订单
const removeOrderFunction = (params) =>{
	return ApiHttp('/xinrenli/order/remove',params,'GET')
}

//生成支付订单
const createPayOrder = (params) =>{
	return ApiHttp('/xinrenli/order/orderPay',params,'GET')
}


//申请退款
const applyRefund = (params) =>{
	return ApiHttp('/xinrenli/order/createPay',params,'POST')
}
//退款
const refundFunction = (params) =>{
	return ApiHttp('/xinrenli/order/refund',params,'GET')
}

//查询用户折扣列表
const userDiscountList = (params) =>{
	return ApiHttp('/xinrenli/userDiscount/list',params,'GET')
}

export {
	updateUserMsg,
	userNeedSquare,
	orderDetailList,
	orderDetailMsg,
	orderDetailMsgNew,
	myNeedList,
	addOrderFunction,
	againSubmitOrder,
	updateOrderFunction,
	removeOrderFunction,
	createPayOrder,
	applyRefund,
	refundFunction,
	userDiscountList
}