Browse Source

Merge pull request 'dev' (#61) from dev into test

Reviewed-on: common/base_daoshi_vue_ts#61
test
姜鑫 3 years ago
parent
commit
12a1ff59c8
  1. BIN
      public/static/img/model/honglvdeng.glb
  2. BIN
      public/static/img/model/jt_left.glb
  3. BIN
      public/static/img/model/jt_left_up.glb
  4. BIN
      public/static/img/model/jt_right.glb
  5. BIN
      public/static/img/model/jt_right_up.glb
  6. BIN
      public/static/img/model/jt_turn.glb
  7. BIN
      public/static/img/model/jt_up.glb
  8. BIN
      public/static/img/model/ludeng.glb
  9. BIN
      public/static/img/model/taiyangsan.glb
  10. 1776
      public/static/qm/MainMap_QM.js
  11. 96
      public/static/qm/three.js
  12. 27
      src/components/PublicComponent/PublicComponent.vue
  13. 20
      src/composables/useHandleScreen.ts
  14. 2
      src/store/root/getters.ts
  15. 5
      src/store/root/state.ts

BIN
public/static/img/model/honglvdeng.glb

Binary file not shown.

BIN
public/static/img/model/jt_left.glb

Binary file not shown.

BIN
public/static/img/model/jt_left_up.glb

Binary file not shown.

BIN
public/static/img/model/jt_right.glb

Binary file not shown.

BIN
public/static/img/model/jt_right_up.glb

Binary file not shown.

BIN
public/static/img/model/jt_turn.glb

Binary file not shown.

BIN
public/static/img/model/jt_up.glb

Binary file not shown.

BIN
public/static/img/model/ludeng.glb

Binary file not shown.

BIN
public/static/img/model/taiyangsan.glb

Binary file not shown.

1776
public/static/qm/MainMap_QM.js

File diff suppressed because it is too large

96
public/static/qm/three.js

File diff suppressed because one or more lines are too long

27
src/components/PublicComponent/PublicComponent.vue

@ -27,19 +27,9 @@ const AutoBackNotification = defineAsyncComponent(() => import('@/base/AutoBackN
const router = useRouter()
const route = useRoute()
const store = useRootStore()
const { language, showSearch, showDetail, mapStatus, nativeMethods } = storeToRefs(store)
const {
checkHandleScreen,
showCountDownDialog,
title,
toIndexTime,
toWallpaperTime,
isWallpaper,
setLogout,
resetClickNumber,
logout,
sleepToWallpaper
} = useHandleScreen(handleScreen)
const { language, showSearch, showDetail } = storeToRefs(store)
const { checkHandleScreen, showCountDownDialog, title, toIndexTime, toWallpaperTime, isWallpaper, setLogout, resetClickNumber, logout } =
useHandleScreen(handleScreen)
//
function handleScreen() {
@ -64,17 +54,6 @@ onBeforeUnmount(() => {
window.removeEventListener('touchend', checkHandleScreen)
})
watch(mapStatus, async newVal => {
//便
if (newVal) {
if (!nativeMethods.value?.hasProgram()) {
return
}
await sleepToWallpaper()
nativeMethods.value?.goScreenSave()
}
})
watch(route, to => {
if (to.fullPath === '/' || to.fullPath === '/nav') {
window?.Map_QM?.startRender()

20
src/composables/useHandleScreen.ts

@ -12,7 +12,7 @@ export const useHandleScreen = (callback: () => void) => {
const router = useRouter()
const store = useRootStore()
const { isAndroid, nativeMethods } = toRefs(store)
const { device, nativeMethods, mapStatus } = toRefs(store)
const { logout, resetClickNumber, setLogout, addTotalClick } = useLogout()
@ -59,7 +59,7 @@ export const useHandleScreen = (callback: () => void) => {
window.sleepToWallpaper = sleepToWallpaper
async function checkHandleScreen(e: TouchEvent) {
!isAndroid && addTotalClick(e)
device.value.label === 'windows' && addTotalClick(e)
toIndexTime.value = totalTime.value[0]
toWallpaperTime.value = totalTime.value[1]
@ -85,10 +85,17 @@ export const useHandleScreen = (callback: () => void) => {
//监听时间 大于等于0且小于等于5时显示弹框
watch([toIndexTime, toWallpaperTime], ([indexTime, wallpaperTime]) => {
if ((indexTime >= MIN_TIME && indexTime <= MAX_TIME) || (wallpaperTime >= MIN_TIME && wallpaperTime <= MAX_TIME)) {
showCountDownDialog.value = true
} else {
showCountDownDialog.value = false
showCountDownDialog.value = (indexTime >= MIN_TIME && indexTime <= MAX_TIME) || (wallpaperTime >= MIN_TIME && wallpaperTime <= MAX_TIME)
})
watch(mapStatus, async (newVal: boolean) => {
//当地图加载成功之后自动触发一次屏保弹框以便能进入屏保
if (newVal) {
if (!nativeMethods.value?.hasProgram()) {
return
}
await sleepToWallpaper()
nativeMethods.value?.goScreenSave()
}
})
@ -111,7 +118,6 @@ export const useHandleScreen = (callback: () => void) => {
logout,
checkHandleScreen,
resetClickNumber,
sleepToWallpaper,
setLogout
}
}

2
src/store/root/getters.ts

@ -14,7 +14,7 @@ export type GenGetters = CreateGetters<State, GettersMap>
export const getters: GenGetters = {
nativeMethods() {
if (this.isAndroid) {
if (this.device.label === 'android') {
return window.android
}
return window.chrome?.webview?.hostObjects?.sync?.csobj

5
src/store/root/state.ts

@ -1,5 +1,4 @@
import type { GroupList, BrandRes } from '@/http/api/brand/types'
import { isAndroid } from '@/utils/utils'
export interface State {
shopList: Readonly<Shop[]> //店铺列表
@ -16,7 +15,6 @@ export interface State {
mapStatus: boolean //地图加载是否成功
device: Device //当前设备信息
shop: Shop //店铺信息
isAndroid: boolean
}
export const state = (): State => ({
@ -33,6 +31,5 @@ export const state = (): State => ({
config: {} as Config,
mapStatus: false,
device: {} as Device,
shop: {} as Shop,
isAndroid: isAndroid()
shop: {} as Shop
})

Loading…
Cancel
Save