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() {
- + + @checkoutRenting="handleCheckout" + /> + +
请绑定汇邦云账号
diff --git a/src/pages/product/components/RentingCabinetContainer.vue b/src/pages/product/components/RentingCabinetContainer.vue new file mode 100644 index 0000000..65b7430 --- /dev/null +++ b/src/pages/product/components/RentingCabinetContainer.vue @@ -0,0 +1,397 @@ + + + + + diff --git a/src/pages/product/components/cart.vue b/src/pages/product/components/cart.vue index 9960e87..83d994a 100644 --- a/src/pages/product/components/cart.vue +++ b/src/pages/product/components/cart.vue @@ -1,45 +1,95 @@ @@ -50,54 +100,91 @@ function handleCheckout() {
清空购物车
- - + + + +
- +
- 合计:¥{{ totalPrice.toFixed(2) }} + + 合计:¥{{ isRentingMode ? rentingCabinetStore.rentingCartTotalPrice : totalPrice.toFixed(2) }}
@@ -109,6 +196,7 @@ function handleCheckout() {