hookehuyr

点击pin时,详情显示的效果优化

...@@ -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-19 10:42:05 5 + * @LastEditTime: 2023-08-07 13:32:25
6 * @FilePath: /map-demo/src/App.vue 6 * @FilePath: /map-demo/src/App.vue
7 * @Description: 7 * @Description:
8 --> 8 -->
......
...@@ -362,7 +362,7 @@ button:focus { ...@@ -362,7 +362,7 @@ button:focus {
362 .level.level--current { 362 .level.level--current {
363 -webkit-transform: translateZ(15vmin) rotate3d(0,0,1,20deg); 363 -webkit-transform: translateZ(15vmin) rotate3d(0,0,1,20deg);
364 /* go to center */ 364 /* go to center */
365 - transform: translateZ(-3rem) rotate3d(0,0,1,20deg); 365 + transform: translateZ(12vmin) rotate3d(0,0,1,20deg);
366 } 366 }
367 367
368 /* Navigation classes */ 368 /* Navigation classes */
...@@ -849,7 +849,7 @@ button:focus { ...@@ -849,7 +849,7 @@ button:focus {
849 849
850 .pin--active .icon--pin { 850 .pin--active .icon--pin {
851 stroke: #515158; 851 stroke: #515158;
852 - stroke-width: 15px; 852 + stroke-width: 2vw;
853 } 853 }
854 854
855 .icon--pin { 855 .icon--pin {
......
1 <!-- 1 <!--
2 * @Date: 2023-07-27 11:04:04 2 * @Date: 2023-07-27 11:04:04
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-08-04 16:57:15 4 + * @LastEditTime: 2023-08-07 13:46:36
5 * @FilePath: /map-demo/src/components/Floor/index.vue 5 * @FilePath: /map-demo/src/components/Floor/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -98,6 +98,7 @@ import './floor.css'; ...@@ -98,6 +98,7 @@ import './floor.css';
98 import $ from 'jquery'; 98 import $ from 'jquery';
99 import SvgIcon from './svgIcon.vue' 99 import SvgIcon from './svgIcon.vue'
100 import Data from './pin' 100 import Data from './pin'
101 +import { wxInfo } from '@/utils/tools'
101 102
102 export default { 103 export default {
103 data() { 104 data() {
...@@ -155,11 +156,11 @@ export default { ...@@ -155,11 +156,11 @@ export default {
155 clearPinShow() { 156 clearPinShow() {
156 $('.level__pins').children('.pin').each((index, ele) => { 157 $('.level__pins').children('.pin').each((index, ele) => {
157 $(ele).removeClass('pin--active'); 158 $(ele).removeClass('pin--active');
158 - }) 159 + });
160 + $('.mall').removeClass('mall--content-open');
159 }, 161 },
160 onFloorClick(level) { 162 onFloorClick(level) {
161 this.level_show = level; 163 this.level_show = level;
162 - $('.mall').addClass('mall--content-open');
163 $('.levels').addClass('levels--open').addClass(`levels--selected-${level}`); 164 $('.levels').addClass('levels--open').addClass(`levels--selected-${level}`);
164 $(`.level--${level}`).addClass('level--current'); 165 $(`.level--${level}`).addClass('level--current');
165 $(`.level--${level} .level__pins`).addClass('level__pins--active'); 166 $(`.level--${level} .level__pins`).addClass('level__pins--active');
...@@ -169,6 +170,7 @@ export default { ...@@ -169,6 +170,7 @@ export default {
169 let level = this.level_show; 170 let level = this.level_show;
170 $('.mall').removeClass('mall--content-open'); 171 $('.mall').removeClass('mall--content-open');
171 $('.levels').removeClass('levels--open').removeClass(`levels--selected-${level}`); 172 $('.levels').removeClass('levels--open').removeClass(`levels--selected-${level}`);
173 + $('.level.level--current').css('transform', '');
172 $(`.level--${level}`).removeClass('level--current'); 174 $(`.level--${level}`).removeClass('level--current');
173 $(`.level--${level} .level__pins`).removeClass('level__pins--active'); 175 $(`.level--${level} .level__pins`).removeClass('level__pins--active');
174 this.level_show = ''; 176 this.level_show = '';
...@@ -202,8 +204,9 @@ export default { ...@@ -202,8 +204,9 @@ export default {
202 // 测试锚点 204 // 测试锚点
203 let currentTarget = null; 205 let currentTarget = null;
204 let category = null; 206 let category = null;
207 + let space = null;
205 $('.level__pins').children('.pin').each((index, ele) => { 208 $('.level__pins').children('.pin').each((index, ele) => {
206 - let space = $(ele).data('space'); // 锚点标记 209 + space = $(ele).data('space'); // 锚点标记
207 if (space === val) { // 匹配符合的dom节点 210 if (space === val) { // 匹配符合的dom节点
208 category = parseInt(space);// 获取图层标记 211 category = parseInt(space);// 获取图层标记
209 currentTarget = ele; 212 currentTarget = ele;
...@@ -217,6 +220,22 @@ export default { ...@@ -217,6 +220,22 @@ export default {
217 setTimeout(() => { 220 setTimeout(() => {
218 // 打开锚点详情 221 // 打开锚点详情
219 this.show_popup = true; 222 this.show_popup = true;
223 + // 把图层推高
224 + $('.mall').addClass('mall--content-open');
225 + if (!wxInfo().isPC) { // 移动端
226 + $('.level.level--current').css('transform', 'translateZ(0) rotate3d(0,0,1,20deg)');
227 + } else { // PC端
228 + $('.level.level--current').css('transform', 'translateZ(15vmin) rotate3d(0,0,1,20deg)');
229 + }
230 + this.level_list.forEach(item => {
231 + item.pin.forEach(x => {
232 + if (x.space === val) {
233 + // 打开 pin 详情信息
234 + this.popup_title = x?.affix?.title;
235 + this.popup_content = x?.affix?.content;
236 + }
237 + })
238 + });
220 }, 500); 239 }, 500);
221 // 关闭搜索弹框 240 // 关闭搜索弹框
222 this.show_search_popup = false; 241 this.show_search_popup = false;
...@@ -227,11 +246,19 @@ export default { ...@@ -227,11 +246,19 @@ export default {
227 }, 246 },
228 clickPin (item, evt) { // 点击pin操作 247 clickPin (item, evt) { // 点击pin操作
229 this.clearPinShow(); 248 this.clearPinShow();
230 - $(evt.target).parents('a.pin').addClass('pin--active'); 249 + $(evt.target).parents('a.pin').addClass('pin--active'); // pin点击效果
250 + //
231 this.show_popup = true; 251 this.show_popup = true;
232 // 打开 pin 详情信息 252 // 打开 pin 详情信息
233 this.popup_title = item?.affix?.title; 253 this.popup_title = item?.affix?.title;
234 this.popup_content = item?.affix?.content; 254 this.popup_content = item?.affix?.content;
255 + // 把图层推高
256 + $('.mall').addClass('mall--content-open');
257 + if (!wxInfo().isPC) { // 移动端
258 + $('.level.level--current').css('transform', 'translateZ(0) rotate3d(0,0,1,20deg)');
259 + } else { // PC端
260 + $('.level.level--current').css('transform', 'translateZ(15vmin) rotate3d(0,0,1,20deg)');
261 + }
235 }, 262 },
236 onSearchUpdate () { 263 onSearchUpdate () {
237 this.search_list.forEach((item) => { 264 this.search_list.forEach((item) => {
......
1 /* 1 /*
2 * @Date: 2023-08-01 13:55:03 2 * @Date: 2023-08-01 13:55:03
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-08-04 16:06:07 4 + * @LastEditTime: 2023-08-04 17:05:49
5 * @FilePath: /map-demo/src/components/Floor/pin.js 5 * @FilePath: /map-demo/src/components/Floor/pin.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -82,6 +82,10 @@ const testInfo = [ ...@@ -82,6 +82,10 @@ const testInfo = [
82 space: 1.01, 82 space: 1.01,
83 icon: 'appleheart', 83 icon: 'appleheart',
84 style: { top: '60vmin', left: '8vmin' }, 84 style: { top: '60vmin', left: '8vmin' },
85 + affix: {
86 + title: '宿舍101',
87 + content: '休息室',
88 + },
85 }, 89 },
86 { 90 {
87 id: 'pin--1-2', 91 id: 'pin--1-2',
...@@ -89,6 +93,10 @@ const testInfo = [ ...@@ -89,6 +93,10 @@ const testInfo = [
89 space: 1.02, 93 space: 1.02,
90 icon: 'bananas', 94 icon: 'bananas',
91 style: { top: '15vmin', left: '15vmin' }, 95 style: { top: '15vmin', left: '15vmin' },
96 + affix: {
97 + title: '宿舍102',
98 + content: '休息室',
99 + },
92 }, 100 },
93 { 101 {
94 id: 'pin--1-3', 102 id: 'pin--1-3',
...@@ -96,6 +104,10 @@ const testInfo = [ ...@@ -96,6 +104,10 @@ const testInfo = [
96 space: 1.03, 104 space: 1.03,
97 icon: 'origami', 105 icon: 'origami',
98 style: { top: '15vmin', left: '88vmin' }, 106 style: { top: '15vmin', left: '88vmin' },
107 + affix: {
108 + title: '宿舍103',
109 + content: '休息室',
110 + },
99 }, 111 },
100 { 112 {
101 id: 'pin--1-4', 113 id: 'pin--1-4',
...@@ -103,6 +115,10 @@ const testInfo = [ ...@@ -103,6 +115,10 @@ const testInfo = [
103 space: 1.04, 115 space: 1.04,
104 icon: 'dress', 116 icon: 'dress',
105 style: { top: '40vmin', left: '77vmin' }, 117 style: { top: '40vmin', left: '77vmin' },
118 + affix: {
119 + title: '宿舍104',
120 + content: '休息室',
121 + },
106 }, 122 },
107 { 123 {
108 id: 'pin--1-5', 124 id: 'pin--1-5',
...@@ -110,6 +126,10 @@ const testInfo = [ ...@@ -110,6 +126,10 @@ const testInfo = [
110 space: 1.05, 126 space: 1.05,
111 icon: 'tree2', 127 icon: 'tree2',
112 style: { top: '33vmin', left: '38vmin' }, 128 style: { top: '33vmin', left: '38vmin' },
129 + affix: {
130 + title: '宿舍105',
131 + content: '休息室',
132 + },
113 }, 133 },
114 { 134 {
115 id: 'pin--1-6', 135 id: 'pin--1-6',
...@@ -117,6 +137,10 @@ const testInfo = [ ...@@ -117,6 +137,10 @@ const testInfo = [
117 space: 1.06, 137 space: 1.06,
118 icon: 'avocado', 138 icon: 'avocado',
119 style: { top: '6vmin', left: '27vmin' }, 139 style: { top: '6vmin', left: '27vmin' },
140 + affix: {
141 + title: '宿舍106',
142 + content: '休息室',
143 + },
120 }, 144 },
121 { 145 {
122 id: 'pin--1-7', 146 id: 'pin--1-7',
...@@ -124,6 +148,10 @@ const testInfo = [ ...@@ -124,6 +148,10 @@ const testInfo = [
124 space: 1.07, 148 space: 1.07,
125 icon: 'cake', 149 icon: 'cake',
126 style: { top: '36vmin', left: '61vmin' }, 150 style: { top: '36vmin', left: '61vmin' },
151 + affix: {
152 + title: '宿舍107',
153 + content: '休息室',
154 + },
127 }, 155 },
128 { 156 {
129 id: 'pin--1-8', 157 id: 'pin--1-8',
...@@ -131,6 +159,10 @@ const testInfo = [ ...@@ -131,6 +159,10 @@ const testInfo = [
131 space: 1.08, 159 space: 1.08,
132 icon: 'mushroom', 160 icon: 'mushroom',
133 style: { top: '9vmin', left: '59vmin' }, 161 style: { top: '9vmin', left: '59vmin' },
162 + affix: {
163 + title: '宿舍108',
164 + content: '休息室',
165 + },
134 }, 166 },
135 { 167 {
136 id: 'pin--1-9', 168 id: 'pin--1-9',
...@@ -138,6 +170,10 @@ const testInfo = [ ...@@ -138,6 +170,10 @@ const testInfo = [
138 space: 1.09, 170 space: 1.09,
139 icon: 'pear', 171 icon: 'pear',
140 style: { top: '8vmin', left: '51vmin' }, 172 style: { top: '8vmin', left: '51vmin' },
173 + affix: {
174 + title: '宿舍109',
175 + content: '休息室',
176 + },
141 }, 177 },
142 ], 178 ],
143 }, 179 },
...@@ -175,6 +211,10 @@ const testInfo = [ ...@@ -175,6 +211,10 @@ const testInfo = [
175 space: 2.01, 211 space: 2.01,
176 icon: 'pepper', 212 icon: 'pepper',
177 style: { top: '7vmin', left: '22vmin' }, 213 style: { top: '7vmin', left: '22vmin' },
214 + affix: {
215 + title: '宿舍201',
216 + content: '休息室',
217 + },
178 }, 218 },
179 { 219 {
180 id: 'pin--2-2', 220 id: 'pin--2-2',
...@@ -182,6 +222,10 @@ const testInfo = [ ...@@ -182,6 +222,10 @@ const testInfo = [
182 space: 2.02, 222 space: 2.02,
183 icon: 'rocket', 223 icon: 'rocket',
184 style: { top: '39vmin', left: '5vmin' }, 224 style: { top: '39vmin', left: '5vmin' },
225 + affix: {
226 + title: '宿舍202',
227 + content: '休息室',
228 + },
185 }, 229 },
186 { 230 {
187 id: 'pin--2-3', 231 id: 'pin--2-3',
...@@ -189,6 +233,10 @@ const testInfo = [ ...@@ -189,6 +233,10 @@ const testInfo = [
189 space: 2.03, 233 space: 2.03,
190 icon: 'bug', 234 icon: 'bug',
191 style: { top: '21vmin', left: '84vmin' }, 235 style: { top: '21vmin', left: '84vmin' },
236 + affix: {
237 + title: '宿舍203',
238 + content: '休息室',
239 + },
192 }, 240 },
193 { 241 {
194 id: 'pin--2-4', 242 id: 'pin--2-4',
...@@ -196,6 +244,10 @@ const testInfo = [ ...@@ -196,6 +244,10 @@ const testInfo = [
196 space: 2.04, 244 space: 2.04,
197 icon: 'books', 245 icon: 'books',
198 style: { top: '39vmin', left: '53vmin' }, 246 style: { top: '39vmin', left: '53vmin' },
247 + affix: {
248 + title: '宿舍204',
249 + content: '休息室',
250 + },
199 }, 251 },
200 { 252 {
201 id: 'pin--2-5', 253 id: 'pin--2-5',
...@@ -203,6 +255,10 @@ const testInfo = [ ...@@ -203,6 +255,10 @@ const testInfo = [
203 space: 2.05, 255 space: 2.05,
204 icon: 'eggplant', 256 icon: 'eggplant',
205 style: { top: '14vmin', left: '50vmin' }, 257 style: { top: '14vmin', left: '50vmin' },
258 + affix: {
259 + title: '宿舍205',
260 + content: '休息室',
261 + },
206 }, 262 },
207 { 263 {
208 id: 'pin--2-6', 264 id: 'pin--2-6',
...@@ -210,6 +266,10 @@ const testInfo = [ ...@@ -210,6 +266,10 @@ const testInfo = [
210 space: 2.06, 266 space: 2.06,
211 icon: 'strawberry', 267 icon: 'strawberry',
212 style: { top: '60vmin', left: '15vmin' }, 268 style: { top: '60vmin', left: '15vmin' },
269 + affix: {
270 + title: '宿舍206',
271 + content: '休息室',
272 + },
213 }, 273 },
214 { 274 {
215 id: 'pin--2-7', 275 id: 'pin--2-7',
...@@ -217,6 +277,10 @@ const testInfo = [ ...@@ -217,6 +277,10 @@ const testInfo = [
217 space: 2.07, 277 space: 2.07,
218 icon: 'heart', 278 icon: 'heart',
219 style: { top: '34vmin', left: '37vmin' }, 279 style: { top: '34vmin', left: '37vmin' },
280 + affix: {
281 + title: '宿舍207',
282 + content: '休息室',
283 + },
220 }, 284 },
221 { 285 {
222 id: 'pin--2-8', 286 id: 'pin--2-8',
...@@ -224,6 +288,10 @@ const testInfo = [ ...@@ -224,6 +288,10 @@ const testInfo = [
224 space: 2.08, 288 space: 2.08,
225 icon: 'wrench', 289 icon: 'wrench',
226 style: { top: '52vmin', left: '74vmin' }, 290 style: { top: '52vmin', left: '74vmin' },
291 + affix: {
292 + title: '宿舍208',
293 + content: '休息室',
294 + },
227 }, 295 },
228 ], 296 ],
229 }, 297 },
......
1 /* 1 /*
2 * @Date: 2022-04-18 15:59:42 2 * @Date: 2022-04-18 15:59:42
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-06-30 13:54:32 4 + * @LastEditTime: 2023-08-07 13:31:59
5 - * @FilePath: /tswj/src/utils/tools.js 5 + * @FilePath: /map-demo/src/utils/tools.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
8 import dayjs from 'dayjs'; 8 import dayjs from 'dayjs';
...@@ -14,7 +14,7 @@ const formatDate = (date) => { ...@@ -14,7 +14,7 @@ const formatDate = (date) => {
14 14
15 /** 15 /**
16 * @description 判断浏览器属于平台 16 * @description 判断浏览器属于平台
17 - * @returns 17 + * @returns
18 */ 18 */
19 const wxInfo = () => { 19 const wxInfo = () => {
20 let u = navigator.userAgent; 20 let u = navigator.userAgent;
...@@ -22,17 +22,23 @@ const wxInfo = () => { ...@@ -22,17 +22,23 @@ const wxInfo = () => {
22 let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 22 let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
23 let uAgent = navigator.userAgent.toLowerCase(); 23 let uAgent = navigator.userAgent.toLowerCase();
24 let isTable = (uAgent.match(/MicroMessenger/i) == 'micromessenger') ? true : false; 24 let isTable = (uAgent.match(/MicroMessenger/i) == 'micromessenger') ? true : false;
25 + let isPC = uAgent.match(
26 + /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|micromessenger)/i,
27 + )
28 + ? false
29 + : true;
25 return { 30 return {
26 isAndroid, 31 isAndroid,
27 isiOS, 32 isiOS,
28 - isTable 33 + isTable,
34 + isPC,
29 }; 35 };
30 }; 36 };
31 37
32 /** 38 /**
33 * @description 判断多行省略文本 39 * @description 判断多行省略文本
34 * @param {*} id 目标dom标签 40 * @param {*} id 目标dom标签
35 - * @returns 41 + * @returns
36 */ 42 */
37 const hasEllipsis = (id) => { 43 const hasEllipsis = (id) => {
38 let oDiv = document.getElementById(id); 44 let oDiv = document.getElementById(id);
...@@ -45,8 +51,8 @@ const hasEllipsis = (id) => { ...@@ -45,8 +51,8 @@ const hasEllipsis = (id) => {
45 51
46 /** 52 /**
47 * @description 解析URL参数 53 * @description 解析URL参数
48 - * @param {*} url 54 + * @param {*} url
49 - * @returns 55 + * @returns
50 */ 56 */
51 const parseQueryString = url => { 57 const parseQueryString = url => {
52 var json = {}; 58 var json = {};
......
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-08-04 16:59:15 4 + * @LastEditTime: 2023-08-07 10:58:59
5 * @FilePath: /map-demo/src/views/inner.vue 5 * @FilePath: /map-demo/src/views/inner.vue
6 * @Description: 内部地图主体页面 6 * @Description: 内部地图主体页面
7 --> 7 -->
...@@ -277,7 +277,7 @@ export default { ...@@ -277,7 +277,7 @@ export default {
277 point_range: [ // 景区范围经纬度 277 point_range: [ // 景区范围经纬度
278 [120.585111, 31.316084], [120.585111, 31.316084], [120.589488, 31.313197], [120.585422, 31.313005] 278 [120.585111, 31.316084], [120.585111, 31.316084], [120.589488, 31.313197], [120.585422, 31.313005]
279 ], 279 ],
280 - show_floor_popup: false, 280 + show_floor_popup: true,
281 } 281 }
282 }, 282 },
283 async mounted() { 283 async mounted() {
......