Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master' into master

肖路 1 mese fa
parent
commit
24f447347d

+ 3 - 2
src/assets/styles/common.scss

@@ -61,9 +61,10 @@
   text-overflow: ellipsis;
 }
 .ellipsis2 {
-  display: -webkit-box;
+ display: -webkit-box;
   -webkit-line-clamp: 2;
-  line-clamp: 2; /* 添加标准属性 */
+  line-clamp: 2;
+  /* 添加标准属性 */
   -webkit-box-orient: vertical;
   overflow: hidden;
   text-overflow: ellipsis;

+ 31 - 13
src/views/home/index-fuli.vue

@@ -118,12 +118,12 @@
       <div class="goods-bos" v-for="(item, index) in goodsList" :key="index">
         <img class="goods-main" :src="item.mainImg" alt="" />
         <div class="goods-box">
-          <div v-for="(item1, index1) in 8" :key="index1" class="goods-list">
-            <img class="goods-img" :src="item.productImage ? item.productImage.split(',')[0] : ''" alt="" />
-            <div class="goods-name ellipsis2">{{ item.name || '' }}</div>
+          <div v-for="(item1, index1) in item.goodsList" :key="index1" class="goods-list">
+            <img class="goods-img" :src="item1.productImage ? item1.productImage.split(',')[0] : ''" alt="" />
+            <div class="goods-name ellipsis2">{{ item1.itemName || '' }}</div>
             <div class="goods-price">
-              <span class="price1">¥{{ item.memberPrice || '' }}</span>
-              <span class="price2">¥{{ item.marketPrice || '' }}</span>
+              <span class="price1">¥{{ item1.memberPrice || '' }}</span>
+              <span class="price2">¥{{ item1.marketPrice || '' }}</span>
             </div>
           </div>
         </div>
@@ -256,22 +256,40 @@ getHotCustomGiftFloorList({}).then((res) => {
 });
 
 //循环
-getAdvertisementGiftFloorList({}).then((res) => {
+getAdvertisementGiftFloorList({}).then(async (res) => {
   if (res.code == 200) {
-    goodsList.value = res.data;
-    res.data.forEach((item: any) => {
-      getGiftFloorLinkProductList({ floorId: item.id }).then((res) => {
-        if (res.code == 200) {
+    for (const item of res.data) {
+      try {
+        const datas2 = await getGiftFloorLinkProductList({ floorId: item.id });
+        if (datas2.code == 200) {
+          item.goodsList = datas2.data;
         }
-      });
-    });
+      } catch (error) {}
+    }
+
+    goodsList.value = res.data;
   }
 });
+// getAdvertisementGiftFloorList({}).then((res) => {
+//   if (res.code == 200) {
+//     goodsList.value = res.data;
+//     res.data.forEach((item: any) => {
+//       getGiftFloorLinkProductList({ floorId: item.id }).then((res) => {
+//         if (res.code == 200) {
+//         }
+//       });
+//     });
+//   }
+// });
 
 //为你推荐
 getRecommendGiftFloorList({}).then((res) => {
   if (res.code == 200) {
-    recommend.value = res.data;
+    getGiftFloorLinkProductList({floorId:res.data[0].id}).then((res1) => {
+      if (res1.code == 200) {
+        recommend.value = res1.data;
+      }
+    });
   }
 });
 </script>

+ 0 - 16
src/views/home/index-mro.vue

@@ -280,22 +280,6 @@ getIndustrialFloor({}).then(async (res) => {
   if (res.code == 200) {
     for (const item of res.data) {
       try {
-        // const datas1 = await getClassificationFloorDetail(item.floorNo);
-        // if (datas1.code == 200) {
-        //   if (datas1.data.length > 0) {
-        //     item.imgOne = datas1.data[0];
-        //     if (datas1.data.length > 1) {
-        //       item.home1List = datas1.data.slice(1, 4);
-        //     }
-        //     if (datas1.data.length > 4) {
-        //       item.home2List = datas1.data.slice(4, 6);
-        //     }
-        //     if (datas1.data.length > 6) {
-        //       item.infoTwo = datas1.data[6];
-        //     }
-        //   }
-        // }
-
         const datas2 = await getIndustrialFloorProductList({ floorId: item.id });
         if (datas2.code == 200) {
           item.goodsList = datas2.data;

+ 1 - 1
src/views/home/index.vue

@@ -274,7 +274,7 @@
         <template v-for="(item2, index2) in item1.shopList" :key="index2">
           <div class="shop-list" v-if="Number(index2) < 4" @click="onInfo(item2)">
             <img :src="item2.productImage" alt="" />
-            <div class="itemName">{{ item2.itemName }}</div>
+            <div class="itemName ellipsis2">{{ item2.itemName }}</div>
             <div class="price">
               <span class="memberPrice">¥{{ item2.memberPrice }}</span>
               <span class="marketPrice">¥{{ item2.marketPrice }}</span>