diff --git a/src/pages/product/ProductList.vue b/src/pages/product/ProductList.vue index ce53893..16998e1 100644 --- a/src/pages/product/ProductList.vue +++ b/src/pages/product/ProductList.vue @@ -137,10 +137,16 @@ const currentProducts = computed(() => { // 组件挂载时添加滚动监听 onMounted(() => { + const urlParams = new URLSearchParams(window.location.search); + const shopIdParam = urlParams.get('shopId') || undefined; + if (showShopList.value) { getShopListApi(wxStore.corpid).then((res) => { if (res?.code === 0 && res?.data?.length > 0) { shopList.value = res.data; + if (shopIdParam && shopList.value.some(shop => shop.shopId.toString() == shopIdParam)) { + handleShopSelect(parseInt(shopIdParam)); + } } }); } else {