From ba5400a516dd405b0d7cca637f1276ac25eda1b8 Mon Sep 17 00:00:00 2001 From: liruiqiang <3151805288@qq.com> Date: Fri, 22 Aug 2025 15:40:59 +0800 Subject: [PATCH] =?UTF-8?q?SKU=E6=A8=A1=E5=9D=97=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/goods/goods.vue | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/pages/goods/goods.vue b/src/pages/goods/goods.vue index 089e069..5caabfe 100644 --- a/src/pages/goods/goods.vue +++ b/src/pages/goods/goods.vue @@ -30,7 +30,7 @@ 选择 - 请选择商品规格 + {{ selectArrText }} 送至 @@ -121,6 +121,12 @@ :mode="mode" add-cart-background-color="#FFA868" buy-now-background-color="#27BA9B" + ref="skuPopupRef" + :actived-style="{ + color: '#27BA9B', + borderColor: '#27BA9B', + backgroundColor: '#E9F8F5', + }" /> @@ -131,7 +137,10 @@ import type { GoodsResult } from '@/types/goods' import { getGoodsByIdAPI } from '@/services/goods' import AddressPanel from './components/AddressPanel.vue' import ServicePanel from './components/ServicePanel.vue' -import type { SkuPopupLocaldata } from '@/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup' +import type { + SkuPopupInstance, + SkuPopupLocaldata, +} from '@/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup' // 获取屏幕边界到安全区域距离 const { safeAreaInsets } = uni.getSystemInfoSync() @@ -223,6 +232,14 @@ const openSkuPopup = (val: SkuMode) => { // 修改按钮模式 mode.value = val } + +// SKU组件实例 +const skuPopupRef = ref() + +// 计算被选中的值 +const selectArrText = computed(() => { + return skuPopupRef.value?.selectArr?.join(' ').trim() || '请选择商品规格' +})