From c01783411c3d10d759d1e7ced0377d470ba0addb Mon Sep 17 00:00:00 2001 From: liyongle Date: Wed, 19 Jul 2023 14:14:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E4=B8=9A=E6=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/offline/JSON/getArtList.json | 304 +++++++++++++++++- .../offline/JSON/getSpecialIndustry.json | 27 ++ src/composables/useGuideFilterShop.ts | 13 +- src/composables/useInitConfigAndMallInfo.ts | 9 +- src/http/api/brand/index.ts | 3 + src/store/root/actions.ts | 4 + src/store/root/state.ts | 4 +- src/types/industry.d.ts | 8 + src/views/Guide/ArtList.vue | 2 +- 9 files changed, 366 insertions(+), 8 deletions(-) create mode 100644 public/static/offline/JSON/getSpecialIndustry.json diff --git a/public/static/offline/JSON/getArtList.json b/public/static/offline/JSON/getArtList.json index dbc0b7d..6290c66 100644 --- a/public/static/offline/JSON/getArtList.json +++ b/public/static/offline/JSON/getArtList.json @@ -1 +1,303 @@ -{"code":200,"msg":"操作成功","data":[{"id":172,"title":"2","content":{"name":"魔法水星","nameEn":"MAGIC WATER BALL ","point":"0_0_9"}},{"id":171,"title":"1","content":{"name":"花之泉广场","nameEn":"NORTH ENTRANCE FOUNTAIN SQUARE","point":"0_0_65"}},{"id":173,"title":"3","content":{"name":"家庭乐园","nameEn":"THE FAMILY PARK","point":"0_0_1"}},{"id":174,"title":"4","content":{"name":"精灵之泉","nameEn":"THE FOUNTAIN PLAYGROUND","point":"0_0_161"}}]} \ No newline at end of file +{ + "code": 200, + "msg": "操作成功", + "data": [ + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + }, + { + "id": 171, + "title": "1", + "content": { + "name": "花之泉广场", + "nameEn": "NORTH ENTRANCE FOUNTAIN SQUARE", + "point": "0_0_65" + } + }, + { + "id": 173, + "title": "3", + "content": { + "name": "家庭乐园", + "nameEn": "THE FAMILY PARK", + "point": "0_0_1" + } + }, + { + "id": 174, + "title": "4", + "content": { + "name": "精灵之泉", + "nameEn": "THE FOUNTAIN PLAYGROUND", + "point": "0_0_161" + } + }, + { + "id": 172, + "title": "2", + "content": { + "name": "魔法水星", + "nameEn": "MAGIC WATER BALL ", + "point": "0_0_9" + } + } + ] +} diff --git a/public/static/offline/JSON/getSpecialIndustry.json b/public/static/offline/JSON/getSpecialIndustry.json new file mode 100644 index 0000000..b6218a7 --- /dev/null +++ b/public/static/offline/JSON/getSpecialIndustry.json @@ -0,0 +1,27 @@ +{ + "code": 200, + "msg": "操作成功", + "data": [ + { + "id": 250, + "title": "咖啡/甜品", + "content": { + "industry_id": "XTiJfbL_-Sy87Fw0dU7Tl" + } + }, + { + "id": 251, + "title": "甜品", + "content": { + "industry_id": "hCGB5-YT7j2TpilgXONHT" + } + }, + { + "id": 252, + "title": "健康食品/茶叶", + "content": { + "industry_id": "WDEyhFPf6tv_ejRrhV-sN" + } + } + ] +} diff --git a/src/composables/useGuideFilterShop.ts b/src/composables/useGuideFilterShop.ts index ed2a85c..26484a4 100644 --- a/src/composables/useGuideFilterShop.ts +++ b/src/composables/useGuideFilterShop.ts @@ -3,7 +3,7 @@ import { useRootStore } from '@/store/root' import { hideMapDialog } from '@/composables/useInitMap' export const useGuideFilterShop = () => { const store = useRootStore() - const { shopList } = toRefs(store) + const { shopList, specialIndustryList } = toRefs(store) const areaName = ref('全部区域') //区域选中索引 const floorIdx = ref(6) //楼层选中索引 @@ -32,7 +32,16 @@ export const useGuideFilterShop = () => { // 筛选美食业态 function changeFoodShopList() { - selectedShopList.value = shopList.value.filter(item => item.isSpecial) + selectedShopList.value = selectedShopList.value.filter(item => { + let flag = false + for (let i = 0; i < specialIndustryList.value.length; i++) { + if (specialIndustryList.value[i].content.industry_id === item.industryFatherCode) { + flag = true + break + } + } + return flag + }) } return { areaName, floorIdx, selectedShopList, changeFloor, changeArea, changeFoodShopList } diff --git a/src/composables/useInitConfigAndMallInfo.ts b/src/composables/useInitConfigAndMallInfo.ts index 93eec35..d80e5b2 100644 --- a/src/composables/useInitConfigAndMallInfo.ts +++ b/src/composables/useInitConfigAndMallInfo.ts @@ -3,7 +3,7 @@ import { getConfig, getFacilitiesList, getWeather, getColumnBtn } from '@/http/a import { getShopAndBuildingList } from '@/http/api/shop' import { getDeviceInfo } from '@/http/api/building' import { getArtWorkList } from '@/http/api/art' -import { getShopListByFloor, getShopListByIndustry, getBrandInfo } from '@/http/api/brand' +import { getShopListByFloor, getShopListByIndustry, getBrandInfo, getSpecialIndustry } from '@/http/api/brand' import Message from '@/base/Message/Message' export const useInitConfigAndMallInfo = async () => { @@ -23,7 +23,8 @@ export const useInitConfigAndMallInfo = async () => { _shopListByIndustry, _brandInfo, _artWorkList, - _colomList + _colomList, + _specialList ] = await Promise.all([ getDeviceInfo(), getShopAndBuildingList(), @@ -33,7 +34,8 @@ export const useInitConfigAndMallInfo = async () => { getShopListByIndustry(), getBrandInfo(), getArtWorkList(), - getColumnBtn() + getColumnBtn(), + getSpecialIndustry() ]) const { shopList, buildingList } = _shopAndBuilding.data @@ -47,6 +49,7 @@ export const useInitConfigAndMallInfo = async () => { store.SET_WEATHER(_weather.data) store.SET_ART_PLACE_LIST(_artWorkList.data) store.SET_COLUMN_LIST(_colomList.data) + store.SET_SPECIAL_LIST(_specialList.data) } catch (error) { Message({ text: '初始化数据失败', type: 'success' }) } diff --git a/src/http/api/brand/index.ts b/src/http/api/brand/index.ts index d8e7644..bcfcea5 100644 --- a/src/http/api/brand/index.ts +++ b/src/http/api/brand/index.ts @@ -8,3 +8,6 @@ export const getShopListByFloor = () => request<{ list: GroupList }>({ url: `${P export const getShopListByIndustry = () => request<{ list: GroupList }>({ url: `${PREFIX.STATIC_URL}/JSON/getBrandShopListByIndustryId.json` }) + +// 获取特殊业态 +export const getSpecialIndustry = () => request({ url: `${PREFIX.STATIC_URL}/JSON/getSpecialIndustry.json` }) diff --git a/src/store/root/actions.ts b/src/store/root/actions.ts index 4ea2444..bab77a5 100644 --- a/src/store/root/actions.ts +++ b/src/store/root/actions.ts @@ -25,6 +25,7 @@ export interface Actions { SET_SHOP_MAP(shopMap: ShopMap): void SET_ART_PLACE_LIST(list: ArtPlace[]): void SET_MAP_PARK_LIST(list: string[]): void + SET_SPECIAL_LIST(list: SpecialIndustry[]): void } export type GenActions = CreateActions @@ -92,5 +93,8 @@ export const actions: GenActions = { }, SET_MAP_PARK_LIST(list) { this.mapParkList = list + }, + SET_SPECIAL_LIST(list) { + this.specialIndustryList = list } } diff --git a/src/store/root/state.ts b/src/store/root/state.ts index d1f8a27..3a9a81a 100644 --- a/src/store/root/state.ts +++ b/src/store/root/state.ts @@ -21,6 +21,7 @@ export interface State { shopMap: ShopMap // 店铺code与店铺信息集合 artPlaceList: ArtPlace[] // 艺术装置集合 mapParkList: string[] // 停车位列表 + specialIndustryList: SpecialIndustry[] // 特殊业态列表 } export const state = (): State => ({ @@ -43,5 +44,6 @@ export const state = (): State => ({ is4K: true, shopMap: {} as ShopMap, artPlaceList: [], - mapParkList: [] + mapParkList: [], + specialIndustryList: [] }) diff --git a/src/types/industry.d.ts b/src/types/industry.d.ts index 50d3274..7344774 100644 --- a/src/types/industry.d.ts +++ b/src/types/industry.d.ts @@ -7,3 +7,11 @@ declare interface Industry { industryList: Array<{ industryCode: string; industryName: string; shopNum: number }> fileUrl?: string } + +declare interface SpecialIndustry { + id: number + title: string + content: { + industry_id: string + } +} diff --git a/src/views/Guide/ArtList.vue b/src/views/Guide/ArtList.vue index 15e3f8a..246eb0b 100644 --- a/src/views/Guide/ArtList.vue +++ b/src/views/Guide/ArtList.vue @@ -84,7 +84,7 @@ function show(item: Art, index: number) { .lists { display: grid; grid-template-columns: 1fr 1fr; - gap: 24px; + gap: 12px 24px; grid-auto-flow: row; .item { @include fl(flex-start, flex-start);