acdr-ui/dist/dev/mp-weixin/sheep/api/trade/order.js.map

1 line
6.2 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"version":3,"file":"order.js","sources":["../../../../../../src/sheep/api/trade/order.js"],"sourcesContent":["import request from '@/sheep/request'\r\nimport { isEmpty } from '@/sheep/helper/utils'\r\n\r\nconst OrderApi = {\r\n // 计算订单信息\r\n settlementOrder: (data) => {\r\n const data2 = {\r\n ...data,\r\n }\r\n // 移除多余字段\r\n if (!(data.couponId > 0)) {\r\n delete data2.couponId\r\n }\r\n if (!(data.addressId > 0)) {\r\n delete data2.addressId\r\n }\r\n if (!(data.pickUpStoreId > 0)) {\r\n delete data2.pickUpStoreId\r\n }\r\n if (isEmpty(data.receiverName)) {\r\n delete data2.receiverName\r\n }\r\n if (isEmpty(data.receiverMobile)) {\r\n delete data2.receiverMobile\r\n }\r\n if (!(data.combinationActivityId > 0)) {\r\n delete data2.combinationActivityId\r\n }\r\n if (!(data.combinationHeadId > 0)) {\r\n delete data2.combinationHeadId\r\n }\r\n if (!(data.seckillActivityId > 0)) {\r\n delete data2.seckillActivityId\r\n }\r\n // 解决 SpringMVC 接受 List<Item> 参数的问题\r\n delete data2.items\r\n for (let i = 0; i < data.items.length; i++) {\r\n data2[encodeURIComponent('items[' + i + '' + '].skuId')] = data.items[i].skuId + ''\r\n data2[encodeURIComponent('items[' + i + '' + '].count')] = data.items[i].count + ''\r\n if (data.items[i].cartId) {\r\n data2[encodeURIComponent('items[' + i + '' + '].cartId')] = data.items[i].cartId + ''\r\n }\r\n }\r\n const queryString = Object.keys(data2)\r\n .map((key) => key + '=' + data2[key])\r\n .join('&')\r\n return request({\r\n url: `/trade/order/settlement?${queryString}`,\r\n method: 'GET',\r\n custom: {\r\n showError: true,\r\n showLoading: true,\r\n },\r\n })\r\n },\r\n // 创建订单\r\n createOrder: (data) => {\r\n return request({\r\n url: `/trade/order/create`,\r\n method: 'POST',\r\n data,\r\n })\r\n },\r\n // 获得订单\r\n getOrder: (id) => {\r\n return request({\r\n url: `/trade/order/get-detail`,\r\n method: 'GET',\r\n params: {\r\n id,\r\n },\r\n custom: {\r\n showLoading: false,\r\n },\r\n })\r\n },\r\n // 订单列表\r\n getOrderPage: (params) => {\r\n return request({\r\n url: '/trade/order/page',\r\n method: 'GET',\r\n params,\r\n custom: {\r\n showLoading: false,\r\n },\r\n })\r\n },\r\n // 确认收货\r\n receiveOrder: (id) => {\r\n return request({\r\n url: `/trade/order/receive`,\r\n method: 'PUT',\r\n params: {\r\n id,\r\n },\r\n })\r\n },\r\n // 取消订单\r\n cancelOrder: (id) => {\r\n return request({\r\n url: `/trade/order/cancel`,\r\n method: 'DELETE',\r\n params: {\r\n id,\r\n },\r\n })\r\n },\r\n // 删除订单\r\n deleteOrder: (id) => {\r\n return request({\r\n url: `/trade/order/delete`,\r\n method: 'DELETE',\r\n params: {\r\n id,\r\n },\r\n })\r\n },\r\n // 获得交易订单的物流轨迹\r\n getOrderExpressTrackList: (id) => {\r\n return request({\r\n url: `/trade/order/get-express-track-list`,\r\n method: 'GET',\r\n params: {\r\n id,\r\n },\r\n })\r\n },\r\n // 获得交易订单数量\r\n getOrderCount: () => {\r\n return request({\r\n url: '/trade/order/get-count',\r\n method: 'GET',\r\n custom: {\r\n showLoading: false,\r\n auth: true,\r\n },\r\n })\r\n },\r\n // 创建单个评论\r\n createOrderItemComment: (data) => {\r\n return request({\r\n url: `/trade/order/item/create-comment`,\r\n method: 'POST',\r\n data,\r\n })\r\n },\r\n}\r\n\r\nexport default OrderApi\r\n"],"names":["isEmpty","request"],"mappings":";;;;;;;;;;;;;;;;;;;AAGK,MAAC,WAAW;AAAA;AAAA,EAEf,iBAAiB,CAAC,SAAS;AACzB,UAAM,QAAQ,mBACT;AAGL,QAAI,EAAE,KAAK,WAAW,IAAI;AACxB,aAAO,MAAM;AAAA,IACd;AACD,QAAI,EAAE,KAAK,YAAY,IAAI;AAC