This commit is contained in:
管理员 2025-09-23 17:56:56 +08:00
parent a2eddacc9c
commit 111ce94702
13 changed files with 431 additions and 242 deletions

66
App.vue
View File

@ -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{

View File

@ -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

View File

@ -1,5 +1,6 @@
import App from './App'
import soket from "/utils/soket.js"
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'

View File

@ -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
}

View File

@ -1,6 +1,12 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/go",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/index",
"style": {
@ -57,6 +63,7 @@
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@ -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 {

View File

@ -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()
}
});
})
}

View File

@ -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);
}
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}
}
}

View File

@ -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;