Browse Source

fix: 修复在水牌页刷新地图没展示为2d的问题

ShangHai_LongXiang
jiannibang 3 years ago
parent
commit
583080304e
  1. 29
      src/views/Billboard/Billboard.vue

29
src/views/Billboard/Billboard.vue

@ -63,7 +63,7 @@
</template>
<script setup>
import { computed, ref, watch, nextTick } from 'vue'
import { computed, ref, watch, nextTick, onMounted } from 'vue'
import { storeToRefs } from 'pinia'
import { useStore } from '@/store/root'
import { useRouter } from 'vue-router'
@ -81,7 +81,7 @@ const store = useStore()
const router = useRouter()
const shops = ref([])
const listRef = ref(null)
const { currentFloor, buildingList, currentFloorShopMap, config, theme } = storeToRefs(store)
const { currentFloor, buildingList, currentFloorShopMap, config, theme, mapStatus } = storeToRefs(store)
const bf = computed(() => (buildingList.length > 1 ? currentFloor.value.building + '-' : '') + currentFloor.value.floor)
const scrollWidth = ref(0)
@ -111,15 +111,22 @@ Promise.all([getBrandListByFormat()]).then(([{ data: brandListByFormat }]) => {
}
})
})
try {
window.Map_QM?.showFloor?.(currentFloor.value.floorOrder, () => {
window.Map_QM?.changeMapState('2d')
})
setShopInactive()
} catch (error) {
console.log('error:', error)
}
watch(
mapStatus,
val => {
if (val) {
try {
window.Map_QM?.showFloor?.(currentFloor.value.floorOrder, () => {
window.Map_QM?.changeMapState('2d')
})
setShopInactive()
} catch (error) {
console.log('error:', error)
}
}
},
{ immediate: true }
)
const goPage = item => {
router.push(item.path)

Loading…
Cancel
Save