This commit is contained in:
parent
1694f91e7a
commit
20d99621fa
31
App.vue
31
App.vue
|
|
@ -4,10 +4,13 @@
|
|||
export default {
|
||||
onLaunch: function() {
|
||||
// 生成设备唯一码
|
||||
// upapp()
|
||||
|
||||
uni.getPushClientId({
|
||||
success: (res) => {}
|
||||
})
|
||||
let _Android =uni.getStorageSync('cid') || new Date().getTime()
|
||||
// #ifdef APP
|
||||
|
||||
// 获取设备码
|
||||
function getAndroidId() {
|
||||
plus.android.importClass("android.provider.Settings");
|
||||
|
|
@ -22,17 +25,39 @@
|
|||
if (uni.getStorageSync('token')) {
|
||||
soket()
|
||||
uni.reLaunch({
|
||||
url: "/pages/index"
|
||||
url: "/pages/index",
|
||||
success() {
|
||||
// #ifdef APP-PLUS
|
||||
// 检查是否要更新APP
|
||||
setTimeout(()=>{
|
||||
upapp()
|
||||
},1000)
|
||||
|
||||
// #endif
|
||||
}
|
||||
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: "/pages/signIn"
|
||||
url: "/pages/signIn",
|
||||
success() {
|
||||
// #ifdef APP-PLUS
|
||||
// 检查是否要更新APP
|
||||
setTimeout(()=>{
|
||||
upapp()
|
||||
},1000)
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
plus.navigator.setFullscreen(true)
|
||||
|
||||
}, 500)
|
||||
|
||||
|
||||
|
||||
// #endif
|
||||
},
|
||||
onShow: function() {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@
|
|||
"Geolocation" : {},
|
||||
"LivePusher" : {},
|
||||
"VideoPlayer" : {},
|
||||
"Camera" : {}
|
||||
"Camera" : {},
|
||||
"Push" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
|
|
@ -41,9 +42,14 @@
|
|||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAG\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.QUERY_ALL_PACKAGES\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_TASKS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
|
|
@ -70,7 +76,12 @@
|
|||
"appkey_android" : "nWnzss8CKEBKcBLoYUdVybkrKl4o2izT"
|
||||
}
|
||||
},
|
||||
"statics" : {}
|
||||
"statics" : {},
|
||||
"push" : {
|
||||
"unipush" : {
|
||||
"offline" : false
|
||||
}
|
||||
}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
|
|
@ -106,18 +117,25 @@
|
|||
}
|
||||
},
|
||||
"nativePlugins" : {
|
||||
"hk-preview" : {
|
||||
"AS-HikVideoModule" : {
|
||||
"android_appid" : "blyc.qjcs.com",
|
||||
"__plugin_info__" : {
|
||||
"name" : "海康视频实时预览插件",
|
||||
"description" : "海康摄像头录像机直连插件,实现设备视频预览和云台控制",
|
||||
"name" : "海康摄像头插件 - [试用版,仅用于自定义调试基座]",
|
||||
"description" : "基于海康SDK开发,支持视频实时预览、视频抓拍、录像、摄像头旋转、缩放及回预置点等操作,支付后联系QQ提供源码,可根据需求有偿修改",
|
||||
"platforms" : "Android",
|
||||
"url" : "https://ext.dcloud.net.cn/plugin?id=1981",
|
||||
"android_package_name" : "blyc.qjcs.com",
|
||||
"url" : "https://ext.dcloud.net.cn/plugin?id=7190",
|
||||
"android_package_name" : "",
|
||||
"ios_bundle_id" : "",
|
||||
"isCloud" : true,
|
||||
"bought" : 1,
|
||||
"pid" : "1981",
|
||||
"parameters" : {}
|
||||
"bought" : 0,
|
||||
"pid" : "7190",
|
||||
"parameters" : {
|
||||
"android_appid" : {
|
||||
"des" : "参数描述",
|
||||
"key" : "TM123456",
|
||||
"value" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
74
pages.json
74
pages.json
|
|
@ -7,41 +7,77 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index",
|
||||
"path": "pages/subNVue/camera",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"app-plus":{
|
||||
"subNVues": [{
|
||||
"id": "hkcamera", // 唯一标识
|
||||
"path": "pages/subNVue/camera" // 页面路径
|
||||
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/signIn",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
"navigationStyle": "custom",
|
||||
"app-plus": {
|
||||
"bounce": "none",
|
||||
"scrollIndicator": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/upapp",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"animationDuration": 200,
|
||||
"animationType": "fade-in",
|
||||
"background": "transparent",
|
||||
"backgroundColorTop": "transparent",
|
||||
"popGesture": "none",
|
||||
"scrollIndicator": false,
|
||||
"titleNView": false
|
||||
},
|
||||
"disableScroll": true
|
||||
}
|
||||
"path": "pages/upapp",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"animationDuration": 200,
|
||||
"animationType": "fade-in",
|
||||
"background": "transparent",
|
||||
"backgroundColorTop": "transparent",
|
||||
"popGesture": "none",
|
||||
"scrollIndicator": "none",
|
||||
"titleNView": false,
|
||||
"bounce": "none"
|
||||
},
|
||||
"navigationStyle": "custom",
|
||||
"background": "transparent",
|
||||
"backgroundColorTop": "transparent",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"animationDuration": 200,
|
||||
"animationType": "fade-in",
|
||||
"background": "transparent",
|
||||
"backgroundColorTop": "transparent",
|
||||
"popGesture": "none",
|
||||
"scrollIndicator": false,
|
||||
"titleNView": false
|
||||
},
|
||||
"disableScroll": true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "区间测速",
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"pageOrientation": "portrait",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
"pageOrientation": "portrait"
|
||||
|
||||
},
|
||||
"uniIdRouter": {}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="page" @click.stop="showsignOut=false">
|
||||
<view class="page" @click.stop="hidesub()">
|
||||
<view class="left">
|
||||
<view class="top">
|
||||
<view class="logo" @click.stop="showsignOut=true">
|
||||
|
|
@ -46,16 +46,9 @@
|
|||
</view>
|
||||
<view class="bottom">
|
||||
<view class="title">设备:</view>
|
||||
<!-- <view class="item on" :class="{on1:selectindex==5}" @click="settab(5)">
|
||||
<view class="l">
|
||||
<image src="/static/equipmenton.png"></image>
|
||||
<view class="name">设备001</view>
|
||||
</view>
|
||||
<view class="r"></view>
|
||||
</view> -->
|
||||
<view class="item" v-for="item in allDevices"
|
||||
:class="{on1:(selectindex==5 && Devicesid==item.id),on:item.status==2}"
|
||||
@click="setshowDevices(item)">
|
||||
@click.stop="setshowDevices(item)">
|
||||
<view class="l">
|
||||
<image src="/static/equipmentno.png"></image>
|
||||
<view class="name">设备{{item.encoding}}</view>
|
||||
|
|
@ -64,7 +57,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="right" id="rightbox">
|
||||
<view class="subpage" v-show="state[0]==1">
|
||||
<warningInformation ref="refwarningInformation" />
|
||||
</view>
|
||||
|
|
@ -101,8 +94,24 @@
|
|||
import statistics from "./pages/statistics.vue"
|
||||
import passingTheCar from "./pages/passingTheCar.vue"
|
||||
import warningInformation from "./pages/warningInformation.vue"
|
||||
import qjcamera from "./pages/camera.vue"
|
||||
|
||||
import qjcamera from "./pages/camera.nvue"
|
||||
// #ifdef APP-PLUS
|
||||
const subNVue = uni.getSubNVueById("hkcamera")
|
||||
subNVue.hide()
|
||||
nextTick(() => {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select("#rightbox")
|
||||
.boundingClientRect((data) => {
|
||||
subNVue.setStyle({
|
||||
width: data.width + 'px',
|
||||
right: "0px"
|
||||
})
|
||||
})
|
||||
.exec();
|
||||
})
|
||||
// #endif
|
||||
|
||||
import {
|
||||
nextTick,
|
||||
ref,
|
||||
|
|
@ -117,7 +126,7 @@
|
|||
onBackPress,
|
||||
onShow
|
||||
} from "@dcloudio/uni-app"
|
||||
|
||||
|
||||
// 页面管理
|
||||
const refhistory = ref()
|
||||
const refsetUp = ref()
|
||||
|
|
@ -129,7 +138,7 @@
|
|||
const showout = ref(false);
|
||||
const showsignOut = ref(false);
|
||||
// 结束
|
||||
|
||||
|
||||
// 设备
|
||||
const allDevices = ref([])
|
||||
const Devicesid = ref('')
|
||||
|
|
@ -138,18 +147,18 @@
|
|||
nextTick(() => {
|
||||
settab(0)
|
||||
})
|
||||
|
||||
|
||||
// 处理子页面弹窗 和详情页面打开 返回关闭详情页面不关闭应用
|
||||
let _isback=false;
|
||||
uni.$on('back',(e)=>{
|
||||
_isback=e;
|
||||
let _isback = false;
|
||||
uni.$on('back', (e) => {
|
||||
_isback = e;
|
||||
})
|
||||
onBackPress(()=>{
|
||||
onBackPress(() => {
|
||||
uni.$emit('close')
|
||||
return _isback
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
uni.$on('LOGOUT', () => {
|
||||
showout.value = true;
|
||||
})
|
||||
|
|
@ -157,7 +166,7 @@
|
|||
onShow(() => {
|
||||
// 获取设备信息
|
||||
getequipment().then(r => {
|
||||
allDevices.value =r.data?r.data.allDevices:[]
|
||||
allDevices.value = r.data ? r.data.allDevices : []
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -174,19 +183,43 @@
|
|||
})
|
||||
|
||||
}
|
||||
|
||||
function hidesub() {
|
||||
subNVue.hide('fade-out', 300)
|
||||
showsignOut.value=false;
|
||||
}
|
||||
// 打开设备页面
|
||||
function setshowDevices(item) {
|
||||
if (item.status == 2) {
|
||||
Devicesid.value = item.id;
|
||||
settab(5, {
|
||||
id: Devicesid.value
|
||||
})
|
||||
}
|
||||
|
||||
// subNVue.hide('fade-out', 300)
|
||||
// console.log(uni.getSubNVueById())
|
||||
// // 打开 nvue 子窗体
|
||||
|
||||
subNVue.show('slide-in', 500, function() {
|
||||
// 打开后进行一些操作...
|
||||
//
|
||||
});
|
||||
uni.$emit("xxxxx","555555")
|
||||
// 关闭 nvue 子窗体
|
||||
// subNVue.hide('fade-out', 300)
|
||||
// Devicesid.value = item.id;
|
||||
// settab(5, {
|
||||
// id: Devicesid.value
|
||||
// })
|
||||
// if (item.status == 2) {
|
||||
// Devicesid.value = item.id;
|
||||
// settab(5, {
|
||||
// id: Devicesid.value
|
||||
// })
|
||||
// }
|
||||
}
|
||||
// 查看网络状态
|
||||
uni.getNetworkType({
|
||||
success: function(res) {
|
||||
console.log(res.networkType);
|
||||
},
|
||||
fail(e) {
|
||||
console.log(e, 8888);
|
||||
}
|
||||
});
|
||||
// 监听网络状态
|
||||
|
|
@ -246,6 +279,7 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function logOut() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
|
@ -270,6 +304,7 @@
|
|||
left: 0px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 999999;
|
||||
|
||||
.box {
|
||||
position: absolute;
|
||||
width: 300rpx;
|
||||
|
|
|
|||
|
|
@ -1,221 +0,0 @@
|
|||
<template>
|
||||
<view class="camerapage">
|
||||
<view class="title">摄像头设置</view>
|
||||
<view class="box">
|
||||
<video class="video" object-fit='contain' src="https://media.w3.org/2010/05/sintel/trailer.mp4"></video>
|
||||
<!-- <sjy-vidbr :option="hp1option" bColor="#ffffff"></sjy-vidbr> -->
|
||||
|
||||
<view class="workbench">
|
||||
<view class="direction">
|
||||
<view class="item" v-for="(item,index) in 4" :class="{on:keyindex==index+1}"
|
||||
@touchstart="press(index+1)" @touchend="release()">
|
||||
<view class="icon">
|
||||
<uv-icon name="arrow-up-fill" :color="keyindex==index+1?'#fff':'#4D7BFF'"
|
||||
size="20rpx"></uv-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="key">
|
||||
<view class="item" :class="{on:keyindex==5}" @touchstart="press(5)" @touchend="release()">
|
||||
<image :src="`/static/camera/${keyindex==5?11:1}.png`"></image>
|
||||
调焦 -
|
||||
</view>
|
||||
<view class="item" :class="{on:keyindex==6}" @touchstart="press(6)" @touchend="release()">
|
||||
<image :src="`/static/camera/${keyindex==6?22:2}.png`"></image>
|
||||
调焦 +
|
||||
</view>
|
||||
<view class="item" :class="{on:keyindex==7}" @touchstart="press(7)" @touchend="release()">
|
||||
<image :src="`/static/camera/${keyindex==7?33:3}.png`"></image>
|
||||
聚焦 -
|
||||
</view>
|
||||
<view class="item" :class="{on:keyindex==8}" @touchstart="press(8)" @touchend="release()">
|
||||
<image :src="`/static/camera/${keyindex==8?44:4}.png`"></image>
|
||||
聚焦 +
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
|
||||
const keyindex = ref("")
|
||||
const hp1option = ref({
|
||||
width: 426 * 1.5,
|
||||
height: 240 * 1.5,
|
||||
})
|
||||
|
||||
function load() {
|
||||
console.log('预警信息load')
|
||||
}
|
||||
|
||||
function hide() {
|
||||
console.log('预警信息hide')
|
||||
}
|
||||
|
||||
function show() {
|
||||
console.log('预警信息show')
|
||||
}
|
||||
|
||||
function press(index) {
|
||||
keyindex.value = index;
|
||||
}
|
||||
|
||||
function release() {
|
||||
keyindex.value = "";
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
load,
|
||||
hide,
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.camerapage {
|
||||
padding: 15rpx;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 11rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.workbench {
|
||||
padding: 15rpx 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
|
||||
.key {
|
||||
|
||||
display: flex;
|
||||
gap: 20rpx 15rpx;
|
||||
width: 265rpx;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.item {
|
||||
|
||||
|
||||
background: linear-gradient(180deg, #F4F4F4 0%, #E3E7EE 78%, #DCE0EA 100%);
|
||||
box-shadow: 0rpx 0rpx 2rpx 0rpx rgba(0, 0, 0, 0.21), inset 0rpx 1rpx 1rpx 0rpx #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 125rpx;
|
||||
padding: 10rpx 15rpx;
|
||||
justify-content: center;
|
||||
border-radius: 100rpx;
|
||||
font-weight: 500;
|
||||
font-size: 11rpx;
|
||||
color: #223457;
|
||||
|
||||
&.on {
|
||||
background: linear-gradient(45deg, #4F8AFF 0%, #4B5EFF 100%);
|
||||
box-shadow: inset 0rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.33);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
margin-right: 15rpx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.direction {
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
|
||||
|
||||
background: linear-gradient(180deg, #F4F4F4 0%, #E3E7EE 78%, #DCE0EA 100%);
|
||||
border: 1rpx solid #d2d2d2;
|
||||
border-radius: 139rpx;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transform: rotate(45deg);
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
border-radius: 54rpx;
|
||||
z-index: 2;
|
||||
background: #fff;
|
||||
box-shadow: 0rpx 0rpx 2rpx 0rpx rgba(0, 0, 0, 0.21), inset 0rpx 1rpx 15rpx 0rpx rgba(0, 0, 0, 0.21);
|
||||
}
|
||||
|
||||
.item {
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
|
||||
position: absolute;
|
||||
transform-origin: 100% 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&.on {
|
||||
background: linear-gradient(45deg, #4F8AFF 0%, #4B5EFF 100%);
|
||||
box-shadow: inset 0rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.33);
|
||||
}
|
||||
|
||||
.icon {
|
||||
transform: rotate(-45deg);
|
||||
// margin-left: 10rpx;
|
||||
// margin-top: 10rpx;
|
||||
}
|
||||
|
||||
&:nth-of-type(2) {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
&:nth-of-type(3) {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
&:nth-of-type(4) {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
background: #fff;
|
||||
border-radius: 8rpx;
|
||||
overflow: hidden;
|
||||
margin-top: 15rpx;
|
||||
position: relative;
|
||||
|
||||
._video_r1 {}
|
||||
|
||||
|
||||
.video {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
border-radius: 8rpx 8rpx 0 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -142,7 +142,7 @@
|
|||
<view class="tbody">
|
||||
<view class="ul">
|
||||
<view class="title">暂扣时间</view>
|
||||
<view class="txt">{{info.detainTime?.detainTime || '/'}}</view>
|
||||
<view class="txt">{{info.detainInfo?.detainTime || '/'}}</view>
|
||||
<view class="title">放行时间</view>
|
||||
<view class="txt">{{info.releaseInfo?.releaseTime || '/'}}</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -250,6 +250,9 @@
|
|||
onSearchComplete: (results) => {
|
||||
let _Distance = 0; //单位KM
|
||||
let _Polylines = [];
|
||||
if(!results._plans){
|
||||
return
|
||||
}
|
||||
results._plans.map(r => {
|
||||
_Distance += r._distance;
|
||||
r._routes.map(res => {
|
||||
|
|
@ -383,10 +386,16 @@
|
|||
|
||||
},
|
||||
setpoint(e) {
|
||||
|
||||
|
||||
|
||||
// 删除所有覆盖物
|
||||
_map.clearOverlays()
|
||||
|
||||
// 设置坐标信息
|
||||
this.marker1.point = e.data.point1.point;
|
||||
this.marker2.point = e.data.point2.point;
|
||||
|
||||
|
||||
|
||||
// 绘制坐标
|
||||
function createDOM() {
|
||||
var div = document.createElement('div');
|
||||
|
|
|
|||
|
|
@ -70,11 +70,10 @@
|
|||
},
|
||||
updata(r) {
|
||||
|
||||
if (window.echarts) {
|
||||
let allnum=r.overspeedStatistics.overspeed50Plus+r.overspeedStatistics.overspeed20To50+r.overspeedStatistics.overspeed10To20+r.overspeedStatistics.overspeedUnder10
|
||||
if (window.echarts && r.overspeedStatistics) {
|
||||
let allnum=r.overspeedStatistics.overspeedOver50+r.overspeedStatistics.overspeed20To50+r.overspeedStatistics.overspeed10To20+r.overspeedStatistics.overspeedUnder10
|
||||
myChart = echarts.init(document.getElementById("echart"))
|
||||
myChart.setOption({
|
||||
|
||||
grid: {
|
||||
top: 20,
|
||||
right: 0,
|
||||
|
|
@ -84,9 +83,11 @@
|
|||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
axisLabel: { interval: 0 }
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
interval: 0,
|
||||
data: ["超速50%以上", "超速20%-50%", "超速10%-20%", "超速10%以下"]
|
||||
},
|
||||
series: [{
|
||||
|
|
@ -96,16 +97,16 @@
|
|||
label: {
|
||||
show: true,
|
||||
position: 'right',
|
||||
width:100,
|
||||
interval: 0,
|
||||
formatter:function(a){
|
||||
return Number(a.value/allnum*100).toFixed(2)+'%';
|
||||
return Number(a.value/allnum*100 || 0).toFixed(2)+'%';
|
||||
}
|
||||
},
|
||||
emphasis:{
|
||||
disabled:true
|
||||
},
|
||||
data: [
|
||||
r.overspeedStatistics.overspeed50Plus,
|
||||
r.overspeedStatistics.overspeedOver50,
|
||||
r.overspeedStatistics.overspeed20To50,
|
||||
r.overspeedStatistics.overspeed10To20,
|
||||
r.overspeedStatistics.overspeedUnder10,
|
||||
|
|
@ -126,7 +127,7 @@
|
|||
disabled:true
|
||||
},
|
||||
data: [
|
||||
r.overspeedStatistics.overspeed50Plus,
|
||||
r.overspeedStatistics.overspeedOver50,
|
||||
r.overspeedStatistics.overspeed20To50,
|
||||
r.overspeedStatistics.overspeed10To20,
|
||||
r.overspeedStatistics.overspeedUnder10,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@
|
|||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-view">
|
||||
<view v-for="item in info.data" class="item" @click.stop="listwithhold(item.encoding,status==2?1:2)">
|
||||
<view v-for="(item,index) in info.data" :class="{hide:itemanimation && index==0}" class="item"
|
||||
@click.stop="listwithhold(item.encoding,gettype(status))">
|
||||
<view class="left">
|
||||
<view class="t">
|
||||
<image v-if="status==2" src="/static/err.png"></image>
|
||||
|
|
@ -63,12 +64,12 @@
|
|||
<view class="thead">
|
||||
<view>待休息时长</view>
|
||||
<view>待放行时间</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<view>{{item.restDuration}}</view>
|
||||
<view>{{item.overspeedRatio}}</view>
|
||||
|
||||
<view>{{item.restDurationEndtime}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="center center3" v-if="status==4">
|
||||
|
|
@ -76,24 +77,24 @@
|
|||
<view>平均车速</view>
|
||||
<view>超速比例</view>
|
||||
<view>休息时长</view>
|
||||
<view>放行时间</view>
|
||||
<view style="flex: 1.5;">放行时间</view>
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<view>{{item.averageSpeed}}</view>
|
||||
<view>{{item.overspeedRatio}}</view>
|
||||
<view>{{item.restDuration}}</view>
|
||||
<view>{{item.restDuration}}</view>
|
||||
<view style="flex: 1.5;">{{item.releaseTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right red" v-if="status==2" @click.stop="withhold(item.encoding,1)">暂扣</view>
|
||||
<view class="right green" v-if="status==3" @click.stop="withhold(item.encoding,2)">放行</view>
|
||||
<view class="right red" v-if="status==2" @click.stop="withhold(item.encoding,1)">暂扣</view>
|
||||
<view class="right green" v-if="status==3" @click.stop="withhold(item.encoding,2)">放行</view>
|
||||
</view>
|
||||
<nynull v-if="!info.data?.length"></nynull>
|
||||
</scroll-view>
|
||||
<pageanimation v-model="showdetails" @close="refdetails.hide()" >
|
||||
<pageanimation v-model="showdetails" @close="refdetails.hide()">
|
||||
<pagedetails ref="refdetails" @opneinfo='opneshowdetails' @refresh="getinfo" />
|
||||
</pageanimation>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -104,53 +105,120 @@
|
|||
getwarningList
|
||||
} from "/appapi/index.js"
|
||||
import pagedetails from "./details.vue";
|
||||
const refdetails = ref()
|
||||
const showdetails=ref(false)
|
||||
const status =ref(2)
|
||||
const pageSize=ref(999)
|
||||
const info=ref({
|
||||
data:[]
|
||||
const refdetails = ref()
|
||||
const showdetails = ref(false)
|
||||
const status = ref(2)
|
||||
|
||||
// 分页相关
|
||||
const pageSize = ref(50);
|
||||
const pageNum = ref(1);
|
||||
const hasNextPage = ref(true)
|
||||
|
||||
|
||||
const info = ref({
|
||||
data: []
|
||||
});
|
||||
const keyword=ref("")
|
||||
const keyword = ref("")
|
||||
|
||||
function load() {
|
||||
console.log('预警信息load')
|
||||
}
|
||||
function opneshowdetails(){
|
||||
showdetails.value=true;
|
||||
|
||||
function opneshowdetails() {
|
||||
showdetails.value = true;
|
||||
}
|
||||
|
||||
function hide() {
|
||||
console.log('预警信息hide')
|
||||
showdetails.value=false;
|
||||
showdetails.value = false;
|
||||
refdetails.value.hide()
|
||||
}
|
||||
function getinfo(){
|
||||
info.value.data=[];
|
||||
getwarningList({status:status.value,keyword:keyword.value,pageSize:pageSize.value}).then(r=>{
|
||||
info.value=r.data;
|
||||
})
|
||||
|
||||
function getinfo() {
|
||||
info.value.data = [];
|
||||
pageNum.value = 1;
|
||||
hasNextPage.value = true;
|
||||
getlist()
|
||||
}
|
||||
function setstatus(type){
|
||||
status.value=type;
|
||||
|
||||
function gettype(t) {
|
||||
if (t == 2) {
|
||||
return 1
|
||||
}
|
||||
if (t == 3) {
|
||||
return 2
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
function getlist() {
|
||||
if (hasNextPage.value) {
|
||||
getwarningList({
|
||||
status: status.value,
|
||||
keyword: keyword.value,
|
||||
pageSize: pageSize.value,
|
||||
pageNum: pageNum.value
|
||||
}).then(r => {
|
||||
r.data.data = r.data.data.map(res => {
|
||||
res["hide"] = 2;
|
||||
return res;
|
||||
})
|
||||
info.value = {
|
||||
...r.data,
|
||||
data: info.value.data.concat(r.data.data)
|
||||
};
|
||||
console.log(info.value)
|
||||
hasNextPage.value = r.data.hasPreviousPage;
|
||||
pageNum.value = pageNum.value + 1;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function setstatus(type) {
|
||||
status.value = type;
|
||||
getinfo()
|
||||
}
|
||||
|
||||
function show() {
|
||||
getinfo()
|
||||
}
|
||||
|
||||
// 点击暂扣
|
||||
|
||||
|
||||
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)
|
||||
// #ifdef APP
|
||||
res.map(r=>{
|
||||
uni.createPushMessage({
|
||||
title: "超速预警",
|
||||
content: `${r.vehicleNumber}超速${r.overspeedRatio}`
|
||||
})
|
||||
})
|
||||
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// 打开详情页面
|
||||
function listwithhold(id,type){
|
||||
showdetails.value=true;
|
||||
refdetails.value.show(id,type)
|
||||
function listwithhold(id, type) {
|
||||
showdetails.value = true;
|
||||
refdetails.value.show(id, type)
|
||||
}
|
||||
|
||||
function withhold(id,type){
|
||||
|
||||
function withhold(id, type) {
|
||||
// 打开详情弹窗
|
||||
refdetails.value.opneshowupimg(id,type)
|
||||
refdetails.value.opneshowupimg(id, type)
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
load,
|
||||
hide,
|
||||
|
|
@ -174,6 +242,26 @@
|
|||
margin-bottom: 10rpx;
|
||||
overflow: hidden;
|
||||
padding: 10rpx 15rpx;
|
||||
position: relative;
|
||||
left: 0%;
|
||||
transition:0.5s;
|
||||
height: 75rpx;
|
||||
opacity: 1;
|
||||
&.hide{
|
||||
left: 100%;
|
||||
height: 0rpx;
|
||||
transition:0s;
|
||||
opacity: 0;
|
||||
}
|
||||
&.show{
|
||||
|
||||
left: 0%;
|
||||
|
||||
}
|
||||
|
||||
&.show {
|
||||
left: 0%;
|
||||
}
|
||||
|
||||
.left {
|
||||
.t {
|
||||
|
|
@ -194,10 +282,10 @@
|
|||
line-height: 20rpx;
|
||||
margin-top: 8rpx;
|
||||
text-align: center;
|
||||
|
||||
|
||||
font-weight: 800;
|
||||
font-size: 11rpx;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -249,16 +337,18 @@
|
|||
color: #333333;
|
||||
}
|
||||
}
|
||||
&.center2{
|
||||
|
||||
&.center2 {
|
||||
.thead {
|
||||
view{
|
||||
view {
|
||||
width: 180rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.center3{
|
||||
|
||||
&.center3 {
|
||||
.thead {
|
||||
view{
|
||||
view {
|
||||
width: 110rpx;
|
||||
}
|
||||
}
|
||||
|
|
@ -267,21 +357,24 @@
|
|||
|
||||
.right {
|
||||
border-radius: 15rpx;
|
||||
|
||||
|
||||
font-weight: 600;
|
||||
font-size: 11rpx;
|
||||
width: 60rpx;
|
||||
text-align: center;
|
||||
padding: 5rpx 0;
|
||||
&.green{
|
||||
|
||||
&.green {
|
||||
border: 1rpx solid #4D7BFF;
|
||||
color: #4D7BFF;
|
||||
}
|
||||
&.red{
|
||||
|
||||
&.red {
|
||||
border: 1rpx solid #D10B0B;
|
||||
color: #D10B0B;
|
||||
}
|
||||
&.grey{
|
||||
|
||||
&.grey {
|
||||
border: 1rpx solid #666666;
|
||||
color: #666666;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
<view class="from">
|
||||
<view class="input" :class="{on:isname}">
|
||||
<image src="/static/signIn/2.png"></image>
|
||||
<input cursor-spacing='15' v-model="name" @focus="isname=true" @blur="isname=false" placeholder="请填写账号" />
|
||||
<input cursor-spacing='15' v-model="name" @focus="isname=true" @blur="isname=false"
|
||||
placeholder="请填写账号" />
|
||||
</view>
|
||||
<view class="input" :class="{on:ispassword}">
|
||||
<image src="/static/signIn/1.png"></image>
|
||||
|
|
@ -19,73 +20,103 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="checkbox" @click.stop="memory=!memory">
|
||||
<checkbox @click.stop="memory=!memory" activeBackgroundColor='#4D7BFF' :checked="memory" color="#ffffff"
|
||||
style="transform:scale(0.7)" />
|
||||
<checkbox @click.stop="memory=!memory" activeBackgroundColor='#4D7BFF' :checked="memory"
|
||||
color="#ffffff" style="transform:scale(0.7)" />
|
||||
记住密码
|
||||
</view>
|
||||
<view class="submit" @click="submit">登录</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
applogin
|
||||
} from "/appapi/index.js"
|
||||
import soket from "/utils/soket.js"
|
||||
import {onShow} from "@dcloudio/uni-app"
|
||||
import soket from "/utils/soket.js"
|
||||
import {
|
||||
onShow
|
||||
} from "@dcloudio/uni-app"
|
||||
// var hikVideoModule = uni.requireNativePlugin("AS-HikVideoModule");
|
||||
import {
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
|
||||
|
||||
|
||||
const isname = ref(false);
|
||||
const ispassword = ref(false);
|
||||
const showpassword = ref(false)
|
||||
const name = ref(uni.getStorageSync('name'));
|
||||
const password = ref(uni.getStorageSync('password'))
|
||||
const memory=ref(true)
|
||||
onShow(()=>{
|
||||
const memory = ref(true)
|
||||
|
||||
|
||||
function opne() {
|
||||
hikVideoModule.playVideo({
|
||||
'Id': '1',
|
||||
'CamIp': "192.168.1.65",
|
||||
'CamPort': "8000",
|
||||
'CamUser': "admin",
|
||||
'CamPassword': "renyizhi001",
|
||||
'CamFactory': "HAIKANG",
|
||||
'Name': "1#站视频"
|
||||
},
|
||||
(ret) => {
|
||||
modal.toast({
|
||||
message: ret,
|
||||
duration: 1.5
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
// 登录页面 关闭Socket
|
||||
uni.closeSocket()
|
||||
})
|
||||
function submit(){
|
||||
if(!name.value){
|
||||
|
||||
function submit() {
|
||||
if (!name.value) {
|
||||
uni.showToast({
|
||||
title:"请填写账号",
|
||||
icon:"none"
|
||||
title: "请填写账号",
|
||||
icon: "none"
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!password.value){
|
||||
if (!password.value) {
|
||||
uni.showToast({
|
||||
title:"请填写密码",
|
||||
icon:"none"
|
||||
title: "请填写密码",
|
||||
icon: "none"
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
applogin({
|
||||
username:name.value,
|
||||
password:password.value,
|
||||
deviceType:" android"
|
||||
}).then(r=>{
|
||||
username: name.value,
|
||||
password: password.value,
|
||||
deviceType: " android"
|
||||
}).then(r => {
|
||||
// 创建soket连接
|
||||
uni.setStorageSync('USERID',r.data.user.userId)
|
||||
uni.setStorageSync('USERID', r.data.user.userId)
|
||||
soket()
|
||||
uni.reLaunch({
|
||||
url:"/pages/index"
|
||||
url: "/pages/index"
|
||||
})
|
||||
if(memory.value){
|
||||
uni.setStorageSync('name',name.value);
|
||||
uni.setStorageSync('password',password.value);
|
||||
}else{
|
||||
if (memory.value) {
|
||||
uni.setStorageSync('name', name.value);
|
||||
uni.setStorageSync('password', password.value);
|
||||
} else {
|
||||
uni.removeStorageSync('name')
|
||||
uni.removeStorageSync('password')
|
||||
}
|
||||
})
|
||||
}
|
||||
function ccc(e){
|
||||
|
||||
function ccc(e) {
|
||||
console.log(e)
|
||||
}
|
||||
</script>
|
||||
|
|
@ -99,13 +130,14 @@
|
|||
justify-content: space-between;
|
||||
padding: 0rpx 118rpx 0 32rpx;
|
||||
background: #f1f5fd;
|
||||
|
||||
.left {
|
||||
width: 410rpx;
|
||||
height: 310rpx;
|
||||
}
|
||||
|
||||
.box {
|
||||
|
||||
|
||||
|
||||
.title {
|
||||
height: 40rpx;
|
||||
|
|
|
|||
Loading…
Reference in New Issue