فهرست منبع

fix(ui): 登录前热门商品恢复一列列表展示(与登录后两列商城模式区分)

任务: home-hot-products-one-column
- pages/index-home/index.vue:登录前「热门商品」由 DimensionProducts layout=mall(两列大卡)改回一列列表(左图右文 product-list/product-card),与登录后推荐商品(两列 DimensionProducts layout=mall)明确区分
- 保留 loadDiscoverProducts 的 sales_count 降序排序与 intro/description 纯文本化(plainText),商品简介仍展示纯文本,不再出现 HTML 源码
- components/DimensionProducts.vue:回退上一轮新增的 layout=mall 简介行(登录前不再使用该组件;登录后首页/成长页推荐商品不传 desc,本就无需展示)

验证:verify-vue-compile.js 2 文件 PASS;audit-mp-antipatterns ERROR 0
Agnes Agent 1 هفته پیش
والد
کامیت
893a757e77
2فایلهای تغییر یافته به همراه13 افزوده شده و 14 حذف شده
  1. 0 13
      cfc-frontend/components/DimensionProducts.vue
  2. 13 1
      cfc-frontend/pages/index-home/index.vue

+ 0 - 13
cfc-frontend/components/DimensionProducts.vue

@@ -8,7 +8,6 @@
         <image class="product-img" :class="layout === 'mall' ? 'product-img-mall' : ''" :src="getImageUrl(prod.coverImage) || '/static/default-product.png'" mode="aspectFill"  lazy-load />
         <view class="product-body" :class="layout === 'mall' ? 'product-body-mall' : ''">
           <text class="product-name" :class="layout === 'mall' ? 'product-name-mall' : ''">{{ prod.name }}</text>
-          <text v-if="layout === 'mall' && prod.desc" class="product-desc-mall">{{ prod.desc }}</text>
           <view class="price-row">
             <text class="product-price" :class="layout === 'mall' ? 'product-price-mall' : ''" v-if="prod.priceLabel">{{ prod.priceLabel }}</text>
             <text class="product-price" :class="layout === 'mall' ? 'product-price-mall' : ''" v-else-if="prod.price">{{ formatPriceWithSymbol(prod.price) }}</text>
@@ -230,18 +229,6 @@ export default {
   -webkit-box-orient: vertical;
   white-space: normal;
 }
-.product-desc-mall {
-  display: -webkit-box;
-  font-size: calc(22rpx * var(--font-scale, 1));
-  color: $facade-text-muted;
-  line-height: 1.5;
-  margin-bottom: 8rpx;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  -webkit-line-clamp: 2;
-  -webkit-box-orient: vertical;
-  white-space: normal;
-}
 .product-price-mall {
   font-size: calc(28rpx * var(--font-scale, 1));
 }

+ 13 - 1
cfc-frontend/pages/index-home/index.vue

@@ -409,7 +409,19 @@
         <view v-if="hotProducts.length === 0" class="empty-state" style="padding: 40rpx 0;">
           <text class="empty-text">暂无商品</text>
         </view>
-        <DimensionProducts v-else :products="hotProducts" layout="mall" @productClick="goHotProduct" />
+        <view class="product-list" v-else>
+          <view class="product-card" v-for="prod in hotProducts" :key="prod.id" @click="goHotProduct(prod)">
+            <image class="product-cover" :src="getImageUrl(prod.coverImage) || '/static/default-product.png'" mode="aspectFill" lazy-load />
+            <view class="product-info">
+              <text class="product-name line-clamp-1">{{ prod.name }}</text>
+              <text class="product-desc line-clamp-1">{{ prod.desc }}</text>
+              <view class="product-bottom">
+                <text class="product-fee" v-if="prod.price">¥{{ prod.price }}</text>
+                <text class="product-fee" v-else>立即查看 ›</text>
+              </view>
+            </view>
+          </view>
+        </view>
       </view>
     </view>