From df3ce9eda79d591378a16fce49420537f9589013 Mon Sep 17 00:00:00 2001 From: chc <1501738723@qq.com> Date: Tue, 22 Nov 2022 17:19:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/store.js | 12 + api/trade.js | 38 +++ pages.json | 7 + pages/mine/address/storeAddress.vue | 88 +++++++ pages/order/fillorder.vue | 383 ++++++++++++++-------------- pages/order/orderDetail.vue | 117 ++++++--- 6 files changed, 413 insertions(+), 232 deletions(-) create mode 100644 pages/mine/address/storeAddress.vue diff --git a/api/store.js b/api/store.js index 00e8fe4..61c57b8 100644 --- a/api/store.js +++ b/api/store.js @@ -55,5 +55,17 @@ export function getStoreList(params) { } +/** + * 获取自提点信息 + * @param id + */ + export function getStoreAddress(storeId,params) { + return http.request({ + url: `/store/address/page/${storeId}`, + method: Method.GET, + params + }); +} + diff --git a/api/trade.js b/api/trade.js index bc4beb1..3143b08 100644 --- a/api/trade.js +++ b/api/trade.js @@ -155,6 +155,18 @@ export function setAddressId(addressId,way) { }); } +/** + * 设置收货地址ID + * @param addressId + */ + export function setStoreAddressId(storeAddressId,way) { + return http.request({ + url: `/trade/carts/storeAddress?storeAddressId=${storeAddressId}&way=${way}`, + method: Method.GET, + needToken: true, + + }); +} /** @@ -281,3 +293,29 @@ export function reBuy(sn) { needToken: true, }); } + + +/** + * 获取全部配送方式 + */ + export function shippingMethodList(params) { + return http.request({ + url: `/buyer/trade/carts/shippingMethodList`, + method: Method.GET, + needToken: true, + params: params, + }); +} + +/** + * 提交配送方式 + * @param params + */ + export function setShipMethod(params) { + return http.request({ + url: "/buyer/trade/carts/shippingMethod", + method: Method.PUT, + needToken: true, + params, + }); +} diff --git a/pages.json b/pages.json index af9e598..9a94654 100644 --- a/pages.json +++ b/pages.json @@ -225,6 +225,13 @@ "navigationBarTitleText": "地址管理" } }, + { + "path": "address/storeAddress", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "自提点" + } + }, { "path": "address/add", "style": { diff --git a/pages/mine/address/storeAddress.vue b/pages/mine/address/storeAddress.vue new file mode 100644 index 0000000..035a692 --- /dev/null +++ b/pages/mine/address/storeAddress.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/pages/order/fillorder.vue b/pages/order/fillorder.vue index 2ef494b..28d96c4 100644 --- a/pages/order/fillorder.vue +++ b/pages/order/fillorder.vue @@ -1,7 +1,7 @@ @@ -255,6 +281,10 @@ export default { title: "已完成", value: "订单已完成,祝您生活愉快", }, + STAY_PICKED_UP: { + title: "待自提", + value: "商品正在等待提取", + }, TAKE: { title: "待核验", }, @@ -272,7 +302,6 @@ export default { }, onLoad(options) { this.loadData(options.sn); - this.loadLogistics(options.sn); this.sn = options.sn; }, methods: { @@ -304,7 +333,7 @@ export default { this.orderGoodsList[0].goodsId, }); }, - loadData(sn) { + async loadData(sn) { uni.showLoading({ title: "加载中", }); @@ -313,9 +342,12 @@ export default { this.order = order.order; this.orderGoodsList = order.orderItems; this.orderDetail = res.data.result; - + if (this.order.deliveryMethod === 'LOGISTICS') { + this.loadLogistics() + } uni.hideLoading(); }); + }, onReceipt(val) { uni.navigateTo({ @@ -383,8 +415,8 @@ export default { toPay(val) { val.sn ? uni.navigateTo({ - url: "/pages/cart/payment/payOrder?order_sn=" + val.sn, - }) + url: "/pages/cart/payment/payOrder?order_sn=" + val.sn, + }) : false; }, //删除订单 deleteOrder(index) { @@ -491,9 +523,11 @@ export default {