123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <div class="simple-map-nav">
- <van-popup v-model="show" :closeable="true" :position="position">
- <div class="title">地图导航</div>
- <div class="popup-content">
- <van-button
- class="btn"
- :size="size"
- :color="color"
- :round="round"
- @click="$emit('click', 'gaode')"
- >高德地图</van-button
- >
- <van-button
- class="btn"
- :size="size"
- :color="color"
- :round="round"
- @click="$emit('click', 'tx')"
- >腾讯地图</van-button
- >
- <van-button
- class="btn"
- :size="size"
- :color="color"
- :round="round"
- @click="$emit('click', 'baidu')"
- >百度地图</van-button
- >
- </div>
- </van-popup>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- export default {
- props: {
- color: {
- type: String,
- default: '#bc1724',
- },
- },
- computed: {
- ...mapGetters(['isPc']),
- position() {
- return this.isPc ? 'center' : 'bottom'
- },
- round() {
- return !this.isPc
- },
- size() {
- return this.isPc ? 'normal' : 'small'
- },
- },
- data() {
- return {
- show: false,
- }
- },
- methods: {
- close() {
- this.show = false
- },
- open() {
- this.show = true
- },
- },
- }
- </script>
- <style scoped lang="scss">
- @media screen and (min-width: 768px) {
- .simple-map-nav {
- .title {
- font-size: 18px;
- color: #666;
- text-align: center;
- padding: 24px 0;
- }
- .popup-content {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 360px;
- padding: 0 24px 24px;
- }
- }
- }
- @media screen and (max-width: 768px) {
- .simple-map-nav {
- .title {
- font-size: 3.6vw;
- color: #666;
- text-align: center;
- padding: 2.4vw 0;
- }
- .popup-content {
- display: flex;
- align-items: center;
- flex-direction: column;
- padding: 2.4vw;
- ::v-deep {
- .van-button {
- width: 100%;
- margin: 1.2vw 0;
- }
- }
- }
- }
- }
- </style>
|