"use strict";const e=require("../../request/index.js"),t={settlementOrder:t=>{const r={...t};t.couponId>0||delete r.couponId,t.addressId>0||delete r.addressId,!t.combinationActivityId>0&&delete r.combinationActivityId,t.combinationHeadId>0||delete r.combinationHeadId,t.seckillActivityId>0||delete r.seckillActivityId,delete r.items;for(let e=0;e<t.items.length;e++)r[encodeURIComponent("items["+e+"].skuId")]=t.items[e].skuId+"",r[encodeURIComponent("items["+e+"].count")]=t.items[e].count+"",t.items[e].cartId&&(r[encodeURIComponent("items["+e+"].cartId")]=t.items[e].cartId+"");const d=Object.keys(r).map((e=>e+"="+r[e])).join("&");return e.request({url:`/trade/order/settlement?${d}`,method:"GET",custom:{showError:!0,showLoading:!0}})},createOrder:t=>e.request({url:"/trade/order/create",method:"POST",data:t}),getOrder:t=>e.request({url:"/trade/order/get-detail",method:"GET",params:{id:t},custom:{showLoading:!1}}),getOrderPage:t=>e.request({url:"/trade/order/page",method:"GET",params:t,custom:{showLoading:!1}}),receiveOrder:t=>e.request({url:"/trade/order/receive",method:"PUT",params:{id:t}}),cancelOrder:t=>e.request({url:"/trade/order/cancel",method:"DELETE",params:{id:t}}),deleteOrder:t=>e.request({url:"/trade/order/delete",method:"DELETE",params:{id:t}}),getOrderExpressTrackList:t=>e.request({url:"/trade/order/get-express-track-list",method:"GET",params:{id:t}}),getOrderCount:()=>e.request({url:"/trade/order/get-count",method:"GET",custom:{showLoading:!1,auth:!0}}),createOrderItemComment:t=>e.request({url:"/trade/order/item/create-comment",method:"POST",data:t})};exports.OrderApi=t;
