From f8f697f74b7c807a468927aaa1c96c0b3dcb152d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=96=B5=E5=92=AA?= <15233722133@163.com> Date: Mon, 10 Aug 2026 17:24:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=89=E6=8B=A9=E8=87=AA=E6=8F=90?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E5=88=97=E5=B1=95=E7=A4=BA=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/user/goods_details_store/index.vue | 82 +++++++++++++++++++++--- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/pages/user/goods_details_store/index.vue b/pages/user/goods_details_store/index.vue index 26083c0..64b32ec 100644 --- a/pages/user/goods_details_store/index.vue +++ b/pages/user/goods_details_store/index.vue @@ -45,6 +45,13 @@ #{{ index + 1 }} {{ item.name }} + + {{ getStoreStatusText(item.status) }} + {{ formatDistance(item.distance) }} @@ -53,12 +60,18 @@ {{ formatAddress(item) || '--' }} - - 营业中 {{ formatBusinessHours(item) }} + + + 营业中 {{ formatBusinessHours(item) }} + 导航 - 选择 + 选择 @@ -161,6 +174,10 @@ * 选中门店 */ const checked = (addressInfo) => { + if (!isStoreOpen(addressInfo)) { + uni.showToast({ title: '当前门店暂不支持自提', icon: 'none' }); + return; + } uni.$emit('SELECT_PICK_UP_INFO', { addressInfo, }); @@ -168,6 +185,10 @@ }; const onSelect = (item) => { + if (!isStoreOpen(item)) { + uni.showToast({ title: '当前门店暂不支持自提', icon: 'none' }); + return; + } state.selectedStoreId = Number(item?.id || 0); const lat = Number(item?.latitude); const lon = Number(item?.longitude); @@ -208,6 +229,12 @@ return `${start}-${end}`; }; + const STORE_STATUS_TEXT = { 1: '营业中', 2: '休息中', 3: '停用' }; + const STORE_STATUS_LEVEL = { 1: 'open', 2: 'rest', 3: 'closed' }; + const getStoreStatusText = (status) => STORE_STATUS_TEXT[Number(status)] || ''; + const getStoreStatusLevel = (status) => STORE_STATUS_LEVEL[Number(status)] || 'closed'; + const isStoreOpen = (item) => Number(item?.status) === 1; + const filteredStoreList = computed(() => { const list = Array.isArray(state.storeList) ? state.storeList : []; const kw = String(state.keyword || '').trim(); @@ -314,15 +341,18 @@ const ensureDefaultSelectedStore = async (list = []) => { const stores = Array.isArray(list) && list.length ? list : filteredStoreList.value; if (!stores.length) return null; + const openStores = stores.filter((o) => isStoreOpen(o)); + const candidates = openStores.length ? openStores : stores; let target = null; if (Number(state.selectedStoreId) > 0) { - target = stores.find((o) => Number(o?.id || 0) === Number(state.selectedStoreId)); + target = candidates.find((o) => Number(o?.id || 0) === Number(state.selectedStoreId)); } if (!target) { - target = stores.find((o) => Number(o?.latitude) && Number(o?.longitude)) || stores[0]; - state.selectedStoreId = Number(target?.id || 0); + target = + candidates.find((o) => Number(o?.latitude) && Number(o?.longitude)) || candidates[0]; + state.selectedStoreId = isStoreOpen(target) ? Number(target?.id || 0) : 0; } - if (target) { + if (target && isStoreOpen(target)) { const lat = Number(target?.latitude); const lon = Number(target?.longitude); if (lat && lon) { @@ -331,7 +361,7 @@ } await renderMarkerIcon(target, true); } - return target; + return isStoreOpen(target) ? target : null; }; const markers = computed(() => { @@ -575,6 +605,31 @@ margin-left: 10rpx; } + .store-status { + height: 32rpx; + padding: 0 12rpx; + border-radius: 999rpx; + font-size: 20rpx; + line-height: 32rpx; + margin-left: 12rpx; + flex-shrink: 0; + } + + .store-status--open { + background: rgba(18, 180, 107, 0.12); + color: #12b46b; + } + + .store-status--rest { + background: rgba(255, 159, 67, 0.12); + color: #ff9f43; + } + + .store-status--closed { + background: rgba(153, 153, 153, 0.12); + color: #999; + } + .store-address { margin-top: 10rpx; font-size: 24rpx; @@ -590,13 +645,22 @@ } .store-hours { + flex: 1; + min-width: 0; + height: 56rpx; + line-height: 56rpx; font-size: 22rpx; color: #12b46b; + margin-right: 14rpx; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } .store-actions { display: flex; align-items: center; + flex-shrink: 0; } .btn { @@ -608,10 +672,12 @@ font-size: 24rpx; line-height: 56rpx; margin-left: 14rpx; + flex-shrink: 0; } .btn--ghost { background: rgba(37, 86, 236, 0.12); color: #2556ec; + margin-left: 0; }