Browse Source

feat: 🚀 新增特殊业态功能

pull/2/head
liyongle 3 years ago
parent
commit
c01783411c
  1. 304
      public/static/offline/JSON/getArtList.json
  2. 27
      public/static/offline/JSON/getSpecialIndustry.json
  3. 13
      src/composables/useGuideFilterShop.ts
  4. 9
      src/composables/useInitConfigAndMallInfo.ts
  5. 3
      src/http/api/brand/index.ts
  6. 4
      src/store/root/actions.ts
  7. 4
      src/store/root/state.ts
  8. 8
      src/types/industry.d.ts
  9. 2
      src/views/Guide/ArtList.vue

304
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"}}]}
{
"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"
}
}
]
}

27
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"
}
}
]
}

13
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 }

9
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' })
}

3
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<SpecialIndustry[]>({ url: `${PREFIX.STATIC_URL}/JSON/getSpecialIndustry.json` })

4
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<Root, State, Actions>
@ -92,5 +93,8 @@ export const actions: GenActions = {
},
SET_MAP_PARK_LIST(list) {
this.mapParkList = list
},
SET_SPECIAL_LIST(list) {
this.specialIndustryList = list
}
}

4
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: []
})

8
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
}
}

2
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);

Loading…
Cancel
Save