Browse Source

🎈 perf(product): 商品评分展示优化

陈雪 1 tháng trước cách đây
mục cha
commit
2d989c96f8

+ 2 - 2
src/components/product-list/data.json

@@ -5,7 +5,7 @@
     "price": 299.9,
     "cover": "https://t.xiaoyaotravel.com/image/TourImComplait/messageContent/890ed9e754c54ceaa886a3946d55adbe.png",
     "category": "Electronics",
-    "rate": 4.5,
+    "rate": 4.0,
     "sold": 1200
   },
   {
@@ -14,7 +14,7 @@
     "price": 159.0,
     "cover": "https://t.xiaoyaotravel.com/image/TourImComplait/messageContent/890ed9e754c54ceaa886a3946d55adbe.png",
     "category": "Daily Essentials",
-    "rate": 4.2,
+    "rate": 4.21,
     "sold": 850
   },
   {

+ 4 - 1
src/components/product-list/product-item.vue

@@ -4,7 +4,7 @@
     <image :src="product.cover" class="w-328rpx" mode="widthFix"></image>
     <view class="product-name">{{ product.name }}</view>
     <view class="sell-rate">
-      <view class="rate">
+      <view v-format="'number'" class="rate">
         {{ product.rate }}
         <image src="@/static/images/rate.svg" class="w-28rpx ml-8rpx" mode="widthFix"></image>
       </view>
@@ -50,13 +50,16 @@
     }
 
     .product-name {
+      height: 30rpx;
       margin-top: 16rpx;
+      overflow: hidden;
       font-family: 'PingFang SC';
       font-size: 28rpx;
       font-style: normal;
       font-weight: 600;
       line-height: 30rpx;
       color: $shop-text-3;
+      white-space: nowrap;
     }
 
     .sell-rate {