consumerm模块完成度90%,完善消费者和商家端数据库表,商品、聊天、订单数据对接好了supabase,和商家端对接了聊天功能,安卓端编译通过了css样式,剩余几个页面在处理函数规范问题

This commit is contained in:
cyh666666
2026-02-24 17:17:49 +08:00
parent e2f1dfb097
commit e606c597ca
174 changed files with 37917 additions and 4444 deletions

View File

@@ -6,13 +6,13 @@
<view class="shop-list" v-if="shops.length > 0">
<view class="shop-item" v-for="shop in shops" :key="shop.id" @click="goToShop(shop)">
<image :src="shop.shop_logo || '/static/default-shop.png'" class="shop-logo" mode="aspectFill" />
<image :src="shop.shop_logo != null ? shop.shop_logo : '/static/default-shop.png'" class="shop-logo" mode="aspectFill" />
<view class="shop-info">
<text class="shop-name">{{ shop.shop_name }}</text>
<text class="shop-desc">{{ shop.description || '暂无介绍' }}</text>
<text class="shop-desc">{{ shop.description != null ? shop.description : '暂无介绍' }}</text>
<view class="shop-meta">
<text class="rating">⭐ {{ shop.rating_avg || 5.0 }}</text>
<text class="sales">销量: {{ shop.total_sales || 0 }}</text>
<text class="rating shop-meta-text">⭐ {{ shop.rating_avg }}</text>
<text class="sales shop-meta-text">销量: {{ shop.total_sales }}</text>
</view>
</view>
<button class="unfollow-btn" @click.stop="unfollow(shop)">已关注</button>
@@ -72,8 +72,8 @@ const loadFollowedShops = async () => {
shop_name: shopData['shop_name'] as string,
shop_logo: shopData['shop_logo'] as string | null,
description: shopData['description'] as string | null,
rating_avg: (shopData['rating_avg'] || 5.0) as number,
total_sales: (shopData['total_sales'] || 0) as number
rating_avg: (shopData['rating_avg'] != null) ? (shopData['rating_avg'] as number) : 5.0,
total_sales: (shopData['total_sales'] != null) ? (shopData['total_sales'] as number) : 0
})
}
})
@@ -111,8 +111,9 @@ const goToShop = (shop: FollowedShop) => {
// Since shop-detail handles both, passing shop.id (which is ml_shops.id) is fine?
// Wait, shop-detail logic: 1. getShopByMerchantId(id) [tries merchant_id then id].
// So passing shop.id is safer if merchant_id is not unique or confusing.
const targetId = shop.merchant_id != '' ? shop.merchant_id : shop.id
uni.navigateTo({
url: `/pages/mall/consumer/shop-detail?merchantId=${shop.merchant_id || shop.id}`
url: `/pages/mall/consumer/shop-detail?merchantId=${targetId}`
})
}
@@ -125,7 +126,7 @@ const goHome = () => {
.followed-shops-page {
padding: 15px;
background-color: #f5f5f5;
min-height: 100vh;
flex: 1;
}
.header {
margin-bottom: 15px;
@@ -137,7 +138,6 @@ const goHome = () => {
.shop-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.shop-item {
background-color: #fff;
@@ -146,6 +146,10 @@ const goHome = () => {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 10px;
}
.shop-item:last-child {
margin-bottom: 0;
}
.shop-logo {
width: 50px;
@@ -178,7 +182,9 @@ const goHome = () => {
color: #999;
margin-top: 4px;
display: flex;
gap: 8px;
}
.shop-meta-text {
margin-right: 8px;
}
.unfollow-btn {
font-size: 12px;