consumer模块完成95%,在和商家端对接聊天购物闭环

This commit is contained in:
2026-02-06 17:10:31 +08:00
parent 06b7369494
commit e2f1dfb097
1454 changed files with 5425 additions and 210555 deletions

View File

@@ -40,9 +40,9 @@
<text v-if="isShopSelected(group.shopId)" class="selected-icon">✓</text>
<text v-else class="unselected-icon"></text>
</view>
<text class="shop-icon">🏪</text>
<text class="shop-name">{{ group.shopName }}</text>
<text class="shop-arrow">></text>
<text class="shop-icon" @click="navigateToShop(group.shopId, group.merchantId)">🏪</text>
<text class="shop-name" @click="navigateToShop(group.shopId, group.merchantId)">{{ group.shopName }}</text>
<text class="shop-arrow" @click="navigateToShop(group.shopId, group.merchantId)">></text>
</view>
<!-- 店铺商品 -->
@@ -188,6 +188,7 @@ const cartGroups = computed(() => {
groups.set(shopKey, {
shopId: item.shopId,
shopName: item.shopName || '商城优选', // Better default name
merchantId: item.merchantId, // Add merchantId for navigation
items: [] as any[]
})
}
@@ -550,6 +551,17 @@ const addToCart = async (product: any) => {
}
// 导航函数
const navigateToShop = (shopId: string, merchantId: any) => {
// Prevent navigation for invalid shops
if (!shopId || shopId === 'default_shop' || shopId === 'unknown') return
let url = `/pages/mall/consumer/shop-detail?id=${shopId}`
if (merchantId) {
url += `&merchantId=${merchantId}`
}
uni.navigateTo({ url })
}
const goShopping = () => {
uni.switchTab({ url: '/pages/mall/consumer/index' })
}