This commit is contained in:
parent
a2eddacc9c
commit
111ce94702
66
App.vue
66
App.vue
|
|
@ -3,11 +3,32 @@
|
|||
export default {
|
||||
onLaunch: function() {
|
||||
|
||||
uni.log = function(...arg) {
|
||||
console.log(...arg)
|
||||
|
||||
uni.$emit("consoledebug",...arg)
|
||||
}
|
||||
|
||||
|
||||
// 初始化推送
|
||||
uni.getPushClientId({
|
||||
success: (res) => {}
|
||||
})
|
||||
|
||||
|
||||
let _Android = uni.getStorageSync('cid') || new Date().getTime()
|
||||
// #ifdef APP
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
plus.navigator.setFullscreen(true)
|
||||
}, 500)
|
||||
// 检查是否要更新APP
|
||||
|
||||
setTimeout(() => {
|
||||
upapp()
|
||||
}, 5000)
|
||||
// 获取设备码
|
||||
function getAndroidId() {
|
||||
plus.android.importClass("android.provider.Settings");
|
||||
|
|
@ -19,43 +40,6 @@
|
|||
_Android = getAndroidId() || plus.device.getOAID() || uni.getSystemInfoSync().deviceId;
|
||||
// #endif
|
||||
uni.setStorageSync('cid', _Android)
|
||||
if (uni.getStorageSync('token')) {
|
||||
// #ifdef APP-PLUS
|
||||
let _toure = getCurrentPages();
|
||||
if (_toure[0].route != 'pages/index') {
|
||||
uni.reLaunch({
|
||||
url: "/pages/index",
|
||||
success() {}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
uni.reLaunch({
|
||||
url: "/pages/index",
|
||||
success() {}
|
||||
})
|
||||
// #endif
|
||||
|
||||
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: "/pages/signIn",
|
||||
success() {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
plus.navigator.setFullscreen(true)
|
||||
}, 500)
|
||||
// 检查是否要更新APP
|
||||
setTimeout(() => {
|
||||
upapp()
|
||||
}, 5000)
|
||||
// #endif
|
||||
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
|
|
@ -77,21 +61,29 @@
|
|||
.numcolor1 {
|
||||
background: #3336E0;
|
||||
color: #fff;
|
||||
border-radius: 5rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.numcolor3 {
|
||||
background: #07C688;
|
||||
color: #fff;
|
||||
border-radius: 5rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.numcolor2 {
|
||||
background: #FF9521;
|
||||
color: #fff;
|
||||
border-radius: 5rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.numcolor4 {
|
||||
background: #333333;
|
||||
color: #fff;
|
||||
border-radius: 5rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
/* :root{
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
function reset(){
|
||||
chooseday.value=daydata.value.day[0];
|
||||
dayindex.value=0;
|
||||
adssEmits("change",chooseday.value)
|
||||
// adssEmits("change",chooseday.value)
|
||||
}
|
||||
defineExpose({
|
||||
reset
|
||||
|
|
|
|||
1
main.js
1
main.js
|
|
@ -1,5 +1,6 @@
|
|||
import App from './App'
|
||||
import soket from "/utils/soket.js"
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
|
|
|
|||
|
|
@ -2,14 +2,18 @@
|
|||
"name" : "区间测速",
|
||||
"appid" : "__UNI__E207F22",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.1",
|
||||
"versionCode" : 101,
|
||||
"versionName" : "2.0.2",
|
||||
"versionCode" : 100,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"console" : true,
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"compatible" : {
|
||||
"ignoreVersion" : true
|
||||
},
|
||||
"screenOrientation" : [
|
||||
"landscape-primary", //可选,字符串类型,支持横屏
|
||||
"landscape-secondary"
|
||||
|
|
@ -151,7 +155,7 @@
|
|||
//配置跨域
|
||||
"proxy" : {
|
||||
"/api" : {
|
||||
"target" : "http://speed-bl.renyizhi.cc",
|
||||
"target" : "http://192.168.1.7:9005",
|
||||
"changeOrigin" : true,
|
||||
"secure" : false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
{
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/go",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index",
|
||||
"style": {
|
||||
|
|
@ -57,6 +63,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
|
|
|||
|
|
@ -46,13 +46,13 @@
|
|||
</view>
|
||||
<view class="bottom">
|
||||
<view class="title">设备:</view>
|
||||
<view class="item" v-for="item in allDevices"
|
||||
:class="{on1:(selectindex==5 && Devicesid==item.encoding),on:item.status==2}"
|
||||
<view class="item" v-for="item in devices"
|
||||
:class="{on1:(selectindex==5 && Devicesid==item.deviceId),on:item.status==2}"
|
||||
@click.stop="setshowDevices(item)">
|
||||
<view class="l">
|
||||
<image v-if="item.status==2 " src="/static/equipmenton.png"></image>
|
||||
<image v-else src="/static/equipmentno.png"></image>
|
||||
<view class="name">设备{{item.encoding}}</view>
|
||||
<view class="name">设备{{item.deviceId}}</view>
|
||||
</view>
|
||||
<view class="r"></view>
|
||||
</view>
|
||||
|
|
@ -86,6 +86,15 @@
|
|||
<view class="yes" @click="outsignOut">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 调试窗口 -->
|
||||
<!-- <view class="debug" :class="{on:showdebug}">
|
||||
<view class="BUG" @click="openbug"> BUG</view>
|
||||
<view class="qk" @click="debug=[]">清空</view>
|
||||
<scroll-view :scroll-y="true" :scroll-x="true">
|
||||
<jsObjectText v-for="(ixx,kxx) in debug" :key="kxx" :obj="ixx" style="margin-right:8rpx" />
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
</template>
|
||||
<script setup>
|
||||
import history from "./pages/history.vue"
|
||||
|
|
@ -93,7 +102,7 @@
|
|||
import statistics from "./pages/statistics.vue"
|
||||
import passingTheCar from "./pages/passingTheCar.vue"
|
||||
import warningInformation from "./pages/warningInformation.vue"
|
||||
|
||||
import jsObjectText from"./jsObjectText.vue"
|
||||
import {
|
||||
nextTick,
|
||||
ref,
|
||||
|
|
@ -107,10 +116,12 @@
|
|||
import {
|
||||
onBackPress,
|
||||
onShow,
|
||||
onLoad,
|
||||
onUnload
|
||||
} from "@dcloudio/uni-app"
|
||||
|
||||
// 页面管理
|
||||
const showdebug=ref(false);
|
||||
const refhistory = ref()
|
||||
const refsetUp = ref()
|
||||
const refcamera = ref()
|
||||
|
|
@ -120,15 +131,28 @@
|
|||
const selectindex = ref("")
|
||||
const showout = ref(false);
|
||||
const showsignOut = ref(false);
|
||||
// 结束
|
||||
// 设备
|
||||
const devices = ref([])
|
||||
|
||||
const allDevices = ref([])
|
||||
const Devicesid = ref('')
|
||||
|
||||
const debug=ref([]);
|
||||
// 调试插件通讯
|
||||
// uni.$on("consoledebug",function(...arg){
|
||||
// debug.value.push(...arg)
|
||||
// })
|
||||
|
||||
|
||||
function openbug(){
|
||||
showdebug.value=!showdebug.value
|
||||
}
|
||||
// 子页面状态管理
|
||||
const state = ref([0, 0, 0, 0, 0, 0]) //0表示页面为加载 1 表示页面已加载并显示 2页面隐藏
|
||||
nextTick(() => {
|
||||
settab(0);
|
||||
})
|
||||
|
||||
|
||||
// 处理子页面弹窗 和详情页面打开 返回关闭详情页面不关闭应用
|
||||
let _isback = false;
|
||||
uni.$on('back', (e) => {
|
||||
|
|
@ -138,6 +162,11 @@
|
|||
uni.$emit('close')
|
||||
return _isback
|
||||
})
|
||||
|
||||
// 监听设备状态
|
||||
uni.$on("SHEBEISTATUS", (e) => {
|
||||
devices.value = e.devices;
|
||||
})
|
||||
uni.$on('LOGOUT', () => {
|
||||
// 清除token
|
||||
// 断WebSocket
|
||||
|
|
@ -157,26 +186,14 @@
|
|||
// #endif
|
||||
|
||||
})
|
||||
let _getequipment;
|
||||
onShow(() => {
|
||||
// 获取设备信息
|
||||
clearInterval(_getequipment)
|
||||
getequipmentinfo()
|
||||
_getequipment=setInterval(()=>{
|
||||
getequipmentinfo()
|
||||
},10000)
|
||||
|
||||
uni.senSkt("SHEBEISDATATATUS")
|
||||
})
|
||||
onLoad(() => {
|
||||
|
||||
})
|
||||
|
||||
onUnload(()=>{
|
||||
clearInterval(_getequipment)
|
||||
})
|
||||
//定时获取设备信息
|
||||
function getequipmentinfo(){
|
||||
getequipment().then(r => {
|
||||
allDevices.value = r.data ? r.data.allDevices : []
|
||||
})
|
||||
}
|
||||
// 退出登录
|
||||
function outsignOut() {
|
||||
showout.value = false;
|
||||
|
|
@ -293,6 +310,34 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.debug{
|
||||
position: fixed;
|
||||
width: 320rpx;
|
||||
background: #fff;
|
||||
right: -320rpx;
|
||||
transition:0.3s;
|
||||
top: 0rpx;
|
||||
height: 100vh;
|
||||
z-index: 222;
|
||||
padding: 15rpx;
|
||||
box-shadow: 0px 10rpx 1rpx #eee;
|
||||
&.on{
|
||||
right: 0rpx;
|
||||
}
|
||||
scroll-view{
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.BUG{
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
right: 0rpx;
|
||||
background: red;
|
||||
color: #fff;
|
||||
font-size: 12rpx;
|
||||
padding: 3rpx 5rpx;
|
||||
z-index: 223;
|
||||
}
|
||||
.popUpNotificationout {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
|
|
@ -360,10 +405,12 @@
|
|||
margin-bottom: 18rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.text {
|
||||
color: #B9BAC9;
|
||||
|
||||
}
|
||||
|
||||
&.on {
|
||||
.l {
|
||||
background: linear-gradient(45deg, #4F8AFF 0%, #4B5EFF 100%);
|
||||
|
|
@ -474,6 +521,7 @@
|
|||
color: rgba(255, 255, 255, 0.4);
|
||||
font-size: 11rpx;
|
||||
margin: 0rpx 8rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
image {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
</view>
|
||||
<view class="rbox">
|
||||
<block v-if="type==1">
|
||||
<view class="fn" v-if="!yesok" @click="showupimg=true">暂扣</view>
|
||||
<view class="fn" v-if="!yesok" @click="upimg()">暂扣</view>
|
||||
<view class="fn red " :class="{aft:tips}" v-if="yesok" @click="setwithhold">
|
||||
确认暂扣
|
||||
<view class="tc" v-if="tips">
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
</block>
|
||||
<block v-else-if="type==2">
|
||||
<block v-if="info.type">
|
||||
<view class="fn fx" v-if="!yesok" @click="showupimg=true">放行</view>
|
||||
<view class="fn fx" v-if="!yesok" @click="upimg()">放行</view>
|
||||
<view class="fn yfx" :class="{aft:tips}" v-if="yesok" @click="setrelease">
|
||||
确认放行
|
||||
<view class="tc" v-if="tips">
|
||||
|
|
@ -33,8 +33,7 @@
|
|||
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="fn released" v-if="info.basicInfo?.status==4" >已放行</view>
|
||||
<view class="fn fx" v-else style="opacity: 0;">站位</view>
|
||||
<view class="fn released" >{{info.basicInfo?.statusText}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -65,7 +64,7 @@
|
|||
</view>
|
||||
<view class="txt">
|
||||
{{info.intervalInfo?.startDeviceJson?.position}}
|
||||
<view>{{info.intervalInfo?.startDeviceJson?.longitude.toFixed(6)}} / {{info.intervalInfo?.startDeviceJson?.latitude.toFixed(6)}}</view>
|
||||
<view>{{info.intervalInfo?.startDeviceJson?.longitude}} / {{info.intervalInfo?.startDeviceJson?.latitude}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -75,7 +74,7 @@
|
|||
</view>
|
||||
<view class="txt">
|
||||
{{info.intervalInfo?.endDeviceJson?.position}}
|
||||
<view>{{info.intervalInfo?.endDeviceJson?.longitude.toFixed(6)}} / {{info.intervalInfo?.endDeviceJson?.latitude.toFixed(6)}}</view>
|
||||
<view>{{info.intervalInfo?.endDeviceJson?.longitude}} / {{info.intervalInfo?.endDeviceJson?.latitude}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -332,7 +331,9 @@
|
|||
function upimg() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType:["camera"],
|
||||
success: function(res) {
|
||||
showupimg.value = true;
|
||||
uni.uploadFile({
|
||||
url: evn.SERVERUL + '/file/upload', //仅为示例,非真实的接口地址
|
||||
filePath: res.tempFilePaths[0],
|
||||
|
|
@ -350,8 +351,9 @@
|
|||
reset()
|
||||
encoding.value=id;
|
||||
type.value = indextype
|
||||
showupimg.value = true;
|
||||
|
||||
// 先拍照在弹窗
|
||||
upimg()
|
||||
getinfo()
|
||||
}
|
||||
|
||||
|
|
@ -370,33 +372,42 @@
|
|||
// 确认暂扣
|
||||
function setwithhold(){
|
||||
detainVehicle({encoding:encoding.value,releaseImageUrl:imgs.value}).then(r=>{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '已暂扣',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '已暂扣',
|
||||
// showCancel:false,
|
||||
// success: function (res) {
|
||||
// reset()
|
||||
// // 刷新列表通知
|
||||
// Emits("refresh")
|
||||
// uni.navigateBack()
|
||||
// }
|
||||
// });
|
||||
reset()
|
||||
// 刷新列表通知
|
||||
Emits("refresh")
|
||||
uni.navigateBack()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
// 确认放行
|
||||
function setrelease(){
|
||||
releaseVehicle({encoding:encoding.value,releaseImageUrl:imgs.value}).then(r=>{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '已放行',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '已放行',
|
||||
// showCancel:false,
|
||||
// success: function (res) {
|
||||
// reset()
|
||||
// // 刷新列表通知
|
||||
// Emits("refresh")
|
||||
// uni.navigateBack()
|
||||
// }
|
||||
// });
|
||||
|
||||
reset()
|
||||
// 刷新列表通知
|
||||
Emits("refresh")
|
||||
uni.navigateBack()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</view>
|
||||
<view class="right">
|
||||
<input placeholder="搜索超速车辆" v-model="vehicleNumber" @confirm='confirm(e)' />
|
||||
<uni-icons type="search" size="16rpx"></uni-icons>
|
||||
<uni-icons type="search" size="16rpx" @click='confirm()'></uni-icons>
|
||||
</view>
|
||||
<view class="reset" @click="emptydata">重置</view>
|
||||
</view>
|
||||
|
|
@ -305,6 +305,7 @@
|
|||
|
||||
input {
|
||||
font-size: 11rpx;
|
||||
width: calc(100% - 30rpx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
timeFormat
|
||||
} from '@/uni_modules/uv-ui-tools/libs/function/index.js';
|
||||
// 分页相关
|
||||
const pageSize = ref(40);
|
||||
const pageSize = ref(5);
|
||||
const pageNum = ref(1);
|
||||
const hasNextPage = ref(true)
|
||||
const getdata = ref(new Date().getTime())
|
||||
|
|
@ -66,21 +66,13 @@
|
|||
}
|
||||
|
||||
function hide() {
|
||||
clearInterval(_getequipment)
|
||||
|
||||
}
|
||||
let _getequipment;
|
||||
|
||||
function show() {
|
||||
|
||||
|
||||
getequipmentinfo()
|
||||
|
||||
// 定时刷新设备状态
|
||||
clearInterval(_getequipment)
|
||||
function getinfo(){
|
||||
getequipment().then(r => {
|
||||
// 监听设备状态
|
||||
uni.$on("SHEBEISTATUS", (e) => {
|
||||
try{
|
||||
if(r.data.allDevices[0].status==2 && r.data.allDevices[1].status==2){
|
||||
if(e.devices[0].status==2 && e.devices[1].status==2){
|
||||
type.value=2;
|
||||
}else{
|
||||
type.value=1;
|
||||
|
|
@ -89,13 +81,11 @@
|
|||
type.value=1;
|
||||
}
|
||||
})
|
||||
}
|
||||
getinfo()
|
||||
_getequipment = setInterval(() => {
|
||||
getinfo()
|
||||
}, 10000)
|
||||
function show() {
|
||||
// 获取设备信息
|
||||
|
||||
getequipmentinfo()
|
||||
|
||||
console.log('过车信息show')
|
||||
}
|
||||
// 设置设备ID
|
||||
function setdeviceid(id) {
|
||||
|
|
@ -108,7 +98,8 @@
|
|||
reset()
|
||||
getequipment().then(r => {
|
||||
devices.value = r.data.allDevices;
|
||||
deviceId.value = devices.value[0].encoding
|
||||
deviceId.value = devices.value[0].encoding;
|
||||
|
||||
getinfo()
|
||||
})
|
||||
}
|
||||
|
|
@ -127,7 +118,8 @@
|
|||
infodata.value = r.data;
|
||||
daytiem.value = r.data.vehicleList[0] ? new Date(r.data.vehicleList[0].queryTime).getTime() :
|
||||
new Date().getTime();
|
||||
list.value = list.value.concat(r.data.vehicleList)
|
||||
|
||||
list.value = r.data.vehicleList
|
||||
hasNextPage.value = r.data.hasNextPage;
|
||||
settiem()
|
||||
})
|
||||
|
|
@ -143,7 +135,9 @@
|
|||
// 监听推送数据
|
||||
uni.onSkt("SERCHNEWDATA", (res) => {
|
||||
if (res.deviceId == deviceId.value) {
|
||||
list.value = [...res.viewList, ...list.value]
|
||||
list.value = [...res.viewList, ...list.value].splice(0,5)
|
||||
|
||||
|
||||
infodata.value.todayCount = infodata.value.todayCount + res.viewList.length;
|
||||
daytiem.value = new Date().getTime();
|
||||
clearInterval(_eliminate)
|
||||
|
|
@ -154,17 +148,22 @@
|
|||
})
|
||||
|
||||
function timeAgo() {
|
||||
const now = new Date();
|
||||
const past = new Date(daytiem.value);
|
||||
|
||||
const now = new Date().getTime();
|
||||
const past = daytiem.value;
|
||||
// uni.log(now.getTime(),past.getTime())
|
||||
const seconds = Math.floor((now - past) / 1000);
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const days = Math.floor(hours / 24);
|
||||
const years = Math.floor(days / 365);
|
||||
|
||||
if (years > 0) return `${years}年前`;
|
||||
if (days > 0) return `${days}天前`;
|
||||
if (hours > 0) return `${hours}小时前`;
|
||||
if (minutes > 0) return `${minutes}分钟前`;
|
||||
|
||||
|
||||
return `${seconds>=0?seconds:0}秒前`;
|
||||
}
|
||||
|
||||
|
|
@ -281,7 +280,7 @@
|
|||
|
||||
.li {
|
||||
display: flex;
|
||||
padding: 14rpx 15rpx;
|
||||
padding: 12rpx 15rpx;
|
||||
background: #fff;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
<view class="verticalLine"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myposition" @click="setcenter" v-if="showmap">
|
||||
<!-- <view class="myposition" @click="setcenter" v-if="showmap">
|
||||
<uni-icons type="map-pin-ellipse" size="20rpx"></uni-icons>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="right">
|
||||
|
|
@ -145,20 +145,26 @@
|
|||
window.BMapGL_loadScriptTime = (new Date).getTime();
|
||||
window.BMapGL = window.BMapGL || {};
|
||||
window.BMapGL.apiLoad = function() {
|
||||
console.log("地图加载完毕")
|
||||
delete window.BMapGL.apiLoad;
|
||||
console.log("创还能地图实例")
|
||||
_map = new BMapGL.Map('baiduimap'); // 创建Map实例
|
||||
var point = new BMapGL.Point(116.404, 39.915); // 创建点坐
|
||||
_map.centerAndZoom(point, 13);
|
||||
_map.enableScrollWheelZoom();
|
||||
console.log("创建完毕")
|
||||
var localcity = new BMapGL.LocalCity();
|
||||
localcity.get(e => {
|
||||
point = new BMapGL.Point(e.center.lng, e.center.lat);
|
||||
_map.setCenter(point);
|
||||
})
|
||||
fn()
|
||||
};
|
||||
var s = document.createElement('script');
|
||||
s.src =
|
||||
`https://api.map.baidu.com/getscript?type=webgl&v=1.0&ak=${BAIDUKEY}&services=&t=${window.BMapGL_loadScriptTime}`;
|
||||
document.body.appendChild(s);
|
||||
|
||||
|
||||
|
||||
|
||||
var link = document.createElement('link');
|
||||
link.setAttribute('rel', 'stylesheet');
|
||||
link.setAttribute('type', 'text/css');
|
||||
|
|
@ -228,21 +234,32 @@
|
|||
})
|
||||
|
||||
},
|
||||
setcenter(e) {
|
||||
if (_map) {
|
||||
mapsetcenter(e) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var point;
|
||||
if (e.type) {
|
||||
point = new BMapGL.Point(e.data.longitude, e.data.latitude);
|
||||
} else {
|
||||
point = new BMapGL.Point(e.longitude, e.latitude);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_map.setCenter(point);
|
||||
}
|
||||
this.mapsetEmit({
|
||||
type: e.type,
|
||||
data: {}
|
||||
})
|
||||
},
|
||||
|
||||
showsetcenter(e) {
|
||||
if (_map) {
|
||||
console.log(6666666)
|
||||
_map.clearOverlays()
|
||||
var point = new BMapGL.Point(e.data.longitude, e.data.latitude);
|
||||
_map.setCenter(point);
|
||||
|
|
@ -256,8 +273,10 @@
|
|||
drawpolyline(e) {
|
||||
|
||||
let _this = this;
|
||||
|
||||
var transit = new BMapGL.DrivingRoute(_map, {
|
||||
onSearchComplete: (results) => {
|
||||
|
||||
let _Distance = 0; //单位KM
|
||||
let _Polylines = [];
|
||||
if (!results._plans) {
|
||||
|
|
@ -309,6 +328,7 @@
|
|||
this.marker2 = {}
|
||||
if (this.marker1.point) {
|
||||
// 重新绘制第一个
|
||||
|
||||
draw(1, this.marker1.point, e.data.id)
|
||||
}
|
||||
}
|
||||
|
|
@ -318,6 +338,7 @@
|
|||
this.marker1 = {}
|
||||
if (this.marker2.point) {
|
||||
// 重新绘制第二个
|
||||
|
||||
draw(2, this.marker2.point, e.data.id)
|
||||
}
|
||||
}
|
||||
|
|
@ -388,9 +409,9 @@
|
|||
_this.marker2.point = center
|
||||
}
|
||||
// 稍微移动下确认位置
|
||||
var _center = _map.getCenter();
|
||||
var _point = new BMapGL.Point(_center.lng, _center.lat - 0.02);
|
||||
_map.setCenter(_point);
|
||||
// var _center = _map.getCenter();
|
||||
// var _point = new BMapGL.Point(_center.lng, _center.lat - 0.02);
|
||||
// _map.setCenter(_point);
|
||||
|
||||
_map.addOverlay(customOverlay);
|
||||
|
||||
|
|
@ -449,6 +470,7 @@
|
|||
}
|
||||
|
||||
if (this.marker2.point && this.marker1.point) {
|
||||
|
||||
this.drawpolyline(e);
|
||||
}
|
||||
},
|
||||
|
|
@ -462,7 +484,6 @@
|
|||
_this[e.type](e);
|
||||
})
|
||||
}
|
||||
|
||||
if (_map) {
|
||||
if (e.type && suspend == false) {
|
||||
suspend = true;
|
||||
|
|
@ -470,12 +491,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
clearTimeout(timing)
|
||||
// 一秒没回馈清除
|
||||
timing = setTimeout(function() {
|
||||
suspend = false;
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
mapsetEmit(e) {
|
||||
suspend = false;
|
||||
|
|
@ -494,7 +515,7 @@
|
|||
getpassingTheCar,
|
||||
setSettings
|
||||
} from "/appapi/index.js"
|
||||
|
||||
let map;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -577,24 +598,40 @@
|
|||
})
|
||||
return
|
||||
}
|
||||
setSettings({
|
||||
equipment: [{
|
||||
let _data={
|
||||
distance: this.Distance,
|
||||
speed: this.speed,
|
||||
warningLevel: this.speeding,
|
||||
equipment:[{
|
||||
encoding: this.pointPosition1.id,
|
||||
position: "",
|
||||
longitude: "",
|
||||
latitude: "",
|
||||
},
|
||||
{
|
||||
encoding: this.pointPosition2.id,
|
||||
position: "",
|
||||
longitude: "",
|
||||
latitude: "",
|
||||
}]
|
||||
}
|
||||
if(this.pointPosition1.point && this.pointPosition2.point){
|
||||
_data["equipment"]=[
|
||||
{
|
||||
encoding: this.pointPosition1.id,
|
||||
position: this.pointPosition1.address.address,
|
||||
longitude: this.pointPosition1.point.lng,
|
||||
latitude: this.pointPosition1.point.lat,
|
||||
longitude: this.pointPosition1.point.lng.toFixed(6),
|
||||
latitude: this.pointPosition1.point.lat.toFixed(6),
|
||||
},
|
||||
{
|
||||
encoding: this.pointPosition2.id,
|
||||
position: this.pointPosition2.address.address,
|
||||
longitude: this.pointPosition2.point.lng,
|
||||
latitude: this.pointPosition2.point.lat,
|
||||
longitude: this.pointPosition2.point.lng.toFixed(6),
|
||||
latitude: this.pointPosition2.point.lat.toFixed(6),
|
||||
}
|
||||
],
|
||||
distance: this.Distance,
|
||||
speed: this.speed,
|
||||
warningLevel: this.speeding
|
||||
}).then(r => {
|
||||
]
|
||||
}
|
||||
setSettings(_data).then(r => {
|
||||
uni.showToast({
|
||||
title: "已修改",
|
||||
icon: "success"
|
||||
|
|
@ -602,32 +639,105 @@
|
|||
})
|
||||
},
|
||||
load() {
|
||||
|
||||
|
||||
// #ifdef APP
|
||||
map = plus.maps.create('map', {
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: '0%',
|
||||
height: '0px',
|
||||
position: 'static'
|
||||
});
|
||||
plus.webview.currentWebview().append(map);
|
||||
// #endif
|
||||
},
|
||||
hide() {},
|
||||
setcenter() {
|
||||
uni.showLoading({
|
||||
title: "....."
|
||||
})
|
||||
uni.getLocation({
|
||||
type: "gcj02",
|
||||
success: (res) => {
|
||||
hide() {
|
||||
this.showmap = false;
|
||||
|
||||
this.setEmit({
|
||||
type: "setcenter",
|
||||
type: "clearmap",
|
||||
data: {
|
||||
...res,
|
||||
type: this.type,
|
||||
id: this.pointPosition1.id
|
||||
|
||||
}
|
||||
}, () => {
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
setcenter() {
|
||||
let _this = this;
|
||||
|
||||
uni.showLoading({
|
||||
title: "....."
|
||||
})
|
||||
// #ifdef APP
|
||||
map.getUserLocation(function(e, point) {
|
||||
uni.hideLoading()
|
||||
if( point.latitude && point.latitude>0){
|
||||
|
||||
// 坐标转换
|
||||
// https://blog.csdn.net/xiasohuai/article/details/104426647
|
||||
var x_PI = 3.14159265358979324 * 3000.0 / 180.0;
|
||||
var PI = 3.1415926535897932384626;
|
||||
var a = 6378245.0;
|
||||
var ee = 0.00669342162296594323;
|
||||
function gcj02tobd09(lng, lat) {
|
||||
var z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_PI);
|
||||
var theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_PI);
|
||||
var bd_lng = z * Math.cos(theta) + 0.0065;
|
||||
var bd_lat = z * Math.sin(theta) + 0.006;
|
||||
return [bd_lng, bd_lat]
|
||||
}
|
||||
|
||||
|
||||
_this.setEmit({
|
||||
type: "mapsetcenter",
|
||||
data: {
|
||||
latitude:gcj02tobd09(point.longitude,point.latitude)[1],
|
||||
longitude:gcj02tobd09(point.longitude,point.latitude)[0],
|
||||
type: _this.type,
|
||||
id: _this.pointPosition1.id
|
||||
}
|
||||
})
|
||||
|
||||
// _this.setEmit({
|
||||
// type: "mapsetcenter",
|
||||
// data: {
|
||||
// latitude: point.latitude,
|
||||
// longitude: point.longitude,
|
||||
// type: _this.type,
|
||||
// id: _this.pointPosition1.id
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
})
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
uni.getLocation({
|
||||
success: (res) => {
|
||||
try {
|
||||
uni.hideLoading()
|
||||
_this.setEmit({
|
||||
type: "mapsetcenter",
|
||||
data: {
|
||||
latitude: res.latitude,
|
||||
longitude: res.longitude,
|
||||
type: _this.type,
|
||||
id: _this.pointPosition1.id
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading()
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
show() {
|
||||
let _this = this;
|
||||
|
|
@ -665,26 +775,10 @@
|
|||
this.Distance = r.data.distance;
|
||||
this.speeding = r.data.warningLevel;
|
||||
this.speed = r.data.speed;
|
||||
|
||||
|
||||
|
||||
if (!this.pointPosition1.point && !this.pointPosition2.point) {
|
||||
this.showmap = true;
|
||||
uni.getLocation({
|
||||
type: "gcj02",
|
||||
success: (res) => {
|
||||
this.setEmit({
|
||||
type: "showsetcenter",
|
||||
data: {
|
||||
...res,
|
||||
type: this.type,
|
||||
id: this.pointPosition1.id
|
||||
}
|
||||
}, () => {
|
||||
// this.setcenter()
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.showmap = false;
|
||||
this.setEmit({
|
||||
|
|
@ -719,10 +813,10 @@
|
|||
this.Distance = "";
|
||||
let _id;
|
||||
if (this.type == 1) {
|
||||
_id = this.pointPosition1.id;
|
||||
_id = this.pointPosition2.id;
|
||||
}
|
||||
if (this.type == 2) {
|
||||
_id = this.pointPosition2.id;
|
||||
_id = this.pointPosition1.id;
|
||||
}
|
||||
this.setEmit({
|
||||
type: "removemarker",
|
||||
|
|
@ -786,6 +880,7 @@
|
|||
},
|
||||
// renderjs 和页面通讯相关方法
|
||||
setEmit(e, fn) {
|
||||
|
||||
uni.$off(e.type)
|
||||
uni.$once(e.type, function(data) {
|
||||
fn && fn(data || '')
|
||||
|
|
@ -794,6 +889,7 @@
|
|||
...e,
|
||||
day: new Date().getTime()
|
||||
})
|
||||
|
||||
},
|
||||
getEmit(e) {
|
||||
uni.$emit(e.type, e.data || '')
|
||||
|
|
@ -932,10 +1028,10 @@
|
|||
margin-bottom: 10rpx;
|
||||
|
||||
.name {
|
||||
width: 44rpx;
|
||||
width: 50rpx;
|
||||
font-size: 11rpx;
|
||||
padding: 8rpx 0;
|
||||
white-space: nowrap;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
let allnum = r.overspeedStatistics.overspeedOver50 + r.overspeedStatistics.overspeed20To50 + r
|
||||
.overspeedStatistics.overspeed10To20 + r.overspeedStatistics.overspeedUnder10
|
||||
myChart = echarts.init(document.getElementById("echart"))
|
||||
console.log(5555,allnum)
|
||||
|
||||
myChart.setOption({
|
||||
|
||||
grid: {
|
||||
|
|
@ -257,7 +257,7 @@
|
|||
|
||||
<style scoped lang="scss">
|
||||
.charts-box {
|
||||
height: 150rpx;
|
||||
height: 140rpx;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@
|
|||
const status = ref(2)
|
||||
|
||||
// 分页相关
|
||||
const pageSize = ref(50);
|
||||
const pageSize = ref(20);
|
||||
const pageNum = ref(1);
|
||||
const hasNextPage = ref(true)
|
||||
let timer;
|
||||
|
|
@ -126,35 +126,39 @@
|
|||
function load() {
|
||||
console.log('预警信息load')
|
||||
}
|
||||
function tips(){
|
||||
|
||||
function tips() {
|
||||
uni.showToast({
|
||||
title:"未到放行时间",icon:"error"
|
||||
title: "未到放行时间",
|
||||
icon: "error"
|
||||
})
|
||||
}
|
||||
// 更新放行状态
|
||||
upreleasetype()
|
||||
function upreleasetype(){
|
||||
|
||||
function upreleasetype() {
|
||||
// 清除定制任务 避免多个定时任务
|
||||
clearInterval(timer)
|
||||
function gettype(){
|
||||
|
||||
function gettype() {
|
||||
// 只有暂扣车辆列表
|
||||
if(status.value==3){
|
||||
info.value.data.map((res,index)=>{
|
||||
if(new Date().getTime()>new Date(res.restDurationEndtime).getTime()){
|
||||
if (status.value == 3) {
|
||||
info.value.data.map((res, index) => {
|
||||
if (new Date().getTime() > new Date(res.restDurationEndtime).getTime()) {
|
||||
// 可放行
|
||||
info.value.data[index]['type']=1;
|
||||
}else{
|
||||
info.value.data[index]['type'] = 1;
|
||||
} else {
|
||||
// 不可放行
|
||||
info.value.data[index]['type']=0;
|
||||
info.value.data[index]['type'] = 0;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
gettype()
|
||||
// 重启定时任务
|
||||
timer=setInterval(()=>{
|
||||
timer = setInterval(() => {
|
||||
gettype()
|
||||
},1000)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -201,7 +205,6 @@
|
|||
...r.data,
|
||||
data: info.value.data.concat(r.data.data)
|
||||
};
|
||||
|
||||
hasNextPage.value = r.data.hasPreviousPage;
|
||||
pageNum.value = pageNum.value + 1;
|
||||
})
|
||||
|
|
@ -218,22 +221,36 @@
|
|||
|
||||
}
|
||||
|
||||
const itemanimation=ref(false)
|
||||
const itemanimation = ref(false)
|
||||
// 监听推送数据
|
||||
uni.onSkt("SPEEDNEWDATA", (res) => {
|
||||
// 预警列表接收推送数据
|
||||
if (status.value == 2) {
|
||||
itemanimation.value=true;
|
||||
info.value.data = [...res, ...info.value.data]
|
||||
setTimeout(()=>{
|
||||
itemanimation.value=false;
|
||||
},50)
|
||||
itemanimation.value = true;
|
||||
let _list = res;
|
||||
|
||||
// 过滤同车牌同时间
|
||||
if (info.value.data.length) {
|
||||
_list = res.filter(r => {
|
||||
return (r.vehicleNumber == info.value.data[0].vehicleNumber && r.queryTime != info
|
||||
.value.data[0].queryTime) ||
|
||||
r.vehicleNumber != info.value.data[0].vehicleNumber
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
info.value.data = [..._list, ...info.value.data].splice(0, 20)
|
||||
setTimeout(() => {
|
||||
itemanimation.value = false;
|
||||
}, 50)
|
||||
|
||||
// #ifdef APP
|
||||
res.map(r=>{
|
||||
res.map(r => {
|
||||
uni.createPushMessage({
|
||||
title: "超速预警",
|
||||
content: `${r.vehicleNumber}超速${r.overspeedRatio}`
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
// #endif
|
||||
|
|
@ -279,16 +296,18 @@
|
|||
padding: 10rpx 15rpx;
|
||||
position: relative;
|
||||
left: 0%;
|
||||
transition:0.5s;
|
||||
transition: 0.5s;
|
||||
height: 75rpx;
|
||||
opacity: 1;
|
||||
&.hide{
|
||||
|
||||
&.hide {
|
||||
left: 100%;
|
||||
height: 0rpx;
|
||||
transition:0s;
|
||||
transition: 0s;
|
||||
opacity: 0;
|
||||
}
|
||||
&.show{
|
||||
|
||||
&.show {
|
||||
|
||||
left: 0%;
|
||||
|
||||
|
|
@ -464,6 +483,7 @@
|
|||
|
||||
input {
|
||||
font-size: 11rpx;
|
||||
width: calc(100% - 40rpx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
记住密码
|
||||
</view>
|
||||
<view class="submit" @click="submit">登录</view>
|
||||
|
||||
<view class="appWgtVersion">版本号:{{appWgtVersion}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -45,8 +45,14 @@
|
|||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
|
||||
|
||||
const appWgtVersion=ref("0.0.0")
|
||||
// #ifdef APP
|
||||
let platform = plus.os.name.toLocaleLowerCase()
|
||||
let info = uni.getSystemInfoSync()
|
||||
console.log(info)
|
||||
appWgtVersion.value=info.appWgtVersion
|
||||
console.log(platform,'版本名'+info.appWgtVersion,'版本号'+info.appVersionCode)
|
||||
// #endif
|
||||
|
||||
const isname = ref(false);
|
||||
const ispassword = ref(false);
|
||||
|
|
@ -100,6 +106,10 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.appWgtVersion{
|
||||
font-size: 11rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.page {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
|
|
|||
Loading…
Reference in New Issue