From 6943211e44eaedbdd2a013690c5f34ce12c7d33c Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Tue, 27 May 2025 00:37:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=B4=AD=E7=89=A9=E8=BD=A6):=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=8A=9F=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=AE=A2=E5=8D=95=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增购物车页面及API接口 - 在商品详情页添加加入购物车功能 - 修改订单创建流程支持购物车多商品结算 - 调整UI样式和交互细节 - 修复订单状态判断逻辑 --- api/api.js | 2 +- api/model/cart.js | 34 +++ api/model/index.js | 13 ++ components/base/kefu.vue | 3 +- components/base/tabbar.vue | 7 + components/productItem.vue | 10 + pages/index/cart.vue | 167 +++++++++++---- pages/index/order.vue | 21 +- pages_order/components/product/submit.vue | 4 +- pages_order/order/createOrder.vue | 50 ++--- pages_order/order/firmOrder.vue | 229 +++++++++++++++------ pages_order/order/orderDetail.vue | 41 ++-- pages_order/order/pictureOrder.vue | 2 +- pages_order/order/voiceOrder.vue | 2 +- pages_order/product/productDetail.vue | 20 +- pages_order/product/productList.vue | 4 +- .../components/uv-number-box/props.js | 2 +- 17 files changed, 452 insertions(+), 159 deletions(-) create mode 100644 api/model/cart.js diff --git a/api/api.js b/api/api.js index 061bea8..e8723cd 100644 --- a/api/api.js +++ b/api/api.js @@ -5,7 +5,7 @@ import utils from '../utils/utils.js' let limit = {} let debounce = {} -const models = ['login', 'index'] +const models = ['login', 'index', 'cart'] const config = { // 示例 diff --git a/api/model/cart.js b/api/model/cart.js new file mode 100644 index 0000000..16c83ce --- /dev/null +++ b/api/model/cart.js @@ -0,0 +1,34 @@ + + +// 登录相关接口 + +const api = { + // 获取购物车信息列表带分页 + getCartPageList: { + url: '/cat/getCartPageList', + method: 'GET', + limit : 500, + }, + // 加入购物车 + addCart: { + url: '/cat/addCart', + method: 'GET', + limit : 500, + }, + // 删除购物车信息 + deleteCart: { + url: '/cat/deleteCart', + method: 'POST', + auth: true, + }, + // 修改购物车信息数量 + updateCartNum: { + url: '/cat/updateCartNum', + method: 'POST', + auth: true, + limit : 500, + showLoading : true, + }, +} + +export default api \ No newline at end of file diff --git a/api/model/index.js b/api/model/index.js index 9fe5cdc..bf6a19b 100644 --- a/api/model/index.js +++ b/api/model/index.js @@ -32,6 +32,12 @@ const api = { method: 'POST', limit : 1000, }, + // 商城-加入购物车之后一次下多个订单 + createSumOrder: { + url: '/order/createSumOrder', + method: 'POST', + limit : 1000, + }, // 支付订单 payOrder: { url: '/index/payOrder', @@ -43,6 +49,12 @@ const api = { method: 'POST', limit : 1000, }, + // 取消快捷订单 + cancelOrderFast: { + url: '/index/cancelOrder', + method: 'POST', + limit : 1000, + }, // 获取快捷下单信息 getOrderInfo: { url: '/index/getOrderInfo', @@ -135,6 +147,7 @@ const api = { method: 'POST', limit : 1000, }, + } export default api \ No newline at end of file diff --git a/components/base/kefu.vue b/components/base/kefu.vue index 52cf33c..c4333b9 100644 --- a/components/base/kefu.vue +++ b/components/base/kefu.vue @@ -41,13 +41,14 @@