diff --git a/src/composables/useHandleScreen.ts b/src/composables/useHandleScreen.ts index d19bdef..5b6a6b8 100644 --- a/src/composables/useHandleScreen.ts +++ b/src/composables/useHandleScreen.ts @@ -53,11 +53,11 @@ export const useHandleScreen = (callback: () => void) => { } //跳转屏保挂载到全局 供app使用 - window.sleepToWallpaper = async () => { - await checkHandleScreen() + window.sleepToWallpaper = () => { + checkHandleScreen() } - async function checkHandleScreen() { + function checkHandleScreen() { toIndexTime.value = totalTime.value[0] toWallpaperTime.value = totalTime.value[1] diff --git a/src/composables/useInitMap.ts b/src/composables/useInitMap.ts index a803538..5d7fac1 100644 --- a/src/composables/useInitMap.ts +++ b/src/composables/useInitMap.ts @@ -59,5 +59,5 @@ function showMapDialog() { //监听地图上下文丢失 刷新页面 function onContextLost() { - location.reload() + window.location.href = '/' } diff --git a/src/composables/useStatistics.ts b/src/composables/useStatistics.ts index 3e440d5..05e04a2 100644 --- a/src/composables/useStatistics.ts +++ b/src/composables/useStatistics.ts @@ -3,8 +3,13 @@ import { storeToRefs } from 'pinia' import { getStatistics } from '@/http/api/statistics' import type { Query, TagType } from '@/http/api/statistics/types' -//店铺编码: tag=navigation或shop或brandSearch或时必传 -//industryCode : tag=industry时必传 +/** + * @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 }) => { const store = useRootStore() const { device } = storeToRefs(store) diff --git a/src/http/http.ts b/src/http/http.ts index bd49818..13fc093 100644 --- a/src/http/http.ts +++ b/src/http/http.ts @@ -85,6 +85,7 @@ class Request { const _request = new Request({ timeout: 10000, + timeoutErrorMessage: '网络超时', interceptors: { requestInterceptors(_config) { const store = useRootStore() diff --git a/src/store/root/actions.ts b/src/store/root/actions.ts index bc7994d..3f2c71b 100644 --- a/src/store/root/actions.ts +++ b/src/store/root/actions.ts @@ -24,15 +24,15 @@ export interface Actions { export type GenActions = CreateActions export const actions: GenActions = { - SET_SHOP_LIST_BY_FLOOR(list) { - this.shopListGroupByFloor = list - }, SET_SHOW_SEARCH(flag) { this.showSearch = flag }, SET_SHOW_DETAIL(flag) { this.showDetail = flag }, + SET_SHOP_LIST_BY_FLOOR(list) { + this.shopListGroupByFloor = list + }, SET_SHOP_LIST_BY_INDUSTRY(list) { this.shopListGroupByIndustry = list }, @@ -54,7 +54,7 @@ export const actions: GenActions = { this.config = config }, SET_SHOP_LIST(list) { - this.shopList = Object.freeze(list) + this.shopList = list }, SET_DEVICE(device) {