suerprisePlus
2024-05-30 7452857e6eb0d23dbd71a29f25985ada5208f25d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<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>