Commit 698028d4 by 张晓玮

Merge branch 'v1.9.0' into 'master'

V1.9.0

See merge request !4
2 parents 45195ca4 7ef939f2
......@@ -15,12 +15,12 @@
"babel-plugin-import": "^1.13.5",
"clipboard": "^2.0.11",
"core-js": "^3.8.3",
"element-plus": "^2.2.9",
"moment": "^2.29.1",
"svg-sprite-loader": "^6.0.11",
"vant": "^3.5.2",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vue-slider-component": "^4.1.0-beta.1",
"vuex": "^4.0.0"
},
"devDependencies": {
......
......@@ -4,11 +4,13 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no,maximum-scale=1.0"
id="viewportMeta">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<title>找车</title>
</head>
<body>
......
......@@ -3,8 +3,8 @@ module.exports = function (data) {
const shared =
`.icon {display: inline-block;background-image: url(I);background-size: Wpx Hpx;}`
.replace("I", data.sprites[0].image)
.replace("W", data.sprites[0].total_width)
.replace("H", data.sprites[0].total_height);
.replace("W", data.sprites[0].total_width / 2)
.replace("H", data.sprites[0].total_height / 2);
const perSprite = data.sprites
.map(function (sprite) {
......@@ -16,10 +16,10 @@ module.exports = function (data) {
return style
.replace(/N/g, sprite.name)
.replace(/A/g, sprite.name.replace(/\-active$/g, ""))
.replace(/W/g, sprite.width)
.replace(/H/g, sprite.height)
.replace(/X/g, sprite.offset_x)
.replace(/Y/g, sprite.offset_y);
.replace(/W/g, sprite.width / 2)
.replace(/H/g, sprite.height / 2)
.replace(/X/g, sprite.offset_x / 2)
.replace(/Y/g, sprite.offset_y / 2);
})
.join("\n");
......
......@@ -34,15 +34,23 @@ export default {
html,
body {
height: 100%;
// min-height: 100%;
// min-height: 100%;
overflow: hidden;
}
.warp-content {
height: 100%;
}
* {
-webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important;
-webkit-tap-highlight-color: transparent !important;
}
#app {
height: 100%;
// min-height: 100%;
position: fixed;
position: -ms-device-fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
}
.curr-marker {
display: inline-block;
......@@ -57,7 +65,13 @@ body {
.map-container {
width: 100%;
height: 100%;
position: fixed;
// position: fixed;
z-index: 100;
}
button {
border-radius: 0;
border: none;
outline: none;
background: rgba(0, 0, 0, 0);
}
</style>
......@@ -39,3 +39,8 @@ export const SET_FREQ = (params) => {
export const ADD_FENCE = (params) => {
return request(params, `${prefix}/fence/add`, "POST");
};
// 校验分享时效性 是否可用
export const CHECK_SHARE = (params) => {
return request(params, `${prefix}/vehicle/sharedDetails`);
};
.icon-share {
position: absolute;
top: 20px;
right: 70px;
}
.tip {
margin-top: 120px;
text-align: center;
color: #fff;
font-size: 16px;
.fle {
display: inline-block;
width: 18px;
height: 22px;
vertical-align: middle;
}
.sharebtn {
display: inline-block;
width: 4px;
height: 4px;
margin: 1px;
background: #fff;
border-radius: 50%;
}
.sharebtn.middle {
width: 6px;
height: 6px;
margin: 0;
}
}
\ No newline at end of file
.el-slider {
width: 100%;
height: 32px;
display: flex;
align-items: center;
}
.el-slider__runway {
flex: 1;
height: 2px;
background-color: #e4e7eb;
border-radius: 2px;
position: relative;
cursor: pointer;
}
.el-slider__input {
flex-shrink: 0;
width: 130px;
}
.el-slider__bar {
height: 2px;
background-color: var(--base-color);
border-top-left-radius: 1px;
border-bottom-left-radius: 1px;
position: absolute;
}
.el-slider__button-wrapper {
height: 16px;
width: 16px;
position: absolute;
z-index: 1;
top: -9px;
transform: translateX(-50%);
background-color: transparent;
text-align: center;
-webkit-user-select: none;
user-select: none;
line-height: normal;
outline: 0;
}
.el-slider__button-wrapper::after {
display: inline-block;
content: "";
height: 100%;
vertical-align: middle;
}
.el-slider__button-wrapper.hover,
.el-slider__button-wrapper:hover {
cursor: grab;
}
.el-slider__button-wrapper.dragging {
cursor: grabbing;
}
.el-slider__button {
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
border: none;
box-shadow: 0px 2px 8px 0px rgba(135,143,153,0.5000);
background-color: #fff;
border-radius: 50%;
box-sizing: border-box;
transition: .2s;
-webkit-user-select: none;
user-select: none;
}
.el-slider__button.dragging,
.el-slider__button.hover,
.el-slider__button:hover {
transform: scale(1.2);
}
.el-slider__button.hover,
.el-slider__button:hover {
cursor: grab;
}
.el-slider__button.dragging {
cursor: grabbing;
}
.el-slider__stop {
position: absolute;
top: -4px;
height: 6px;
width: 6px;
border-radius: 6px;
background-color: #fff;
border: 2px solid #e4e7eb;
}
.el-slider__marks {
top: 0;
left: 12px;
width: 18px;
height: 100%;
}
.el-slider__marks-text {
position: absolute;
transform: translateX(-50%);
font-size: 14px;
color: #111;
margin-top: 15px;
}
.el-slider--large {
height: 40px;
}
.el-slider--small {
height: 24px;
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
--van-text-link-color: #0077FF !important;
--van-blue: #0077FF !important;
--van-search-input-height: 32px !important;
--van-search-content-background-color: #f5f6f7 !important;
--van-font-weight-bold: 600 !important;
--van-search-action-text-color: var(--base-color) !important;
--van-dropdown-menu-title-active-text-color: var(--base-color) !important;
......

768 Bytes | W: | H:

1.55 KB | W: | H:

src/assets/icon/copy.png
src/assets/icon/copy.png
src/assets/icon/copy.png
src/assets/icon/copy.png
  • 2-up
  • Swipe
  • Onion skin

218 Bytes | W: | H:

423 Bytes | W: | H:

src/assets/icon/device.png
src/assets/icon/device.png
src/assets/icon/device.png
src/assets/icon/device.png
  • 2-up
  • Swipe
  • Onion skin

720 Bytes | W: | H:

1.48 KB | W: | H:

src/assets/icon/loc-icon.png
src/assets/icon/loc-icon.png
src/assets/icon/loc-icon.png
src/assets/icon/loc-icon.png
  • 2-up
  • Swipe
  • Onion skin

491 Bytes | W: | H:

1.13 KB | W: | H:

src/assets/icon/locate-sm.png
src/assets/icon/locate-sm.png
src/assets/icon/locate-sm.png
src/assets/icon/locate-sm.png
  • 2-up
  • Swipe
  • Onion skin

656 Bytes | W: | H:

1.31 KB | W: | H:

src/assets/icon/location.png
src/assets/icon/location.png
src/assets/icon/location.png
src/assets/icon/location.png
  • 2-up
  • Swipe
  • Onion skin

853 Bytes | W: | H:

1.74 KB | W: | H:

src/assets/icon/navgation.png
src/assets/icon/navgation.png
src/assets/icon/navgation.png
src/assets/icon/navgation.png
  • 2-up
  • Swipe
  • Onion skin

1.71 KB | W: | H:

3.65 KB | W: | H:

src/assets/icon/off-car.png
src/assets/icon/off-car.png
src/assets/icon/off-car.png
src/assets/icon/off-car.png
  • 2-up
  • Swipe
  • Onion skin

453 Bytes | W: | H:

1.05 KB | W: | H:

src/assets/icon/offline-time.png
src/assets/icon/offline-time.png
src/assets/icon/offline-time.png
src/assets/icon/offline-time.png
  • 2-up
  • Swipe
  • Onion skin

1.61 KB | W: | H:

3.52 KB | W: | H:

src/assets/icon/on-car.png
src/assets/icon/on-car.png
src/assets/icon/on-car.png
src/assets/icon/on-car.png
  • 2-up
  • Swipe
  • Onion skin

389 Bytes | W: | H:

834 Bytes | W: | H:

src/assets/icon/online-time.png
src/assets/icon/online-time.png
src/assets/icon/online-time.png
src/assets/icon/online-time.png
  • 2-up
  • Swipe
  • Onion skin

378 Bytes | W: | H:

743 Bytes | W: | H:

src/assets/icon/put-away.png
src/assets/icon/put-away.png
src/assets/icon/put-away.png
src/assets/icon/put-away.png
  • 2-up
  • Swipe
  • Onion skin

679 Bytes | W: | H:

1.34 KB | W: | H:

src/assets/icon/refresh-car.png
src/assets/icon/refresh-car.png
src/assets/icon/refresh-car.png
src/assets/icon/refresh-car.png
  • 2-up
  • Swipe
  • Onion skin

1.16 KB | W: | H:

1.09 KB | W: | H:

src/assets/icon/replay-pause.png
src/assets/icon/replay-pause.png
src/assets/icon/replay-pause.png
src/assets/icon/replay-pause.png
  • 2-up
  • Swipe
  • Onion skin

1.01 KB | W: | H:

1.11 KB | W: | H:

src/assets/icon/replay-play.png
src/assets/icon/replay-play.png
src/assets/icon/replay-play.png
src/assets/icon/replay-play.png
  • 2-up
  • Swipe
  • Onion skin

1.38 KB | W: | H:

1.95 KB | W: | H:

src/assets/icon/replay-refresh.png
src/assets/icon/replay-refresh.png
src/assets/icon/replay-refresh.png
src/assets/icon/replay-refresh.png
  • 2-up
  • Swipe
  • Onion skin

522 Bytes | W: | H:

1.21 KB | W: | H:

src/assets/icon/setting-btn.png
src/assets/icon/setting-btn.png
src/assets/icon/setting-btn.png
src/assets/icon/setting-btn.png
  • 2-up
  • Swipe
  • Onion skin

2.35 KB | W: | H:

5.14 KB | W: | H:

src/assets/icon/share.png
src/assets/icon/share.png
src/assets/icon/share.png
src/assets/icon/share.png
  • 2-up
  • Swipe
  • Onion skin

434 Bytes | W: | H:

916 Bytes | W: | H:

src/assets/icon/typeList.png
src/assets/icon/typeList.png
src/assets/icon/typeList.png
src/assets/icon/typeList.png
  • 2-up
  • Swipe
  • Onion skin
.icon {display: inline-block;background-image: url(sprite.png);background-size: 232px 186px;}
.icon-begin { width: 52px; height: 72px; background-position: -68px 0px; }
.icon-checked { width: 20px; height: 20px; background-position: -150px -156px; }
.icon-copy { width: 28px; height: 28px; background-position: -172px -112px; }
.icon-device { width: 14px; height: 14px; background-position: -64px -140px; }
.icon-loc-icon { width: 30px; height: 30px; background-position: 0px -156px; }
.icon-locate-sm { width: 14px; height: 14px; background-position: -78px -140px; }
.icon-location { width: 24px; height: 24px; background-position: -30px -156px; }
.icon-navgation { width: 28px; height: 28px; background-position: -200px -112px; }
.icon-off-car { width: 52px; height: 52px; background-position: -172px -60px; }
.icon-off-line { width: 20px; height: 20px; background-position: -170px -156px; }
.icon-offline-time { width: 14px; height: 14px; background-position: -92px -140px; }
.icon-on-car { width: 52px; height: 52px; background-position: -120px -80px; }
.icon-on-line { width: 24px; height: 24px; background-position: -54px -156px; }
.icon-online-time { width: 14px; height: 14px; background-position: -106px -140px; }
.icon-put-away { width: 64px; height: 16px; background-position: 0px -140px; }
.icon-refresh-car { width: 24px; height: 24px; background-position: -78px -156px; }
.icon-replay-pause { width: 60px; height: 60px; background-position: 0px -80px; }
.icon-replay-play { width: 60px; height: 60px; background-position: -60px -80px; }
.icon-replay-refresh { width: 60px; height: 60px; background-position: -172px 0px; }
.icon-resident { width: 52px; height: 72px; background-position: -120px 0px; }
.icon-screen-btn { width: 24px; height: 24px; background-position: -102px -156px; }
.icon-setting-btn { width: 24px; height: 24px; background-position: -126px -156px; }
.icon-share { width: 68px; height: 80px; background-position: 0px 0px; }
.icon-typeList { width: 14px; height: 14px; background-position: -120px -140px; }
\ No newline at end of file
.icon {display: inline-block;background-image: url(sprite.png);background-size: 192px 188px;}
.icon-battery-empty { width: 24px; height: 16px; background-position: -144px -124px; }
.icon-battery-enough { width: 24px; height: 16px; background-position: -168px -124px; }
.icon-begin { width: 26px; height: 36px; background-position: -140px -52px; }
.icon-copy { width: 28px; height: 28px; background-position: -144px -96px; }
.icon-device { width: 14px; height: 14px; background-position: -118px -68px; }
.icon-loc-icon { width: 30px; height: 30px; background-position: -88px -52px; }
.icon-locate-sm { width: 14px; height: 14px; background-position: -88px -82px; }
.icon-location { width: 24px; height: 24px; background-position: -28px -160px; }
.icon-navgation { width: 28px; height: 28px; background-position: 0px -160px; }
.icon-off-car { width: 52px; height: 52px; background-position: -88px 0px; }
.icon-offline-time { width: 14px; height: 14px; background-position: -102px -82px; }
.icon-on-car { width: 52px; height: 52px; background-position: -140px 0px; }
.icon-online-time { width: 14px; height: 14px; background-position: -116px -82px; }
.icon-put-away { width: 64px; height: 16px; background-position: 0px -144px; }
.icon-refresh-car { width: 24px; height: 24px; background-position: -52px -160px; }
.icon-replay-pause { width: 48px; height: 48px; background-position: 0px -96px; }
.icon-replay-play { width: 48px; height: 48px; background-position: -48px -96px; }
.icon-replay-refresh { width: 48px; height: 48px; background-position: -96px -96px; }
.icon-resident { width: 26px; height: 36px; background-position: -166px -52px; }
.icon-search { width: 16px; height: 16px; background-position: -118px -52px; }
.icon-setting-btn { width: 24px; height: 24px; background-position: -76px -160px; }
.icon-share { width: 88px; height: 96px; background-position: 0px 0px; }
.icon-typeList { width: 14px; height: 14px; background-position: -64px -144px; }
.icon-warning { width: 16px; height: 16px; background-position: -172px -96px; }
\ No newline at end of file

21.4 KB | W: | H:

37 KB | W: | H:

src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -5,13 +5,8 @@
</template>
<script>
import { Loading } from "vant";
export default {
name: "LOADING",
components: {
["van-loading"]: Loading,
},
};
</script>
<style lang="scss" scoped>
......
......@@ -2,18 +2,29 @@
<div class="map-box">
<slot name="mapBox"></slot>
<div v-show="isUploaded">
<a class="map-cmd-icon location" @click="getLocation">
<span class="icon icon-location"></span>
</a>
<a class="map-cmd-icon refresh-car" @click="refresh">
<button
class="map-cmd-icon location"
@click="getLocation"
v-preventReClick
>
<span v-if="!isGetLocation" class="icon icon-location"></span>
<van-loading v-else color="#1989fa" />
</button>
<button
class="map-cmd-icon refresh-car"
@click="refresh"
v-preventReClick
>
<span class="icon icon-refresh-car"></span>
</a>
</button>
</div>
</div>
</template>
<script>
import { onMounted, ref } from "vue";
import { Toast } from "vant";
import "vant/es/toast/style";
export default {
name: "mapContent",
props: {},
......@@ -23,6 +34,7 @@ export default {
let checkLoadedTimeoutId = "";
const satelActive = ref(null);
const roadActive = ref(null);
const isGetLocation = ref(false);
onMounted(() => {});
const initMap = (id) => {
let check = () => {
......@@ -47,6 +59,7 @@ export default {
let currMarker = null;
// 获取定位
const getLocation = () => {
isGetLocation.value = true;
map.plugin("AMap.Geolocation", function () {
var geolocation = new window.AMap.Geolocation({
enableHighAccuracy: true,
......@@ -61,6 +74,7 @@ export default {
if (currMarker) {
currMarker.setMap(null);
}
isGetLocation.value = false;
currMarker = new window.AMap.Marker({
position: data.position,
content: '<span class="curr-marker"></span>',
......@@ -69,7 +83,10 @@ export default {
});
map.setFitView();
});
window.AMap.event.addListener(geolocation, "error", () => {});
window.AMap.event.addListener(geolocation, "error", () => {
Toast("获取定位失败");
isGetLocation.value = false;
});
});
};
// 刷新
......@@ -85,6 +102,7 @@ export default {
roadActive,
refresh,
isUploaded,
isGetLocation,
};
},
};
......@@ -104,13 +122,14 @@ export default {
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 5px 12px 0px rgba(0, 0, 0, 0.12);
}
.location {
bottom: 180px;
bottom: 160px;
right: 20px;
}
.refresh-car {
bottom: 240px;
bottom: 220px;
right: 20px;
}
......
<template>
<van-popup
v-model:show="props.showPopup"
:model-show="props.showPopup"
round
@close="close"
:close-on-click-overlay="true"
......@@ -8,13 +8,15 @@
>
<div class="content-box">
<div class="btn-class">
<span class="cancel-btn" @click="cancel">取消</span>
<span
<button class="cancel-btn" @click="cancel">取消</button>
<button
class="save-btn"
:class="isDisabled ? 'disabled' : ''"
@click="save"
>{{ isDisabled ? "关闭" : "确定" }}</span
v-preventReClick
>
{{ isDisabled ? "关闭" : "确定" }}
</button>
</div>
<slot></slot>
</div>
......@@ -72,10 +74,12 @@ export default defineComponent({
padding-bottom: 40px;
.btn-class {
padding: 15px;
box-sizing: border-box;
border-bottom: 1px solid #f0f2f5;
width: calc(100% - 40px);
width: 100%;
display: flex;
justify-content: space-between;
font-size: 14px;
.cancel-btn {
color: #6c737a;
}
......
<template>
<div>
<div class="top-tab-class">
<van-tabs v-model:active="active" @click-tab="onTabClick">
<van-tab
v-for="(item, index) in tabRoutes"
......@@ -29,20 +29,23 @@ export default {
// 过滤tab
const filterTabs = async (cb) => {
let source = routeQuery.source;
// 有线设备 无设备调频
if (source == 1) {
routesArr.map((val, index) => {
if (val.name === "freq") {
routesArr.splice(index, 1);
for (var i = routes.tabRoutes.length - 1; i >= 0; i--) {
if (routes.tabRoutes[i].name === "freq" && source == 1) {
routesArr.splice(i, 1);
}
});
if (
(routes.tabRoutes[i].name === "fence" && source == 0) ||
(routes.tabRoutes[i].name === "fence" &&
JSON.parse(localStorage.getItem("sharePage")))
) {
routesArr.splice(i, 1);
}
if (source == 0) {
routesArr.map((val, index) => {
if (val.name === "fence") {
routesArr.splice(index, 1);
if (
routes.tabRoutes[i].name === "share" &&
JSON.parse(localStorage.getItem("sharePage"))
) {
routesArr.splice(i, 1);
}
});
}
await cb();
};
......@@ -62,8 +65,25 @@ export default {
},
};
</script>
<style lang="scss" scoped>
.top-tab-class {
height: 100%;
}
.tab-content {
height: 100%;
}
</style>
<style lang="scss">
.van-tabs {
height: 100%;
}
.van-tabs__wrap {
border-bottom: 1px solid #f0f2f5;
}
.van-tabs__content {
height: calc(100% - 45px);
}
.van-tab__panel {
height: 100%;
}
</style>
......@@ -10,6 +10,19 @@ import "@/assets/icons";
import SvgIcon from "@/components/svgIcon";
const app = createApp(App);
// 防止重复快速点击自定义全局指令
app.directive("preventReClick", {
mounted(el, binding) {
el.addEventListener("click", () => {
if (!el.disabled) {
el.disabled = true;
setTimeout(() => {
el.disabled = false;
}, binding.value || 1000);
}
});
},
});
app.component("svg-icon", SvgIcon);
vant(app);
app.use(store).use(router).mount("#app");
......
import { createRouter, createWebHistory } from "vue-router";
import { createRouter, createWebHashHistory } from "vue-router";
import routes from "./routes";
const router = createRouter({
history: createWebHistory("/miniapp/"),
history: createWebHashHistory(),
routes: routes.baseRoutes,
});
......
import axios from "axios";
import { Dialog } from "vant";
import store from "@/store";
import wx from "wx";
// 测试 https://eshield.test.glsx.com.cn
// 开发 https://eshield.dev.glsx.com.cn
// 线上
const BASE_URL = "https://eshield.dev.glsx.com.cn";
/* eslint-disable */
const BASE_URL = process.env.NODE_ENV == "development" ? "/api" : location.origin;
const instance = axios.create({
// 创建axios实例,在这里可以设置请求的默认配置
timeout: 10 * 60 * 1000, // 设置超时时间60s
......@@ -40,18 +42,24 @@ instance.interceptors.request.use(
instance.interceptors.response.use(
(response) => {
store.commit("hideLoading");
const serverCode = response.data.code,
token = response.headers["authorization"];
if (token || token === "") {
localStorage.setItem("token", token);
}
const serverCode = response.data.code;
if (serverCode === 200) {
if (response.status) {
return Promise.resolve(response);
}
return Promise.resolve(response.data);
} else {
Dialog({ message: response.data.message });
Dialog.confirm({
message: response.data.message,
showCancelButton: false
}).then(() => {
if (serverCode == 603 || serverCode == 604) { // 登录失效
localStorage.removeItem("token");
wx.miniProgram.reLaunch({
url: `../../pages/login/index?isLoginOut=true`,
});
}
});
return Promise.reject(response.data.message);
}
},
......
let map = null;
function MapService() {
map = null;
}
MapService.prototype = {
init: (id) => {
map = new window.AMap.Map(id);
return map;
},
// 卫星地图切换
satelEvent: (satelActive) => {
let layers = map.getLayers();
let satelLayer = [new window.AMap.TileLayer.Satellite()];
let flag = true;
layers.filter((val) => {
if (val.CLASS_NAME === "AMap.TileLayer.Satellite") {
satelActive.value = false;
flag = false;
map.remove(satelLayer);
}
});
if (flag) {
satelActive.value = true;
map.add(satelLayer);
}
},
// 获取定位
getLocationEvent: (currMarker) => {
map.plugin("AMap.Geolocation", function () {
var geolocation = new window.AMap.Geolocation({
enableHighAccuracy: true,
timeout: 10000,
buttonOffset: new window.AMap.Pixel(10, 20),
zoomToAccuracy: true,
buttonPosition: "RB",
});
geolocation.getCurrentPosition();
window.AMap.event.addListener(geolocation, "complete", (data) => {
if (currMarker) {
currMarker.setMap(null);
}
currMarker = new window.AMap.Marker({
position: data.position,
content: '<span class="curr-marker"></span>',
map: map,
offset: new window.AMap.Pixel(-12, -12),
});
map.setFitView();
});
window.AMap.event.addListener(geolocation, "error", () => {});
});
},
// 切换路况
roadStatusEvent: (roadActive) => {
let layers = map.getLayers();
let roadLayer = [new window.AMap.TileLayer.Traffic()];
let flag = true;
layers.filter((val) => {
if (val.CLASS_NAME === "AMap.TileLayer.Traffic") {
roadActive.value = false;
flag = false;
map.remove(roadLayer);
}
});
if (flag) {
roadActive.value = true;
map.add(roadLayer);
}
},
// 地图放大
mapPlusEvent: () => {
map.zoomIn();
},
// 地图缩小
mapMinusEvent: () => {
map.zoomOut();
},
// 刷新
refresheEvent: (context) => {
context.emit("refreshCb", map);
},
};
const mapService = new MapService();
export default mapService;
......@@ -3,17 +3,16 @@ import {
List,
Search,
Overlay,
Picker,
Tab,
Tabs,
Icon,
Button,
DatetimePicker,
Progress,
RadioGroup,
Radio,
Slider,
DropdownMenu,
Field,
Switch,
Cell,
Loading,
NoticeBar,
} from "vant";
export function vant(app) {
......@@ -21,15 +20,14 @@ export function vant(app) {
app.use(List);
app.use(Search);
app.use(Overlay);
app.use(Picker);
app.use(Icon);
app.use(Button);
app.use(DatetimePicker);
app.use(Progress);
app.use(RadioGroup);
app.use(Radio);
app.use(Slider);
app.use(DropdownMenu);
app.use(Field);
app.use(Switch);
app.use(Tab);
app.use(Tabs);
app.use(Cell);
app.use(Loading);
app.use(NoticeBar);
}
<template>
<div>
<div class="settingControll" @click="showSettingDialog = true">
<div class="info-content">
<button
class="settingControll"
@click="showSettingDialog = true"
v-preventReClick
>
<a class="icon icon-setting-btn"></a>
<span class="setting-text">设置</span>
</div>
</button>
<popup
:show="showSettingDialog"
@btnCancel="showSettingDialog = false"
......@@ -16,13 +20,15 @@
>
<div class="setting-content">
<div class="type-btn">
<span
<button
:class="selectedTypeItem === index ? 'active' : ''"
v-for="(item, index) in fenceTypeList"
:key="index"
@click="changeFenceType(index)"
>{{ item }}</span
v-preventReClick
>
{{ item }}
</button>
</div>
<div class="type-box" v-if="selectedTypeItem === 0">
<div>
......@@ -39,20 +45,20 @@
<div class="type-box" v-if="selectedTypeItem === 1">
<div>
<span class="label">{{ fenceTypeList[selectedTypeItem] }}</span>
<a @click="changeProviceCity(1)"
><span
<button @click="changeProviceCity(1)" v-preventReClick>
<span
class="radio"
:class="proviceCityType === 1 ? 'active' : ''"
></span
><span>跨省</span></a
>
<a @click="changeProviceCity(2)"
><span
><span>跨省</span>
</button>
<button @click="changeProviceCity(2)" v-preventReClick>
<span
class="radio"
:class="proviceCityType === 2 ? 'active' : ''"
></span
><span>跨市</span></a
>
><span>跨市</span>
</button>
</div>
</div>
</div>
......@@ -67,10 +73,10 @@
<script>
import { defineComponent, onMounted, ref } from "vue";
import mapContent from "@/components/mapContent.vue";
import popup from "@/components/popup.vue";
import AMapLoader from "@amap/amap-jsapi-loader";
import { CONSTANT } from "../constant";
import { Toast, Dialog } from "vant";
import ADCODE from "@/utils/adcode";
import { useRoute } from "vue-router";
import "vant/es/toast/style";
import { GET_CAR_LOCATION_INFO, ADD_FENCE } from "@/api/index";
......@@ -78,6 +84,7 @@ export default defineComponent({
name: "FencePage",
components: {
mapContent,
popup,
},
setup() {
const mapContentRefs = ref(null);
......@@ -94,6 +101,7 @@ export default defineComponent({
const routeQuery = route.query;
const hasRadiusFence = ref(false);
const hasProviceCityFence = ref(false);
const adcodeItemName = ref(null);
let district = null;
onMounted(() => {
AMapLoader.load({
......@@ -110,7 +118,18 @@ export default defineComponent({
});
});
// 地图刷新
const refreshCb = () => {};
const refreshCb = (map) => {
map.clearMap();
getData(map);
if (hasRadiusFence.value) {
createCircle(currLnglat.value, radiusNum.value);
createPoint(currLnglat.value);
}
if (hasProviceCityFence.value && adcodeItemName.value) {
coverArea(adcodeItemName.value, map);
}
map.setFitView();
};
// 切换围栏类型
const changeFenceType = (index) => {
selectedTypeItem.value = index;
......@@ -130,6 +149,7 @@ export default defineComponent({
val["gpsLocation"].elng,
val["gpsLocation"].elat
);
drawMarker(currLnglat.value);
});
} else {
Dialog({ message: "暂无数据" });
......@@ -160,7 +180,6 @@ export default defineComponent({
currentMap = currentMap
? currentMap
: mapContentRefs.value.init("fenceContainer");
drawMarker(currLnglat.value);
currentMap.setFitView();
showSettingDialog.value = false;
hasRadiusFence.value = true;
......@@ -172,13 +191,9 @@ export default defineComponent({
}
if (selectedTypeItem.value === 1 && proviceCityType.value) {
getAdcodeByLatlng(currLnglat.value, (obj) => {
var adcodeItem = filterAdcodeObj(obj.adcode);
if (proviceCityType.value != adcodeItem.type) {
adcodeItem = filterAdcodeObj(adcodeItem.parentid);
}
ADD_FENCE({
shapeType: 4,
areaCode: adcodeItem.adcode,
areaCode: obj.adcode,
lnglat: currLnglat.value.lng + "," + currLnglat.value.lat,
sn: routeQuery.sn,
}).then((res) => {
......@@ -186,7 +201,8 @@ export default defineComponent({
Toast(
`设定${proviceCityType.value === 1 ? "跨省" : "跨市"}围栏成功`
);
coverArea(adcodeItem.name, currentMap);
adcodeItemName.value = obj.adName;
coverArea(obj.adName, currentMap);
currentMap.setFitView();
hasProviceCityFence.value = true;
}
......@@ -234,12 +250,24 @@ export default defineComponent({
if (geocoderValue.value) {
var lnglatXY = [currLnglat.lng, currLnglat.lat];
geocoderValue.value.getAddress(lnglatXY, function (status, result) {
var _adcode = "";
let _adcode = "";
let _adName = "";
if (status === "complete" && result.info === "OK") {
_adcode = result.regeocode.addressComponent.adcode;
_adcode = _adcode.substr(0, 4) + "00";
_adName =
proviceCityType.value == 1
? result.regeocode.addressComponent.province
: proviceCityType.value == 2
? result.regeocode.addressComponent.city
: "";
_adcode =
proviceCityType.value == 1
? _adcode.substr(0, 2) + "0000"
: proviceCityType.value == 2
? _adcode.substr(0, 4) + "00"
: "";
}
cb({ adcode: _adcode });
cb({ adcode: _adcode, adName: _adName });
});
} else {
setTimeout(function () {
......@@ -247,17 +275,6 @@ export default defineComponent({
}, 500);
}
};
// 省市区code过滤
const filterAdcodeObj = (adcode) => {
adcode = adcode.toString().substr(0, 4) + "00";
for (var i = 0, len = ADCODE.length; i < len; i++) {
var item = ADCODE[i];
if (adcode == item.adcode) {
return item;
}
}
return null;
};
// 添加标记
const drawMarker = (currLnglat) => {
new window.AMap.Marker({
......@@ -269,6 +286,7 @@ export default defineComponent({
map: currentMap,
offset: new window.AMap.Pixel(-17, -26),
});
currentMap.setFitView();
};
// 地图添加圆
const createCircle = (lnglat, radius) => {
......@@ -319,6 +337,7 @@ export default defineComponent({
createCircle,
hasRadiusFence,
hasProviceCityFence,
adcodeItemName,
};
},
});
......@@ -336,6 +355,8 @@ export default defineComponent({
flex-flow: column;
align-items: center;
justify-content: center;
box-shadow: 0px 5px 12px 0px rgba(0, 0, 0, 0.12);
border-radius: 6px;
.setting-text {
font-size: 16px;
display: inline-block;
......@@ -343,7 +364,8 @@ export default defineComponent({
}
}
.setting-content {
width: calc(100% - 32px);
box-sizing: border-box;
width: 100%;
height: 100%;
padding: 10px 16px;
font-size: 14px;
......@@ -353,7 +375,7 @@ export default defineComponent({
color: #111;
font-weight: var(--van-font-weight-bold);
display: flex;
span {
button {
flex: 1;
border-radius: 5px;
height: 36px;
......@@ -362,7 +384,7 @@ export default defineComponent({
text-align: center;
line-height: 36px;
}
span.active {
button.active {
height: 34px;
line-height: 34px;
color: var(--base-color);
......@@ -387,8 +409,9 @@ export default defineComponent({
background: #f0f2f5;
border-radius: 4px;
line-height: 40px;
margin-bottom: 0 !important;
}
a {
button {
display: flex;
align-items: center;
margin-left: 15px;
......
......@@ -11,14 +11,15 @@
<div class="content" v-if="openFreq">
<span class="title-text">选择模式</span>
<div class="middle">
<span
<button
v-for="(item, index) in typeList"
:key="index"
@click="changeType(index)"
v-preventReClick
>
<span class="radio" :class="type === index ? 'active' : ''"></span>
<span>{{ item }}</span>
</span>
</button>
</div>
<!-- 追车模式 -->
<div class="chas-car-content bottom" v-if="type === 0">
......@@ -36,49 +37,67 @@
<!-- 闹钟模式 -->
<div class="clock-content bottom" v-if="type === 1">
<div v-for="(item, index) in clockList" :key="index" class="clock-item">
<span class="cont-left" @click="changeClockCheck(index)">
<button
class="cont-left"
@click="changeClockCheck(index)"
v-preventReClick
>
<svg-icon
:icon-class="item.checked ? 'checked' : 'check'"
class="check-class"
></svg-icon>
<span class="lable">{{ item.name }}</span>
</span>
<span class="cont-right" @click="onShowTimePicker(1, index)">
</button>
<button
class="cont-right"
@click="onShowTimePicker(1, index)"
v-preventReClick
>
<svg-icon icon-class="clock" class="clock-class"></svg-icon>
<span>
{{ item.time }}
</span>
</span>
</button>
</div>
</div>
<!-- 星期模式 -->
<div class="week-content bottom" v-if="type === 2">
<div class="week-top">
<span
<button
v-for="(item, index) in weekCheckboxItems"
:key="index"
class="week-item"
@click="changeWeekCheck(index)"
v-preventReClick
>
<svg-icon
:icon-class="item.checked ? 'checked' : 'check'"
class="check-class"
></svg-icon>
<span class="lable">{{ item.name }}</span>
</span>
</button>
</div>
<div class="time-cont">
<span class="label">上点时间</span>
<span class="cont-right" @click="onShowTimePicker(2, weekSelectTime)">
<button
class="cont-right"
@click="onShowTimePicker(2, weekSelectTime)"
v-preventReClick
>
<svg-icon icon-class="clock" class="clock-class"></svg-icon>
<span>
{{ weekSelectTime }}
</span>
</span>
</button>
</div>
</div>
<van-button class="save-btn" type="primary" @click="onSave" block
<van-button
class="save-btn"
type="primary"
@click="onSave"
block
v-preventReClick
>保存</van-button
>
</div>
......@@ -93,16 +112,15 @@
v-model="currentTime"
class="time-picker"
type="time"
title="选择时间"
:show-toolbar="false"
:filter="filter"
@change="changeTime"
@confirm="changeTime"
ref="dateTimePicker"
/>
</popup>
</div>
</template>
<script>
import { defineComponent, onMounted, ref } from "vue";
import { defineComponent, onMounted, ref, watch, nextTick } from "vue";
import { Toast } from "vant";
import "vant/es/toast/style";
import popup from "@/components/popup.vue";
......@@ -114,7 +132,7 @@ export default defineComponent({
popup,
},
setup() {
const openFreq = ref(true);
const openFreq = ref(false);
const type = ref(0);
const route = useRoute();
let routeQuery = route.query;
......@@ -141,6 +159,7 @@ export default defineComponent({
const columns = ref([]);
const showTimePicker = ref(false);
const selectedId = ref(null);
const dateTimePicker = ref(null);
onMounted(() => {
// 获取已设置调频数据
getInfoData();
......@@ -148,10 +167,10 @@ export default defineComponent({
const getInfoData = () => {
GET_FREQ_INFO({ sn: routeQuery.sn }).then((res) => {
if (res.code === 200) {
res;
if (!res.data.type.toString()) {
if ((res.data && res.data.type === 3) || !res.data) {
openFreq.value = false;
} else {
openFreq.value = true;
type.value = res.data.type;
switch (res.data.type) {
case 0:
......@@ -160,8 +179,12 @@ export default defineComponent({
case 1:
res.data.timer &&
res.data.timer.split(",").forEach((val, index) => {
if (val != "NA") {
clockList.value[index].checked = true;
clockList.value[index].time = val;
} else {
clockList.value[index].checked = false;
}
});
break;
case 2:
......@@ -180,10 +203,10 @@ export default defineComponent({
}
});
};
// 切换模式
const changeType = (index) => {
type.value = index;
switch (index) {
watch(
() => type.value,
(newVal) => {
switch (newVal) {
case 0:
Toast("适用于收车场景,指定设备每隔几分钟更新定位信息。");
break;
......@@ -194,6 +217,11 @@ export default defineComponent({
Toast("适用于日常场景,可按需设置每周的设备回传次数。");
break;
}
}
);
// 切换模式
const changeType = (index) => {
type.value = index;
};
// 闹钟模式选择
const changeClockCheck = (index) => {
......@@ -217,7 +245,7 @@ export default defineComponent({
// 闹钟模式
if (num === 1) {
selectedId.value = data;
let time = clockList.value[data].value;
let time = clockList.value[data].time;
currentTime.value = time;
selectTime.value = time;
}
......@@ -236,20 +264,24 @@ export default defineComponent({
};
// 时间选择确定
const saveTime = () => {
nextTick(() => {
let confirmBtn = dateTimePicker.value.$el.children[0].children[1];
confirmBtn.click();
});
showTimePicker.value = false;
};
const changeTime = (e) => {
selectTime.value = e;
if (type.value === 1) {
clockList.value.forEach((val, index) => {
if (index === selectedId.value) {
val.value = selectTime.value;
val.time = e;
}
});
}
if (type.value === 2) {
weekSelectTime.value = selectTime.value;
weekSelectTime.value = e;
}
showTimePicker.value = false;
};
const changeTime = (e) => {
selectTime.value = e;
};
// 开启关闭调频
const switchOnChange = (e) => {
......@@ -257,6 +289,25 @@ export default defineComponent({
CLOSE_FREQ({ sn: routeQuery.sn }).then((res) => {
if (res.code === 200) {
Toast("关闭调频成功");
// 重置默认的调频数据
clockList.value = [
{ name: "第一组", time: "08:00", checked: true },
{ name: "第二组", time: "12:00" },
{ name: "第三组", time: "18:00" },
{ name: "第四组", time: "22:00" },
];
type.value = 0;
minuteNum.value = null;
weekCheckboxItems.value = [
{ name: "周一", id: "1", checked: true },
{ name: "周二", id: "2" },
{ name: "周三", id: "3" },
{ name: "周四", id: "4" },
{ name: "周五", id: "5" },
{ name: "周六", id: "6" },
{ name: "周日", id: "7" },
];
weekSelectTime.value = "10:00";
}
});
}
......@@ -273,23 +324,31 @@ export default defineComponent({
if (
!/^\d{1,3}$/.test(minuteNum.value) ||
minuteNum.value < 1 ||
minuteNum.value > 999
minuteNum.value > 5
) {
return Toast("请输入1~999之间的数字");
return Toast("请输入1~5之间的数字");
}
break;
case 1:
// eslint-disable-next-line no-case-declarations
let arr = [];
let arr = [[], []];
clockList.value.forEach((val) => {
arr[0].push(val.checked ? val.time : "NA");
if (val.checked) {
arr.push(val.time);
arr[1].push(val.time);
}
});
if (arr.length <= 0) {
if (arr[1].length <= 0) {
return Toast("请至少选择一组模式");
}
OParams.timer = arr.join(",");
// eslint-disable-next-line no-case-declarations
// let timeArr = clockList.value.map((item) => item.time);
// eslint-disable-next-line no-case-declarations
let timeArrSet = new Set(arr[1]);
if (arr[1].length != timeArrSet.size) {
return Toast("每组模式时间不可相同");
}
OParams.timer = arr[0].join(",");
break;
case 2:
// eslint-disable-next-line no-case-declarations
......@@ -336,21 +395,28 @@ export default defineComponent({
onSave,
switchOnChange,
getInfoData,
dateTimePicker,
};
},
});
</script>
<style lang="scss">
.van-picker__toolbar {
display: none;
}
</style>
<style lang="scss" scoped>
.freq-page {
position: fixed;
width: calc(100% - 20px);
box-sizing: border-box;
width: 100%;
padding: 16px 10px;
height: 100%;
overflow: auto;
background: #f5f6f7;
color: #111;
.top {
width: calc(100% - 32px);
box-sizing: border-box;
width: 100%;
height: 52px;
border-radius: 8px;
padding: 0 16px;
......@@ -367,7 +433,8 @@ export default defineComponent({
margin: 16px 0 8px 24px;
}
.middle {
width: calc(100% - 32px);
box-sizing: border-box;
width: 100%;
height: 52px;
border-radius: 8px;
padding: 0 16px;
......@@ -375,7 +442,7 @@ export default defineComponent({
display: flex;
align-items: center;
font-size: 14px;
span {
button {
flex: 1;
display: flex;
align-items: center;
......@@ -396,7 +463,8 @@ export default defineComponent({
}
}
.bottom {
width: calc(100% - 32px);
box-sizing: border-box;
width: 100%;
padding: 24px 16px;
border-radius: 8px;
margin-top: 16px;
......
......@@ -112,34 +112,8 @@ export default defineComponent({
});
</script>
<style lang="scss" scoped>
.icon-share {
position: absolute;
top: 20px;
right: 65px;
}
.tip {
margin-top: 105px;
text-align: center;
color: #fff;
font-size: 16px;
.fle {
display: inline-block;
width: 18px;
height: 22px;
vertical-align: middle;
}
.sharebtn {
display: inline-block;
width: 4px;
height: 4px;
margin: 1px;
background: #fff;
border-radius: 50%;
}
.sharebtn.middle {
width: 6px;
height: 6px;
margin: 0;
}
.info-content {
height: 100%;
}
@import "@/assets/css/share.scss";
</style>
<template>
<div class="monitor-tabContent">
<div class="info-content">
<mapContent @refreshCb="refreshCb" @getData="getData" ref="mapContentRefs">
<template #mapBox>
<div id="monitorContainer" class="map-container"></div>
......@@ -170,14 +170,13 @@ export default {
require("@/assets/images/car.png") +
'" style="transform: scale(0.5);" />',
map: currentMap,
offset: new window.AMap.Pixel(-8.5, -13),
offset: new window.AMap.Pixel(-17, -26),
});
beginMarker = new window.AMap.Marker({
position: lnglat,
content:
'<span class="icon icon-begin" style="transform: scale(0.5);"></span>',
content: '<span class="icon icon-begin" ></span>',
map: currentMap,
offset: new window.AMap.Pixel(-8.5, -13),
offset: new window.AMap.Pixel(-17, -26),
visible: false,
});
} else {
......@@ -248,7 +247,8 @@ export default {
}
}
.list-content-monitor {
width: calc(100% - 30px);
box-sizing: border-box;
width: 100%;
padding: 5px 15px 0 15px;
font-size: 14px;
.list-item {
......@@ -263,6 +263,7 @@ export default {
flex-flow: column;
overflow: hidden;
padding-bottom: 14px;
width: 100%;
border-bottom: 1px solid #f0f2f5;
}
.title {
......@@ -274,7 +275,7 @@ export default {
.time {
color: #666;
font-size: 12px;
margin-top: 5px;
margin-top: 7px;
}
}
:last-child {
......@@ -287,7 +288,7 @@ export default {
transition: max-height 0.3s;
}
.toggle-bottom-monitor.show {
max-height: 80%;
max-height: 60%;
transition: max-height 0.3s;
.list-content-monitor {
overflow-y: scroll;
......
<template>
<div>
<div class="searchControll" @click="showTimeDialog = true">
<a class="icon icon-screen-btn"></a>
<span class="screen-text">筛选</span>
</div>
<popup
:show="showTimeDialog"
@btnCancel="showTimeDialog = false"
@btnSave="saveTime"
:position="'bottom'"
>
<div class="time-content">
<span
<div class="info-content">
<div class="tab">
<div class="tabbar">
<button
class="time_btn"
v-for="(item, index) in timeBtnList"
:key="index"
:class="seledtedItem === index ? 'active' : ''"
@click="selectTime(index)"
>{{ index < 2 ? item : currentDateText }}</span
v-preventReClick
>
{{ index < 2 ? item : currentDateText }}
</button>
</div>
</div>
<popup
:show="showTimePicker"
@btnCancel="showTimePicker = false"
@btnSave="saveTime"
:position="'bottom'"
>
<van-datetime-picker
style="width: 100%"
v-if="showTimePicker"
:show-toolbar="false"
v-model="currentDate"
:max-date="maxDate"
type="year-month"
title="选择年月"
:formatter="formatter"
@change="change"
@confirm="change"
ref="dateTimePicker"
/>
</popup>
<mapContent @refreshCb="refreshCb" @getData="getData" ref="mapContentRefs">
......@@ -56,6 +54,7 @@
:key="index"
>
<span class="icon icon-loc-icon"></span>
<div class="text-content">
<div class="left">
<p class="title">{{ item.transferAddress }}</p>
<p class="time">
......@@ -66,15 +65,22 @@
</p>
</div>
<div class="right">
<a
class="copy-adr"
<button
class="button-class copy-adr"
@click="copyAddress"
v-preventReClick
:data-clipboard-text="item.transferAddress"
><i class="icon icon-copy"></i><span>复制</span></a
>
<a class="navigate" @click="navigation(item)"
><i class="icon icon-navgation"></i><span>导航</span></a
<i class="icon icon-copy"></i><span>复制</span>
</button>
<button
class="button-class"
@click="navigation(item)"
v-preventReClick
>
<i class="icon icon-navgation"></i><span>导航</span>
</button>
</div>
</div>
</div>
</div>
......@@ -85,6 +91,7 @@
<script>
import { defineComponent, nextTick, onMounted, ref, watch } from "vue";
import mapContent from "@/components/mapContent.vue";
import popup from "@/components/popup.vue";
import AMapLoader from "@amap/amap-jsapi-loader";
import { CONSTANT } from "../constant";
import moment from "@/utils/moment";
......@@ -99,6 +106,7 @@ export default defineComponent({
name: "ResidentPage",
components: {
mapContent,
popup,
},
setup() {
const route = useRoute();
......@@ -108,7 +116,6 @@ export default defineComponent({
const currentDateText = ref("自定义");
const timeBtnList = ["7天", "30天", "自定义"];
const seledtedItem = ref(0);
const showTimeDialog = ref(false);
const isShowAllList = ref(false);
const residentList = ref([]);
const listScroll = ref(0);
......@@ -118,6 +125,7 @@ export default defineComponent({
]);
const changey = ref(null);
const maxDate = ref(new Date());
const dateTimePicker = ref(null);
let currentMap = null;
let routeQuery = route.query;
let markerArr = [];
......@@ -174,17 +182,12 @@ export default defineComponent({
return val;
};
const saveTime = () => {
showTimeDialog.value = false;
if (seledtedItem.value === 2) {
currentDateText.value = moment(currentDate.value).format("YYYY-MM");
searchTime.value = [
moment(currentDate.value)
.endOf("month")
.format("YYYY-MM-DD HH:mm:ss"),
moment(currentDate.value).format("YYYY-MM-DD HH:mm:ss"),
];
}
getData();
showTimePicker.value = false;
// 不显示picker顶部 确认时调用 自带的confirm 防止选择时间延迟
nextTick(() => {
let confirmBtn = dateTimePicker.value.$el.children[0].children[1];
confirmBtn.click();
});
};
onMounted(() => {
AMapLoader.load({
......@@ -196,9 +199,8 @@ export default defineComponent({
mapContentRefs.value.initMap("residentContainer");
});
});
// 选择时间
// 快捷选择时间
const selectTime = (e) => {
seledtedItem.value = e;
switch (e) {
case 0:
searchTime.value = [
......@@ -206,24 +208,33 @@ export default defineComponent({
moment().format("YYYY-MM-DD HH:mm:ss"),
];
showTimePicker.value = false;
currentDateText.value = "自定义";
seledtedItem.value = e;
getData();
break;
case 1:
searchTime.value = [
moment().subtract(30, "day").format("YYYY-MM-DD HH:mm:ss"),
moment().format("YYYY-MM-DD HH:mm:ss"),
];
currentDateText.value = "自定义";
showTimePicker.value = false;
seledtedItem.value = e;
getData();
break;
case 2:
showTimePicker.value = true;
break;
}
};
// 时间选择确定
// 自定义时间选择
const change = (e) => {
currentDate.value = e;
currentDateText.value = moment(e).format("YYYY-MM");
searchTime.value = [
moment(e).format("YYYY-MM-DD HH:mm:ss"),
moment(e).endOf("month").format("YYYY-MM-DD HH:mm:ss"),
];
seledtedItem.value = timeBtnList.findIndex((item) => item == "自定义");
getData();
};
// 获取数据
const getData = (map) => {
......@@ -237,6 +248,8 @@ export default defineComponent({
if (res.data.length > 0) {
init(currentMap, res.data);
} else {
currentMap.clearMap();
residentList.value = [];
Dialog({ message: "暂无数据" });
}
}
......@@ -256,8 +269,7 @@ export default defineComponent({
var lnglat = new window.AMap.LngLat(item.elng, item.elat);
var marker = new window.AMap.Marker({
position: lnglat,
content:
'<span class="icon icon-resident" style="transform: scale(0.5);"></span>',
content: '<span class="icon icon-resident"></span>',
map: currentMap,
offset: new window.AMap.Pixel(-8.5, -13),
});
......@@ -286,9 +298,8 @@ export default defineComponent({
};
// 导航
const navigation = (data) => {
console.log(data.transferAddress);
wx.miniProgram.navigateTo({
url: `../../pages/navgation/index?lat=${data.elat}&lng=${data.elng}&address=${data.transferAddress}`,
url: `../../mapPackage/pages/tracking?lat=${data.elat}&lng=${data.elng}&address=${data.transferAddress}`,
});
};
// 复制地址
......@@ -320,42 +331,57 @@ export default defineComponent({
residentList,
selectTime,
searchTime,
showTimeDialog,
timeBtnList,
changey,
listScroll,
saveTime,
formatter,
maxDate,
dateTimePicker,
};
},
});
</script>
<style lang="scss" scoped>
.searchControll {
position: fixed;
top: 70px;
right: 12px;
width: 40px;
height: 52px;
.info-content {
.map-box {
height: calc(100% - 44px) !important;
}
}
.tab {
height: 28px;
background: #fff;
z-index: 300;
padding: 8px 16px;
.tabbar {
background: #f5f6f7;
border-radius: 6px;
height: 28px;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
.screen-text {
font-size: 16px;
display: inline-block;
transform: scale(0.5);
align-items: center;
.time_btn {
height: 24px;
font-size: 14px;
line-height: 24px;
color: #6c737a;
flex: 1;
margin: 0 1px;
text-align: center;
}
.time_btn.active {
background: #fff;
border-radius: 4px;
color: var(--base-color);
}
}
}
.time-content {
background: #fff;
color: #999;
display: flex;
width: calc(100% - 16px);
box-sizing: border-box;
width: 100%;
padding: 20px 8px;
overflow: hidden;
.time_btn {
......@@ -397,21 +423,33 @@ export default defineComponent({
}
}
.list-content-resident {
width: calc(100% - 30px);
padding: 5px 15px 0 15px;
box-sizing: border-box;
width: 100%;
padding-top: 5px;
font-size: 14px;
.list-item {
height: 68px;
display: flex;
width: 100%;
justify-content: space-between;
.icon-loc-icon {
margin-top: 7px;
flex-shrink: 0;
}
.text-content {
flex-shrink: 0;
border-bottom: 1px solid #f0f2f5;
display: flex;
flex: 1;
width: 0;
.left {
padding: 12px 10px 12px 0;
border-bottom: 1px solid #f0f2f5;
flex: 1;
width: 0;
display: flex;
flex-flow: column;
.title {
color: #000;
width: 224px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
......@@ -427,16 +465,14 @@ export default defineComponent({
}
.right {
padding: 12px 0;
border-bottom: 1px solid #f0f2f5;
display: flex;
align-items: center;
a {
button {
display: flex;
flex-flow: column;
align-items: center;
}
.navigate {
.button-class {
i {
display: inline-block;
}
......@@ -446,15 +482,6 @@ export default defineComponent({
transform: scale(0.5);
}
}
.copy-adr {
i {
display: inline-block;
}
span {
color: #6c737a;
font-size: 20px;
transform: scale(0.5);
}
}
}
}
......@@ -482,4 +509,7 @@ export default defineComponent({
border-radius: 4px;
padding: 10px;
}
.van-picker__toolbar {
display: none;
}
</style>
<template>
<div>
<div class="info-content">
<mapContent ref="mapContentRefs">
<template #mapBox>
<div id="shareContainer" class="map-container"></div>
......
......@@ -11,10 +11,18 @@ function resolve(dir) {
return path.join(__dirname, ".", dir);
}
module.exports = defineConfig({
publicPath: "/miniapp/",
publicPath: "./",
transpileDependencies: true,
devServer: {
port: 9527,
proxy: {
'/api': {
target: 'https://eshield.dev.glsx.com.cn/',
changeOrigin: true,
secure: false,
pathRewrite: { "^/api": "" },
}
}
},
chainWebpack: (config) => {
config.plugin("webpack-spritesmith").use(Spritesmith, [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!