|
|
@@ -8,8 +8,12 @@
|
|
|
<imageCube v-if="scenario.length > 0" :datas="scenario" :row="imageCubeData"></imageCube>
|
|
|
|
|
|
<!-- 热门定制 -->
|
|
|
- <indexFuilTitle :datas="{ title: '热门定制' }"></indexFuilTitle>
|
|
|
- <comGoods :row="{ styleType: 1, goodsShow: [1, 2, 3], goodsTitleType: 3 }" :datas="popular"></comGoods>
|
|
|
+ <div v-for="(item, index) in popularList" :key="index">
|
|
|
+ <template v-if="item.popular && item.popular.length > 0">
|
|
|
+ <indexFuilTitle :datas="{ title: item.name }"></indexFuilTitle>
|
|
|
+ <comGoods :row="{ styleType: 1, goodsShow: [1, 2, 3], goodsTitleType: 3 }" :datas="item.popular"></comGoods>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
|
|
|
<!-- 循环数据 -->
|
|
|
<div class="goods-bos" v-for="(item, index) in goodsList" :key="index">
|
|
|
@@ -18,8 +22,12 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 为您推荐 -->
|
|
|
- <indexFuilTitle :datas="{ title: '为您推荐' }"></indexFuilTitle>
|
|
|
- <comGoods :row="{ styleType: 1, goodsShow: [1, 2, 3], goodsTitleType: 3 }" :datas="recommend"></comGoods>
|
|
|
+ <div v-for="(item, index) in recommendList" :key="index">
|
|
|
+ <template v-if="item.recommend && item.recommend.length > 0">
|
|
|
+ <indexFuilTitle :datas="{ title: item.name }"></indexFuilTitle>
|
|
|
+ <comGoods :row="{ styleType: 1, goodsShow: [1, 2, 3], goodsTitleType: 3 }" :datas="item.recommend"></comGoods>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -46,9 +54,9 @@ const headData = ref<any>({});
|
|
|
const imageCubeData = ref<any>({});
|
|
|
const realList = ref<any>([]);
|
|
|
const scenario = ref<any>([]);
|
|
|
-const popular = ref<any>([]);
|
|
|
+const popularList = ref<any>([]);
|
|
|
const goodsList = ref<any>([]);
|
|
|
-const recommend = ref<any>([]);
|
|
|
+const recommendList = ref<any>([]);
|
|
|
|
|
|
onMounted(() => {
|
|
|
document.documentElement.style.setProperty('--hover-color', '#E7000B');
|
|
|
@@ -140,13 +148,17 @@ getRecommendAdList({}).then((res) => {
|
|
|
});
|
|
|
|
|
|
//热门定制
|
|
|
-getHotCustomGiftFloorList({}).then((res) => {
|
|
|
+getHotCustomGiftFloorList({}).then(async (res) => {
|
|
|
if (res.code == 200) {
|
|
|
- getGiftFloorLinkProductList({ floorId: res.data[0].id }).then((res1) => {
|
|
|
- if (res1.code == 200) {
|
|
|
- popular.value = res1.data;
|
|
|
- }
|
|
|
- });
|
|
|
+ for (const item of res.data) {
|
|
|
+ try {
|
|
|
+ const datas2 = await getGiftFloorLinkProductList({ floorId: item.id });
|
|
|
+ if (datas2.code == 200) {
|
|
|
+ item.popular = datas2.data;
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ }
|
|
|
+ popularList.value = res.data;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -184,13 +196,17 @@ getAdvertisementGiftFloorList({}).then(async (res) => {
|
|
|
});
|
|
|
|
|
|
// 为您推荐
|
|
|
-getRecommendGiftFloorList({}).then((res) => {
|
|
|
+getRecommendGiftFloorList({}).then(async (res) => {
|
|
|
if (res.code == 200) {
|
|
|
- getGiftFloorLinkProductList({ floorId: res.data[0].id }).then((res1) => {
|
|
|
- if (res1.code == 200) {
|
|
|
- recommend.value = res1.data;
|
|
|
- }
|
|
|
- });
|
|
|
+ for (const item of res.data) {
|
|
|
+ try {
|
|
|
+ const datas2 = await getGiftFloorLinkProductList({ floorId: item.id });
|
|
|
+ if (datas2.code == 200) {
|
|
|
+ item.recommend = datas2.data;
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ }
|
|
|
+ recommendList.value = res.data;
|
|
|
}
|
|
|
});
|
|
|
</script>
|