From 132f7808dbec26f1e428aeff6db8b8d5eea0afc5 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Sat, 12 Apr 2025 18:01:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=94=B5=E5=8A=A8=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tab-bar/tab-bar.vue | 48 +- page_fenbao/index.vue | 64 ++- page_fenbao/storedlist/trueorder.vue | 203 ++++--- page_shanghu/admin_index.vue | 10 +- page_shanghu/guanli/admin_order.vue | 8 +- page_shanghu/guanli/admin_worke.vue | 2 +- page_shanghu/guanli/device_detail.vue | 122 ++-- page_shanghu/guanli/order_detail.vue | 10 +- page_user/guzhang/guzhanglv.vue | 24 +- page_user/yongche/orderxq.vue | 376 ++++++++----- pages/myorder/index.vue | 9 +- pages/myorder/returned/index.vue | 126 ++++- pages/nearbystores/index.vue | 778 ++++++++++++++++++-------- 13 files changed, 1162 insertions(+), 618 deletions(-) diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue index b447168..9036b8e 100644 --- a/components/tab-bar/tab-bar.vue +++ b/components/tab-bar/tab-bar.vue @@ -156,25 +156,35 @@ let sceneValue = res.result let decodedValue = decodeURIComponent(sceneValue) this.sn = getQueryParam(decodedValue, 's') - this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { - if (res.code == 200) { - if(res.data){ - this.modelId = res.data.modelId - uni.navigateTo({ - url:'/page_fenbao/storedlist/trueorder?modelId=' + this.modelId + '&sn=' + this.sn - }) - }else{ - uni.showToast({ - title: '当前车辆不可用', - icon: 'none' - }) - } - }else{ - uni.showToast({ - title: res.msg, - icon: 'none' - }) - } + this.$u.get("/app/orderDevice/mineUsing").then(res =>{ + if(res.code == 200){ + if(res.data){ + uni.switchTab({ + url:'/pages/nearbystores/index' + }) + }else{ + this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { + if (res.code == 200) { + if(res.data){ + this.modelId = res.data.modelId + uni.navigateTo({ + url:'/page_fenbao/storedlist/trueorder?modelId=' + this.modelId + '&sn=' + this.sn + }) + }else{ + uni.showToast({ + title: '当前车辆不可用', + icon: 'none' + }) + } + }else{ + uni.showToast({ + title: res.msg, + icon: 'none' + }) + } + }) + } + } }) }, fail: err => { diff --git a/page_fenbao/index.vue b/page_fenbao/index.vue index 183f970..e56fbc4 100644 --- a/page_fenbao/index.vue +++ b/page_fenbao/index.vue @@ -36,40 +36,50 @@ methods: { // 确认开锁 btnkaisuo(){ - this.$u.get("/app/device/availableDetail?sn=" + this.sn).then((res) => { - if (res.code == 200) { + this.$u.get("/app/orderDevice/mineUsing").then(res =>{ + if(res.code == 200){ if(res.data){ - uni.navigateTo({ - url:'/page_fenbao/storedlist/trueorder?modelId=' + res.data.modelId + '&sn=' + this.sn + uni.switchTab({ + url:'/pages/nearbystores/index' }) }else{ - uni.showToast({ - title:'当前车辆不可用', - icon: 'none', - duration:2000 - }) - } - }else if(res.code == 401){ - uni.showModal({ - title: '提示', - content: '您当前未登录,是否前去登录?', - showCancel: true, - success: function (res) { - if (res.confirm) { - uni.reLaunch({ - url:'/pages/login/login' + this.$u.get("/app/device/availableDetail?sn=" + this.sn).then((res) => { + if (res.code == 200) { + if(res.data){ + uni.navigateTo({ + url:'/page_fenbao/storedlist/trueorder?modelId=' + res.data.modelId + '&sn=' + this.sn + }) + }else{ + uni.showToast({ + title:'当前车辆不可用', + icon: 'none', + duration:2000 }) - } else if (res.cancel) { - } + }else if(res.code == 401){ + uni.showModal({ + title: '提示', + content: '您当前未登录,是否前去登录?', + showCancel: true, + success: function (res) { + if (res.confirm) { + uni.reLaunch({ + url:'/pages/login/login' + }) + } else if (res.cancel) { + + } + } + }) + } else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration:2000 + }) } }) - } else{ - uni.showToast({ - title: res.msg, - icon: 'none', - duration:2000 - }) + } } }) } diff --git a/page_fenbao/storedlist/trueorder.vue b/page_fenbao/storedlist/trueorder.vue index 5042202..70f129d 100644 --- a/page_fenbao/storedlist/trueorder.vue +++ b/page_fenbao/storedlist/trueorder.vue @@ -1,6 +1,6 @@ @@ -324,7 +324,7 @@ data() { return { bgc: { - backgroundColor: "#CCE5FF", + backgroundColor: "", }, bqlist: ['含电池', '含头盔', '含充电器', '含瓶装水', '含竹篮'], fanganindex: 0, @@ -347,32 +347,94 @@ deviceId: '', name: '', mac: '', - zhezhaoflag:true + zhezhaoflag:true, + tit:' ' } }, onLoad(option) { console.log(option) if (option.modelId) { - this.zhezhaoflag = false - this.modelId = option.modelId - this.chesn = option.sn - this.gettaocan() - this.getcheliang() - } else { - this.zhezhaoflag = true uni.showLoading({ title: '加载中...', mask: true }) - this.$u.get("/app/orderDevice/mineUsing").then((res) => { - if (res.code == 200) { - if (res.data) { - uni.switchTab({ - url:'/pages/nearbystores/index' - }) - this.zhezhaoflag = false - uni.hideLoading() - } else { + setTimeout(()=>{ + this.$u.get("/app/orderDevice/mineUsing").then(res =>{ + if(res.code == 200){ + if(res.data){ + uni.switchTab({ + url:'/pages/nearbystores/index' + }) + this.zhezhaoflag = false + uni.hideLoading() + }else{ + this.tit= '确认订单页' + this.zhezhaoflag = false + uni.hideLoading() + this.modelId = option.modelId + this.chesn = option.sn + this.gettaocan() + this.getcheliang() + } + } + }) + },1000) + } else { + // this.zhezhaoflag = true + uni.showLoading({ + title: '加载中...', + mask: true + }) + setTimeout(()=>{ + this.$u.get("/app/orderDevice/mineUsing").then((res) => { + if (res.code == 200) { + if (res.data) { + uni.switchTab({ + url:'/pages/nearbystores/index' + }) + this.zhezhaoflag = false + uni.hideLoading() + } else { + this.tit= '确认订单页' + this.zhezhaoflag = false + uni.hideLoading() + // 判断是用户直接从微信扫描二维码进来 + function getQueryParam(url, paramName) { + let regex = new RegExp(`[?&]${paramName}=([^&]*)`) + let results = regex.exec(url) + return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null + } + let sceneValue = option.q + let decodedValue = decodeURIComponent(sceneValue) + this.sn = getQueryParam(decodedValue, 's') + this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { + if (res.code == 200) { + if (res.data) { + this.bikeobj = res.data + this.modelId = res.data.modelId + this.gettaocan() + this.getcheliang() + } else { + uni.showToast({ + title: '当前车辆不可用', + icon: 'none', + duration: 2000 + }) + setTimeout(() => { + if (this.chesn == '') { //判断是直接从微信扫码进来的点击返回回到首页 + uni.switchTab({ + url: '/pages/nearbystores/index' + }) + } else { //不是则返回上一级 + uni.navigateBack() + } + }, 1500) + } + } + }) + } + }else{ + this.tit= '确认订单页' this.zhezhaoflag = false uni.hideLoading() // 判断是用户直接从微信扫描二维码进来 @@ -410,45 +472,8 @@ } }) } - }else{ - this.zhezhaoflag = false - uni.hideLoading() - // 判断是用户直接从微信扫描二维码进来 - function getQueryParam(url, paramName) { - let regex = new RegExp(`[?&]${paramName}=([^&]*)`) - let results = regex.exec(url) - return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null - } - let sceneValue = option.q - let decodedValue = decodeURIComponent(sceneValue) - this.sn = getQueryParam(decodedValue, 's') - this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { - if (res.code == 200) { - if (res.data) { - this.bikeobj = res.data - this.modelId = res.data.modelId - this.gettaocan() - this.getcheliang() - } else { - uni.showToast({ - title: '当前车辆不可用', - icon: 'none', - duration: 2000 - }) - setTimeout(() => { - if (this.chesn == '') { //判断是直接从微信扫码进来的点击返回回到首页 - uni.switchTab({ - url: '/pages/nearbystores/index' - }) - } else { //不是则返回上一级 - uni.navigateBack() - } - }, 1500) - } - } - }) - } - }) + }) + },1000) } }, methods: { @@ -666,42 +691,42 @@ this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { if (res.code == 200) { this.bikeobj = res.data - if (res.data.onlineStatus == 0) { - wx.openBluetoothAdapter({ - success: function(res) { - console.log('蓝牙适配器初始化成功') - xBlufi.initXBlufi(1) - xBlufi.notifyStartDiscoverBle({ - 'isStart': true - }) - xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) - }, - fail: function(err) { - console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) - } - }) - } + // if (res.data.onlineStatus == 0) { + // wx.openBluetoothAdapter({ + // success: function(res) { + // console.log('蓝牙适配器初始化成功') + // xBlufi.initXBlufi(1) + // xBlufi.notifyStartDiscoverBle({ + // 'isStart': true + // }) + // xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) + // }, + // fail: function(err) { + // console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) + // } + // }) + // } } }) } else { this.$u.get(`/app/device/availableDetail?sn=${this.chesn}`).then((res) => { if (res.code == 200) { this.bikeobj = res.data - if (res.data.onlineStatus == 0) { - wx.openBluetoothAdapter({ - success: function(res) { - console.log('蓝牙适配器初始化成功') - xBlufi.initXBlufi(1) - xBlufi.notifyStartDiscoverBle({ - 'isStart': true - }) - xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) - }, - fail: function(err) { - console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) - } - }) - } + // if (res.data.onlineStatus == 0) { + // wx.openBluetoothAdapter({ + // success: function(res) { + // console.log('蓝牙适配器初始化成功') + // xBlufi.initXBlufi(1) + // xBlufi.notifyStartDiscoverBle({ + // 'isStart': true + // }) + // xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) + // }, + // fail: function(err) { + // console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) + // } + // }) + // } } }) } diff --git a/page_shanghu/admin_index.vue b/page_shanghu/admin_index.vue index bb2fd51..28f7437 100644 --- a/page_shanghu/admin_index.vue +++ b/page_shanghu/admin_index.vue @@ -533,11 +533,11 @@ }, 2: { fillColor: "#FFF5D640", - strokeColor: "#FFC107" + strokeColor: "#FF473E" }, 3: { fillColor: "#FFD1CF40", - strokeColor: "#FF473E" + strokeColor: "#FFC107" } }; @@ -925,15 +925,15 @@ iconPath: row.type == 1 ? 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : row.type == 2 ? - 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : - 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq', + 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' : + 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t', callout: { content: row.name, color: '#ffffff', fontSize: 14, borderRadius: 10, bgColor: row.type == 1 ? '#3A7EDB' : row.type == 2 ? - '#FFC107' : '#FF473E', + '#FF473E' : '#FFC107', padding: 6, display: 'BYCLICK' }, diff --git a/page_shanghu/guanli/admin_order.vue b/page_shanghu/guanli/admin_order.vue index c179294..dddd008 100644 --- a/page_shanghu/guanli/admin_order.vue +++ b/page_shanghu/guanli/admin_order.vue @@ -295,7 +295,9 @@ createDateRange:this.firsTime == '' ? '' : this.lasTime == '' ? '' : this.firsTime + ',' + this.lasTime, areaId: this.areaId, pageSize: 20, - pageNum: this.pageNum + pageNum: this.pageNum, + isAsc:'desc', + orderByColumn:'createTime' }; } else if (this.typeidx == 2) { // 修改条件为 this.typeidx == 2 data = { @@ -305,7 +307,9 @@ createDateRange:this.firsTime == '' ? '' : this.lasTime == '' ? '' : this.firsTime + ',' + this.lasTime, areaId: this.areaId, pageSize: 20, - pageNum: this.pageNum + pageNum: this.pageNum, + isAsc:'desc', + orderByColumn:'createTime' }; } this.$u.get('/bst/order/list?', data).then((res) => { diff --git a/page_shanghu/guanli/admin_worke.vue b/page_shanghu/guanli/admin_worke.vue index 14d4932..be6f6f8 100644 --- a/page_shanghu/guanli/admin_worke.vue +++ b/page_shanghu/guanli/admin_worke.vue @@ -372,7 +372,7 @@ export default { }) } else if (num == 4) { //用户页面 uni.switchTab({ - url: '/pages/index/index' + url: '/pages/my' }) } else if (num == 5) { uni.navigateTo({ diff --git a/page_shanghu/guanli/device_detail.vue b/page_shanghu/guanli/device_detail.vue index ec7ff51..e0e6e9f 100644 --- a/page_shanghu/guanli/device_detail.vue +++ b/page_shanghu/guanli/device_detail.vue @@ -17,7 +17,13 @@ - SN:{{deviceInfos.sn}} + SN:{{deviceInfos.sn}} + + + + + + @@ -75,15 +81,6 @@ 开锁 - @@ -156,6 +153,31 @@ 定位更新 + + + + + + 蓝牙开锁 + + + + + + 蓝牙关锁 + + + + + + 蓝牙重启 + + + + + + 蓝牙响铃 + @@ -197,45 +219,6 @@ - - - - - - {{buletxt}} - - - - 请确保与车辆的距离小于3米 - - - - - - - - - - - 蓝牙连接失败 - - - - 请确保手机蓝牙已经打开 - - - - - - - 返回 - - - 重新连接 - - - - @@ -415,6 +398,10 @@ xBlufi.notifySendCustomData({ customData: "11close@" }) + }else if (num == 3) { + xBlufi.notifySendCustomData({ + customData: "11reboot@" + }) } else { xBlufi.notifySendCustomData({ customData: "11play1@" @@ -424,7 +411,7 @@ getlanya() { console.log("进入111蓝牙连接") if (this.ver_dataflag != 3) { - this.ver_dataflag = 2 + this.ver_dataflag = 1 this.findDevice() } }, @@ -900,9 +887,9 @@ if (res.code === 200) { this.deviceInfos = res.data this.mac = res.data.mac - // if (res.data.onlineStatus == 1) { - // this.getlanya() - // } + if (res.data.onlineStatus == 0) { + this.getlanya() + } if (res.data.isSound == 0) { this.jytxt = '关' } else { @@ -913,7 +900,6 @@ } this.getnum = 1 this.vehicleNum = res.vehicleNum - this.mac = res.data.mac this.getModelList() this.latitude = this.deviceInfos.latitude this.longitude = this.deviceInfos.longitude @@ -1144,7 +1130,7 @@ return { points: points, fillColor: "#FFF5D640", //填充颜色 - strokeColor: "#FFC107", //描边颜色 + strokeColor: "#FF473E", //描边颜色 strokeWidth: 2, //描边宽度 zIndex: 1, //层级 } @@ -1171,7 +1157,7 @@ return { points: points, fillColor: "#FFD1CF40", //填充颜色 - strokeColor: "#FF473E", //描边颜色 + strokeColor: "#FFC107", //描边颜色 strokeWidth: 2, //描边宽度 zIndex: 1, //层级 @@ -1193,15 +1179,15 @@ iconPath: item.type == 1 ? 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item .type == 2 ? - 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : - ' https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq', + 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' : + 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t', callout: { content: item.name, color: '#ffffff', fontSize: 14, borderRadius: 10, - bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FFC107' : - '#FF473E', + bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' : + '#FFC107', padding: 6, display: 'ALWAYS' }, @@ -1444,6 +1430,22 @@ font-weight: 600; font-size: 32rpx; color: #3D3D3D; + display: flex; + align-items: center; + .lypic{ + background-color: #ccc; + width: 50rpx; + height: 50rpx; + margin-left: 10rpx; + text-align: center; + padding-top: 8rpx; + border-radius: 6rpx; + box-sizing: border-box; + image{ + width: 32rpx; + height: 32rpx; + } + } } .rt{ display: flex; diff --git a/page_shanghu/guanli/order_detail.vue b/page_shanghu/guanli/order_detail.vue index 23c92e6..a6dfd31 100644 --- a/page_shanghu/guanli/order_detail.vue +++ b/page_shanghu/guanli/order_detail.vue @@ -1553,7 +1553,7 @@ return { points: points, fillColor: "#FFF5D640", //填充颜色 - strokeColor: "#FFC107", //描边颜色 + strokeColor: "#FF473E", //描边颜色 strokeWidth: 2, //描边宽度 zIndex: 1, //层级 } @@ -1580,7 +1580,7 @@ return { points: points, fillColor: "#FFD1CF40", //填充颜色 - strokeColor: "#FF473E", //描边颜色 + strokeColor: "#FFC107", //描边颜色 strokeWidth: 2, //描边宽度 zIndex: 1, //层级 @@ -1602,14 +1602,14 @@ iconPath: item.type == 1 ? 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item .type == 2 ? - 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : - ' https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq', + 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' : + 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t', callout: { content: item.name, color: '#ffffff', fontSize: 14, borderRadius: 10, - bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FFC107' : '#FF473E', + bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' : '#FFC107', padding: 6, display: 'ALWAYS' }, diff --git a/page_user/guzhang/guzhanglv.vue b/page_user/guzhang/guzhanglv.vue index 118ea11..8bd8763 100644 --- a/page_user/guzhang/guzhanglv.vue +++ b/page_user/guzhang/guzhanglv.vue @@ -10,16 +10,16 @@ 车牌号:{{item.vehicleNum == null ? '--' : item.vehicleNum}} - 已驳回 + 已驳回 - 待处理 + 待处理 - 维修中 + 维修中 - 已完成 + 已完成 @@ -50,29 +50,33 @@ }, list:[], pageNum:1, - total:'' + total:'', + userid:'' } }, onLoad() { }, onShow() { + this.pageNum = 1 + this.list = [] this.getuser() }, methods: { getuser(){ this.$u.get("/getInfo").then((res) => { if (res.code == 200) { + this.userid = res.user.userId let that = this - that.$u.get(`/app/fault?userId=${res.user.userId}&pageNum=${this.pageNum}&pageSize=10`).then((resp) => { + that.$u.get(`/app/fault?userId=${that.userid}&pageNum=${that.pageNum}&pageSize=10`).then((resp) => { if (resp.code == 200) { that.total = resp.total - if(this.pageNum == 1){ + if(that.pageNum == 1){ that.list = resp.rows }else{ that.list = that.list.concat(resp.rows) } - this.pageNum++ + that.pageNum++ } }) }else if(res.code == 401){ @@ -97,10 +101,10 @@ handleScrollToLower() { if(this.total > this.list.length){ let that = this - that.$u.get(`/app/fault?userId=${res.user.userId}&pageNum=${this.pageNum}&pageSize=10`).then((resp) => { + that.$u.get(`/app/fault?userId=${that.userid}&pageNum=${that.pageNum}&pageSize=10`).then((resp) => { if (resp.code == 200) { that.total = resp.total - if(this.pageNum == 1){ + if(that.pageNum == 1){ that.list = resp.rows }else{ that.list = that.list.concat(resp.rows) diff --git a/page_user/yongche/orderxq.vue b/page_user/yongche/orderxq.vue index debcc67..798330a 100644 --- a/page_user/yongche/orderxq.vue +++ b/page_user/yongche/orderxq.vue @@ -1,65 +1,161 @@