2024-02-20 14:55:52 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
2024-03-04 15:57:34 +08:00
|
|
|
<div
|
|
|
|
|
v-show="!showit"
|
|
|
|
|
class="switch"
|
|
|
|
|
style="position: absolute; top: -40px; right: 0; z-index: 99; cursor: pointer"
|
|
|
|
|
@click="showLandmark"
|
|
|
|
|
>
|
|
|
|
|
<img class="icon" src="../assets/toup.png" />
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-show="showit"
|
|
|
|
|
class="switch"
|
|
|
|
|
style="position: absolute; top: -50px; right: 0; z-index: 99; cursor: pointer"
|
|
|
|
|
@click="showLandmark"
|
|
|
|
|
>
|
|
|
|
|
<img class="icon" src="../assets/todown.png" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="landmark">
|
|
|
|
|
<table v-if="showit">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>景点名称</th>
|
|
|
|
|
<th>经度</th>
|
|
|
|
|
<th>纬度</th>
|
|
|
|
|
<th>访问景点</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr v-for="(item, index) in landmarkArr" :key="index">
|
|
|
|
|
<td>{{ item ? item.landmark : index + 1 }}</td>
|
|
|
|
|
<td>{{ item ? item.position.lng : "" }}</td>
|
|
|
|
|
<td>{{ item ? item.position.lat : "" }}</td>
|
|
|
|
|
<td>
|
|
|
|
|
<button style="cursor: pointer" @click="write(item.position)">访问</button>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
2024-02-20 14:55:52 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2024-03-04 15:57:34 +08:00
|
|
|
import { ref } from "vue";
|
|
|
|
|
import { usePositionStore } from "/@/stores/position";
|
|
|
|
|
import { landmarkArr } from "/@/information/landmark";
|
2024-02-20 14:55:52 +08:00
|
|
|
|
|
|
|
|
let showit = ref(false);
|
|
|
|
|
|
|
|
|
|
const showLandmark = () => {
|
2024-03-04 15:57:34 +08:00
|
|
|
showit.value = !showit.value;
|
|
|
|
|
};
|
2024-02-20 14:55:52 +08:00
|
|
|
|
2024-03-04 15:57:34 +08:00
|
|
|
const position = usePositionStore();
|
2024-02-20 14:55:52 +08:00
|
|
|
|
2024-03-04 15:57:34 +08:00
|
|
|
const write = (myposition) => {
|
|
|
|
|
position.set(myposition);
|
|
|
|
|
};
|
2024-02-20 14:55:52 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.landmark {
|
|
|
|
|
max-height: 360px;
|
2024-03-04 15:57:34 +08:00
|
|
|
overflow-y: scroll;
|
2024-02-20 14:55:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.switch {
|
2024-03-04 15:57:34 +08:00
|
|
|
width: 42px;
|
|
|
|
|
height: 42px;
|
2024-02-20 14:55:52 +08:00
|
|
|
border-radius: 50%;
|
2024-03-04 15:57:34 +08:00
|
|
|
background-color: #fff;
|
|
|
|
|
padding-top: 9px;
|
|
|
|
|
padding-left: 3px;
|
2024-02-20 14:55:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.icon {
|
2024-03-04 15:57:34 +08:00
|
|
|
width: 36px;
|
2024-02-20 14:55:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table {
|
2024-03-04 15:57:34 +08:00
|
|
|
color: #ffffff;
|
2024-02-20 14:55:52 +08:00
|
|
|
background-color: #242424;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
border-radius: 7px;
|
|
|
|
|
border-collapse: separate;
|
|
|
|
|
border-spacing: 2px;
|
2024-03-04 15:57:34 +08:00
|
|
|
text-align: center;
|
2024-02-20 14:55:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table th:first-child {
|
|
|
|
|
width: 120px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table th:not(:first-child) {
|
|
|
|
|
width: 100px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table thead tr {
|
|
|
|
|
background-color: rgba(84, 84, 84, 0.8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table tbody tr:nth-child(even) {
|
|
|
|
|
background-color: rgba(84, 84, 84, 0.8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table tbody tr:nth-child(odd) {
|
|
|
|
|
background-color: rgba(84, 84, 84, 0.25);
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-04 15:57:34 +08:00
|
|
|
table th,
|
|
|
|
|
table td {
|
2024-02-20 14:55:52 +08:00
|
|
|
padding: 3px 5px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|