liyongle 3 years ago
parent
commit
da0c641a4d
  1. 2
      .vscode/settings.json
  2. 1866
      public/static/offline/JSON/GetMapInfo.json
  3. 6
      public/static/offline/JSON/getBackTime.json
  4. 149
      public/static/offline/JSON/getBrandShopList.json
  5. 10
      public/static/offline/JSON/getMallInfo.json
  6. 10
      src/assets/images/brand/icon_heart.svg
  7. 3
      src/assets/images/brand/icon_pos.svg
  8. 108
      src/components/ShopItem/ShopItem.vue
  9. 72
      src/components/TypeBtnList/TypeBtnList.vue
  10. 14
      src/http/api/brand/types.ts
  11. 7
      src/router/routes.ts
  12. 2
      src/types/industry.d.ts
  13. 270
      src/views/Brand/Brand.vue

2
.vscode/settings.json

@ -3,7 +3,7 @@
"source.fixAll.stylelint": true, "source.fixAll.stylelint": true,
"source.fixAll.eslint": true "source.fixAll.eslint": true
}, },
"editor.fontSize": 18,
"editor.fontSize": 15,
"cSpell.words": [ "cSpell.words": [
"chahao", "chahao",
"columer", "columer",

1866
public/static/offline/JSON/GetMapInfo.json

File diff suppressed because one or more lines are too long

6
public/static/offline/JSON/getBackTime.json

@ -1 +1,5 @@
{"code":200,"msg":"操作成功","data":[60,60]}
{
"code": 200,
"msg": "操作成功",
"data": [600, 600]
}

149
public/static/offline/JSON/getBrandShopList.json

@ -1 +1,148 @@
{"code":200,"msg":"操作成功","data":{"allShopNum":5,"floorList":[{"building":"A","floor":"B4","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"uDKfemAB1vCVZsudb_hmh"},{"building":"A","floor":"B3","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"ktEJNAQBDLLr_o7bpQh74"},{"building":"A","floor":"LG2","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"DvdHx4Xhv2C5Yc_dxyDup"},{"building":"A","floor":"LG","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"Y_gTy-qqMogOmHJlbDsIr"},{"building":"A","floor":"L1","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"-vH5uZXijKrzlJQIIIkba"},{"building":"A","floor":"L2","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"vVq2ZOi0H7-tpjZHRdZyE"},{"building":"A","floor":"L3","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"UHo56B1ktH2zS6gLnzuij"},{"building":"A","floor":"L4","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"6JbqB2VzMiXV52gvPE4K4"},{"building":"A","floor":"L5","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"hZs9j374JhdAK_IsNV1vc"},{"building":"A","floor":"L6","buildingCode":"suG1YjUhWnvRBJm3ULnCo","floorCode":"sC2NmA7VAOxLZ1-Su3DXo"}],"recommendList":[{"industryName":"餐饮","shopCode":"N58iWdPNw2wAB0X8BxmW1","shopName":"星巴克","shopNameEn":"","logoUrl":"/iotFile/2023/04/18/Jrw0_ifPRL40HwIJuQMv7.png","industryUrl":"/iotFile/2023/04/19/T25A8zEygrRp9WxBOlXj_.png","building":"A","floor":"L1","intro":"","introEn":"","businessHours":"","contact":"","isNewShop":0,"xaxis":"","yaxis":"","navXaxis":"","navYaxis":"","doorMaterialList":["/iotFile/2023/04/19/V2UUfgleZ3SUV4H_shCq2.jpeg"],"foodMaterialList":[],"buildingCode":"suG1YjUhWnvRBJm3ULnCo","buildingOrder":0,"floorCode":"-vH5uZXijKrzlJQIIIkba","floorOrder":4}],"industryFatherList":[{"fileUrl":"/iotFile/2023/04/19/T25A8zEygrRp9WxBOlXj_.png","isSpecial":0,"industryCode":"p4E21-vTzrb-rU0FQnzcG","industryName":"餐饮","shopNum":3,"industryList":[{"industryCode":"GOK_kIXzGq7PVYMB2AJlt","industryName":"美食","shopNum":3}]},{"fileUrl":"/iotFile/2023/04/19/0QbPfyN2cvDiy1te5odlp.png","isSpecial":0,"industryCode":"Hqv9P3BtktRX919qjQZWv","industryName":"餐饮1","shopNum":2,"industryList":[]}],"buildingList":[{"building":"A","buildingCode":"suG1YjUhWnvRBJm3ULnCo","buildingOrder":0,"floorList":[{"floor":"B4","floorCode":"uDKfemAB1vCVZsudb_hmh","floorOrder":0},{"floor":"B3","floorCode":"ktEJNAQBDLLr_o7bpQh74","floorOrder":1},{"floor":"LG2","floorCode":"DvdHx4Xhv2C5Yc_dxyDup","floorOrder":2},{"floor":"LG","floorCode":"Y_gTy-qqMogOmHJlbDsIr","floorOrder":3},{"floor":"L1","floorCode":"-vH5uZXijKrzlJQIIIkba","floorOrder":4},{"floor":"L2","floorCode":"vVq2ZOi0H7-tpjZHRdZyE","floorOrder":5},{"floor":"L3","floorCode":"UHo56B1ktH2zS6gLnzuij","floorOrder":6},{"floor":"L4","floorCode":"6JbqB2VzMiXV52gvPE4K4","floorOrder":7},{"floor":"L5","floorCode":"hZs9j374JhdAK_IsNV1vc","floorOrder":8},{"floor":"L6","floorCode":"sC2NmA7VAOxLZ1-Su3DXo","floorOrder":9}]}]}}
{
"code": 200,
"msg": "操作成功",
"data": {
"allShopNum": 5,
"floorList": [{
"building": "A",
"floor": "B4",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "uDKfemAB1vCVZsudb_hmh"
}, {
"building": "A",
"floor": "B3",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "ktEJNAQBDLLr_o7bpQh74"
}, {
"building": "A",
"floor": "LG2",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "DvdHx4Xhv2C5Yc_dxyDup"
}, {
"building": "A",
"floor": "LG",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "Y_gTy-qqMogOmHJlbDsIr"
}, {
"building": "A",
"floor": "L1",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "-vH5uZXijKrzlJQIIIkba"
}, {
"building": "A",
"floor": "L2",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "vVq2ZOi0H7-tpjZHRdZyE"
}, {
"building": "A",
"floor": "L3",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "UHo56B1ktH2zS6gLnzuij"
}, {
"building": "A",
"floor": "L4",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "6JbqB2VzMiXV52gvPE4K4"
}, {
"building": "A",
"floor": "L5",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "hZs9j374JhdAK_IsNV1vc"
}, {
"building": "A",
"floor": "L6",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"floorCode": "sC2NmA7VAOxLZ1-Su3DXo"
}],
"recommendList": [{
"industryName": "餐饮",
"shopCode": "N58iWdPNw2wAB0X8BxmW1",
"shopName": "星巴克",
"shopNameEn": "",
"logoUrl": "/iotFile/2023/04/18/Jrw0_ifPRL40HwIJuQMv7.png",
"industryUrl": "/iotFile/2023/04/19/T25A8zEygrRp9WxBOlXj_.png",
"building": "A",
"floor": "L1",
"intro": "",
"introEn": "",
"businessHours": "",
"contact": "",
"isNewShop": 0,
"xaxis": "",
"yaxis": "",
"navXaxis": "",
"navYaxis": "",
"doorMaterialList": ["/iotFile/2023/04/19/V2UUfgleZ3SUV4H_shCq2.jpeg"],
"foodMaterialList": [],
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"buildingOrder": 0,
"floorCode": "-vH5uZXijKrzlJQIIIkba",
"floorOrder": 4
}],
"industryFatherList": [{
"fileUrl": "/iotFile/2023/04/19/T25A8zEygrRp9WxBOlXj_.png",
"isSpecial": 0,
"industryCode": "p4E21-vTzrb-rU0FQnzcG",
"industryName": "餐饮",
"shopNum": 3,
"industryList": [{
"industryCode": "GOK_kIXzGq7PVYMB2AJlt",
"industryName": "美食",
"shopNum": 3
}]
}, {
"fileUrl": "/iotFile/2023/04/19/0QbPfyN2cvDiy1te5odlp.png",
"isSpecial": 0,
"industryCode": "Hqv9P3BtktRX919qjQZWv",
"industryName": "餐饮1",
"shopNum": 2,
"industryList": []
}],
"buildingList": [{
"building": "A",
"buildingCode": "suG1YjUhWnvRBJm3ULnCo",
"buildingOrder": 0,
"floorList": [{
"floor": "B4",
"floorCode": "uDKfemAB1vCVZsudb_hmh",
"floorOrder": 0
}, {
"floor": "B3",
"floorCode": "ktEJNAQBDLLr_o7bpQh74",
"floorOrder": 1
}, {
"floor": "LG2",
"floorCode": "DvdHx4Xhv2C5Yc_dxyDup",
"floorOrder": 2
}, {
"floor": "LG",
"floorCode": "Y_gTy-qqMogOmHJlbDsIr",
"floorOrder": 3
}, {
"floor": "L1",
"floorCode": "-vH5uZXijKrzlJQIIIkba",
"floorOrder": 4
}, {
"floor": "L2",
"floorCode": "vVq2ZOi0H7-tpjZHRdZyE",
"floorOrder": 5
}, {
"floor": "L3",
"floorCode": "UHo56B1ktH2zS6gLnzuij",
"floorOrder": 6
}, {
"floor": "L4",
"floorCode": "6JbqB2VzMiXV52gvPE4K4",
"floorOrder": 7
}, {
"floor": "L5",
"floorCode": "hZs9j374JhdAK_IsNV1vc",
"floorOrder": 8
}, {
"floor": "L6",
"floorCode": "sC2NmA7VAOxLZ1-Su3DXo",
"floorOrder": 9
}]
}]
}
}

10
public/static/offline/JSON/getMallInfo.json

@ -1 +1,9 @@
{"code":200,"msg":"操作成功","data":{"content":"水游城位于南京市秦淮区建康路和中华路交叉路口东北角,属夫子庙商圈核心地段,距新街口仅2公里,是一个大型综合性商业项目,由上海鹏欣集团开发建设,建筑面积16.7万平方米,于2008年8月29日正式开业。\n水游城是以流动的水为主体,营造的一个集购物、休闲、餐饮、娱乐、旅游、文化等为一体的休闲购物主题公园。其中包括若干国际品牌的主力店及次主力店,业态以时尚、新潮为主流;一流的院线影城;餐饮包括异国风情美食街,大型特色餐饮,咖啡座、甜品屋、面包坊、茶餐厅地方以及风味小吃,根据不同消费群体分设于各个楼面。","contentEn":"Located in the northeast corner of the intersection of Jiankang Road and Zhonghua Road, Qinhuai District, Nanjing, Aqua City belongs to the core area of Fuzimiao business district, only 2 kilometers away from Xinjiekou, is a large-scale comprehensive commercial project, developed and constructed by Shanghai Pengxin Group, with a construction area of 167,000 square meters, officially opened on August 29, 2008.\nAqua City is a leisure and shopping theme park integrating shopping, leisure, catering,","fileList":["/iotFile/2023/04/18/_cZgZ4EEDd1T92c9IisYI.png"]}}
{
"code": 200,
"msg": "操作成功",
"data": {
"content": "水游城位于南京市秦淮区建康路和中华路交叉路口东北角,属夫子庙商圈核心地段,距新街口仅2公里,是一个大型综合性商业项目,由上海鹏欣集团开发建设,建筑面积16.7万平方米,于2008年8月29日正式开业。\n水游城是以流动的水为主体,营造的一个集购物、休闲、餐饮、娱乐、旅游、文化等为一体的休闲购物主题公园。其中包括若干国际品牌的主力店及次主力店,业态以时尚、新潮为主流;一流的院线影城;餐饮包括异国风情美食街,大型特色餐饮,咖啡座、甜品屋、面包坊、茶餐厅地方以及风味小吃,根据不同消费群体分设于各个楼面。",
"contentEn": "Located in the northeast corner of the intersection of Jiankang Road and Zhonghua Road, Qinhuai District, Nanjing, Aqua City belongs to the core area of Fuzimiao business district, only 2 kilometers away from Xinjiekou, is a large-scale comprehensive commercial project, developed and constructed by Shanghai Pengxin Group, with a construction area of 167,000 square meters, officially opened on August 29, 2008.\nAqua City is a leisure and shopping theme park integrating shopping, leisure, catering,",
"fileList": ["/iotFile/2023/04/18/_cZgZ4EEDd1T92c9IisYI.png"]
}
}

10
src/assets/images/brand/icon_heart.svg

@ -0,0 +1,10 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_166_9578)">
<path d="M9.00076 3.39673C10.7625 1.81498 13.485 1.86748 15.1823 3.56774C16.8788 5.26874 16.9373 7.97774 15.3593 9.74474L8.99925 16.1137L2.64075 9.74474C1.06275 7.97774 1.122 5.26424 2.81775 3.56774C4.51651 1.86973 7.23376 1.81273 9.00076 3.39673Z" fill="#E8DCC0"/>
</g>
<defs>
<clipPath id="clip0_166_9578">
<rect width="18" height="18" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 513 B

3
src/assets/images/brand/icon_pos.svg

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 15.6749L12.7125 11.9624C13.4467 11.2282 13.9466 10.2927 14.1492 9.27435C14.3517 8.25596 14.2477 7.20039 13.8503 6.24111C13.4529 5.28183 12.78 4.46192 11.9167 3.88507C11.0533 3.30821 10.0383 3.00032 9 3.00032C7.96167 3.00032 6.94666 3.30821 6.08332 3.88507C5.21997 4.46192 4.54706 5.28183 4.14969 6.24111C3.75231 7.20039 3.64831 8.25596 3.85084 9.27435C4.05337 10.2927 4.55333 11.2282 5.2875 11.9624L9 15.6749ZM9 17.7959L4.227 13.0229C3.28301 12.0789 2.64014 10.8762 2.3797 9.56683C2.11925 8.25746 2.25293 6.90026 2.76382 5.66687C3.27472 4.43347 4.13988 3.37927 5.24991 2.63757C6.35994 1.89588 7.66498 1.5 9 1.5C10.335 1.5 11.6401 1.89588 12.7501 2.63757C13.8601 3.37927 14.7253 4.43347 15.2362 5.66687C15.7471 6.90026 15.8808 8.25746 15.6203 9.56683C15.3599 10.8762 14.717 12.0789 13.773 13.0229L9 17.7959ZM9 9.74994C9.39783 9.74994 9.77936 9.59191 10.0607 9.3106C10.342 9.0293 10.5 8.64777 10.5 8.24994C10.5 7.85212 10.342 7.47059 10.0607 7.18928C9.77936 6.90798 9.39783 6.74994 9 6.74994C8.60218 6.74994 8.22065 6.90798 7.93934 7.18928C7.65804 7.47059 7.5 7.85212 7.5 8.24994C7.5 8.64777 7.65804 9.0293 7.93934 9.3106C8.22065 9.59191 8.60218 9.74994 9 9.74994ZM9 11.2499C8.20435 11.2499 7.44129 10.9339 6.87868 10.3713C6.31607 9.80865 6 9.04559 6 8.24994C6 7.45429 6.31607 6.69123 6.87868 6.12862C7.44129 5.56601 8.20435 5.24994 9 5.24994C9.79565 5.24994 10.5587 5.56601 11.1213 6.12862C11.6839 6.69123 12 7.45429 12 8.24994C12 9.04559 11.6839 9.80865 11.1213 10.3713C10.5587 10.9339 9.79565 11.2499 9 11.2499Z" fill="#B7A475"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

108
src/components/ShopItem/ShopItem.vue

@ -0,0 +1,108 @@
<template>
<transition appear enter-active-class="animate__animated animate__zoomIn" leave-active-class="animate__animated animate__zoomOut">
<div :key="shop.shopCode" class="shop-li">
<!-- 图片 -->
<div class="banner-wrapper">
<img v-lazy="shop.logoUrl" alt="" />
</div>
<!-- 文字 -->
<div class="bottom">
<span class="name">{{ switchLanguage(shop, 'shopName') }}</span>
<div class="bottom-info">
<span class="floor-name">
<img src="@/assets/images/brand/icon_pos.svg" alt="" />
<span>{{ shop.floor + '-' + shop.houseNumber }}</span>
</span>
<div class="likes">
<img src="@/assets/images/brand/icon_heart.svg" alt="" />
111
</div>
</div>
</div>
</div>
</transition>
</template>
<script setup lang="ts">
const props = defineProps<{ shop: Shop }>()
</script>
<style scoped lang="scss">
.shop-li {
position: relative;
width: 230px;
height: 300px;
animation-duration: 0.3s;
.banner-wrapper {
position: relative;
overflow: hidden;
width: 100%;
height: 230px;
background-color: #fff;
border-radius: 8px;
img {
position: absolute;
top: 50%;
left: 50%;
width: 180px;
height: 180px;
transform: translate(-50%, -50%);
}
}
.bottom {
display: flex;
justify-content: flex-start;
width: 100%;
height: 54px;
padding-right: 0;
padding-left: 0;
margin-top: 16px;
font-family: 'font_bold';
text-align: left;
flex-direction: column;
.name {
max-width: 90%;
font-size: 16px;
color: #685c3b;
@include no-wrap();
}
.bottom-info {
display: flex;
justify-content: space-between;
align-items: flex-end;
.floor-name {
display: flex;
align-items: center;
font-size: 14px;
color: #a6976f;
img {
width: 18px;
margin-right: 4px;
}
}
.likes {
display: flex;
align-items: center;
width: 72px;
height: 28px;
padding: 0 8px;
font-size: 14px;
font-family: 'font_regular';
color: #fff;
background: #b7a475;
border-radius: 900px;
font-style: normal;
font-weight: 400;
img {
display: inline-block;
width: 18px;
margin-right: 10px;
}
}
}
}
}
</style>

72
src/components/TypeBtnList/TypeBtnList.vue

@ -0,0 +1,72 @@
<template>
<div class="btn-title-group">
<div
v-for="(item, index) in list"
:key="index"
class="btn-item"
:class="{ active: currentTypeId === index }"
@click="changeType(item, index)"
>
<h4>
{{ switchLanguage(item, 'title') }}
</h4>
<div class="saw"></div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const currentTypeId = ref(0)
const emit = defineEmits(['change-type'])
type TypeItem = {
title: string
titleEn: string
}
const props = defineProps<{
list: TypeItem[]
}>()
function changeType(item: TypeItem, index: number) {
currentTypeId.value = index
emit('change-type', { ...item, order: currentTypeId.value })
}
</script>
<style scoped lang="scss">
.btn-title-group {
z-index: 10;
display: flex;
justify-content: space-between;
width: fit-content;
.btn-item {
display: flex;
h4 {
width: 96px;
height: 40px;
font-size: 24px;
font-family: 'font_regular';
color: #84754e;
font-style: normal;
font-weight: 400;
}
&:nth-child(odd) {
.saw {
width: 2px;
height: 26px;
margin-right: 40px;
margin-left: 40px;
background: #84754e;
}
}
&.active {
h4 {
border-bottom: 4px solid #84754e;
}
}
}
}
</style>

14
src/http/api/brand/types.ts

@ -23,4 +23,16 @@ export type PickRecommendShop = Pick<
| 'yaxis' | 'yaxis'
> >
export type BrandRes = { allShopNum: number; buildingList: Building[]; recommendList: PickRecommendShop[]; industryFatherList: Industry[] }
type floorItem = {
floor: string
floorCode: number
floorMapUrl: string
floorOrder: number
}
export type BrandRes = {
allShopNum: number
buildingList: Building[]
recommendList: PickRecommendShop[]
industryFatherList: Industry[]
floorList: floorItem[]
}

7
src/router/routes.ts

@ -15,6 +15,13 @@ export const routes: RouteRecordRaw[] = [
showMap: false showMap: false
} }
}, },
{
path: '/brand',
component: () => import(/* webpackChunkName: "guide" */ '@/views/Brand/Brand.vue'),
meta: {
showMap: false
}
},
{ {
path: '/nav', path: '/nav',
name: 'Nav', name: 'Nav',

2
src/types/industry.d.ts

@ -1,7 +1,7 @@
declare interface Industry { declare interface Industry {
fileUrl: string fileUrl: string
isSpecial: 0 | 1 //1特殊业态 反之不是 isSpecial: 0 | 1 //1特殊业态 反之不是
industryId: number //唯一标识
industryCode: string //唯一标识
industryName: string //业态名称 industryName: string //业态名称
industryNameEn: string //业态英文 industryNameEn: string //业态英文
shopNum: number //店铺总数 shopNum: number //店铺总数

270
src/views/Brand/Brand.vue

@ -0,0 +1,270 @@
<template>
<div class="brand-container">
<!-- 线条 -->
<div class="line"></div>
<!-- 业态和字母切换按钮 -->
<typeBtnGroup class="type-wrapper" :list="typeBtnList" @change-type="changeType"></typeBtnGroup>
<!-- 业态按钮组 字母按钮组-->
<scrollView class="btn-wrapper" :refresh-delay="200" :scroll-x="true" :list="formatZMList" :pull-up="false">
<ul class="btn-group">
<li
v-for="(item, index) in formatZMList"
:key="index"
:class="{ active: index === formatIdx }"
class="format-item"
@click="handleClickFormat(item, index)"
>
{{ switchLanguage(item, 'industryName') }}
</li>
</ul>
</scrollView>
<!-- 楼层按钮组 -->
<ul class="floor-group">
<li
v-for="(item, index) in floorList"
:key="index"
class="floor-item"
:class="{ active: floorIdx === index }"
@click="handleClickFloor(item, index)"
>
{{ item.floor }}
</li>
</ul>
<!-- 店铺 -->
<scroll-view ref="shopScroll" :scrollbar="true" class="shop-scroll" :list="copyShopList" :pull-up="false">
<ul class="shop-group">
<shopItem v-for="shop in copyShopList" :key="shop.shopCode" :shop="shop" @click="clickShop(shop)" />
</ul>
</scroll-view>
</div>
</template>
<script setup lang="ts">
import shopItem from '@/components/ShopItem/ShopItem.vue'
import typeBtnGroup from '@/components/TypeBtnList/TypeBtnList.vue'
import scrollView from '@/base/ScrollView/ScrollView.vue'
import { getBrandInfo } from '@/http/api/brand/index'
import { ref, computed, shallowRef } from 'vue'
import { storeToRefs } from 'pinia'
import { useRootStore } from '@/store/root'
const store = useRootStore()
const { shopList } = storeToRefs(store)
type FloorItem = {
floor: string
floorCode: number
floorMapUrl: string
floorOrder: number
}
const currentTypeId = ref(0)
const formatIdx = ref(0)
const formatZMList = computed(() => {
if (currentTypeId.value === 0) {
return formatList.value
}
return zmList.value
})
const formatList = ref<Industry[]>([])
const zmList = ref<Industry[]>([])
const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
const floorIdx = ref(-1)
const floorList = ref<FloorItem[]>([])
const copyShopList = shallowRef<Shop[]>([])
const typeBtnList = [
{
title: '业态筛选',
titleEn: 'Formats'
},
{
title: '字母筛选',
titleEn: 'Floors'
}
]
//
getBrandInfo().then(({ data }) => {
formatList.value.push({
fileUrl: '',
isSpecial: 0,
industryCode: 0,
industryName: '全部类别',
industryNameEn: '',
shopNum: 0,
industryList: []
})
zmList.value.push({
fileUrl: '',
isSpecial: 0,
industryCode: 0,
industryName: 'ALL',
industryNameEn: '',
shopNum: 0,
industryList: []
})
data.industryFatherList.forEach(item => {
formatList.value.push(item)
})
floorList.value = [
{
floor: 'ALL',
floorCode: 0,
floorMapUrl: '',
floorOrder: -1
},
...data.floorList?.reverse()
]
letters.split('').forEach(letter => {
const temp = {
fileUrl: '',
industryCode: 0,
industryNameEn: '',
shopNum: 0,
industryList: []
}
zmList.value.push({ industryName: letter, isSpecial: 0, ...temp })
})
copyShopList.value = [...shopList.value]
})
//
function changeType(item: any) {
currentTypeId.value = item.order
}
function resetIdx() {
formatIdx.value = 0
floorIdx.value = 0
}
//
function handleClickFloor(item: FloorItem, index: number) {
resetIdx()
floorIdx.value = index
if (index === 0) {
copyShopList.value = [...shopList.value]
return
}
copyShopList.value = shopList.value.filter(shop => shop.floor === item.floor)
}
//
function handleClickFormat(item: Industry, index: number) {
resetIdx()
formatIdx.value = index
if (index === 0) {
copyShopList.value = [...shopList.value]
return
}
if (currentTypeId.value === 0) {
copyShopList.value = shopList.value.filter(shop => shop.industryFatherCode === item.industryCode)
} else {
copyShopList.value = shopList.value.filter(shop => shop.initials?.charAt(0) === item.industryName)
}
}
//
function clickShop(item: Shop) {
store.SET_SHOP(item)
store.SET_SHOW_DETAIL(true)
}
</script>
<style scoped lang="scss">
:deep(.bscroll-vertical-scrollbar) {
background: rgb(0 0 0 / 1%);
border-radius: 8px;
opacity: 1 !important;
.bscroll-indicator {
background: #b7a475 !important;
border: none !important;
border-radius: 4px !important;
box-shadow: 0 8px 20px rgb(0 0 0 / 10%);
}
}
.brand-container {
.line {
position: absolute;
right: 0;
left: 0;
width: 1544px;
height: 1px;
margin: 288px auto;
background: #84754e;
opacity: 0.3;
}
.type-wrapper {
position: absolute;
right: 0;
left: 0;
margin: 140px auto 0;
}
.btn-wrapper {
position: absolute;
top: 228px;
left: 124px;
overflow: hidden;
width: 1706px;
.btn-group {
width: fit-content;
white-space: nowrap;
.format-item {
display: inline-block;
height: 36px;
padding: 0 24px;
margin-right: 40px;
font-size: 16px;
font-family: 'font_regular';
color: #84754e;
background: rgb(255 255 255 / 40%);
border-radius: 108px;
line-height: 36px;
font-style: normal;
font-weight: 400;
&.active {
color: #fff;
background: #a6976f;
}
}
}
}
.floor-group {
position: absolute;
top: 319px;
left: 124px;
font-size: 24px;
font-family: 'font_bold';
text-align: center;
color: #a6976f;
font-style: normal;
font-weight: 700;
.floor-item {
margin-bottom: 32px;
&.active {
font-size: 36px;
color: #595447;
}
}
}
.shop-scroll {
position: absolute;
top: 321px;
left: 289px;
overflow: hidden;
width: 1372px;
height: 759px;
padding-right: 24px;
.shop-group {
display: grid;
grid-template-columns: repeat(5, 230px);
gap: 24px 48px;
}
}
}
</style>
Loading…
Cancel
Save