From e12bc78fe423afc7cd1025fa57236c9c11a355a9 Mon Sep 17 00:00:00 2001 From: liyongle Date: Sat, 6 May 2023 10:26:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Search/Hot.vue | 2 ++ src/components/Search/Result.vue | 2 ++ src/components/ShopDetail/ShopDetail.vue | 2 +- src/composables/useFacilityNav.ts | 4 ++-- src/composables/useHandleScreen.ts | 3 ++- src/views/Brand/Brand.vue | 3 ++- src/views/Nav/Nav.vue | 3 --- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/Search/Hot.vue b/src/components/Search/Hot.vue index 4e6ecfc..72a03b6 100644 --- a/src/components/Search/Hot.vue +++ b/src/components/Search/Hot.vue @@ -24,6 +24,7 @@ import { ref } from 'vue' import { getIndexJson } from '@/http/api/base' import { useRootStore } from '@/store/root' +import { useStatistics } from '@/composables/useStatistics' import ScrollView from '@/base/ScrollView/ScrollView.vue' const list = ref() getIndexJson().then(({ data }) => { @@ -34,6 +35,7 @@ const store = useRootStore() function show(item: any) { store.SET_SHOP(item) store.SET_SHOW_DETAIL(true) + useStatistics({ tag: 'brandSearch', shopCode: item.shopCode }) } diff --git a/src/components/Search/Result.vue b/src/components/Search/Result.vue index 2256946..a4df32c 100644 --- a/src/components/Search/Result.vue +++ b/src/components/Search/Result.vue @@ -22,6 +22,7 @@ diff --git a/src/components/ShopDetail/ShopDetail.vue b/src/components/ShopDetail/ShopDetail.vue index 1359514..188a430 100644 --- a/src/components/ShopDetail/ShopDetail.vue +++ b/src/components/ShopDetail/ShopDetail.vue @@ -97,7 +97,6 @@ import 'swiper/css/effect-fade' import scrollView from '@/base/ScrollView/ScrollView.vue' import masker from '@/base/Masker/Masker.vue' import marquees from '@/base/Marquees/Marquees.vue' - import { ref } from 'vue' import { useRouter } from 'vue-router' import { useStatistics } from '@/composables/useStatistics' @@ -117,6 +116,7 @@ function close() { } //导航 function handleGo() { + useStatistics({ tag: 'navigation', shopCode: shop.value.shopCode }) store.SET_SHOW_DETAIL(false) store.SET_SHOW_SEARCH(false) router.push('/nav') diff --git a/src/composables/useFacilityNav.ts b/src/composables/useFacilityNav.ts index f068460..9be3858 100644 --- a/src/composables/useFacilityNav.ts +++ b/src/composables/useFacilityNav.ts @@ -6,11 +6,11 @@ export const useFacilityNav = () => { const store = useRootStore() const router = useRouter() - function handleFacility({ abbreviation, customFacilityName, filePath, code }: Facility) { + function handleFacility({ abbreviation, customFacilityName, filePath, code, name }: Facility) { const { floor, node } = window.Map_QM.pathIcon({ type: abbreviation }) const floorName = store.currentBuildingFloorsList.find(_floor => _floor.floorOrder === floor)?.floor const shop = new Brand({ - shopName: customFacilityName, + shopName: customFacilityName ? customFacilityName : name, floorOrder: floor, floor: floorName as string, logoUrl: filePath, diff --git a/src/composables/useHandleScreen.ts b/src/composables/useHandleScreen.ts index 5195b1e..16a9ab3 100644 --- a/src/composables/useHandleScreen.ts +++ b/src/composables/useHandleScreen.ts @@ -3,7 +3,7 @@ import { useRouter } from 'vue-router' import { getBackTime } from '@/http/api/base' import { useLogout } from '@/composables/useLogout' import { isAndroid } from '@/utils/utils' - +import { useStatistics } from '@/composables/useStatistics' export const useHandleScreen = (callback: () => void) => { const MIN_TIME = 0 const MAX_TIME = 5 @@ -54,6 +54,7 @@ export const useHandleScreen = (callback: () => void) => { } async function checkHandleScreen(e: TouchEvent) { + useStatistics({ tag: 'device' }) !_isAndroid && addTotalClick(e) toIndexTime.value = totalTime.value[0] toWallpaperTime.value = totalTime.value[1] diff --git a/src/views/Brand/Brand.vue b/src/views/Brand/Brand.vue index ed24c9b..1fce53c 100644 --- a/src/views/Brand/Brand.vue +++ b/src/views/Brand/Brand.vue @@ -48,7 +48,7 @@ import { ref, computed, shallowRef } from 'vue' import { storeToRefs } from 'pinia' import { useRootStore } from '@/store/root' - +import { useStatistics } from '@/composables/useStatistics' const store = useRootStore() const { shopList, device } = storeToRefs(store) @@ -164,6 +164,7 @@ function handleClickFormat(item: Industry, index: number) { } if (currentTypeId.value === 0) { copyShopList.value = shopList.value.filter(shop => shop.industryFatherCode === item.industryCode) + useStatistics({ tag: 'industry', industryCode: item.industryCode }) } else { copyShopList.value = shopList.value.filter(shop => shop.initials?.charAt(0) === item.industryName) } diff --git a/src/views/Nav/Nav.vue b/src/views/Nav/Nav.vue index 560cf57..930e0f6 100644 --- a/src/views/Nav/Nav.vue +++ b/src/views/Nav/Nav.vue @@ -162,7 +162,6 @@ import { useMapNavControl } from '@/composables/useMapNavControl' import { useChangeNavMethod } from '@/composables/useChangeNavMethod' import { useStartNavi } from '@/composables/useStartNavi' import { useSetCameraViews } from '@/composables/useSetCameraViews' -import { useStatistics } from '@/composables/useStatistics' import { hideMapDialog } from '@/composables/useInitMap' import { i18n } from '@/i18n' import { useRouter, useRoute } from 'vue-router' @@ -174,8 +173,6 @@ import ScrollView from '@/base/ScrollView/ScrollView.vue' const store = useRootStore() const { shop, device, language, config } = storeToRefs(store) -useStatistics({ tag: 'navigation', shopCode: shop.value.shopCode }) - const { replay, pause, speedUp, handleReplay, togglePause, handleSpeedUp, resetPause } = useMapNavControl() const { directionInfo, pathShopList, backPathArray, startNavi } = useStartNavi(shop, device, resetPause) const { methodIdx, methodsList, handleControl } = useChangeNavMethod(backPathArray)