Browse Source

feat: 🚀 统计功能

pull/2/head
liyongle 3 years ago
parent
commit
e12bc78fe4
  1. 2
      src/components/Search/Hot.vue
  2. 2
      src/components/Search/Result.vue
  3. 2
      src/components/ShopDetail/ShopDetail.vue
  4. 4
      src/composables/useFacilityNav.ts
  5. 3
      src/composables/useHandleScreen.ts
  6. 3
      src/views/Brand/Brand.vue
  7. 3
      src/views/Nav/Nav.vue

2
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<HotSearch[]>()
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 })
}
</script>

2
src/components/Search/Result.vue

@ -22,6 +22,7 @@
<script setup lang="ts">
import { useRootStore } from '@/store/root'
import { useStatistics } from '@/composables/useStatistics'
import ScrollView from '@/base/ScrollView/ScrollView.vue'
type ShopList = {
list: Shop[]
@ -31,6 +32,7 @@ const store = useRootStore()
function show(item: Shop) {
store.SET_SHOP(item)
store.SET_SHOW_DETAIL(true)
useStatistics({ tag: 'brandSearch', shopCode: item.shopCode })
}
</script>

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

4
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,

3
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]

3
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)
}

3
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)

Loading…
Cancel
Save