diff --git a/App.vue b/App.vue index b4d7361..6e8b373 100644 --- a/App.vue +++ b/App.vue @@ -2,7 +2,7 @@ import upapp from "/utils/upapp.js" export default { onLaunch: function() { - + uni.getPushClientId({ success: (res) => {} }) @@ -20,36 +20,42 @@ // #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() { - // #ifdef APP-PLUS - // 检查是否要更新APP - setTimeout(() => { - upapp() - }, 1000) - // #endif - } + success() {} }) - + // #endif + + } else { uni.reLaunch({ url: "/pages/signIn", success() { - // #ifdef APP-PLUS - // 检查是否要更新APP - setTimeout(() => { - upapp() - }, 1000) - // #endif + } }) } + // #ifdef APP-PLUS - setTimeout(() => { - plus.navigator.setFullscreen(true) - }, 500) + setTimeout(() => { + plus.navigator.setFullscreen(true) + }, 500) + // 检查是否要更新APP + setTimeout(() => { + upapp() + }, 5000) // #endif + }, onShow: function() { @@ -67,18 +73,22 @@ color: #667085; font-size: 14rpx; } + .numcolor1 { background: #3336E0; color: #fff; } - .numcolor2 { + + .numcolor3 { background: #07C688; color: #fff; } - .numcolor3 { + + .numcolor2 { background: #FF9521; color: #fff; } + .numcolor4 { background: #333333; color: #fff; diff --git a/components/dateSelection/dateSelection.vue b/components/dateSelection/dateSelection.vue index 435fb6d..3d88522 100644 --- a/components/dateSelection/dateSelection.vue +++ b/components/dateSelection/dateSelection.vue @@ -79,9 +79,9 @@ } } daydata.value = getCompleteMonthData() + chooseday.value=daydata.value.day[0]; - - reset() + // reset() function close(){ Props.modelValue=false; adssEmits("update:modelValue",false) diff --git a/manifest.json b/manifest.json index 448a0f3..5d666fc 100644 --- a/manifest.json +++ b/manifest.json @@ -14,6 +14,9 @@ "landscape-primary", //可选,字符串类型,支持横屏 "landscape-secondary" ], + "statusbar" : { + "immersed" : true + }, "runmode" : "liberate", "splashscreen" : { "alwaysShowBeforeRender" : true, @@ -53,6 +56,8 @@ "", "", "", + "", + "", "", "" ] @@ -146,7 +151,7 @@ //配置跨域 "proxy" : { "/api" : { - "target" : "http://192.168.1.7:9005", + "target" : "http://speed-bl.renyizhi.cc", "changeOrigin" : true, "secure" : false } diff --git a/pages.json b/pages.json index e86dc31..cf964c8 100644 --- a/pages.json +++ b/pages.json @@ -4,16 +4,8 @@ { "path": "pages/index", "style": { - "navigationStyle": "custom", - "app-plus":{ - "subNVues": [{ - "id": "hkcamera", // 唯一标识 - "path": "pages/subNVue/camera" ,// 页面路径 - "style": { - "width": "0px" - } - }] - } + "navigationStyle": "custom" + } }, { diff --git a/pages/index.vue b/pages/index.vue index f50b045..0088df0 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -13,31 +13,31 @@ - + 预警信息 - + 过车信息 - + 历史记录 - + 统计数据 - + 预警设置 @@ -47,10 +47,11 @@ 设备: - + + 设备{{item.encoding}} @@ -74,9 +75,7 @@ - - - + @@ -94,7 +93,7 @@ import statistics from "./pages/statistics.vue" import passingTheCar from "./pages/passingTheCar.vue" import warningInformation from "./pages/warningInformation.vue" - import qjcamera from "./subNVue/camera.nvue" + import { nextTick, ref, @@ -107,7 +106,8 @@ import { onBackPress, - onShow + onShow, + onUnload } from "@dcloudio/uni-app" // 页面管理 @@ -121,16 +121,14 @@ const showout = ref(false); const showsignOut = ref(false); // 结束 - // 设备 const allDevices = ref([]) const Devicesid = ref('') // 子页面状态管理 const state = ref([0, 0, 0, 0, 0, 0]) //0表示页面为加载 1 表示页面已加载并显示 2页面隐藏 nextTick(() => { - settab(0) + settab(0); }) - // 处理子页面弹窗 和详情页面打开 返回关闭详情页面不关闭应用 let _isback = false; uni.$on('back', (e) => { @@ -140,8 +138,6 @@ uni.$emit('close') return _isback }) - - uni.$on('LOGOUT', () => { // 清除token // 断WebSocket @@ -161,17 +157,30 @@ // #endif }) - + let _getequipment; onShow(() => { // 获取设备信息 + clearInterval(_getequipment) + getequipmentinfo() + _getequipment=setInterval(()=>{ + getequipmentinfo() + },10000) + + }) + + onUnload(()=>{ + clearInterval(_getequipment) + }) + //定时获取设备信息 + function getequipmentinfo(){ getequipment().then(r => { allDevices.value = r.data ? r.data.allDevices : [] }) - }) - + } // 退出登录 function outsignOut() { showout.value = false; + uni.$emit('Socketclose') uni.removeStorageSync("token"); uni.removeStorageSync("USERID") // 跳转登录页 @@ -184,47 +193,23 @@ function hidesub() { _is = true; - // #ifdef APP - let subNVue = uni.getSubNVueById("hkcamera") - subNVue.hide('fade-out', 300) - // #endif + showsignOut.value = false; uni.$emit("camerahide") } // 打开设备页面l function setshowDevices(item) { - // 防止多次点击 - selectindex.value=5; - Devicesid.value=item.id; - if (!_is) { - return - } - _is = false; - - - function setsbuview() { - let subNVue = uni.getSubNVueById("hkcamera") - subNVue.hide() - let query = uni.createSelectorQuery(); - query - .select("#rightbox") - .boundingClientRect((data) => { - subNVue.setStyle({ - width: data.width + 'px', - right: "0px" - }) - subNVue.show('slide-in', 500, function() { - uni.$emit("camerashow") - }); - }) - .exec(); - } - - setsbuview() - + // Devicesid.value=item.encoding; + // // 防止多次点击 + // if (!_is ) { + // return + // } + // _is = false; + // selectindex.value=5; } + // 查看网络状态 uni.getNetworkType({ success: function(res) { @@ -369,13 +354,16 @@ z-index: 9999; .tabnav { - margin-top: 35rpx; + margin-top: 24rpx; .li { margin-bottom: 18rpx; display: flex; align-items: center; - + .text { + color: #B9BAC9; + + } &.on { .l { background: linear-gradient(45deg, #4F8AFF 0%, #4B5EFF 100%); @@ -465,6 +453,7 @@ .bottom { .title { color: #fff; + font-size: 12rpx; } .item { @@ -483,8 +472,8 @@ .name { color: rgba(255, 255, 255, 0.4); - font-size: 9rpx; - margin: 0rpx 4rpx; + font-size: 11rpx; + margin: 0rpx 8rpx; } image { diff --git a/pages/pages/details.vue b/pages/pages/details.vue index c204cf3..55653cb 100644 --- a/pages/pages/details.vue +++ b/pages/pages/details.vue @@ -33,13 +33,16 @@ - 站位 + 已放行 + 站位 - + + + 超速信息 放行时间:{{info.releaseInfo?.releaseTime}} @@ -49,7 +52,7 @@ 车牌号码 - {{info.basicInfo?.vehicleNumber}} + {{info.basicInfo?.vehicleNumber}} 超速等级 @@ -62,7 +65,7 @@ {{info.intervalInfo?.startDeviceJson?.position}} - {{info.intervalInfo?.startDeviceJson?.longitude}} / {{info.intervalInfo?.startDeviceJson?.latitude}} + {{info.intervalInfo?.startDeviceJson?.longitude.toFixed(6)}} / {{info.intervalInfo?.startDeviceJson?.latitude.toFixed(6)}} @@ -72,7 +75,7 @@ {{info.intervalInfo?.endDeviceJson?.position}} - {{info.intervalInfo?.endDeviceJson?.longitude}} / {{info.intervalInfo?.endDeviceJson?.latitude}} + {{info.intervalInfo?.endDeviceJson?.longitude.toFixed(6)}} / {{info.intervalInfo?.endDeviceJson?.latitude.toFixed(6)}} @@ -131,7 +134,7 @@ 设备{{info.intervalInfo?.startId}} 抓取照片 - + {{info.intervalInfo?.startDeviceTime}} @@ -140,7 +143,7 @@ 设备{{info.intervalInfo?.endId}} 抓取照片 - + {{info.intervalInfo?.endDeviceTime}} @@ -159,11 +162,11 @@ 暂扣照片 - + 放行照片 - + @@ -185,7 +188,7 @@ - + 上传照片 @@ -219,10 +222,18 @@ const imgs = ref("") const encoding=ref("") const info=ref({}) - + // 节流处理 const time=ref("") let timer; - + let _throttle; + // 节流处理 + function setscrolltop(e){ + clearTimeout(_throttle) + _throttle=setTimeout(()=>{ + scrolltop.value=e.detail.scrollTop + },500) + + } function showtips(){ uni.showToast({ title:"未到放行时间", @@ -340,14 +351,15 @@ encoding.value=id; type.value = indextype showupimg.value = true; - scrolltop.value=10; + getinfo() } function getinfo(){ + scrolltop.value=0; getdetails({encoding:encoding.value}).then(res=>{ info.value=res.data; - scrolltop.value=0; + if(type.value==2){ upreleasetype() @@ -435,15 +447,17 @@ .title { display: flex; align-items: center; + image { width: 31rpx; height: 31rpx; margin-right: 15rpx; + } .typename { - font-weight: 800; + font-size: 13rpx; color: #333333; } @@ -466,11 +480,12 @@ image{ width: 100%; height: 100%; + background: #000; } .icon { .h3 { - font-weight: 800; + color: #4D7BFF; font-size: 11rpx; margin-top: 10rpx; @@ -494,7 +509,7 @@ border-radius: 100rpx; line-height: 32rpx; font-size: 11rpx; - font-weight: 800; + background: #E8EEF5; &:nth-of-type(2) { @@ -526,19 +541,19 @@ margin-right: 7rpx; } - font-weight: 800; + font-size: 11rpx; color: #4D7BFF; } .title { - font-weight: 800; + font-size: 11rpx; color: #333333; } .fn { - font-weight: 800; + background: #FE5F13; color: #fff; padding: 7rpx 30rpx; @@ -599,6 +614,12 @@ &.yfx { background: linear-gradient(45deg, #4F8AFF 0%, #4B5EFF 100%); } + &.released{ + color: #666; + background: transparent; + + padding:7rpx 0rpx; + } } } @@ -614,13 +635,13 @@ justify-content: space-between; .l { - font-weight: 800; + font-size: 11rpx; color: #333333; } .r { - font-weight: 800; + font-size: 11rpx; color: #4D7BFF; } @@ -630,20 +651,20 @@ margin: 10rpx 0rpx 0rpx; border-radius: 3rpx; overflow: hidden; - border: 1px solid #A0A0A0; - + border: 1px solid #c0cdde; + color:#333; .item { display: flex; // align-items: center; justify-content: space-between; - border-bottom: 1px solid #A0A0A0; + border-bottom: 1px solid #c0cdde; &>view { &:nth-last-of-type(1) { border: none; } - border-right: 1px solid #A0A0A0; + border-right: 1px solid #c0cdde; } &:nth-last-of-type(1) { @@ -666,7 +687,7 @@ flex: 1; font-size: 9rpx; text-align: left; - padding:10rpx 7rpx; + padding:0rpx 7rpx; display: flex; justify-content: space-between; align-items: center; @@ -674,6 +695,9 @@ view { font-size: 9rpx; } + .number{ + padding:3rpx 10rpx; + } } } @@ -690,7 +714,8 @@ .title { margin: 10rpx 0; font-size: 11rpx; - font-weight: 800; + color:#333; + } .img { @@ -703,6 +728,7 @@ image { width: 100%; height: 100%; + background: #000; } .time { @@ -721,11 +747,11 @@ &>.title { margin: 7rpx 0; font-size: 11rpx; - font-weight: 800; + color:#333; } .tbody { - border: 1px solid #A0A0A0; + border: 1px solid #c0cdde; border-radius: 3rpx; overflow: hidden; @@ -737,7 +763,7 @@ border: none; } - border-bottom: 1px solid #A0A0A0; + border-bottom: 1px solid #c0cdde; .title { font-size: 9rpx; @@ -745,8 +771,8 @@ text-align: center; background: #F3F5F8; padding: 7rpx; - border-left: 1px solid #A0A0A0; - border-right: 1px solid #A0A0A0; + border-left: 1px solid #c0cdde; + border-right: 1px solid #c0cdde; &:nth-of-type(1) { border-left: none; @@ -763,6 +789,7 @@ height: 94rpx; margin: 0rpx; border-radius: 5rpx; + background: #000; } } } diff --git a/pages/pages/history.vue b/pages/pages/history.vue index 8ff2aaf..afe1503 100644 --- a/pages/pages/history.vue +++ b/pages/pages/history.vue @@ -68,6 +68,16 @@ const pageNum=ref(1); const hasNextPage=ref(true) + // 默认当天 + // 默认当天 + setday() + function setday(){ + const date = new Date(); + const year = date.getFullYear(); + const month = date.getMonth() + 1; + queryDate.value= `${year}-${month}-${date.getDate()}` + } + // 打开详情 function openinfo(id){ refdetails.value.show(id) @@ -123,7 +133,7 @@ // 重置 function reset(){ - queryDate.value=""; + setday() vehicleNumber.value="" Selectiondate.value.reset(); showdate.value=false; @@ -180,7 +190,7 @@ line-height: 20rpx; margin-top: 8rpx; text-align: center; - font-weight: 800; + font-size: 11rpx; } } @@ -255,7 +265,7 @@ color: #fff; font-size: 11rpx; text-align: center; - font-weight: 800; + } @@ -276,7 +286,7 @@ } .time { - font-weight: 800; + font-size: 11rpx; color: #000000; } diff --git a/pages/pages/passingTheCar.vue b/pages/pages/passingTheCar.vue index f36955b..ef31821 100644 --- a/pages/pages/passingTheCar.vue +++ b/pages/pages/passingTheCar.vue @@ -1,17 +1,19 @@