// 订单相关

// 下单
export const submitOrder = {
	url: "/order/createOrder",
	dealReqData: ({ address, delivery, merchantGoodsVos, goodsIdCouponVos, orderType, phone, province, uname }) => {
		return { address, delivery, merchantGoodsVos, goodsIdCouponVos, orderType, phone, province, uname }
	}
}

// 支付
export const submitPay = {
	url: "/order/pay",
	dealReqData: ({ payPassword, pid, verificationCode, payType = 4, coin }) => {
		return { payPassword, pid, verificationCode, payType, coin }
	}
}

//  获取openId
export const getWxOpenId = {
	url: '/wxpay/without/getOpenId',
	dealReqData: ( {code}) => {
		return {code}
	}
}
//  微信支付
export const wxPay = {
	url: '/wxpay/without/pay'
}

// 查询支付信息
export const getPayInfo = {
	url: "/order/getPay",
	dealReqData: pid => {
		return { pid }
	}
}

// 订单
// 获取订单列表
export const getOrderList = {
	url: "/orderMain/select",
	dealReqData: ({ orderState, searchKey, page, size }) => {
		return { orderState, searchKey, page, size }
	}
}

// 获取订单详情
export const getOrderDetail = {
	url: "/orderMain/getByOid",
	dealReqData: oid => {
		return { oid }
	}
}

// 取消订单
export const cancelOrder = {
	url: "/order/closePay",
	dealReqData: pid => {
		return { pid }
	}
}

// 订单退款
export const applyOrderRefund = {
	url: "/order/applyReturn",
	dealReqData: ({ orderId, returnImg, returnReason, returnType }) => {
		return { orderId, returnImg, returnReason, returnType }
	}
}

// 撤销退款
export const cancelOrderRefund = {
	url: "/order/revokeReturn",
	dealReqData: (oid) => {
		return { oid }
	}
}

// 退款详情
export const getOrderRefundDetail = {
	url: "/order/returnMoneyDetail",
	dealReqData: (oid) => {
		return { oid }
	}
}

// 售后列表
export const getOrderRefundList = {
	url: "/orderMain/selectAfterSale",
	dealReqData: ({ page, size }) => {
		return { page, size }
	}
}



// 提货单
// 获取提货订单列表
export const getDeliveryList = {
	url: "/delivery/select",
	dealReqData: ({ orderState, searchKey, page, size }) => {
		return { orderState, searchKey, page, size }
	}
}

// 获取提货订单详情
export const getDeliveryDetail = {
	url: "/delivery/getByOid",
	dealReqData: deliveryId => {
		return { deliveryId }
	}
}

// 提货单退货
export const applyDeliveryRefund = {
	url: "/delivery/applyReturn",
	dealReqData: ({ orderDeliveryId, returnImg, returnReason, returnType }) => {
		return { orderDeliveryId, returnImg, returnReason, returnType }
	}
}

// 退货详情
export const getDeliveryRefundDetail = {
	url: "/delivery/returnGoodsDetail",
	dealReqData: orderDeliveryId => {
		return { orderDeliveryId }
	}
}

// 退货填写快递单号
export const addDeliveryRefundExpressNo = {
	url: "/delivery/addExpressNo",
	dealReqData: ({ orderDeliveryId, returnExpressNo, simpleName }) => {
		return { orderDeliveryId, returnExpressNo, simpleName }
	}
}

// 确认收货
export const confirmDeliveryReceipt = {
	url: "/delivery/confirmReceipt",
	dealReqData: orderDeliveryId => {
		return { orderDeliveryId }
	}
}

// 查询物流
export const queryExpress = {
	url: "/delivery/queryLogistics",
	dealReqData: (orderDeliveryId) => {
		return { orderDeliveryId }
	}
}

// 撤销退货
export const cancelDeliveryRefund = {
	url: "/delivery/revokeReturn",
	dealReqData: (orderDeliveryId) => {
		return { orderDeliveryId }
	}
}
// 用积分支付提货单邮费
export const payPostfeeByCoin = {
	url: "/delivery/payPostfeeByCoin"
}

// 售后列表
export const getDeliveryRefundList = {
	url: "/delivery/selectAfterSale",
	dealReqData: ({ page, size }) => {
		return { page, size }
	}
}

// 发起投诉
export const addComplaint = {
	url: '/order/addComplaint',
	dealReqData: ({ attachments, orderId, description, orderType }) => {
		return { attachments, orderId, description, orderType }
	}
}

// 投诉列表
export const getComplaintList = {
	url: '/order/complaintList',
	dealReqData: ({ page, size }) => {
		return { page, size }
	}
}

// 投诉详情
export const detailComplaintById = {
	url: '/order/complaintById'
}

// 查询待评价订单
export const getUnCommentOrderList = {
	url: '/orderDetail/select'
}

// 转让商品
// 转让商品下单
export const transferSubmitOrder = {
	url: "/tran/order/createOrder",
	dealReqData: ({ delivery, number, province, tranId, uaddress, uname, uphone }) => {
		return { delivery, number, province, tranId, uaddress, uname, uphone }
	}
}
//盲盒下单
export const BlindBoxSubmitOrder = {
	url: "/order/blindBox/createOrder",
	dealReqData: ({ delivery=0, province, tranId, uaddress, uname, uphone,goodsId }) => {
		return { delivery, province, tranId, uaddress, uname, uphone,goodsId }
	}
}
// 转让商品支付
export const submitTransferPay = {
	url: "/tran/order/pay",
	dealReqData: ({ payPassword, pid, verificationCode }) => {
		return { payPassword, pid, verificationCode }
	}
}

// 转让支付单详情
export const getTransferPayDetail = {
	url: "/tran/order/payResult",
	dealReqData: (pid) => {
		return { pid }
	}
}

// 转让商品订单列表
export const getTransferOrderList = {
	url: "/tran/order/tranOrderList",
	dealReqData: ({ param, page, size }) => {
		return { param, page, size }
	}
}

// 转让商品订单详情
export const getTransferOrderDetail = {

}
export const getCreatApiToken = {
	url:"/apiToken/creatApiToken"
}
