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 163bf380
authored
Aug 01, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
页面优化
1 parent
664e5bf2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
24 deletions
src/components/mapContent.vue
src/views/index.vue
src/views/resident.vue
src/components/mapContent.vue
View file @
163bf38
...
...
@@ -23,6 +23,8 @@
<
script
>
import
{
onMounted
,
ref
}
from
"vue"
;
import
{
Toast
}
from
"vant"
;
import
"vant/es/toast/style"
;
export
default
{
name
:
"mapContent"
,
props
:
{},
...
...
@@ -82,6 +84,7 @@ export default {
map
.
setFitView
();
});
window
.
AMap
.
event
.
addListener
(
geolocation
,
"error"
,
()
=>
{
Toast
(
"获取定位失败"
);
isGetLocation
.
value
=
false
;
});
});
...
...
src/views/index.vue
View file @
163bf38
...
...
@@ -62,6 +62,7 @@
v-model:loading=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
offset=
"150"
@
load=
"getCarList"
:immediate-check=
"false"
>
...
...
@@ -274,6 +275,7 @@ export default defineComponent({
getCarInfo
(
carItem
.
value
);
getCarList
();
}
return
;
}
getCarList
();
});
...
...
@@ -472,10 +474,8 @@ export default defineComponent({
offset
:
new
window
.
AMap
.
Pixel
(
24
,
-
20
),
});
const
move
=
(
newLnglat
)
=>
{
console
.
log
(
newLnglat
);
marker
.
setPosition
(
newLnglat
);
infoWindow
.
setPosition
(
newLnglat
);
infoWindow
.
setSize
(
window
.
innerWidth
-
48
);
map
.
setCenter
(
newLnglat
);
map
.
panBy
(
0
,
70
);
};
...
...
@@ -581,14 +581,9 @@ export default defineComponent({
// 车辆追踪
carLocationBtn
&&
(
carLocationBtn
.
onclick
=
()
=>
{
let
lng
=
item
[
item
.
locationType
].
elng
;
let
lat
=
item
[
item
.
locationType
].
elat
;
let
address
=
item
[
item
.
locationType
].
transferAddress
;
check
(()
=>
{
clickFlag
.
value
=
false
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/tracking?lat=
${
lat
}
&lng=
${
lng
}
&address=
${
address
}
`
,
});
jumpToMiniProgram
(
"tracking"
,
""
,
item
);
});
});
...
...
@@ -597,9 +592,7 @@ export default defineComponent({
(
carReplayBtn
.
onclick
=
()
=>
{
check
(()
=>
{
clickFlag
.
value
=
false
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/findCar?sn=
${
item
.
sn
}
&tabItem=replay&source=
${
item
.
source
}
&locationType=
${
item
.
locationType
}
`
,
});
jumpToMiniProgram
(
"findCar"
,
"replay"
,
item
);
});
});
...
...
@@ -608,9 +601,7 @@ export default defineComponent({
(
carResidentBtn
.
onclick
=
()
=>
{
check
(()
=>
{
clickFlag
.
value
=
false
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/findCar?sn=
${
item
.
sn
}
&tabItem=resident&source=
${
item
.
source
}
&locationType=
${
item
.
locationType
}
`
,
});
jumpToMiniProgram
(
"findCar"
,
"resident"
,
item
);
});
});
// 实时监控
...
...
@@ -618,9 +609,7 @@ export default defineComponent({
(
carMonitorBtn
.
onclick
=
()
=>
{
check
(()
=>
{
clickFlag
.
value
=
false
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/findCar?sn=
${
item
.
sn
}
&tabItem=monitor&source=
${
item
.
source
}
&locationType=
${
item
.
locationType
}
`
,
});
jumpToMiniProgram
(
"findCar"
,
"monitor"
,
item
);
});
});
...
...
@@ -632,9 +621,7 @@ export default defineComponent({
}
else
{
check
(()
=>
{
clickFlag
.
value
=
false
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/findCar?sn=
${
item
.
sn
}
&tabItem=freq&source=
${
item
.
source
}
&locationType=
${
item
.
locationType
}
`
,
});
jumpToMiniProgram
(
"findCar"
,
"freq"
,
item
);
});
}
};
...
...
@@ -646,9 +633,7 @@ export default defineComponent({
}
else
{
check
(()
=>
{
clickFlag
.
value
=
false
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/findCar?sn=
${
item
.
sn
}
&tabItem=fence&source=
${
item
.
source
}
&locationType=
${
item
.
locationType
}
`
,
});
jumpToMiniProgram
(
"findCar"
,
"fence"
,
item
);
});
}
};
...
...
@@ -684,6 +669,21 @@ export default defineComponent({
},
1000
);
cb
();
};
// 跳转小程序
const
jumpToMiniProgram
=
(
page
,
tabItem
,
item
)
=>
{
if
(
page
==
"tracking"
)
{
let
lng
=
item
[
item
.
locationType
].
elng
;
let
lat
=
item
[
item
.
locationType
].
elat
;
let
address
=
item
[
item
.
locationType
].
transferAddress
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/tracking?lat=
${
lat
}
&lng=
${
lng
}
&address=
${
address
}
`
,
});
}
else
{
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/
${
page
}
?sn=
${
item
.
sn
}
&tabItem=
${
tabItem
}
&source=
${
item
.
source
}
&locationType=
${
item
.
locationType
}
`
,
});
}
};
// 加载更多
const
getCarList
=
(
flag
)
=>
{
if
(
isShareDead
.
value
)
return
;
...
...
@@ -751,6 +751,7 @@ export default defineComponent({
clickFlag
,
showNotice
,
closeNotice
,
jumpToMiniProgram
,
};
},
});
...
...
src/views/resident.vue
View file @
163bf38
...
...
@@ -295,7 +295,6 @@ export default defineComponent({
};
// 导航
const
navigation
=
(
data
)
=>
{
console
.
log
(
"123"
);
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/tracking?lat=
${
data
.
elat
}
&lng=
${
data
.
elng
}
&address=
${
data
.
transferAddress
}
`
,
});
...
...
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