|
@@ -6,31 +6,78 @@
|
6
|
6
|
@click="onShowInfoBtn"
|
7
|
7
|
/>
|
8
|
8
|
<PopUpVue :show="showInfo" :info="info" :onClose="onCloseInfoBtn" />
|
|
9
|
+ <div v-if="showGesture" class="gesture2" :class="{ hidden: gestureHide }" :style="gestureStyle">
|
|
10
|
+ <i class="iconfont icon-cc-pointer-right"></i>
|
|
11
|
+ </div>
|
9
|
12
|
</template>
|
10
|
13
|
|
11
|
14
|
<script setup>
|
12
|
|
-import { computed, ref, watch } from "vue";
|
|
15
|
+ import { computed, ref, watch } from "vue";
|
13
|
16
|
import CoverBtn from "./CoverBtn.vue";
|
14
|
|
-import PopUpVue from "./PopUp.vue";
|
|
17
|
+ import PopUpVue from "./PopUp.vue";
|
15
|
18
|
|
16
|
|
-const props = defineProps({
|
17
|
|
- center: Array,
|
18
|
|
- info: {
|
19
|
|
- type: Object,
|
20
|
|
- default: () => ({})
|
21
|
|
- }
|
22
|
|
-})
|
|
19
|
+ const props = defineProps({
|
|
20
|
+ center: Array,
|
|
21
|
+ info: {
|
|
22
|
+ type: Object,
|
|
23
|
+ default: () => ({})
|
|
24
|
+ },
|
|
25
|
+ showGesture: {
|
|
26
|
+ type: Boolean,
|
|
27
|
+ default: false,
|
|
28
|
+ },
|
|
29
|
+ })
|
23
|
30
|
|
24
|
|
-const showInfo = ref(false)
|
25
|
|
-const width = ref(50);
|
26
|
|
-const height = ref(120);
|
|
31
|
+ const showInfo = ref(false)
|
|
32
|
+ const width = ref(50);
|
|
33
|
+ const height = ref(120);
|
|
34
|
+ const gestureHide = ref(false);
|
27
|
35
|
|
28
|
|
-// 显示详情介绍
|
29
|
|
-const onShowInfoBtn = () => {
|
30
|
|
- showInfo.value=true
|
31
|
|
-};
|
|
36
|
+ const gestureStyle = computed(() => {
|
|
37
|
+ if (props.center && props.center.length > 1) {
|
|
38
|
+ return {
|
|
39
|
+ left: `${props.center[0] - 12}px`,
|
|
40
|
+ top: `${props.center[1] - height.value / 1.8}px`
|
|
41
|
+ }
|
|
42
|
+ } else {
|
|
43
|
+ return {};
|
|
44
|
+ }
|
|
45
|
+ });
|
|
46
|
+ // 显示详情介绍
|
|
47
|
+ const onShowInfoBtn = () => {
|
|
48
|
+ gestureHide.value = true;
|
|
49
|
+ showInfo.value=true
|
|
50
|
+ };
|
32
|
51
|
|
33
|
|
-const onCloseInfoBtn = () => {
|
34
|
|
- showInfo.value=false
|
35
|
|
-};
|
|
52
|
+ const onCloseInfoBtn = () => {
|
|
53
|
+ showInfo.value=false
|
|
54
|
+ };
|
36
|
55
|
</script>
|
|
56
|
+
|
|
57
|
+<style lang="less" scoped>
|
|
58
|
+
|
|
59
|
+.gesture2 {
|
|
60
|
+ position: absolute;
|
|
61
|
+ z-index: 9;
|
|
62
|
+ animation: gestureAnimation2 1.6s ease-in-out infinite;
|
|
63
|
+
|
|
64
|
+ .iconfont {
|
|
65
|
+ font-size: 24px;
|
|
66
|
+ }
|
|
67
|
+
|
|
68
|
+ &.hidden {
|
|
69
|
+ display: none;
|
|
70
|
+ }
|
|
71
|
+ }
|
|
72
|
+
|
|
73
|
+ @keyframes gestureAnimation2 {
|
|
74
|
+ from {
|
|
75
|
+ opacity: 0;
|
|
76
|
+ transform: translateY(0) rotate(90deg);
|
|
77
|
+ }
|
|
78
|
+ to {
|
|
79
|
+ opacity: 1;
|
|
80
|
+ transform: translateY(12px) rotate(90deg);
|
|
81
|
+ }
|
|
82
|
+ }
|
|
83
|
+</style>
|