From c4bd835fff76182f028c753d3bded0c70c574eb2 Mon Sep 17 00:00:00 2001 From: Sliverber <2622874537@qq.com> Date: Mon, 3 Jun 2024 21:04:26 +0800 Subject: [PATCH] 11 --- page_fix/repair/repair_detail.vue | 65 ++++++++++++++++++++++++----- page_fix/repair/repair_index.vue | 38 +++++++++++------ page_user/bhks.vue | 20 ++++++--- pages/index/index.vue | 12 +++--- pages_admin/admin_index.vue | 39 ++++++++++++++++- pages_admin/order/device_detail.vue | 9 ++-- 6 files changed, 141 insertions(+), 42 deletions(-) diff --git a/page_fix/repair/repair_detail.vue b/page_fix/repair/repair_detail.vue index f9fdef8..02af418 100644 --- a/page_fix/repair/repair_detail.vue +++ b/page_fix/repair/repair_detail.vue @@ -116,7 +116,7 @@ 设备位置 - 嵛山岛芦竹村三沙路68号 + {{info.address}} @@ -225,20 +225,20 @@ - - + + 开锁 - + 关锁 - + 车辆禁用 - + 车辆解禁 - + 响铃寻车 @@ -296,7 +296,7 @@ bgc: { backgroundColor: "#fff", }, - curtitidx:1, + curtitidx:0, latitude: 0, longitude: 0, info:'', @@ -334,6 +334,51 @@ } }, methods: { + btn(num){ + if(num==0){ + this.$u.post('/appVerify/admin/unlocking?sn='+this.info.sn).then((res) => { + if (res.code === 200) { + // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 + this.deviceInfo() + } + }).catch(error => { + console.error("Error fetching area data:", error); + }); + }else if(num==1){ + this.$u.post('/appVerify/admin/lock?sn='+this.info.sn).then((res) => { + if (res.code === 200) { + // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 + this.deviceInfo() + } + }).catch(error => { + console.error("Error fetching area data:", error); + }); + }else if(num==2){ + this.$u.post('/appVerify/device/offline?sn='+this.info.sn).then((res) => { + if (res.code === 200) { + // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 + this.deviceInfo() + } + }).catch(error => { + console.error("Error fetching area data:", error); + }); + }else if(num==3){ + this.$u.post('/appVerify/device/online?sn='+this.info.sn).then((res) => { + if (res.code === 200) { + // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 + this.deviceInfo() + } + }).catch(error => { + console.error("Error fetching area data:", error); + }); + }else if(num==4){ + this.$u.post('/app/device/ring?sn=' + this.info.sn).then((res) => { + if (res.code === 200) { + + } + }) + } + }, historyList(){ this.$u.get(`/appVerify/admiOrder/historyList?orderNo` + 111).then((res) => { if (res.code == 200) { @@ -405,8 +450,8 @@ //纬度 - 目的地/坐标点 longitude: this.longitude, //经度 - 目的地/坐标点 - name: "荆门市", - address: "一夜城" + // name: "荆门市", + address: this.info.address }); }, } diff --git a/page_fix/repair/repair_index.vue b/page_fix/repair/repair_index.vue index ff5ee28..6c410fd 100644 --- a/page_fix/repair/repair_index.vue +++ b/page_fix/repair/repair_index.vue @@ -67,8 +67,10 @@ - {{item.address}} - + + {{item.address}} + + 已完成 @@ -184,19 +186,19 @@ 嵛山岛芦竹村三沙路68号 - + 已完成 - + 待换电 - + 待维修 - + 换电中 - + 维修中 @@ -242,19 +244,20 @@ 嵛山岛芦竹村三沙路68号 - + + 已完成 - + 待换电 - + 待维修 - + 换电中 - + 维修中 @@ -527,6 +530,17 @@ page{ width: 41.66rpx; height: 48rpx; } + .card_bot_txt{ + width: 80%; + white-space: nowrap; + /* 禁止换行 */ + overflow: hidden; + /* 超出部分隐藏 */ + text-overflow: ellipsis; + font-weight: 400; + font-size: 28rpx; + color: #3D3D3D; + } font-weight: 400; font-size: 28rpx; color: #3D3D3D; diff --git a/page_user/bhks.vue b/page_user/bhks.vue index f6858bd..af78c1e 100644 --- a/page_user/bhks.vue +++ b/page_user/bhks.vue @@ -10,9 +10,9 @@ - + - + 确认开锁 @@ -27,9 +27,16 @@ bgc: { backgroundColor: "#fff", }, - sn:'' + sn:'', + istrue:false } }, + watch: { + sn(newVal) { + const regex = /^\d{8}$/; + this.istrue = regex.test(newVal); + } + }, methods: { sub(){ if(this.sn==''){ @@ -44,7 +51,7 @@ this.$u.get('/app/device/info?sn=' + this.sn).then((res) => { if (res.code === 200) { uni.navigateTo({ - url:'/pages/index/index?sn='+this.code + url:'/pages/index/index?sn='+this.sn }) }else{ @@ -72,7 +79,7 @@ that.$u.get('/app/device/info?sn=' + that.sn).then((res) => { if (res.code === 200) { uni.navigateTo({ - url:'/pages/index/index?sn='+this.code + url:'/pages/index/index?sn='+that.sn }) }else{ @@ -166,6 +173,9 @@ page{ font-size: 36rpx; color: #FFFFFF; } + .act1{ + background: #02CBAF; + } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 4c7ddf1..0a0beb5 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -8,8 +8,8 @@ - + @@ -51,7 +51,7 @@ - + 扫码用车 @@ -824,9 +824,7 @@ setTimeout(() => { if (!this.orderinfo.status) { this.deviceInfo() - this.showdevice = true - this.deviceIndex = 1 - this.type = 1 + } }, 1000) @@ -3034,7 +3032,7 @@ background: linear-gradient(180deg, #EEF5FD 20%, rgba(255, 255, 255, 0)30%), #FFFFFF; border-radius: 30rpx; padding: 48rpx 36rpx; - + z-index: 30; .close { position: absolute; right: 32rpx; diff --git a/pages_admin/admin_index.vue b/pages_admin/admin_index.vue index f10f5fd..c0c6b62 100644 --- a/pages_admin/admin_index.vue +++ b/pages_admin/admin_index.vue @@ -9,7 +9,7 @@ 电量区间 - + @@ -24,7 +24,7 @@ - + 车辆扫码 @@ -173,6 +173,41 @@ }, }, methods: { + qecodelock() { + uni.scanCode({ + onlyFromCamera: true, + scanType: ['qrCode'], + success: res => { + + let sn = null; + let queryParams = res.result.split('?')[1]; + if (queryParams) { + let params = queryParams.split('&'); + params.forEach(param => { + let [key, value] = param.split('='); + if (key === 'sn') { + sn = value; + } + }); + } + + this.sn = sn + if (this.sn != '') { + uni.navigateTo({ + url:'/pages_admin/order/device_detail?id='+this.sn + }) + } + + }, + fail: err => { + console.error('扫描失败:', err); + uni.showToast({ + title: '扫描失败', + icon: 'none' + }); + } + }); + }, topage(){ uni.navigateTo({ url:'/pages_admin/order/search_device' diff --git a/pages_admin/order/device_detail.vue b/pages_admin/order/device_detail.vue index 290888c..fad034f 100644 --- a/pages_admin/order/device_detail.vue +++ b/pages_admin/order/device_detail.vue @@ -230,14 +230,11 @@ console.error("Error fetching area data:", error); }); }else if(num==4){ - this.$u.get('/appVerify/device/ring?sn='+this.sn).then((res) => { + this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => { if (res.code === 200) { - // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 - this.deviceInfo() + } - }).catch(error => { - console.error("Error fetching area data:", error); - }); + }) } }, status(){