From 2365d8d2c90d440ec0c3dfc9759be6e3da884efd Mon Sep 17 00:00:00 2001 From: jiannibang <271381693@qq.com> Date: Thu, 2 Feb 2023 15:01:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useHandleScreen.js | 10 ---------- src/composables/useStatistics.js | 9 +++++---- src/store/root/actions.js | 2 ++ src/views/Nav/Nav.vue | 2 +- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/composables/useHandleScreen.js b/src/composables/useHandleScreen.js index 3d93a77..395daa0 100644 --- a/src/composables/useHandleScreen.js +++ b/src/composables/useHandleScreen.js @@ -38,16 +38,6 @@ export const useHandleScreen = callback => { } } - //当前操作页是否首页专用 - function rootPromise() { - clearTimeout(state.isRootTimer) - return new Promise(resolve => { - state.isRootTimer = setTimeout(() => { - resolve() - }, state.times[0] * 1000) - }) - } - //回到首页专用 function indexPromise() { return new Promise(resolve => { diff --git a/src/composables/useStatistics.js b/src/composables/useStatistics.js index 7c54acc..60bbb37 100644 --- a/src/composables/useStatistics.js +++ b/src/composables/useStatistics.js @@ -5,14 +5,15 @@ import { getStatistics } from '@/http/api' /** * @param {string} tag 设备点击量:device,导航使用次数:navigation,店铺点击次数:shop,业态点击次数:industry, 搜索店铺: brandSearch */ -export const useStatistics = tag => { +export const useStatistics = (tag, rest = {}) => { const store = useStore() const { currentFloor } = storeToRefs(store) - const { projectCode, deviceCode } = currentFloor.value + const { projectCode, machineCode } = currentFloor.value const params = { projectCode, - deviceCode, - tag + deviceCode: machineCode, + tag, + ...rest } getStatistics(params) } diff --git a/src/store/root/actions.js b/src/store/root/actions.js index ab7675b..5bb61d7 100644 --- a/src/store/root/actions.js +++ b/src/store/root/actions.js @@ -1,4 +1,5 @@ import { i18n } from '@/i18n' +import { useStatistics } from '@/composables/useStatistics' export const actions = { SET_SHOP_LIST(list) { @@ -25,6 +26,7 @@ export const actions = { }, SET_SHOP(shop) { this.shop = shop + if (shop) useStatistics('shop', { shopId: shop.shopId }) }, SET_CURRENT_FLOOR(currentFloor) { this.currentFloor = currentFloor diff --git a/src/views/Nav/Nav.vue b/src/views/Nav/Nav.vue index e7d98d2..2d9d18f 100644 --- a/src/views/Nav/Nav.vue +++ b/src/views/Nav/Nav.vue @@ -42,7 +42,7 @@ const { setPause } = useMapNavControl() const { directionInfo, pathShopList, backPathArray } = useStartNavi(shop, currentFloor, setPause) const { methodIdx, handleControl } = useChangeNavMethod(backPathArray) -useStatistics('navigation') +useStatistics('navigation', { shopId: shop.value.shopId })