diff --git a/src/pages/product/ProductList.vue b/src/pages/product/ProductList.vue index 952371b..b8c6f82 100644 --- a/src/pages/product/ProductList.vue +++ b/src/pages/product/ProductList.vue @@ -14,6 +14,8 @@ import { bindQyUserApi } from "@/common/apis/ab98" import { getShopListApi } from "@/common/apis/shop" import { ShopEntity } from "@/common/apis/shop/type" import ProductContainer from "./components/ProductContainer.vue" +import RentingCabinetContainer from "./components/RentingCabinetContainer.vue" +import { useRentingCabinetStoreOutside } from "@/pinia/stores/rentingCabinet" const router = useRouter() const route = useRoute() @@ -21,6 +23,7 @@ const route = useRoute() const productStore = useProductStore(); const cartStore = useCartStore(); const wxStore = useWxStore(); +const rentingCabinetStore = useRentingCabinetStoreOutside(); const { openid, corpidLogin, ab98User, qyUserId } = storeToRefs(wxStore); @@ -47,8 +50,13 @@ function handleShopSelect(selectedShopId: number) { shopId.value = selectedShopId; showShopList.value = false; productStore.setSelectedShop(shopList.value.find(shop => shop.shopId === selectedShopId)!); - productStore.getGoods(selectedShopId); + if(productStore.selectedShop?.mode == 3) { + rentingCabinetStore.fetchRentingCabinetDetail(selectedShopId); + } else { + productStore.getGoods(selectedShopId); + } cartStore.clearCart(); + rentingCabinetStore.clearRentingCart(); } @@ -157,10 +165,15 @@ async function handleAb98Bind() {