Browse Source

fix: 取消首页后 地图导览初始化无法筛选当前楼层

潮流
姜鑫 4 years ago
parent
commit
ed57559644
  1. BIN
      iot_two_template_V.zip
  2. 0
      src/components/KeyboardByWritten/KeyboardByWritten.vue
  3. 25
      src/components/Map/Map.vue
  4. 5
      src/components/PublicComponent/PublicComponent.vue
  5. 9
      src/components/Search/Search.vue
  6. 1
      src/composables/useChangeNavMethod.js
  7. 25
      src/composables/useSetCameraViews.js
  8. 3
      src/router/index.js
  9. 10
      src/views/Guide/Guide.vue
  10. 7
      src/views/Nav/Nav.vue

BIN
iot_two_template_V.zip

Binary file not shown.

0
src/components/keyboardByWritten/keyboardByWritten.vue → src/components/KeyboardByWritten/KeyboardByWritten.vue

25
src/components/Map/Map.vue

@ -4,7 +4,7 @@
<div id="mapContainer" />
<!-- 地图弹框 -->
<div id="shopInfo" class="boxShop boxShop2" :style="{ background: `url(${require('@/assets/images/map/map-dialog.png')}) no-repeat center center` }">
<div id="shopInfo" class="boxShop boxShop2" :style="{ backgroundImage: `url(${require('@/assets/images/map/map-dialog.png')})` }">
<div id="shopNum">{{ switchLanguage(shop, 'shopName') }}</div>
<div style="display: flex; align-items: center">
<div class="pop-bottom" @click="handleDetail">{{ $t('detail') }}</div>
@ -44,22 +44,24 @@ function handleDetail() {
position: absolute;
top: 0;
left: 0;
height: 1006px;
height: 920px;
width: 1080px;
z-index: 50;
z-index: 10;
}
#shopInfo {
position: absolute;
z-index: 400;
z-index: 9000 !important;
visibility: hidden;
width: 235px;
height: 157px;
background-size: 235px 157px;
height: 158px;
background-size: contain;
background-repeat: no-repeat;
background-position: center center;
#shopNum {
height: 75px;
line-height: 80px;
padding: 0 36px 0 36px;
padding: 10px 36px 0 36px;
color: #ffffff;
font-family: 'font_medium';
font-size: 20px;
@ -68,12 +70,11 @@ function handleDetail() {
.go-button {
width: 50%;
text-align: center;
line-height: 60px;
line-height: 50px;
font-weight: bold;
font-size: 18px;
color: #6a5e59;
height: 55px;
height: 50px;
font-family: 'font_medium';
text-align: center;
}
@ -82,8 +83,8 @@ function handleDetail() {
font-weight: bold;
font-size: 17px;
width: 50%;
height: 55px;
line-height: 60px;
height: 50px;
line-height: 50px;
color: #6a5e59;
overflow: hidden;
font-family: 'font_medium';

5
src/components/PublicComponent/PublicComponent.vue

@ -1,6 +1,6 @@
<template>
<!-- 地图容器 -->
<Map v-show="$route.meta.showMap" @handle-GO="handleGO" />
<Map v-show="$route.meta.showMap" @handle-GO="handleGO" @handle-Detail="handleDetail" />
<!-- 退出弹框 -->
<Logout v-model="logoutRef" @bingo="send('startexplorer')" />
@ -49,6 +49,9 @@ const { title, countDownGif, isWall, countDownToWall, countDownNum, send, checkH
function handleGO() {
router.push('/nav')
}
function handleDetail() {
store.SET_SHOW_DETAIL(true)
}
//
async function handleScreen() {

9
src/components/Search/Search.vue

@ -14,13 +14,13 @@
<h1 class="title">快捷入口</h1>
<h1 class="title-en">Quick entrance</h1>
<div class="facility-list">
<FacilityItem class="margin" :facility="item" v-for="item of facilityList" :key="item.title" />
<FacilityItem @click="_handleFacility(item)" class="margin" :facility="item" v-for="item of facilityList" :key="item.title" />
</div>
</div>
<div class="keyboard-wrapper">
<Tabs @click="handleTab" :list="list" class="width" />
<KeyboardByLetter @del="del" @handle-letter="handleLetter" v-if="tabIdx === 0" />
<keyboardByWritten @del="del" @handle-word="handleLetter" v-else />
<KeyboardByWritten @del="del" @handle-word="handleLetter" v-else />
</div>
</div>
</div>
@ -64,6 +64,7 @@ import { storeToRefs } from 'pinia'
import { useStore } from '@/store/root'
import { list } from './tabs'
import { useSearchShop } from '@/composables/useSearchShop'
import { useFacilityNav } from '@/composables/useFacilityNav'
import View from '@/layouts/View.vue'
import Dialog from '@/layouts/Dialog.vue'
import ScrollView from '@/base/ScrollView/ScrollView.vue'
@ -73,11 +74,13 @@ import Tabs from '@/components/Tabs/Tabs.vue'
import SearchResultList from '@/components/SearchResultList/SearchResultList.vue'
const QuestionClassify = defineAsyncComponent(() => import('@/components/QuestionClassify/QuestionClassify.vue'))
const KeyboardByLetter = defineAsyncComponent(() => import('@/components/KeyboardByLetter/KeyboardByLetter.vue'))
const keyboardByWritten = defineAsyncComponent(() => import('@/components/keyboardByWritten/keyboardByWritten.vue'))
const KeyboardByWritten = defineAsyncComponent(() => import('@/components/KeyboardByWritten/KeyboardByWritten.vue'))
const Voice = defineAsyncComponent(() => import('@/components/Voice/Voice.vue'))
const MAX_LENGTH = 7
const { _handleFacility } = useFacilityNav()
const router = useRouter()
const store = useStore()
const { indexList, shopList, facilityList, config, showVoice } = storeToRefs(store)

1
src/composables/useChangeNavMethod.js

@ -20,7 +20,6 @@ export const useChangeNavMethod = callback => {
//扶梯模式
window.Map_QM.ChangePathByFt(callback)
break
case STRAIGHT:
//电梯模式
window.Map_QM.ChangePathByDt(callback)

25
src/composables/useSetCameraViews.js

@ -1,20 +1,31 @@
import { ref, computed, onBeforeUnmount } from 'vue'
export const useSetCameraViews = pauseRef => {
const cameraViewsText = ref(window.pathCameraState)
const cameraViewsImage = computed(() => (cameraViewsText.value === '2D' ? require('@/assets/images/nav/2D.svg') : require('@/assets/images/nav/3D.svg')))
export const useSetCameraViews = pauseFn => {
const map = {
'3D': {
text: '2D',
image: require('@/assets/images/nav/2D.svg')
},
'2D': {
text: '3D',
image: require('@/assets/images/nav/3D.svg')
}
}
const text = ref(window.pathCameraState)
const cameraViews = computed(() => map[text.value])
//设置导航视角 2D或者3D
function setCameraViews() {
pauseRef.value = false
pauseFn?.()
window.Map_QM.pathRePlay()
window.Map_QM.changePathDir(window.pathCameraState === '2D' ? '3D' : '2D')
cameraViewsText.value = window.pathCameraState
const _text = text.value === '2D' ? '3D' : '2D'
window.Map_QM.changePathDir(_text)
text.value = _text
}
onBeforeUnmount(() => {
window.pathCameraState = '2D'
})
return { cameraViewsText, cameraViewsImage, setCameraViews }
return { cameraViews, setCameraViews }
}

3
src/router/index.js

@ -35,8 +35,7 @@ router.beforeEach(async to => {
if (!router.hasRoute('home')) {
//推荐卡片列表长度为0时说明不需要推荐页面 直接从导航栏列表删除
if (!data.columnList.length) {
const list = store.sidebarList.slice()
store.SET_SIDEBAR_LIST(list.splice(0, 1))
store.SET_SIDEBAR_LIST(store.sidebarList.slice(1))
}
//store存储的首页卡片数据长度不等于请求的卡片数据长度时才能去重新提交到store中 防止重复提交
if (store.indexList?.columnList?.length !== data.columnList.length) {

10
src/views/Guide/Guide.vue

@ -59,7 +59,11 @@ const { currentBuildingFloorsList, currentFloor, shopList, config, facilityList
const { _handleFacility } = useFacilityNav()
window.Map_QM && window.Map_QM.showFloor(currentFloor.value.floorOrder)
try {
window.Map_QM?.showFloor?.(currentFloor.value.floorOrder)
} catch (error) {
console.log('error: ', error)
}
const selectedShopList = ref([])
const idle = ref(null)
@ -161,7 +165,7 @@ watch(
<style lang="scss" scoped>
.floors-list {
position: fixed;
position: absolute;
right: 4px;
top: 320px;
z-index: 60;
@ -279,7 +283,7 @@ watch(
}
.control-area {
position: fixed;
position: absolute;
display: flex;
align-items: flex-start;
justify-content: space-between;

7
src/views/Nav/Nav.vue

@ -5,7 +5,7 @@
<Time />
<Temperature />
<img src="../../assets/images/nav/back.png" class="back-icon" @click="$router.back()" alt="" />
<QRCode />
<!-- <QRCode />-->
</div>
<div class="nav-methods animate__animated animate__fadeInUp animate__faster">
<div class="box w-200 mr-8" @click="handleControl(item.name, index)" v-for="(item, index) of methodsList" :key="item.name" :class="{ active: methodIdx === index }">
@ -27,7 +27,7 @@
</div>
<div class="box w-100" @click="setCameraViews">
<img :src="cameraViewsImage" class="box-icon z-index" alt="" />
<img :src="cameraViews.image" class="box-icon z-index" alt="" />
</div>
</div>
@ -45,7 +45,6 @@ import { useMapNavControl } from '@/composables/useMapNavControl'
import { useChangeNavMethod } from '@/composables/useChangeNavMethod'
import { useStartNavi } from '@/composables/useStartNavi'
import { useSetCameraViews } from '@/composables/useSetCameraViews'
import QRCode from './children/QRCode.vue'
import { Refresh } from '@/base/Svg'
import PassShop from './children/PassShop.vue'
import Temperature from '@/base/Temperature/Temperature.vue'
@ -58,7 +57,7 @@ const { shop, currentFloor, config } = storeToRefs(store)
const { replay, pause, speedUp, handleReplay, togglePause, handleSpeedUp, setPause } = useMapNavControl()
const { directionInfo, pathShopList, backPathArray } = useStartNavi(shop, currentFloor, setPause)
const { methodIdx, handleControl } = useChangeNavMethod(backPathArray)
const { cameraViewsImage, setCameraViews } = useSetCameraViews(pause)
const { cameraViews, setCameraViews } = useSetCameraViews(setPause)
useStatistics('navigation')

Loading…
Cancel
Save