From 8ac9f2714fbff7915e404599f8fa50fe28009663 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Mon, 9 Dec 2024 11:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=BC=BA=E9=99=B7=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=90=8C=E6=97=B6=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E4=B8=A4=E4=B8=AA=E5=95=86=E5=93=81=EF=BC=8C=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E4=BB=85=E6=94=AF=E6=8C=81=E9=97=A8=E5=BA=97=E8=87=AA?= =?UTF-8?q?=E6=8F=90=EF=BC=8C=E4=B8=80=E4=B8=AA=E4=BB=85=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=BF=AB=E9=80=92=E5=8F=91=E8=B4=A7=EF=BC=8C=E5=B0=B1=E4=BC=9A?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/cart.vue | 370 +++++++++++++++++++++------------------- pages/order/confirm.vue | 5 +- sheep/util/const.js | 6 +- 3 files changed, 207 insertions(+), 174 deletions(-) diff --git a/pages/index/cart.vue b/pages/index/cart.vue index 633b567d..59d740e7 100644 --- a/pages/index/cart.vue +++ b/pages/index/cart.vue @@ -1,192 +1,220 @@ \ No newline at end of file + .goods-box { + background-color: #fff; + } + } + } + diff --git a/pages/order/confirm.vue b/pages/order/confirm.vue index 5e8e2ba4..d0b495fd 100644 --- a/pages/order/confirm.vue +++ b/pages/order/confirm.vue @@ -228,6 +228,7 @@ import OrderApi from '@/sheep/api/trade/order'; import TradeConfigApi from '@/sheep/api/trade/config'; import { fen2yuan } from '@/sheep/hooks/useGoods'; + import { DeliveryTypeEnum } from '@/sheep/util/const'; const state = reactive({ orderPayload: {}, @@ -376,14 +377,14 @@ // 价格计算 // 情况一:先自动选择“快递物流” - addressState.value.deliveryType = 1; + addressState.value.deliveryType = DeliveryTypeEnum.EXPRESS.type; let orderCode = await getOrderInfo(); if (orderCode === 0) { return; } // 情况二:失败,再自动选择“门店自提” if (addressState.value.isPickUp) { - addressState.value.deliveryType = 2; + addressState.value.deliveryType = DeliveryTypeEnum.PICK_UP.type; let orderCode = await getOrderInfo(); if (orderCode === 0) { return; diff --git a/sheep/util/const.js b/sheep/util/const.js index ec6078db..e0411a58 100644 --- a/sheep/util/const.js +++ b/sheep/util/const.js @@ -119,7 +119,11 @@ export const PromotionActivityTypeEnum = { name: '积分商城', }, }; - +/** 配送方式枚举 */ +export const DeliveryTypeEnum = { + EXPRESS: { type: 1, name: '快递发货' }, + PICK_UP: { type: 2, name: '用户自提' }, +}; export const getTimeStatusEnum = (startTime, endTime) => { const now = dayjs(); if (now.isBefore(startTime)) {