2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
|
"use strict";var e=Object.defineProperty,r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,o=(r,t,d)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[t]=d;const a=require("../../request/index.js"),s=require("../../helper/utils.js"),i={settlementOrder:e=>{const i=((e,a)=>{for(var s in a||(a={}))t.call(a,s)&&o(e,s,a[s]);if(r)for(var s of r(a))d.call(a,s)&&o(e,s,a[s]);return e})({},e);e.couponId>0||delete i.couponId,e.addressId>0||delete i.addressId,e.pickUpStoreId>0||delete i.pickUpStoreId,s.isEmpty(e.receiverName)&&delete i.receiverName,s.isEmpty(e.receiverMobile)&&delete i.receiverMobile,e.combinationActivityId>0||delete i.combinationActivityId,e.combinationHeadId>0||delete i.combinationHeadId,e.seckillActivityId>0||delete i.seckillActivityId,delete i.items;for(let r=0;r<e.items.length;r++)i[encodeURIComponent("items["+r+"].skuId")]=e.items[r].skuId+"",i[encodeURIComponent("items["+r+"].count")]=e.items[r].count+"",e.items[r].cartId&&(i[encodeURIComponent("items["+r+"].cartId")]=e.items[r].cartId+"");const c=Object.keys(i).map((e=>e+"="+i[e])).join("&");return a.request({url:`/trade/order/settlement?${c}`,method:"GET",custom:{showError:!0,showLoading:!0}})},createOrder:e=>a.request({url:"/trade/order/create",method:"POST",data:e}),getOrder:e=>a.request({url:"/trade/order/get-detail",method:"GET",params:{id:e},custom:{showLoading:!1}}),getOrderPage:e=>a.request({url:"/trade/order/page",method:"GET",params:e,custom:{showLoading:!1}}),receiveOrder:e=>a.request({url:"/trade/order/receive",method:"PUT",params:{id:e}}),cancelOrder:e=>a.request({url:"/trade/order/cancel",method:"DELETE",params:{id:e}}),deleteOrder:e=>a.request({url:"/trade/order/delete",method:"DELETE",params:{id:e}}),getOrderExpressTrackList:e=>a.request({url:"/trade/order/get-express-track-list",method:"GET",params:{id:e}}),getOrderCount:()=>a.request({url:"/trade/order/get-count",method:"GET",custom:{showLoading:!1,auth:!0}}),createOrderItemComment:e=>a.request({url:"/trade/order/item/create-comment",method:"POST",data:e})};exports.OrderApi=i;
|