diff --git a/src/base/ShopItem/ShopItem.vue b/src/base/ShopItem/ShopItem.vue index cb95712..c6dd976 100644 --- a/src/base/ShopItem/ShopItem.vue +++ b/src/base/ShopItem/ShopItem.vue @@ -1,11 +1,11 @@ @@ -14,7 +14,8 @@ const props = defineProps({ shop: Object, config: Object, - isRow: Boolean + isRow: Boolean, + isFood: Boolean }) const emits = defineEmits(['click']) @@ -97,5 +98,47 @@ function handleShop() { } } } + &.isFood { + display: flex; + flex-direction: column; + width: 230px; + height: 242px; + background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 100%); + border-radius: 40px; + align-items: center; + .logo-wrapper { + width: 180px; + height: 180px; + background: rgba(255, 255, 255, 0.8); + border-radius: 200px; + padding: 30px; + &.hasFood { + padding: 0; + } + .shop-logo { + border-radius: 200px; + } + } + .name { + display: block; + width: 100%; + .shop-name { + display: block; + margin-top: 12px; + text-align: center; + } + .name-right { + display: block; + text-align: center; + font-family: 'Montserrat'; + font-style: normal; + font-weight: 700; + font-size: 14px; + line-height: 17px; + color: rgba(0, 0, 0, 0.6); + margin-top: 6px; + } + } + } } diff --git a/src/components/BrandScroll/BrandScroll.vue b/src/components/BrandScroll/BrandScroll.vue index e8b9c4c..e7b4ca3 100644 --- a/src/components/BrandScroll/BrandScroll.vue +++ b/src/components/BrandScroll/BrandScroll.vue @@ -6,7 +6,7 @@ {{ item.name }}/ {{ item.shopList.length }}个 - + @@ -21,7 +21,8 @@ const scroll = ref(null) const props = defineProps({ list: Array, config: Object, - isRow: Boolean + isRow: Boolean, + isFood: Boolean }) const emits = defineEmits(['click']) diff --git a/src/views/Brand/Brand.vue b/src/views/Brand/Brand.vue index 1e47537..bf7ccfd 100644 --- a/src/views/Brand/Brand.vue +++ b/src/views/Brand/Brand.vue @@ -1,132 +1,28 @@ diff --git a/src/views/Brand/Tabs.js b/src/views/Brand/Tabs.js deleted file mode 100644 index c7d8ec7..0000000 --- a/src/views/Brand/Tabs.js +++ /dev/null @@ -1,14 +0,0 @@ -export const list = [ - { - name: '业态筛选', - nameEn: 'Format', - icon: require('@/assets/images/brand/format.png'), - iconActive: require('@/assets/images/brand/format_active.png') - }, - { - name: '楼层筛选', - nameEn: 'floor', - icon: require('@/assets/images/brand/floor.png'), - iconActive: require('@/assets/images/brand/floor_active.png') - } -] diff --git a/src/views/Foods/Foods.vue b/src/views/Foods/Foods.vue index ba1b8d3..a9e55b4 100644 --- a/src/views/Foods/Foods.vue +++ b/src/views/Foods/Foods.vue @@ -1,37 +1,6 @@ @@ -39,58 +8,23 @@ import { ref } from 'vue' import { storeToRefs } from 'pinia' import { useStore } from '@/store/root' -import { getBrandList, getBrandListByFloor } from '@/http/brand/api' +import { getBrandListByFloor } from '@/http/brand/api' import View from '@/layouts/View.vue' -import BrandRecommend from '@/components/BrandRecommend/BrandRecommend.vue' import BrandScroll from '@/components/BrandScroll/BrandScroll.vue' -const ALL_BRAND = '全部品牌' - const store = useStore() -const { config, currentFloor, shopList } = storeToRefs(store) +const { config, shopList } = storeToRefs(store) -const idlecallback = ref(null) const selectedList = ref([]) -let foodsList = [] -const selectedTitle = ref(ALL_BRAND) -const formatList = ref([]) -const recommendList = ref([]) -Promise.all([getBrandList(), getBrandListByFloor()]).then(([_formatList, _brandList]) => { - const child = _formatList.data.industryFatherList.find(item => item.isSpecial)?.industryList ?? [] - idlecallback.value = requestIdleCallback(() => { - formatList.value = [ - { - code: '123', - industryName: ALL_BRAND, - industryNameEn: 'All', - isSpecial: true - }, - ...child - ] - selectedList.value = foodsList = _brandList.data.list.map(item => ({ - name: item.name, - shopList: item.shopList.filter(shop => shop.isSpecial) - })) - recommendList.value = _formatList.data.recommendList - }) -}) +Promise.all([getBrandListByFloor()]).then(([_brandList]) => { + const list = _brandList.data.list.map(item => ({ + name: item.name, + shopList: item.shopList.filter(shop => shop.isSpecial) + })) -const formatIdx = ref(0) -function handleFormat(item, index) { - formatIdx.value = index - selectedTitle.value = item.industryName - if (index === 0) { - selectedList.value = foodsList - return - } - idlecallback.value = requestIdleCallback(() => { - selectedList.value = foodsList.map(brand => ({ - ...brand, - shopList: brand.shopList.filter(shop => shop.industryId === item.industryId) - })) - }) -} + selectedList.value = list +}) function handleShop(item) { const shop = shopList.value.find(_shop => _shop.shopId === item.shopId) @@ -100,82 +34,8 @@ function handleShop(item) { diff --git a/src/views/Guide/Guide.vue b/src/views/Guide/Guide.vue index 8dbe625..a9dd8aa 100644 --- a/src/views/Guide/Guide.vue +++ b/src/views/Guide/Guide.vue @@ -177,11 +177,17 @@ watch( top: 1050px; height: 100px; z-index: 60; - display: flex; + display: block; + overflow-y: hidden; + overflow-x: scroll; background: linear-gradient(113.71deg, #435acd 0%, #749cf3 100%); + &::-webkit-scrollbar { + display: none; + } .floors-item { flex: 1; - display: flex; + display: inline-flex; + width: 122.5px; align-items: center; justify-content: center; position: relative; diff --git a/src/views/Index/Index.vue b/src/views/Index/Index.vue index ec2dcf7..1da13a5 100644 --- a/src/views/Index/Index.vue +++ b/src/views/Index/Index.vue @@ -26,6 +26,24 @@
{{ bf }}
+ +
+
+

推荐品牌

+

心动之选,拥抱美好生活

+
+
+ +
+
@@ -54,13 +72,14 @@ import { useRouter } from 'vue-router' import { storeToRefs } from 'pinia' import { useStore } from '@/store/root' import { getBrandList } from '@/http/brand/api' +import { getWaterfallList } from '@/http/api' import View from '@/layouts/View.vue' const router = useRouter() const store = useStore() -const { indexList, currentFloor, buildingList, shopList, sidebarList, selectedModule } = storeToRefs(store) +const { indexList, currentFloor, buildingList, shopList, sidebarList, selectedModule, config } = storeToRefs(store) const guideDesc = ref('') - +const foodList = computed(() => shopList.value.filter(({ isSpecial }) => isSpecial).slice(0, 12) ?? []) const hotRecommend = computed(() => indexList.value.hotSearch.slice(0, 5) ?? []) const cardsList = computed(() => indexList.value.columnList ?? []) const bf = computed(() => (buildingList.length > 1 ? currentFloor.value.building + '-' : '') + currentFloor.value.floor) @@ -151,6 +170,7 @@ function handleHot(item) { height: 557px; .guide { position: relative; + flex: 0 0 339px; width: 339px; height: 557px; background: linear-gradient(99.5deg, #f0b92b 0%, #f9d556 100%); @@ -216,6 +236,80 @@ function handleHot(item) { color: #000000; } } + .food, + .rec { + h1 { + font-weight: 900; + font-size: 56px; + line-height: 66px; + color: #ffffff; + margin-bottom: 8px; + } + h2 { + font-weight: 700; + font-size: 16px; + line-height: 19px; + color: rgba(255, 255, 255, 0.8); + } + .grid { + margin-top: 40px; + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + width: 485px; + gap: 15px; + .item { + width: 110px; + height: 110px; + background: #ffffff; + border-radius: 12px; + padding: 10px; + object-fit: contain; + } + } + } + .food { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin-left: 40px; + background: linear-gradient(180deg, #ffffff 0%, #f2f4f8 100%); + border-radius: 32px; + border: 4px solid rgba(246, 139, 81, 1); + align-items: center; + overflow: hidden; + .title { + margin-top: 4px; + width: 549px; + background: center / cover no-repeat url(./foodBg.png); + height: 160px; + flex: 0 0 160px; + box-shadow: 0px 15px 26px rgba(244, 142, 88, 0.32); + border-radius: 27px; + padding: 32px 0 0 40px; + } + } + .rec { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin-left: 40px; + background: linear-gradient(180deg, #ffffff 0%, #f2f4f8 100%); + border-radius: 32px; + align-items: center; + overflow: hidden; + .title { + margin-top: 8px; + width: 549px; + background: center / cover no-repeat url(./recBg.png); + height: 160px; + flex: 0 0 160px; + box-shadow: 0px 15px 26px rgba(230, 201, 148, 0.3); + border-radius: 27px; + padding: 32px 0 0 40px; + } + } } .r2 { display: flex; diff --git a/src/views/Index/foodBg.png b/src/views/Index/foodBg.png new file mode 100644 index 0000000..80bc9df Binary files /dev/null and b/src/views/Index/foodBg.png differ diff --git a/src/views/Index/recBg.png b/src/views/Index/recBg.png new file mode 100644 index 0000000..2dfec70 Binary files /dev/null and b/src/views/Index/recBg.png differ