From 716abc5c7687341a3b3501d26036d727d1c618ea Mon Sep 17 00:00:00 2001 From: hflllll Date: Wed, 14 May 2025 15:41:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B0=E7=AC=AC=E4=BA=8C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=20=E5=AE=A2=E6=88=B7=E4=BD=93=E9=AA=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/model/order.js | 25 ++++++- pages/index/cart.vue | 21 ++++-- pages/index/center.vue | 75 ++++++++++++++++---- pages/index/order.vue | 102 +++++++++++++-------------- pages_order/mine/team.vue | 131 +++++++++++++++++++++-------------- pages_order/order/newOrderDetail.vue | 2 +- 6 files changed, 233 insertions(+), 123 deletions(-) diff --git a/api/model/order.js b/api/model/order.js index 946e2bd..152b570 100644 --- a/api/model/order.js +++ b/api/model/order.js @@ -42,6 +42,13 @@ const api = { limit: 500 }, + // 订单-购物车-删除购物车 + deleteShopcar: { + url: '/teambuy/shopcar/deleteShopcar', + method: 'POST', + limit: 500 + }, + // 订单-支付订单 payOrder: { url: '/teambuy/order/payOrder', @@ -117,7 +124,23 @@ const api = { url: '/teambuy/afterservice/addAfterService', method: 'POST', limit: 500 - } + }, + + // 订单-取消团员订单 + deleteMemberOrderById: { + url: '/teambuy/order/deleteMemberOrderById', + method: 'POST', + limit: 500 + }, + + // 订单-团员完成取餐 + finishMemberOrderById: { + url: '/teambuy/order/finishMemberOrderById', + method: 'POST', + limit: 500 + }, + + } export default api \ No newline at end of file diff --git a/pages/index/cart.vue b/pages/index/cart.vue index 51ccd10..56ba621 100644 --- a/pages/index/cart.vue +++ b/pages/index/cart.vue @@ -102,6 +102,9 @@ export default { } return total }, 0) + }, + deleteCartIds(){ + return this.checkboxValue.join(';') } }, methods: { @@ -115,11 +118,11 @@ export default { }) }, // 增加或者减少数量 - modifyCart(item){ + modifyCart(item, type){ this.$api('addShopcar', { goodsId: item.goodsId, id: item.id, - num: item.num + num: type, }, res => { console.log(res); }) @@ -134,13 +137,13 @@ export default { }, increaseQuantity(item) { item.num += 1; - this.modifyCart(item) + this.modifyCart(item, 1) // this.updateCart(); }, decreaseQuantity(item) { if (item.num > 1) { item.num -= 1; - this.modifyCart(item) + this.modifyCart(item, -1) } }, // 结账 @@ -180,6 +183,16 @@ export default { }) // 编写收藏函数的调用 }, 800) + }, + // 删除购物车 + deleteCart(){ + this.$api('deleteShopcar', { + shopcarId: this.deleteCartIds, + }, res => { + if (res.code == 200){ + this.getCartData() + } + }) } }, onShow(){ diff --git a/pages/index/center.vue b/pages/index/center.vue index f4fca88..4e9a331 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -182,9 +182,6 @@ diff --git a/pages_order/mine/team.vue b/pages_order/mine/team.vue index d3535af..6aac428 100644 --- a/pages_order/mine/team.vue +++ b/pages_order/mine/team.vue @@ -5,21 +5,23 @@ color="#fff" /> -