diff --git a/src/composables/useHandleScreen.ts b/src/composables/useHandleScreen.ts index bd4a8eb..4f44133 100644 --- a/src/composables/useHandleScreen.ts +++ b/src/composables/useHandleScreen.ts @@ -2,6 +2,7 @@ import { ref, computed, onMounted, watch, toRefs } from 'vue' import { useRootStore } from '@/store/root' import { useRouter } from 'vue-router' import { getBackTime } from '@/http/api/base' +import { useStatistics } from '@/composables/useStatistics' export const useHandleScreen = (callback: () => void) => { const MIN_TIME = 0 @@ -58,6 +59,7 @@ export const useHandleScreen = (callback: () => void) => { } function checkHandleScreen() { + useStatistics({ tag: 'device' }) toIndexTime.value = totalTime.value[0] toWallpaperTime.value = totalTime.value[1] diff --git a/src/composables/useStatistics.ts b/src/composables/useStatistics.ts index 05e04a2..242fff2 100644 --- a/src/composables/useStatistics.ts +++ b/src/composables/useStatistics.ts @@ -3,19 +3,15 @@ import { storeToRefs } from 'pinia' import { getStatistics } from '@/http/api/statistics' import type { Query, TagType } from '@/http/api/statistics/types' -/** - * @description 店铺编码: tag=navigation或shop或brandSearch或时必传 - * @description industryCode: tag=industry时必传 - * @param tag 统计类型为以下几种: 'navigation' | 'shop' | 'brandSearch' | 'device' | 'program' | 'industry' - * @param shopCode 店铺唯一编码 - * @param industryCode 业态唯一编码 - */ -export const useStatistics = ({ tag, shopCode, industryCode = '' }: { tag: TagType; shopCode: string | number; industryCode?: string }) => { +type Params = { tag: TagType; shopCode?: string | number; industryCode?: string } +//店铺编码: tag=navigation或shop或brandSearch或时必传 +//industryCode : tag=industry时必传 +export const useStatistics = ({ tag, shopCode, industryCode = '' }: Params) => { const store = useRootStore() const { device } = storeToRefs(store) const params: Query = { - deviceCode: device.value.deviceCode, + deviceCode: device.value.machineCode, projectCode: device.value.projectCode, tag, shopCode,