From f61693bf8971e8b44e02661d743a95243d739a9a Mon Sep 17 00:00:00 2001 From: jiannibang <271381693@qq.com> Date: Wed, 8 Mar 2023 10:19:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4shopId=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BAshopCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BrandScroll/BrandScroll.vue | 4 ++-- src/components/Search/Search.vue | 6 +++--- src/components/SearchResultList/SearchResultList.vue | 2 +- src/http/api.js | 4 ++-- src/store/root/actions.js | 2 +- src/store/root/getters.js | 2 +- src/views/Billboard/Billboard.vue | 2 +- src/views/Brand/Brand.vue | 6 +++--- src/views/Foods/Foods.vue | 2 +- src/views/Guide/Guide.vue | 4 ++-- src/views/Index/Index.vue | 10 +++++----- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/components/BrandScroll/BrandScroll.vue b/src/components/BrandScroll/BrandScroll.vue index f213048..69d5820 100644 --- a/src/components/BrandScroll/BrandScroll.vue +++ b/src/components/BrandScroll/BrandScroll.vue @@ -25,8 +25,8 @@ :shop="el" @click="handleShop(el)" v-for="el of item.shopList" - :isActive="shop && shop.shopId === el.shopId" - :key="el.shopId" + :isActive="shop && shop.shopCode === el.shopCode" + :key="el.shopCode" /> diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index fe0c606..987cc29 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -30,7 +30,7 @@

大家都在找

-
+
{{ item.shopName }}
@@ -92,8 +92,8 @@ const list = computed(() => const hotRecommend = computed(() => indexList.value.hotSearch ?? []) async function handleShop(item) { - useStatistics('brandSearch', { shopId: item.shopId }) - const shop = shopList.value.find(_shop => _shop.shopId === item.shopId) + useStatistics('brandSearch', { shopCode: item.shopCode }) + const shop = shopList.value.find(_shop => _shop.shopCode === item.shopCode) store.SET_SHOP(shop) if (router.currentRoute.value.fullPath !== '/guide') { store.SET_SELECTED_MODULE('Guide') diff --git a/src/components/SearchResultList/SearchResultList.vue b/src/components/SearchResultList/SearchResultList.vue index c5a45fa..9333543 100644 --- a/src/components/SearchResultList/SearchResultList.vue +++ b/src/components/SearchResultList/SearchResultList.vue @@ -5,7 +5,7 @@ 搜索结果 / {{ list.length }} - +
diff --git a/src/http/api.js b/src/http/api.js index ce75020..0f946dd 100644 --- a/src/http/api.js +++ b/src/http/api.js @@ -23,10 +23,10 @@ export const getServeList = () => get(`${url().sourceUrl}/JSON/getServeList.json export const getTrafficList = () => get(`${url().sourceUrl}/JSON/getMallTraffic.json`) //获取品牌喜欢数量 -export const getBrandLikesNumber = shopId => get(`${url().interfaceUrl}/guide/v1/web/getBrandStar?shopId=${shopId}`) +export const getBrandLikesNumber = shopCode => get(`${url().interfaceUrl}/guide/v1/web/getBrandStar?shopCode=${shopCode}`) //设置品牌喜欢数量 -export const setBrandLikesNumber = shopId => get(`${url().interfaceUrl}/guide/v1/web/setBrandStar?shopId=${shopId}`) +export const setBrandLikesNumber = shopCode => get(`${url().interfaceUrl}/guide/v1/web/setBrandStar?shopCode=${shopCode}`) //获取 影院信息 export const getCinemaInfo = () => get(`${url().sourceUrl}/JSON/getCinemaInfo.json`) diff --git a/src/store/root/actions.js b/src/store/root/actions.js index 9efb3a2..7ccba48 100644 --- a/src/store/root/actions.js +++ b/src/store/root/actions.js @@ -28,7 +28,7 @@ export const actions = { }, SET_SHOP(shop) { this.shop = shop - if (shop) useStatistics('shop', { shopId: shop.shopId }) + if (shop) useStatistics('shop', { shopCode: shop.shopCode }) }, SET_CURRENT_FLOOR(currentFloor) { this.currentFloor = currentFloor diff --git a/src/store/root/getters.js b/src/store/root/getters.js index 19b126e..8e41bbd 100644 --- a/src/store/root/getters.js +++ b/src/store/root/getters.js @@ -47,6 +47,6 @@ export const currentFloorShopMap = ({ currentFloor: device, shopList, mapData }) } catch (error) { result.dir = arrows[getCodeByAngle(0)] } - return { ...acc, [shop.shopId]: result } + return { ...acc, [shop.shopCode]: result } }, {}) } diff --git a/src/views/Billboard/Billboard.vue b/src/views/Billboard/Billboard.vue index 5413970..8d3b8dd 100644 --- a/src/views/Billboard/Billboard.vue +++ b/src/views/Billboard/Billboard.vue @@ -97,7 +97,7 @@ Promise.all([getBrandListByFormat()]).then(([{ data: brandListByFormat }]) => { shopList: brand.shopList .filter(shop => shop.floor === currentFloor.value.floor) .map(shop => { - const meta = currentFloorShopMap.value[shop.shopId] + const meta = currentFloorShopMap.value[shop.shopCode] return { ...shop, ...(meta ? meta : {}) } }) } diff --git a/src/views/Brand/Brand.vue b/src/views/Brand/Brand.vue index 39abfab..6dd1370 100644 --- a/src/views/Brand/Brand.vue +++ b/src/views/Brand/Brand.vue @@ -20,13 +20,13 @@ const selectedList = ref([]) Promise.all([getBrandListByFloor()]).then(([_brandList]) => { if (storeRefs.shop.value) shop.value = storeRefs.shop.value - const recMap = indexList.value.recommendList.reduce((acc, { shopId }) => ({ ...acc, [shopId]: true }), {}) + const recMap = indexList.value.recommendList.reduce((acc, { shopCode }) => ({ ...acc, [shopCode]: true }), {}) const list = _brandList.data.list - selectedList.value = list.map(({ name, shopList: _shopList }) => ({ name, shopList: _shopList.filter(({ shopId }) => recMap[shopId]) })) + selectedList.value = list.map(({ name, shopList: _shopList }) => ({ name, shopList: _shopList.filter(({ shopCode }) => recMap[shopCode]) })) }) function handleShop(item) { - shop.value = shopList.value.find(_shop => _shop.shopId === item.shopId) + shop.value = shopList.value.find(_shop => _shop.shopCode === item.shopCode) } diff --git a/src/views/Foods/Foods.vue b/src/views/Foods/Foods.vue index 2e9099b..a2e3918 100644 --- a/src/views/Foods/Foods.vue +++ b/src/views/Foods/Foods.vue @@ -28,7 +28,7 @@ Promise.all([getBrandListByFloor()]).then(([_brandList]) => { }) function handleShop(item) { - shop.value = shopList.value.find(_shop => _shop.shopId === item.shopId) + shop.value = shopList.value.find(_shop => _shop.shopCode === item.shopCode) } diff --git a/src/views/Guide/Guide.vue b/src/views/Guide/Guide.vue index 932c27f..4c410bc 100644 --- a/src/views/Guide/Guide.vue +++ b/src/views/Guide/Guide.vue @@ -193,7 +193,7 @@ function changeFloor(index) { shopList: brand.shopList .filter(item => item.floor === floor.floor) .map(item => { - const meta = currentFloorShopMap.value[item.shopId] + const meta = currentFloorShopMap.value[item.shopCode] return { ...item, ...(meta ? meta : {}) } }) })) @@ -220,7 +220,7 @@ function filterAboutCurrentInfo(needShowFloor = true) { shopList: brand.shopList .filter(item => item.floor === floor) .map(item => { - const meta = currentFloorShopMap.value[item.shopId] + const meta = currentFloorShopMap.value[item.shopCode] return { ...item, ...(meta ? meta : {}) } }) })) diff --git a/src/views/Index/Index.vue b/src/views/Index/Index.vue index 183cf11..fed58ce 100644 --- a/src/views/Index/Index.vue +++ b/src/views/Index/Index.vue @@ -5,7 +5,7 @@