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