From fe008e6636b03b92af01efccae1e244f3430845e Mon Sep 17 00:00:00 2001 From: jiangx <1457960500@qq.com> Date: Thu, 25 May 2023 14:08:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useHandleScreen.ts | 6 ++---- src/store/root/getters.ts | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/composables/useHandleScreen.ts b/src/composables/useHandleScreen.ts index e67d21b..d19bdef 100644 --- a/src/composables/useHandleScreen.ts +++ b/src/composables/useHandleScreen.ts @@ -54,8 +54,7 @@ export const useHandleScreen = (callback: () => void) => { //跳转屏保挂载到全局 供app使用 window.sleepToWallpaper = async () => { - await sleepToWallpaper() - nativeMethods.value?.goScreenSave() + await checkHandleScreen() } async function checkHandleScreen() { @@ -93,8 +92,7 @@ export const useHandleScreen = (callback: () => void) => { if (!nativeMethods.value?.hasProgram()) { return } - await sleepToWallpaper() - nativeMethods.value?.goScreenSave() + await checkHandleScreen() } }) diff --git a/src/store/root/getters.ts b/src/store/root/getters.ts index 44386d5..aa367e2 100644 --- a/src/store/root/getters.ts +++ b/src/store/root/getters.ts @@ -1,3 +1,4 @@ +import { DEVICE } from '@/enums' import type { State } from './state' import type { CreateGetters } from '../types' import type { PickRecommendShop } from '@/http/api/brand/types' @@ -14,22 +15,26 @@ export type GenGetters = CreateGetters export const getters: GenGetters = { nativeMethods() { - if (this.device.label === 'android') { + if (this.device.label === DEVICE.ANDROID) { return window.android } return window.chrome?.webview?.hostObjects?.sync?.csobj }, + //当前设备所处楼栋的楼层列表 currentBuildingFloorsList() { const currentBuilding = this.buildingList.find(building => building.buildingCode === this.device.buildingCode) return currentBuilding?.floorList ?? [] }, + //推荐店铺列表 recommendList() { return this.BrandInfo.recommendList ?? [] }, + //品牌模块的楼层列表 brandFloorList() { const currentBuilding = this.BrandInfo.buildingList?.find(item => item.buildingCode === this.device.buildingCode) return currentBuilding?.floorList ?? [] }, + //业态列表 industryList() { return this.BrandInfo.industryFatherList ?? [] }