Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
e-shield-h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6d1c6cdf
authored
Jul 29, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
找车浮窗bug修改 marker修改
1 parent
fd0fffc4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
11 deletions
src/views/fence.vue
src/views/index.vue
src/views/fence.vue
View file @
6d1c6cd
...
@@ -262,7 +262,7 @@ export default defineComponent({
...
@@ -262,7 +262,7 @@ export default defineComponent({
:
""
;
:
""
;
_adcode
=
_adcode
=
proviceCityType
.
value
==
1
proviceCityType
.
value
==
1
?
_adcode
.
substr
(
0
,
4
)
+
"
00"
?
_adcode
.
substr
(
0
,
2
)
+
"00
00"
:
proviceCityType
.
value
==
2
:
proviceCityType
.
value
==
2
?
_adcode
.
substr
(
0
,
4
)
+
"00"
?
_adcode
.
substr
(
0
,
4
)
+
"00"
:
""
;
:
""
;
...
...
src/views/index.vue
View file @
6d1c6cd
...
@@ -14,13 +14,17 @@
...
@@ -14,13 +14,17 @@
mode=
"closeable"
mode=
"closeable"
v-if=
"isSharePage"
v-if=
"isSharePage"
text=
"此分享功能请在有效时间内使用,详情联系分享者"
text=
"此分享功能请在有效时间内使用,详情联系分享者"
@
close=
"closeNotice"
>
>
<
template
#
left-icon
>
<
template
#
left-icon
>
<span
class=
"icon icon-warning"
></span>
<span
class=
"icon icon-warning"
></span>
</
template
>
</
template
>
</van-notice-bar>
</van-notice-bar>
<!-- 搜索区域 -->
<!-- 搜索区域 -->
<div
class=
"search-box"
:class=
"isSharePage ? 'search-box-top' : ''"
>
<div
class=
"search-box"
:class=
"isSharePage && showNotice ? 'search-box-top' : ''"
>
<div
class=
"search-header"
>
<div
class=
"search-header"
>
<div
<div
class=
"select-box"
class=
"select-box"
...
@@ -189,6 +193,7 @@ export default defineComponent({
...
@@ -189,6 +193,7 @@ export default defineComponent({
const
showOverlay
=
ref
(
false
);
const
showOverlay
=
ref
(
false
);
const
isSharePage
=
ref
(
false
);
const
isSharePage
=
ref
(
false
);
const
clickFlag
=
ref
(
true
);
const
clickFlag
=
ref
(
true
);
const
showNotice
=
ref
(
true
);
let
map
=
undefined
;
let
map
=
undefined
;
const
refreshCb
=
()
=>
{
const
refreshCb
=
()
=>
{
if
(
map
&&
carItem
.
value
)
{
if
(
map
&&
carItem
.
value
)
{
...
@@ -313,6 +318,9 @@ export default defineComponent({
...
@@ -313,6 +318,9 @@ export default defineComponent({
const
isUploaded
=
(
data
)
=>
{
const
isUploaded
=
(
data
)
=>
{
mapIsUploaded
.
value
=
data
;
mapIsUploaded
.
value
=
data
;
};
};
const
closeNotice
=
()
=>
{
showNotice
.
value
=
false
;
};
const
getCarInfo
=
(
it
)
=>
{
const
getCarInfo
=
(
it
)
=>
{
carItem
.
value
=
it
;
carItem
.
value
=
it
;
isShowList
.
value
=
false
;
isShowList
.
value
=
false
;
...
@@ -396,10 +404,10 @@ export default defineComponent({
...
@@ -396,10 +404,10 @@ export default defineComponent({
position
:
lnglat
,
position
:
lnglat
,
content
:
content
:
item
.
source
==
"0"
item
.
source
==
"0"
?
'<span class="
icon icon-off-car"
></span>'
?
'<span class="
marker-class"><span class="icon icon-off-car sn-marker"></span><span class="marker-bottom off-line"><span class="outside off-line"></span><span class="inside off-line"></span></span
></span>'
:
'<span class="
icon icon-on-car"
></span>'
,
:
'<span class="
marker-class"><span class="icon icon-on-car sn-marker"></span><span class="marker-bottom on-line"><span class="outside on-line"></span><span class="inside on-line"></span></span
></span>'
,
map
:
map
,
map
:
map
,
offset
:
new
window
.
AMap
.
Pixel
(
-
13
,
-
18
),
offset
:
new
window
.
AMap
.
Pixel
(
-
26
,
-
18
),
});
});
var
carInfoWindowTpl
=
`<div class="car-info-window">`
;
var
carInfoWindowTpl
=
`<div class="car-info-window">`
;
carInfoWindowTpl
+=
`<div class="main-info">`
;
carInfoWindowTpl
+=
`<div class="main-info">`
;
...
@@ -411,13 +419,9 @@ export default defineComponent({
...
@@ -411,13 +419,9 @@ export default defineComponent({
item
.
source
==
1
?
"有线设备"
:
"无线设备"
item
.
source
==
1
?
"有线设备"
:
"无线设备"
}
<
/span><span>${item.sn}</
span
><
/p>`
;
}
<
/span><span>${item.sn}</
span
><
/p>`
;
if
(
item
.
status
&&
item
.
status
==
2
)
{
if
(
item
.
status
&&
item
.
status
==
2
)
{
carInfoWindowTpl
+=
`<p class="offline-info"><i class="icon icon-offline-time"></i><span class="label">离线时长</span><span>
${
carInfoWindowTpl
+=
`<p class="offline-info"><i class="icon icon-offline-time"></i><span class="label">离线时长</span><span>
${
item
.
statusTime
}
</span></p>`
;
item
[
item
.
locationType
].
statusTime
}
<
/span></
p
>
`;
}
}
carInfoWindowTpl += `
<
p
class
=
"time-info"
><
i
class
=
"icon icon-online-time"
><
/i><span class="label">在线时间</
span
><
span
>
$
{
carInfoWindowTpl
+=
`<p class="time-info"><i class="icon icon-online-time"></i><span class="label">在线时间</span><span data-onlineTime></span></p>
item
[
item
.
locationType
].
dateTime
}
<
/span></
p
>
<p class="locate-info"><i class="icon icon-locate-sm"></i><span class="label">详细地址</span><span data-tranferAddress></span></p>`
;
<p class="locate-info"><i class="icon icon-locate-sm"></i><span class="label">详细地址</span><span data-tranferAddress></span></p>`
;
if
(
item
.
hasWifi
)
{
if
(
item
.
hasWifi
)
{
carInfoWindowTpl
+=
`<p p class="list-info" > <i class="icon icon-typeList"></i><span class="label">定位类型</span>
carInfoWindowTpl
+=
`<p p class="list-info" > <i class="icon icon-typeList"></i><span class="label">定位类型</span>
...
@@ -481,6 +485,11 @@ export default defineComponent({
...
@@ -481,6 +485,11 @@ export default defineComponent({
let
Address
=
infoDiv
.
querySelector
(
"[data-tranferAddress]"
);
let
Address
=
infoDiv
.
querySelector
(
"[data-tranferAddress]"
);
Address
.
textContent
=
item
[
item
.
locationType
].
transferAddress
;
Address
.
textContent
=
item
[
item
.
locationType
].
transferAddress
;
};
};
// 在线时间赋值
const
setOnlineTime
=
()
=>
{
let
OnlineTime
=
infoDiv
.
querySelector
(
"[data-onlineTime]"
);
OnlineTime
.
textContent
=
item
[
item
.
locationType
].
dateTime
;
};
if
(
item
.
source
==
1
)
{
if
(
item
.
source
==
1
)
{
// 有线设备
// 有线设备
carFreqBtn
&&
carFreqBtn
.
classList
.
add
(
"disabled"
);
carFreqBtn
&&
carFreqBtn
.
classList
.
add
(
"disabled"
);
...
@@ -504,6 +513,7 @@ export default defineComponent({
...
@@ -504,6 +513,7 @@ export default defineComponent({
WIFIIcon
&&
WIFIIcon
.
classList
.
remove
(
"active"
);
WIFIIcon
&&
WIFIIcon
.
classList
.
remove
(
"active"
);
item
.
locationType
=
"gpsLocation"
;
item
.
locationType
=
"gpsLocation"
;
setAddress
();
setAddress
();
setOnlineTime
();
move
(
newLnglat
);
move
(
newLnglat
);
}
else
{
}
else
{
Toast
(
"暂无GPS定位信息"
);
Toast
(
"暂无GPS定位信息"
);
...
@@ -525,6 +535,7 @@ export default defineComponent({
...
@@ -525,6 +535,7 @@ export default defineComponent({
gprsObj
.
elat
gprsObj
.
elat
);
);
setAddress
();
setAddress
();
setOnlineTime
();
move
(
newLnglat
);
move
(
newLnglat
);
}
else
{
}
else
{
Toast
(
"暂无基站定位信息"
);
Toast
(
"暂无基站定位信息"
);
...
@@ -546,6 +557,7 @@ export default defineComponent({
...
@@ -546,6 +557,7 @@ export default defineComponent({
GPRSIcon
&&
GPRSIcon
.
classList
.
remove
(
"active"
);
GPRSIcon
&&
GPRSIcon
.
classList
.
remove
(
"active"
);
item
.
locationType
=
"wifiLocation"
;
item
.
locationType
=
"wifiLocation"
;
setAddress
();
setAddress
();
setOnlineTime
();
move
(
newLnglat
);
move
(
newLnglat
);
}
else
{
}
else
{
Toast
(
"暂无wifi定位信息"
);
Toast
(
"暂无wifi定位信息"
);
...
@@ -644,6 +656,7 @@ export default defineComponent({
...
@@ -644,6 +656,7 @@ export default defineComponent({
infoWindow
.
open
(
map
);
infoWindow
.
open
(
map
);
}
}
setAddress
();
setAddress
();
setOnlineTime
();
});
});
return
marker
;
return
marker
;
};
};
...
@@ -722,6 +735,8 @@ export default defineComponent({
...
@@ -722,6 +735,8 @@ export default defineComponent({
initViewport
,
initViewport
,
isSharePage
,
isSharePage
,
clickFlag
,
clickFlag
,
showNotice
,
closeNotice
,
};
};
},
},
});
});
...
@@ -1012,4 +1027,78 @@ export default defineComponent({
...
@@ -1012,4 +1027,78 @@ export default defineComponent({
.van-badge__wrapper
{
.van-badge__wrapper
{
margin-right
:
2px
;
margin-right
:
2px
;
}
}
.van-notice-bar__wrap
{
margin-left
:
7px
;
}
.marker-class
{
position
:
relative
;
display
:
inline-block
;
height
:
52px
;
width
:
52px
;
}
.sn-marker
{
position
:
absolute
;
z-index
:
3
;
}
.marker-bottom
{
display
:
inline-block
;
width
:
12px
;
height
:
12px
;
border-radius
:
50%
;
position
:
absolute
;
left
:
50%
;
bottom
:
2px
;
transform
:
translate
(
-50%
,
0
);
.outside
{
position
:
absolute
;
display
:
inline-block
;
width
:
12px
;
height
:
12px
;
border-radius
:
50%
;
border-color
:
#fff
;
z-index
:
1
;
}
.inside
{
position
:
absolute
;
display
:
inline-block
;
width
:
12px
;
height
:
12px
;
border-radius
:
50%
;
z-index
:
1
;
}
.outside.off-line
{
animation
:
Glow
2s
ease-out
infinite
alternate
;
background
:
#ffece6
;
}
.outside.on-line
{
animation
:
Glow
2s
ease-out
infinite
alternate
;
background
:
#e0eeff
;
}
.inside.off-line
{
animation
:
insideGlow
2s
ease-out
infinite
alternate
;
background
:
#ffd5c6
;
}
.inside.on-line
{
animation
:
insideGlow
2s
ease-out
infinite
alternate
;
background
:
#b3d6ff
;
}
}
@keyframes
Glow
{
0
%
{
}
50
%
{
transform
:
scale
(
1.7
);
}
100
%
{
}
}
@keyframes
insideGlow
{
0
%
{
}
50
%
{
transform
:
scale
(
1.4
);
}
100
%
{
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment