<template>
|
<div id="sdkContainer" ref="container" style="height: 100vh">
|
<map-menu @mapRefreash="mapRefreash"></map-menu>
|
<!-- 着陆页 -->
|
<mapSearch v-show="store.state.setMenuFlag == null" v-if="store.state.setRefreshFlag"></mapSearch>
|
|
<!-- 图层页 -->
|
<layerManager v-if="store.state.setMenuFlag == 'layer'"></layerManager>
|
<!-- 概览页 -->
|
<van-popup v-model:show="showCellItemFlag" closeable close-icon="close" @close="setpopCellItemClose" :overlay="false" round position="bottom">
|
<mapCellItem v-if="store.state.setMenuFlag == 'details'"></mapCellItem>
|
</van-popup>
|
<van-overlay :show="store.state.setLoadFlag" z-index="99999">
|
<div class="loadBox">
|
<van-loading color="#0094ff" vertical>加载中...</van-loading>
|
</div>
|
</van-overlay>
|
</div>
|
</template>
|
|
<script setup>
|
import { ref, reactive, onMounted, computed, shallowRef, watch } from 'vue';
|
import { showToast } from 'vant';
|
import { useStore } from 'vuex';
|
import mapView from './assets/js/mapView.js';
|
//左上角菜单
|
import mapMenu from './views/mapMenu.vue';
|
// 关键字查询
|
import mapSearch from './views/mapSearch.vue';
|
//图层管理
|
import mapCellItem from './views/mapCellItem.vue';
|
import layerManager from './views/layerManager.vue';
|
import mapLayer from './assets/js/mapLayer.js';
|
const store = useStore();
|
const showCellItemFlag = ref(false);
|
const activeNames = ref(['1']);
|
let keyWord = ref('');
|
const setpopCellItemClose = () => {
|
showCellItemFlag.value = false;
|
store.state.setShowCellItem = false;
|
|
mapLayer.setRemovelocationEntity();
|
store.state.setMenuFlag = null;
|
};
|
const setDialogClose = () => {
|
showItemFlag.value = false;
|
};
|
// 刷新
|
const mapRefreash = res => {
|
if (res == 'mapRefreash') {
|
setpopCellItemClose();
|
}
|
};
|
onMounted(() => {
|
console.log('mounted');
|
mapView.init();
|
});
|
let show = ref(false);
|
const click = () => {
|
show.value = true;
|
};
|
const onSearch = val => {
|
console.log(val);
|
showToast(keyWord);
|
};
|
const onClickButton = val => {
|
console.log(keyWord);
|
showToast(keyWord.value);
|
};
|
watch(
|
() => store.state.setMenuFlag,
|
(nVal, oVal) => {
|
if (nVal == 'details') {
|
showCellItemFlag.value = true;
|
}
|
}
|
);
|
watch(
|
() => store.state.setRefreshFlag,
|
(nVal, oVal) => {
|
if (nVal) {
|
setpopCellItemClose();
|
}
|
}
|
);
|
</script>
|
|
<style lang="less">
|
.content {
|
height: 80vh;
|
}
|
|
body {
|
font-size: 16px;
|
background-color: #f8f8f8;
|
-webkit-font-smoothing: antialiased;
|
}
|
|
.goods {
|
padding-bottom: 50px;
|
|
&-swipe {
|
img {
|
width: 100%;
|
display: block;
|
}
|
}
|
|
&-title {
|
font-size: 16px;
|
}
|
|
&-price {
|
color: #f44;
|
}
|
|
&-express {
|
color: #999;
|
font-size: 12px;
|
padding: 5px 15px;
|
}
|
|
&-cell-group {
|
margin: 15px 0;
|
}
|
|
&-tag {
|
margin-left: 5px;
|
}
|
}
|
|
.loadBox {
|
width: 100%;
|
height: 100%;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.cellContent {
|
padding: 10px;
|
}
|
</style>
|