Showing
7 changed files
with
171 additions
and
112 deletions
| ... | @@ -10,7 +10,6 @@ export {} | ... | @@ -10,7 +10,6 @@ export {} |
| 10 | declare module '@vue/runtime-core' { | 10 | declare module '@vue/runtime-core' { |
| 11 | export interface GlobalComponents { | 11 | export interface GlobalComponents { |
| 12 | AudioBackground: typeof import('./src/components/audioBackground.vue')['default'] | 12 | AudioBackground: typeof import('./src/components/audioBackground.vue')['default'] |
| 13 | - copy: typeof import('./src/components/InfoWindowWarn copy.vue')['default'] | ||
| 14 | InfoWindow: typeof import('./src/components/InfoWindow.vue')['default'] | 13 | InfoWindow: typeof import('./src/components/InfoWindow.vue')['default'] |
| 15 | InfoWindowLite: typeof import('./src/components/InfoWindowLite.vue')['default'] | 14 | InfoWindowLite: typeof import('./src/components/InfoWindowLite.vue')['default'] |
| 16 | InfoWindowWarn: typeof import('./src/components/InfoWindowWarn.vue')['default'] | 15 | InfoWindowWarn: typeof import('./src/components/InfoWindowWarn.vue')['default'] |
| ... | @@ -23,8 +22,6 @@ declare module '@vue/runtime-core' { | ... | @@ -23,8 +22,6 @@ declare module '@vue/runtime-core' { |
| 23 | VanDialog: typeof import('vant/es')['Dialog'] | 22 | VanDialog: typeof import('vant/es')['Dialog'] |
| 24 | VanIcon: typeof import('vant/es')['Icon'] | 23 | VanIcon: typeof import('vant/es')['Icon'] |
| 25 | VanImage: typeof import('vant/es')['Image'] | 24 | VanImage: typeof import('vant/es')['Image'] |
| 26 | - VanImagePreview: typeof import('vant/es')['ImagePreview'] | ||
| 27 | - VanOverlay: typeof import('vant/es')['Overlay'] | ||
| 28 | VanPopup: typeof import('vant/es')['Popup'] | 25 | VanPopup: typeof import('vant/es')['Popup'] |
| 29 | VanRow: typeof import('vant/es')['Row'] | 26 | VanRow: typeof import('vant/es')['Row'] |
| 30 | } | 27 | } | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | * @Author: hookehuyr hookehuyr@gmail.com | 2 | * @Author: hookehuyr hookehuyr@gmail.com |
| 3 | * @Date: 2022-05-26 23:52:36 | 3 | * @Date: 2022-05-26 23:52:36 |
| 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 5 | - * @LastEditTime: 2023-07-18 14:17:19 | 5 | + * @LastEditTime: 2023-07-19 10:42:05 |
| 6 | * @FilePath: /map-demo/src/App.vue | 6 | * @FilePath: /map-demo/src/App.vue |
| 7 | * @Description: | 7 | * @Description: |
| 8 | --> | 8 | --> |
| ... | @@ -46,11 +46,7 @@ watchEffect( | ... | @@ -46,11 +46,7 @@ watchEffect( |
| 46 | // }); | 46 | // }); |
| 47 | 47 | ||
| 48 | onMounted(async () => { | 48 | onMounted(async () => { |
| 49 | - // 获取当前域名 | 49 | + const { data } = await wxJsAPI(); |
| 50 | - if (!wxInfo().isMobile && !wxInfo().isWeiXin) { | ||
| 51 | - location.href = location.origin + '/f/map/' + location.hash; | ||
| 52 | - } | ||
| 53 | - const { data } = await wxJsAPI({ url: '/f/map/#/' }); | ||
| 54 | data.jsApiList = apiList; | 50 | data.jsApiList = apiList; |
| 55 | wx.config(data); | 51 | wx.config(data); |
| 56 | wx.ready(() => { | 52 | wx.ready(() => { | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2023-07-10 16:14:10 | 2 | * @Date: 2023-07-10 16:14:10 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-07-18 16:00:25 | 4 | + * @LastEditTime: 2023-07-19 11:01:52 |
| 5 | * @FilePath: /map-demo/src/common/yard.js | 5 | * @FilePath: /map-demo/src/common/yard.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -15,7 +15,7 @@ const testInfo = { | ... | @@ -15,7 +15,7 @@ const testInfo = { |
| 15 | list: [ | 15 | list: [ |
| 16 | { | 16 | { |
| 17 | name: '拈花堂', | 17 | name: '拈花堂', |
| 18 | - position: [120.586269, 31.313723], | 18 | + position: [120.586212, 31.31433], |
| 19 | icon: 'https://cdn.ipadbiz.cn/space/Fg-vUZrzlULP6Ls61gRtxgaeTN-y.png', | 19 | icon: 'https://cdn.ipadbiz.cn/space/Fg-vUZrzlULP6Ls61gRtxgaeTN-y.png', |
| 20 | details: [ | 20 | details: [ |
| 21 | { | 21 | { |
| ... | @@ -30,6 +30,30 @@ const testInfo = { | ... | @@ -30,6 +30,30 @@ const testInfo = { |
| 30 | img_url: ['https://cdn.ipadbiz.cn/xys/temp/6e3cddf62ff6369c97fac8fa65299f9a.jpg'], // 图片链接 | 30 | img_url: ['https://cdn.ipadbiz.cn/xys/temp/6e3cddf62ff6369c97fac8fa65299f9a.jpg'], // 图片链接 |
| 31 | book_url: '1', // 预定链接 | 31 | book_url: '1', // 预定链接 |
| 32 | }, | 32 | }, |
| 33 | + { | ||
| 34 | + id: '0', | ||
| 35 | + name: '拈花堂-南厅', | ||
| 36 | + type: '会议室', | ||
| 37 | + sum: 130, | ||
| 38 | + manager: '西仓库运营组长', | ||
| 39 | + contact: '13876476873', | ||
| 40 | + status: '正常', | ||
| 41 | + note: '预订须知', | ||
| 42 | + img_url: ['https://cdn.ipadbiz.cn/xys/temp/6e3cddf62ff6369c97fac8fa65299f9a.jpg'], // 图片链接 | ||
| 43 | + book_url: '1', // 预定链接 | ||
| 44 | + }, | ||
| 45 | + { | ||
| 46 | + id: '0', | ||
| 47 | + name: '拈花堂-二层', | ||
| 48 | + type: '会议室', | ||
| 49 | + sum: 230, | ||
| 50 | + manager: '西仓库运营组长', | ||
| 51 | + contact: '13876476873', | ||
| 52 | + status: '正常', | ||
| 53 | + note: '预订须知', | ||
| 54 | + img_url: ['https://cdn.ipadbiz.cn/xys/temp/6e3cddf62ff6369c97fac8fa65299f9a.jpg'], // 图片链接 | ||
| 55 | + book_url: '1', // 预定链接 | ||
| 56 | + }, | ||
| 33 | ], | 57 | ], |
| 34 | window_type: 'yard', | 58 | window_type: 'yard', |
| 35 | }, | 59 | }, | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div style="position: relative;"> | 2 | <div style="position: relative;"> |
| 3 | - <div class="info-window-warn-wrapper"> | 3 | + <div class="info-window-yarn-wrapper"> |
| 4 | <div :style="{ width: (widow_info.width * 0.8) + 'px', overflow: 'auto' }"> | 4 | <div :style="{ width: (widow_info.width * 0.8) + 'px', overflow: 'auto' }"> |
| 5 | <div class="hideScrollBar info-window-title"> | 5 | <div class="hideScrollBar info-window-title"> |
| 6 | <div v-for="(item, index) in info?.details" :key="index" @click="handleTitle(index)" | 6 | <div v-for="(item, index) in info?.details" :key="index" @click="handleTitle(index)" |
| ... | @@ -21,8 +21,8 @@ | ... | @@ -21,8 +21,8 @@ |
| 21 | <div>联系电话: {{ item.contact }}</div> | 21 | <div>联系电话: {{ item.contact }}</div> |
| 22 | <div>状态: {{ item.status }}</div> | 22 | <div>状态: {{ item.status }}</div> |
| 23 | </div> | 23 | </div> |
| 24 | - <div v-if="warn_info.img_url" class="info-control"> | 24 | + <div v-if="yard_info.img_url" class="info-control"> |
| 25 | - <viewer :images="warn_info.img_url" :options="options" class="images clearfix"> | 25 | + <viewer :images="yard_info.img_url" :options="options" class="images clearfix"> |
| 26 | <template #default="scope"> | 26 | <template #default="scope"> |
| 27 | <van-image v-for="src in scope.images" width="100%" fit="contain" :src="src" /> | 27 | <van-image v-for="src in scope.images" width="100%" fit="contain" :src="src" /> |
| 28 | </template> | 28 | </template> |
| ... | @@ -32,13 +32,13 @@ | ... | @@ -32,13 +32,13 @@ |
| 32 | </div> | 32 | </div> |
| 33 | </div> | 33 | </div> |
| 34 | <div class="van-hairline--top warn-button-wrapper"> | 34 | <div class="van-hairline--top warn-button-wrapper"> |
| 35 | - <div @click="goToUrl()" style="width: 50%; float: left; text-align: center; margin-top: 0.75rem;" | 35 | + <div @click="goToNote()" style="width: 50%; float: left; text-align: center; margin-top: 0.75rem;" |
| 36 | class="van-hairline--right"> | 36 | class="van-hairline--right"> |
| 37 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E8%AF%A6%E6%83%85@2x.png" size="1.25rem" color="#FFF" | 37 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E8%AF%A6%E6%83%85@2x.png" size="1.25rem" color="#FFF" |
| 38 | style="vertical-align: sub;" /> | 38 | style="vertical-align: sub;" /> |
| 39 | <span style="color: #AB8F57; font-size: 1rem;">须知</span> | 39 | <span style="color: #AB8F57; font-size: 1rem;">须知</span> |
| 40 | </div> | 40 | </div> |
| 41 | - <div @click="goToUrl()" style="width: 50%; float: left; text-align: center; margin-top: 0.75rem;" | 41 | + <div @click="goToOrder()" style="width: 50%; float: left; text-align: center; margin-top: 0.75rem;" |
| 42 | class="van-hairline--right"> | 42 | class="van-hairline--right"> |
| 43 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/icon/%E9%A2%84%E5%AE%9A@2x.png" size="1.25rem" color="#FFF" | 43 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/icon/%E9%A2%84%E5%AE%9A@2x.png" size="1.25rem" color="#FFF" |
| 44 | style="vertical-align: sub;" /> | 44 | style="vertical-align: sub;" /> |
| ... | @@ -54,6 +54,22 @@ | ... | @@ -54,6 +54,22 @@ |
| 54 | <div class="leaflet-popup-tip-container" style="left: 50%; position: relative;"> | 54 | <div class="leaflet-popup-tip-container" style="left: 50%; position: relative;"> |
| 55 | <div class="leaflet-popup-tip"></div> | 55 | <div class="leaflet-popup-tip"></div> |
| 56 | </div> | 56 | </div> |
| 57 | + | ||
| 58 | + <van-popup | ||
| 59 | + v-model:show="showPopup" | ||
| 60 | + position="bottom" | ||
| 61 | + :overlay="true" | ||
| 62 | + :style="{ height: '90%' }" | ||
| 63 | + teleport="body" | ||
| 64 | + > | ||
| 65 | + <van-icon name="cross" size="1.35rem" @click="showPopup = false" style="float: right; color: gray; margin-right: 1rem; margin-top: 1rem;" /> | ||
| 66 | + <div style="clear: both;"> | ||
| 67 | + <div style="color: #965f13; text-align: center; margin: 1rem; font-size: 1.25rem;"> | ||
| 68 | + 用户须知 | ||
| 69 | + </div> | ||
| 70 | + <div v-html="yard_info.note" style="padding: 1rem;"></div> | ||
| 71 | + </div> | ||
| 72 | + </van-popup> | ||
| 57 | </div> | 73 | </div> |
| 58 | </template> | 74 | </template> |
| 59 | 75 | ||
| ... | @@ -80,8 +96,8 @@ export default { | ... | @@ -80,8 +96,8 @@ export default { |
| 80 | computed: { | 96 | computed: { |
| 81 | warn_span1() { | 97 | warn_span1() { |
| 82 | let flag = false; | 98 | let flag = false; |
| 83 | - if (this.warn_info.case_url) { | 99 | + if (this.yard_info.case_url) { |
| 84 | - if (this.warn_info.notice_url || this.warn_info.handle_url) { | 100 | + if (this.yard_info.notice_url || this.yard_info.handle_url) { |
| 85 | flag = true | 101 | flag = true |
| 86 | } | 102 | } |
| 87 | } | 103 | } |
| ... | @@ -89,8 +105,8 @@ export default { | ... | @@ -89,8 +105,8 @@ export default { |
| 89 | }, | 105 | }, |
| 90 | warn_span2() { | 106 | warn_span2() { |
| 91 | let flag = false; | 107 | let flag = false; |
| 92 | - if (this.warn_info.notice_url) { | 108 | + if (this.yard_info.notice_url) { |
| 93 | - if (this.warn_info.handle_url) { | 109 | + if (this.yard_info.handle_url) { |
| 94 | flag = true | 110 | flag = true |
| 95 | } | 111 | } |
| 96 | } | 112 | } |
| ... | @@ -103,7 +119,7 @@ export default { | ... | @@ -103,7 +119,7 @@ export default { |
| 103 | }, | 119 | }, |
| 104 | infoWindow(val) { | 120 | infoWindow(val) { |
| 105 | if (val) { | 121 | if (val) { |
| 106 | - this.warn_info = this.info.details[0] | 122 | + this.yard_info = this.info.details[0] |
| 107 | } | 123 | } |
| 108 | } | 124 | } |
| 109 | }, | 125 | }, |
| ... | @@ -119,7 +135,7 @@ export default { | ... | @@ -119,7 +135,7 @@ export default { |
| 119 | play_time: '00:00', | 135 | play_time: '00:00', |
| 120 | isActive: 0, | 136 | isActive: 0, |
| 121 | nav_scroll: false, | 137 | nav_scroll: false, |
| 122 | - warn_info: {}, | 138 | + yard_info: {}, |
| 123 | showBottom: false, | 139 | showBottom: false, |
| 124 | img_url: '', | 140 | img_url: '', |
| 125 | show: false, | 141 | show: false, |
| ... | @@ -128,7 +144,8 @@ export default { | ... | @@ -128,7 +144,8 @@ export default { |
| 128 | title: false, | 144 | title: false, |
| 129 | toolbar: false, | 145 | toolbar: false, |
| 130 | navbar: false, | 146 | navbar: false, |
| 131 | - } | 147 | + }, |
| 148 | + showPopup: false | ||
| 132 | } | 149 | } |
| 133 | }, | 150 | }, |
| 134 | methods: { | 151 | methods: { |
| ... | @@ -141,24 +158,12 @@ export default { | ... | @@ -141,24 +158,12 @@ export default { |
| 141 | // 滚动状态 | 158 | // 滚动状态 |
| 142 | this.nav_scroll = false; | 159 | this.nav_scroll = false; |
| 143 | }, | 160 | }, |
| 144 | - goToCase(url) { | 161 | + goToNote () { |
| 145 | - if (url) { | 162 | + this.showPopup = true; |
| 146 | - location.href = url; | 163 | + console.warn(this.yard_info); |
| 147 | - } | ||
| 148 | - }, | ||
| 149 | - goToList(id) { | ||
| 150 | - this.$router.push({ | ||
| 151 | - path: '/noticeList', | ||
| 152 | - query: { | ||
| 153 | - id | ||
| 154 | - } | ||
| 155 | - }) | ||
| 156 | - }, | ||
| 157 | - goToHandle(url) { | ||
| 158 | - // if (url) { | ||
| 159 | - // location.href = url; | ||
| 160 | - // } | ||
| 161 | }, | 164 | }, |
| 165 | + goToOrder () {}, | ||
| 166 | + goToLocation () {}, | ||
| 162 | onClose () { | 167 | onClose () { |
| 163 | window.devicePixelRatio = 1; | 168 | window.devicePixelRatio = 1; |
| 164 | }, | 169 | }, |
| ... | @@ -168,7 +173,7 @@ export default { | ... | @@ -168,7 +173,7 @@ export default { |
| 168 | // if (index === 2 && this.info.details.length > 3) { | 173 | // if (index === 2 && this.info.details.length > 3) { |
| 169 | // this.handleNavScroll() | 174 | // this.handleNavScroll() |
| 170 | // } | 175 | // } |
| 171 | - this.warn_info = this.info.details[index] | 176 | + this.yard_info = this.info.details[index] |
| 172 | }, | 177 | }, |
| 173 | handleNavScroll() { // 滚动标题 | 178 | handleNavScroll() { // 滚动标题 |
| 174 | this.nav_scroll = !this.nav_scroll; | 179 | this.nav_scroll = !this.nav_scroll; |
| ... | @@ -191,7 +196,7 @@ export default { | ... | @@ -191,7 +196,7 @@ export default { |
| 191 | </script> | 196 | </script> |
| 192 | 197 | ||
| 193 | <style lang="less"> | 198 | <style lang="less"> |
| 194 | -.info-window-warn-wrapper { | 199 | +.info-window-yarn-wrapper { |
| 195 | background: #fff; | 200 | background: #fff; |
| 196 | color: #333; | 201 | color: #333; |
| 197 | -webkit-box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4); | 202 | -webkit-box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4); |
| ... | @@ -311,7 +316,7 @@ export default { | ... | @@ -311,7 +316,7 @@ export default { |
| 311 | text-align: left; | 316 | text-align: left; |
| 312 | 317 | ||
| 313 | .item { | 318 | .item { |
| 314 | - width: 30%; | 319 | + width: 35%; |
| 315 | flex-shrink: 0; | 320 | flex-shrink: 0; |
| 316 | color: #888; | 321 | color: #888; |
| 317 | font-size: 1.1rem; | 322 | font-size: 1.1rem; | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-05-19 14:54:27 | 2 | * @Date: 2023-05-19 14:54:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-07-18 15:02:13 | 4 | + * @LastEditTime: 2023-07-19 06:38:25 |
| 5 | * @FilePath: /map-demo/src/views/index.vue | 5 | * @FilePath: /map-demo/src/views/index.vue |
| 6 | * @Description: 地图主体页面 | 6 | * @Description: 地图主体页面 |
| 7 | --> | 7 | --> |
| ... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
| 25 | </div> | 25 | </div> |
| 26 | 26 | ||
| 27 | <van-popup v-model:show="show_nav_popup" position="bottom" duration="0" :overlay="false" | 27 | <van-popup v-model:show="show_nav_popup" position="bottom" duration="0" :overlay="false" |
| 28 | - :style="{ padding: '1rem', bottom: '4.5rem' }"> | 28 | + :style="{ padding: '1rem', bottom: '6rem' }"> |
| 29 | <div style="text-align: left;"> | 29 | <div style="text-align: left;"> |
| 30 | <div v-for="(item, index) in navList" :key="index" @click="handleNavMarker(item)" | 30 | <div v-for="(item, index) in navList" :key="index" @click="handleNavMarker(item)" |
| 31 | style="margin-bottom: 1rem; font-size: 1.15rem;"> | 31 | style="margin-bottom: 1rem; font-size: 1.15rem;"> | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-05-19 14:54:27 | 2 | * @Date: 2023-05-19 14:54:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-07-18 16:48:31 | 4 | + * @LastEditTime: 2023-07-19 11:23:33 |
| 5 | * @FilePath: /map-demo/src/views/inner.vue | 5 | * @FilePath: /map-demo/src/views/inner.vue |
| 6 | * @Description: 地图主体页面 | 6 | * @Description: 地图主体页面 |
| 7 | --> | 7 | --> |
| ... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
| 25 | </div> | 25 | </div> |
| 26 | 26 | ||
| 27 | <van-popup v-model:show="show_nav_popup" position="bottom" duration="0" :overlay="false" | 27 | <van-popup v-model:show="show_nav_popup" position="bottom" duration="0" :overlay="false" |
| 28 | - :style="{ padding: '1rem', bottom: '4.5rem' }"> | 28 | + :style="{ padding: '1rem', bottom: '6rem' }"> |
| 29 | <div style="text-align: left;"> | 29 | <div style="text-align: left;"> |
| 30 | <div v-for="(item, index) in navList" :key="index" @click="handleNavMarker(item)" | 30 | <div v-for="(item, index) in navList" :key="index" @click="handleNavMarker(item)" |
| 31 | style="margin-bottom: 1rem; font-size: 1.15rem;"> | 31 | style="margin-bottom: 1rem; font-size: 1.15rem;"> |
| ... | @@ -36,10 +36,10 @@ | ... | @@ -36,10 +36,10 @@ |
| 36 | </div> | 36 | </div> |
| 37 | <div class="operate-bar-wrapper"> | 37 | <div class="operate-bar-wrapper"> |
| 38 | <div class="box-wrapper"> | 38 | <div class="box-wrapper"> |
| 39 | - <!-- <div class="item" @click="setLocation"> | 39 | + <div class="item" @click="setLocation"> |
| 40 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%AE%9A%E4%BD%8Dloc@2x.png" size="1.5rem" | 40 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%AE%9A%E4%BD%8Dloc@2x.png" size="1.5rem" |
| 41 | style="vertical-align: middle;" /> | 41 | style="vertical-align: middle;" /> |
| 42 | - </div> --> | 42 | + </div> |
| 43 | <div class="item" @click="selectRoute"> | 43 | <div class="item" @click="selectRoute"> |
| 44 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%AE%9A%E4%BD%8Dloc@2x.png" size="1.5rem" | 44 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%AE%9A%E4%BD%8Dloc@2x.png" size="1.5rem" |
| 45 | style="vertical-align: middle;" /> | 45 | style="vertical-align: middle;" /> |
| ... | @@ -83,28 +83,28 @@ | ... | @@ -83,28 +83,28 @@ |
| 83 | <!-- 隐藏不要使用v-if,因为我们需要渲染完成后的原生html结构作为信息框的dom对象使用 --> | 83 | <!-- 隐藏不要使用v-if,因为我们需要渲染完成后的原生html结构作为信息框的dom对象使用 --> |
| 84 | <InfoWindow v-show="showInfoWindow" ref="infoWindow" :info-window="infoWindow" :info="itemInfo" :rect="rect" | 84 | <InfoWindow v-show="showInfoWindow" ref="infoWindow" :info-window="infoWindow" :info="itemInfo" :rect="rect" |
| 85 | @onLocation="infoWindowLocation" @onPlay="onPlay" @onPause="onPause"></InfoWindow> | 85 | @onLocation="infoWindowLocation" @onPlay="onPlay" @onPause="onPause"></InfoWindow> |
| 86 | - <!-- <InfoWindowLite v-show="showInfoWindowLite" ref="infoWindowLite" :info-window="infoWindowLite" :info="itemInfo" | 86 | + <InfoWindowLite v-show="showInfoWindowLite" ref="infoWindowLite" :info-window="infoWindowLite" :info="itemInfo" |
| 87 | :rect="rect" @onLocation="infoWindowLocation"></InfoWindowLite> | 87 | :rect="rect" @onLocation="infoWindowLocation"></InfoWindowLite> |
| 88 | <InfoWindowWarn v-show="showInfoWindowWarn" ref="infoWindowWarn" :info-window="infoWindowWarn" :info="itemInfo" | 88 | <InfoWindowWarn v-show="showInfoWindowWarn" ref="infoWindowWarn" :info-window="infoWindowWarn" :info="itemInfo" |
| 89 | - :rect="rect"></InfoWindowWarn> --> | 89 | + :rect="rect"></InfoWindowWarn> |
| 90 | <InfoWindowYard v-show="showInfoWindowYard" ref="infoWindowYard" :info-window="infoWindowYard" :info="itemInfo" | 90 | <InfoWindowYard v-show="showInfoWindowYard" ref="infoWindowYard" :info-window="infoWindowYard" :info="itemInfo" |
| 91 | :rect="rect"></InfoWindowYard> | 91 | :rect="rect"></InfoWindowYard> |
| 92 | 92 | ||
| 93 | <!-- <audioBackground></audioBackground> --> | 93 | <!-- <audioBackground></audioBackground> --> |
| 94 | 94 | ||
| 95 | <van-popup v-model:show="show_member_popup" position="bottom" :overlay="true" :style="{ padding: '1rem 0', height: '80%', background: '#F7F8FA' }"> | 95 | <van-popup v-model:show="show_member_popup" position="bottom" :overlay="true" :style="{ padding: '1rem 0', height: '80%', background: '#F7F8FA' }"> |
| 96 | - <van-icon name="cross" size="1.35rem" @click="show_member_popup = false" style="float: right; color: gray; margin-right: 1rem;" /> | 96 | + <van-icon name="cross" size="1.35rem" @click="closeMember" style="float: right; color: gray; margin-right: 1rem;" /> |
| 97 | <div id="member-list" class="popup-wrapper" style="clear: both;"> | 97 | <div id="member-list" class="popup-wrapper" style="clear: both;"> |
| 98 | <div style="color: #965f13; text-align: center; margin-bottom: 1rem; font-size: 1.25rem;"> | 98 | <div style="color: #965f13; text-align: center; margin-bottom: 1rem; font-size: 1.25rem;"> |
| 99 | {{ itemInfo.name }} | 99 | {{ itemInfo.name }} |
| 100 | </div> | 100 | </div> |
| 101 | <div v-for="(item, index) in itemInfo.details" :key="index" style="margin-bottom: 1rem;"> | 101 | <div v-for="(item, index) in itemInfo.details" :key="index" style="margin-bottom: 1rem;"> |
| 102 | <!-- 临时引用演示 --> | 102 | <!-- 临时引用演示 --> |
| 103 | - <van-cell-group inset v-show="false"> | 103 | + <!-- <van-cell-group inset v-show="false"> |
| 104 | <van-cell title="姓名" :value="item.name" /> | 104 | <van-cell title="姓名" :value="item.name" /> |
| 105 | <van-cell title="手机号" :value="item.contact" /> | 105 | <van-cell title="手机号" :value="item.contact" /> |
| 106 | <van-cell title="组别" :value="item.group" /> | 106 | <van-cell title="组别" :value="item.group" /> |
| 107 | - </van-cell-group> | 107 | + </van-cell-group> --> |
| 108 | <!-- end --> | 108 | <!-- end --> |
| 109 | <div class="van-cell-group van-cell-group--inset"> | 109 | <div class="van-cell-group van-cell-group--inset"> |
| 110 | <div class="van-cell"> | 110 | <div class="van-cell"> |
| ... | @@ -203,7 +203,7 @@ const GPS = { | ... | @@ -203,7 +203,7 @@ const GPS = { |
| 203 | }; | 203 | }; |
| 204 | 204 | ||
| 205 | export default { | 205 | export default { |
| 206 | - components: { InfoWindow }, | 206 | + components: { InfoWindow, InfoWindowLite, InfoWindowWarn, InfoWindowYard }, |
| 207 | data() { | 207 | data() { |
| 208 | return { | 208 | return { |
| 209 | map: '', | 209 | map: '', |
| ... | @@ -301,16 +301,6 @@ export default { | ... | @@ -301,16 +301,6 @@ export default { |
| 301 | // this.map.resize(); | 301 | // this.map.resize(); |
| 302 | // console.warn(0); | 302 | // console.warn(0); |
| 303 | // }, 1000 * 10); | 303 | // }, 1000 * 10); |
| 304 | - // wx.getLocation({ | ||
| 305 | - // type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' | ||
| 306 | - // success: function (res) { | ||
| 307 | - // var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90 | ||
| 308 | - // var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。 | ||
| 309 | - // var speed = res.speed; // 速度,以米/每秒计 | ||
| 310 | - // var accuracy = res.accuracy; // 位置精度 | ||
| 311 | - // console.warn(res); | ||
| 312 | - // } | ||
| 313 | - // }); | ||
| 314 | }, | 304 | }, |
| 315 | watch: { | 305 | watch: { |
| 316 | show_popup(val) { | 306 | show_popup(val) { |
| ... | @@ -526,31 +516,32 @@ export default { | ... | @@ -526,31 +516,32 @@ export default { |
| 526 | // fillColor: '#CFE7AA' | 516 | // fillColor: '#CFE7AA' |
| 527 | // }); | 517 | // }); |
| 528 | // }, | 518 | // }, |
| 529 | - // isPointInRing() { // 是否在景区范围 | 519 | + isPointInRing() { // 是否在景区范围 |
| 530 | - // let isPointInRing = AMap.GeometryUtil.isPointInRing([this.current_lng, this.current_lat], [ | 520 | + let isPointInRing = AMap.GeometryUtil.isPointInRing([this.current_lng, this.current_lat], [ |
| 531 | - // [120.585111, 31.316084], [120.585111, 31.316084], [120.589488, 31.313197], [120.585422, 31.313005] | 521 | + [120.585111, 31.316084], [120.585111, 31.316084], [120.589488, 31.313197], [120.585422, 31.313005] |
| 532 | - // ]); | 522 | + ]); |
| 533 | - // return isPointInRing | 523 | + return isPointInRing |
| 534 | - // }, | 524 | + }, |
| 535 | - // setLocation() { // 开启定位服务 | 525 | + setLocation() { // 开启定位服务 |
| 536 | - // // this.map.addControl(this.geolocation); // 添加定位图标 自动跳转当前位置 | 526 | + // this.map.addControl(this.geolocation); // 添加定位图标 自动跳转当前位置 |
| 537 | - // if (!this.current_lng || !this.current_lat) { | 527 | + if (!this.current_lng || !this.current_lat) { |
| 538 | - // this.getLocation() | 528 | + this.getLocation() |
| 539 | - // } else { | 529 | + } else { |
| 540 | - // // 使用纠正偏移后的地址,打一个定位标记 | 530 | + // 使用纠正偏移后的地址,打一个定位标记 |
| 541 | - // var marker = new AMap.Marker({ | 531 | + var marker = new AMap.Marker({ |
| 542 | - // position: new AMap.LngLat(this.current_lng, this.current_lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] | 532 | + position: new AMap.LngLat(this.current_lng, this.current_lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9] |
| 543 | - // }); | 533 | + }); |
| 544 | - // this.map.add(marker); | 534 | + this.map.add(marker); |
| 545 | - // // 定位到地图中心-西园寺 | 535 | + // 定位到地图中心-西园寺 |
| 546 | - // this.map.setCenter([120.587334, 31.314823]); | 536 | + // this.map.setCenter([120.587334, 31.314823]); |
| 547 | - // // 判断是否在范围内 | 537 | + this.map.setZoomAndCenter(this.zoom, [this.current_lng, this.current_lat]); |
| 548 | - // if (!this.isPointInRing()) { | 538 | + // 判断是否在范围内 |
| 549 | - // this.dialog_show = true; | 539 | + // if (!this.isPointInRing()) { |
| 550 | - // this.dialog_text = '您不在景区范围内'; | 540 | + // this.dialog_show = true; |
| 551 | - // } | 541 | + // this.dialog_text = '您不在景区范围内'; |
| 552 | - // } | 542 | + // } |
| 553 | - // }, | 543 | + } |
| 544 | + }, | ||
| 554 | getLocation() { // 获取经纬度 | 545 | getLocation() { // 获取经纬度 |
| 555 | AMap.plugin(['AMap.Geolocation'], () => { | 546 | AMap.plugin(['AMap.Geolocation'], () => { |
| 556 | this.geolocation = new AMap.Geolocation(this.location_options); | 547 | this.geolocation = new AMap.Geolocation(this.location_options); |
| ... | @@ -570,6 +561,19 @@ export default { | ... | @@ -570,6 +561,19 @@ export default { |
| 570 | } | 561 | } |
| 571 | }) | 562 | }) |
| 572 | }); | 563 | }); |
| 564 | + // 微信获取地址 | ||
| 565 | + wx.getLocation({ | ||
| 566 | + type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' | ||
| 567 | + success: (res) => { | ||
| 568 | + var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90 | ||
| 569 | + var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。 | ||
| 570 | + var speed = res.speed; // 速度,以米/每秒计 | ||
| 571 | + var accuracy = res.accuracy; // 位置精度 | ||
| 572 | + this.current_lng = GPS.gcj_encrypt(latitude, longitude).lon; | ||
| 573 | + this.current_lat = GPS.gcj_encrypt(latitude, longitude).lat; | ||
| 574 | + console.warn(this.current_lng, this.current_lat); | ||
| 575 | + } | ||
| 576 | + }); | ||
| 573 | }, | 577 | }, |
| 574 | setZoom(type) { // 设置放大缩小地图 | 578 | setZoom(type) { // 设置放大缩小地图 |
| 575 | const zoom = this.map.getZoom(); | 579 | const zoom = this.map.getZoom(); |
| ... | @@ -946,10 +950,6 @@ export default { | ... | @@ -946,10 +950,6 @@ export default { |
| 946 | this.map.setZoomAndCenter(this.zoom, [item.position[0], item.position[1] + 0.000300]); | 950 | this.map.setZoomAndCenter(this.zoom, [item.position[0], item.position[1] + 0.000300]); |
| 947 | // | 951 | // |
| 948 | this.show_nav_popup = false; | 952 | this.show_nav_popup = false; |
| 949 | - // 禁止缩放 | ||
| 950 | - this.map.setStatus({ | ||
| 951 | - zoomEnable: false | ||
| 952 | - }); | ||
| 953 | }, | 953 | }, |
| 954 | setInfoWindows(item) { | 954 | setInfoWindows(item) { |
| 955 | // 此时需要把组件的样式设置为可见 | 955 | // 此时需要把组件的样式设置为可见 |
| ... | @@ -1050,32 +1050,23 @@ export default { | ... | @@ -1050,32 +1050,23 @@ export default { |
| 1050 | closeInfoWindow() { | 1050 | closeInfoWindow() { |
| 1051 | if (this.showInfoWindow) { | 1051 | if (this.showInfoWindow) { |
| 1052 | this.$refs['infoWindow'].close(); | 1052 | this.$refs['infoWindow'].close(); |
| 1053 | - // 打开缩放 | ||
| 1054 | - this.map.setStatus({ | ||
| 1055 | - zoomEnable: true | ||
| 1056 | - }); | ||
| 1057 | } | 1053 | } |
| 1058 | if (this.showInfoWindowLite) { | 1054 | if (this.showInfoWindowLite) { |
| 1059 | this.$refs['infoWindowLite'].close(); | 1055 | this.$refs['infoWindowLite'].close(); |
| 1060 | - // 打开缩放 | ||
| 1061 | - this.map.setStatus({ | ||
| 1062 | - zoomEnable: true | ||
| 1063 | - }); | ||
| 1064 | } | 1056 | } |
| 1065 | if (this.showInfoWindowWarn) { | 1057 | if (this.showInfoWindowWarn) { |
| 1066 | this.$refs['infoWindowWarn'].close(); | 1058 | this.$refs['infoWindowWarn'].close(); |
| 1067 | - // 打开缩放 | ||
| 1068 | - this.map.setStatus({ | ||
| 1069 | - zoomEnable: true | ||
| 1070 | - }); | ||
| 1071 | } | 1059 | } |
| 1072 | if (this.showInfoWindowYard) { | 1060 | if (this.showInfoWindowYard) { |
| 1073 | this.$refs['infoWindowYard'].close(); | 1061 | this.$refs['infoWindowYard'].close(); |
| 1074 | - // 打开缩放 | ||
| 1075 | - this.map.setStatus({ | ||
| 1076 | - zoomEnable: true | ||
| 1077 | - }); | ||
| 1078 | } | 1062 | } |
| 1063 | + // 打开缩放 | ||
| 1064 | + this.map.setStatus({ | ||
| 1065 | + zoomEnable: true | ||
| 1066 | + }); | ||
| 1067 | + }, | ||
| 1068 | + closeMember () { | ||
| 1069 | + this.show_member_popup = false; | ||
| 1079 | }, | 1070 | }, |
| 1080 | onPlay (name) { | 1071 | onPlay (name) { |
| 1081 | // var zoomStyleMapping = { 14: 0, 15: 0, 16: 0, 17: 0, 18: 0, 19: 0, 20: 0 }; | 1072 | // var zoomStyleMapping = { 14: 0, 15: 0, 16: 0, 17: 0, 18: 0, 19: 0, 20: 0 }; |
| ... | @@ -1300,7 +1291,7 @@ export default { | ... | @@ -1300,7 +1291,7 @@ export default { |
| 1300 | } | 1291 | } |
| 1301 | 1292 | ||
| 1302 | .popup-wrapper { | 1293 | .popup-wrapper { |
| 1303 | - margin-top: 1rem; | 1294 | + margin: 1rem; |
| 1304 | 1295 | ||
| 1305 | .title { | 1296 | .title { |
| 1306 | font-size: 1.25rem; | 1297 | font-size: 1.25rem; |
| ... | @@ -1341,4 +1332,50 @@ export default { | ... | @@ -1341,4 +1332,50 @@ export default { |
| 1341 | font-size: 0.8rem; | 1332 | font-size: 0.8rem; |
| 1342 | } | 1333 | } |
| 1343 | 1334 | ||
| 1335 | +.van-cell-group--inset { | ||
| 1336 | + margin: 0 0.466667vw; | ||
| 1337 | + border-radius: 2.133333vw; | ||
| 1338 | + overflow: hidden; | ||
| 1339 | +} | ||
| 1340 | +.van-cell-group { | ||
| 1341 | + background: '#fff'; | ||
| 1342 | +} | ||
| 1343 | +.van-cell { | ||
| 1344 | + position: relative; | ||
| 1345 | + display: flex; | ||
| 1346 | + box-sizing: border-box; | ||
| 1347 | + width: 100%; | ||
| 1348 | + padding: 2.666667vw 4.266667vw; | ||
| 1349 | + overflow: hidden; | ||
| 1350 | + color: #323233; | ||
| 1351 | + font-size: 3.733333vw; | ||
| 1352 | + line-height: 6.4vw; | ||
| 1353 | + background: #fff; | ||
| 1354 | +} | ||
| 1355 | + | ||
| 1356 | +.van-cell__title, .van-cell__value { | ||
| 1357 | + flex: 1; | ||
| 1358 | +} | ||
| 1359 | + | ||
| 1360 | +.van-cell__value { | ||
| 1361 | + position: relative; | ||
| 1362 | + overflow: hidden; | ||
| 1363 | + color: #969799; | ||
| 1364 | + text-align: right; | ||
| 1365 | + vertical-align: middle; | ||
| 1366 | + word-wrap: break-word; | ||
| 1367 | +} | ||
| 1368 | + | ||
| 1369 | +.van-cell:after { | ||
| 1370 | + position: absolute; | ||
| 1371 | + box-sizing: border-box; | ||
| 1372 | + content: " "; | ||
| 1373 | + pointer-events: none; | ||
| 1374 | + right: 4.266667vw; | ||
| 1375 | + bottom: 0; | ||
| 1376 | + left: 4.266667vw; | ||
| 1377 | + border-bottom: 1px solid #ebedf0; | ||
| 1378 | + transform: scaleY(.5); | ||
| 1379 | +} | ||
| 1380 | + | ||
| 1344 | </style> | 1381 | </style> | ... | ... |
-
Please register or login to post a comment