Browse Source

优化运营区域展示

viczhq 2 months ago
parent
commit
6372ac1b00

+ 6 - 4
src/components/index/OperationArea/index.jsx

@@ -31,9 +31,10 @@ const OperationArea = ({ recommend }) => {
31
           <View className="product-list">
31
           <View className="product-list">
32
             {item.goods &&
32
             {item.goods &&
33
               item.goods.map((product, productIndex) => (
33
               item.goods.map((product, productIndex) => (
34
-                <View key={productIndex} className="product-item">
35
-                  <Image
36
-                    className="product-img"
34
+                productIndex < 3 && (
35
+                  <View key={productIndex} className="product-item">
36
+                    <Image
37
+                      className="product-img"
37
                     src={product.image_url}
38
                     src={product.image_url}
38
                     mode="aspectFill"
39
                     mode="aspectFill"
39
                   />
40
                   />
@@ -46,7 +47,8 @@ const OperationArea = ({ recommend }) => {
46
                       ¥{product.original_price}
47
                       ¥{product.original_price}
47
                     </Text>
48
                     </Text>
48
                   </View>
49
                   </View>
49
-                </View>
50
+                  </View>
51
+                )
50
               ))}
52
               ))}
51
           </View>
53
           </View>
52
         </View>
54
         </View>

+ 0 - 42
src/components/index/RecommendList/index.jsx

@@ -7,48 +7,6 @@ import "./index.less";
7
 const RecommendList = () => {
7
 const RecommendList = () => {
8
   // 模拟推荐商品数据
8
   // 模拟推荐商品数据
9
   const recommendProducts = [
9
   const recommendProducts = [
10
-    {
11
-      id: 1,
12
-      name: "商品名称商品名称商品名称商品名称商品名称",
13
-      price: 99.99,
14
-      sharePrice: 0.12,
15
-      image: "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1saL6x.img?w=768&h=411&m=6"
16
-    },
17
-    {
18
-      id: 2,
19
-      name: "商品名称商品名称商品名称商品名称",
20
-      price: 88.88,
21
-      sharePrice: 0.12,
22
-      image: "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1saL6x.img?w=768&h=411&m=6"
23
-    },
24
-    {
25
-      id: 3,
26
-      name: "商品名称商品名称商品名称",
27
-      price: 77.77,
28
-      sharePrice: 0.12,
29
-      image: "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1saL6x.img?w=768&h=411&m=6"
30
-    },
31
-    {
32
-      id: 4,
33
-      name: "商品名称商品名称商品名称商品名称",
34
-      price: 66.66,
35
-      sharePrice: 0.12,
36
-      image: "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1saL6x.img?w=768&h=411&m=6"
37
-    },
38
-    {
39
-      id: 5,
40
-      name: "商品名称商品名称商品名称",
41
-      price: 55.55,
42
-      sharePrice: 0.12,
43
-      image: "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1saL6x.img?w=768&h=411&m=6"
44
-    },
45
-    {
46
-      id: 6,
47
-      name: "商品名称商品名称商品名称商品名称",
48
-      price: 44.44,
49
-      sharePrice: 0.12,
50
-      image: "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1saL6x.img?w=768&h=411&m=6"
51
-    }
52
   ];
10
   ];
53
 
11
 
54
   // 将商品数据按每3个分组
12
   // 将商品数据按每3个分组