From 77175a85d081f5315ced40a66ef149eed53f6771 Mon Sep 17 00:00:00 2001 From: tx <2622874537@qq.com> Date: Fri, 9 Aug 2024 18:03:26 +0800 Subject: [PATCH] 11 --- common/http.interceptor.js | 20 +-- page_user/yj.vue | 22 ++- pages.json | 26 ++- pages/index/index.vue | 229 +++++++++++++++++--------- pages_admin/admin_order.vue | 70 +++++++- pages_admin/admin_worke.vue | 10 ++ pages_admin/order/device_detail.vue | 22 ++- pages_admin/order/order_detail.vue | 99 ++++++++--- pages_admin/worke/woke_deviceMgmt.vue | 8 +- 9 files changed, 367 insertions(+), 139 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 55129ad..02a1480 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -1,20 +1,5 @@ const install = (Vue, vm) => { - // Vue.prototype.$u.http.setConfig({ - // baseURL: 'https://yruibao.com/admin', - // // baseUrl: 'http://192.168.10.104:8088', - // method: 'POST', - // // 设置为json,返回后会对数据进行一次JSON.parse() - // dataType: 'json', - // showLoading: true, // 是否显示请求中的loading - // loadingText: '请求加载中...', // 请求loading中的文字提示 - // loadingTime: 10000, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms - // originalData: false, // 是否在拦截器中返回服务端的原始数据 - // loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透 - // // 配置请求头信息 - // header: { - // 'content-type': 'application/json;charset=UTF-8', - // }, - // }); + uni.setStorageSync('deptId', 100); Vue.prototype.$u.http.setConfig({ @@ -30,7 +15,8 @@ const install = (Vue, vm) => { 'content-type': 'application/json;charset=UTF-8', }, }); - + // 创特:wx3428c498d5061192 + // 俞山岛: wx4d178f8c80348214 // 请求拦截部分 Vue.prototype.$u.http.interceptor.request = (config) => { // 引用token diff --git a/page_user/yj.vue b/page_user/yj.vue index ccece33..2b2a8b0 100644 --- a/page_user/yj.vue +++ b/page_user/yj.vue @@ -40,12 +40,15 @@ style="margin-top: 18rpx;font-weight: 700;font-size: 92rpx;color: #3D3D3D;line-height: 72rpx;">{{userinfo.balance}} - + 提现 - - 充值押金 + + 有订单审核中暂时无法提现 + @@ -203,7 +206,8 @@ loadingmask:true, ispaid:false, showtxtip:false, - showList:false + showList:false, + isInAuditOrder:[] } @@ -213,7 +217,14 @@ // // 执行其他操作... // }); + this.$u.post("/app/user/isInAuditOrder?userId=" + this.userId).then((res) => { + if (res.code == 200) { + this.isInAuditOrder=res.data + } else { + + } + }); this.getarea() }, onLoad(e) { @@ -288,6 +299,7 @@ } else { uni.hideLoading() + uni.showToast({ title: res.msg, icon: 'none', @@ -670,7 +682,7 @@ padding: 28rpx 0; margin: 30rpx auto; width: 680rpx; - height: 406rpx; + // height: 406rpx; background: #FFFFFF; box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08); border-radius: 20rpx 20rpx 20rpx 20rpx; diff --git a/pages.json b/pages.json index 8ca43be..c85702f 100644 --- a/pages.json +++ b/pages.json @@ -159,15 +159,7 @@ "enablePullDownRefresh" : false } } - // { - // "path" : "worke/bind_sn", - // "style" : - // { - // "navigationBarTitleText" : "", - // "navigationStyle": "custom", - // "enablePullDownRefresh" : false - // } - // } + // ... 分包A的其他页面 ] @@ -216,6 +208,22 @@ } + // ... 分包A的其他页面 + ] + }, + { + "root": "pages_adminSet", // 分包A的根目录 + "pages": [ + { + "path": "shgl", + "style": { + "navigationBarTitleText": "上传", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + } + + // ... 分包A的其他页面 ] }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 997eab0..97e7e0f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -305,8 +305,6 @@ --> - - 解锁骑行 @@ -318,14 +316,12 @@ - 换车骑行 - + v-if="OrderdeviceInfos.sn!='' && (OrderdeviceInfos.status == 3 || OrderdeviceInfos.status == 6)" @click="taploadmask (2)"> 临时锁车 { - if (res.code === 200 && res.data != '') { - this.listData = res.data; - const newDeviceMarkers = this.listData.map(item => ({ - id: parseFloat(item.sn), - latitude: parseFloat(item.latitude), - longitude: parseFloat(item.longitude), - width: 40, - height: 28, - iconPath: this.defaultMarkerIconPath, - isDeviceMarker: true // 区分为设备标记 - })); - - // 保留停车标记和特定设备标记 - const preservedMarkers = this.markers.filter(marker => marker.isParkingMarker || marker - .id === parseFloat(this.OrderdeviceInfos.sn)); - - // 更新markers数组,避免删除已识别的重要标记 - let updatedMarkers = [...newDeviceMarkers, ...preservedMarkers]; - - // 确保点击的标记保持其图标 - if (this.lastClickedMarkerId != null) { - updatedMarkers = updatedMarkers.map(marker => { - if (marker.id === this.lastClickedMarkerId) { - return { - ...marker, - width: 50, - height: 35, - iconPath: this.clickedMarkerIconPath - }; - } - return marker; - }); - } - - // 使用this.$set触发Vue的响应式更新 - this.$set(this, 'markers', updatedMarkers); - - this.oldMarkers = [...this.markers]; - } - }).catch(error => { - console.error("Error fetching device data:", error); - }); - } - }, - + timestare() { this.timers = setInterval(() => { this.getmarks(); @@ -1708,6 +1658,7 @@ if (this.orderinfo.sn) { this.$u.get('/app/device/info?sn=' + this.orderinfo.sn).then((res) => { if (res.code === 200) { + this.isqrcode=false this.mac = this.OrderdeviceInfos.mac; // this.OrderdeviceInfos.onlineStatus = '1' if (this.OrderdeviceInfos.onlineStatus !== res.data.onlineStatus) { @@ -2590,11 +2541,124 @@ }) }, + getmarks() { + if(this.isqrcode){ + let data = { + areaId: this.areaInfo.areaId + }; + if (this.areaInfo.areaId) { + this.$u.get(`/app/allVehicleByArea`, data).then((res) => { + if (res.code === 200 && res.data != '') { + this.listData = res.data; + const newDeviceMarkers = this.listData.map(item => ({ + id: parseFloat(item.sn), + latitude: parseFloat(item.latitude), + longitude: parseFloat(item.longitude), + width: 40, + height: 28, + iconPath: this.defaultMarkerIconPath, + isDeviceMarker: true // 区分为设备标记 + })); + + // 保留停车标记和特定设备标记 + const preservedMarkers = this.markers.filter(marker => marker.isParkingMarker || marker + .id === parseFloat(this.OrderdeviceInfos.sn)); + + // 更新markers数组,避免删除已识别的重要标记 + let updatedMarkers = [...newDeviceMarkers, ...preservedMarkers]; + + // 确保点击的标记保持其图标 + if (this.lastClickedMarkerId != null) { + updatedMarkers = updatedMarkers.map(marker => { + if (marker.id === this.lastClickedMarkerId) { + return { + ...marker, + width: 50, + height: 35, + iconPath: this.clickedMarkerIconPath + }; + } + return marker; + }); + } + + // 使用this.$set触发Vue的响应式更新 + this.$set(this, 'markers', updatedMarkers); + + this.oldMarkers = [...this.markers]; + } + }).catch(error => { + console.error("Error fetching device data:", error); + }); + } + + }else{ + let data = { + longitude: this.deviceGps.longitude, + latitude: this.deviceGps.latitude, + } + + this.$u.get(`/app/vehicleLocalization?`, data).then((res) => { + if (res.code === 200) { + if (res.data !== '') { + this.listData = res.data; + const newDeviceMarkers = this.listData.map(item => ({ + id: parseFloat(item.sn), + latitude: parseFloat(item.latitude), + longitude: parseFloat(item.longitude), + width: 40, + height: 28, + iconPath: this.defaultMarkerIconPath, + isDeviceMarker: true // 区分为设备标记 + })); + + // 保留停车标记和特定设备标记 + const preservedMarkers = this.markers.filter(marker => marker.isParkingMarker || marker.id === parseFloat(this.OrderdeviceInfos.sn)); + + // 更新markers数组,避免删除已识别的重要标记 + let updatedMarkers = [...newDeviceMarkers, ...preservedMarkers]; + + // 确保点击的标记保持其图标 + if (this.lastClickedMarkerId != null) { + updatedMarkers = updatedMarkers.map(marker => { + if (marker.id === this.lastClickedMarkerId) { + return { + ...marker, + width: 50, + height: 35, + iconPath: this.clickedMarkerIconPath + }; + } + return marker; + }); + } + + // 使用this.$set触发Vue的响应式更新 + this.$set(this, 'markers', updatedMarkers); + this.oldMarkers = [...this.markers]; + } else { + // 当 res.data 为空时,删除 markers 中对应的设备标记 + this.markers = this.markers.filter(marker => marker.isParkingMarker || marker.id === parseFloat(this.OrderdeviceInfos.sn)); + + // 使用this.$set触发Vue的响应式更新 + this.$set(this, 'markers', this.markers); + } + } + }).catch(error => { + console.error("Error fetching device data:", error); + }); + } + + + + }, + + onMapRegionChange(event) { // console.log('regionchange', event) if (event.detail.type == 'end') { - // this.getCenterLanLat() + this.getCenterLanLat() } // 你可以在这里执行你需要的操作 }, @@ -2604,9 +2668,9 @@ type: 'gcj02', success: (res) => { console.log("当前地图中心的经纬度", res) - that.gps.latitude = res.latitude; - that.gps.longitude = res.longitude; - that.getAreas() + that.deviceGps.latitude = res.latitude; + that.deviceGps.longitude = res.longitude; + that.getmarks() //其他逻辑 }, fail: (err) => {} @@ -2637,7 +2701,7 @@ - this.setMapScale() + // this.setMapScale() // if(!hasShownPopup){ // console.log(typeof(hasShownPopup),'hasShownPopuphasShownPopup'); // this.showTips=uni.getStorageSync('hasShownPopup') @@ -3550,7 +3614,7 @@ }); }, async setMapScale(e, val) { - console.log('调用了'); + console.log('调用了校验'); let mapContext = uni.createMapContext('map', this); let setScale = () => { return new Promise((resolve, reject) => { @@ -4189,6 +4253,7 @@ changefree(item, index) { this.freeInfo = item this.freeListIndex = index + }, getlist() { this.freList = [] @@ -4206,6 +4271,13 @@ } return item; }); + + setTimeout(()=>{ + this.freeInfo = this.freList[0] + this.freeListIndex = 1 + console.log(this.freeListIndex,'this.freeListIndexthis.freeListIndexthis.freeListIndex'); + },300) + console.log(this.freList, ' this.freList this.freList'); } else { uni.showToast({ @@ -4340,7 +4412,7 @@ } }, getArea() { - this.showmap = false + // this.showmap = false // 发送请求获取数据 this.areaInfo = {} console.log(this.qParam, 'qParamqParamqParamqParam'); @@ -4357,12 +4429,10 @@ if (this.sn != '') { this.gps.sn = this.sn } - setTimeout(() => { - this.setMapScale() - }, 300) + this.$u.get('/app/area/info?', this.gps).then((res) => { - this.showmap = true + // this.showmap = true if (res.code === 200) { // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 @@ -4410,9 +4480,14 @@ } if (this.sn) { setTimeout(()=>{ - this.deviceInfo(1) - this.qParam = null - },500) + if (this.orderinfo.status) { + this.showtcs = true + }else{ + this.deviceInfo(1) + this.qParam = null + } + + },800) } @@ -4752,6 +4827,7 @@ this.$u.get('/app/device/info?sn=' + this.sn).then((res) => { if (res.code === 200) { + this.isqrcode=true this.deviceInfos = res.data; if (!this.orderinfo.sn) { this.mac = res.data.mac @@ -4863,6 +4939,7 @@ .then(( res) => { if (res.code === 200) { + this.isqrcode=true this.deviceInfos = res.data; if (num == 0) { diff --git a/pages_admin/admin_order.vue b/pages_admin/admin_order.vue index 8675a0f..6623d9a 100644 --- a/pages_admin/admin_order.vue +++ b/pages_admin/admin_order.vue @@ -651,50 +651,87 @@ 运营区外调度费 - + + + + + + 最大可退款金额:{{orderInfo.dispatchFee}}元 + + + 停车点外调度费 - + + + + + + 最大可退款金额:{{orderInfo.manageFee}}元 + + + 骑行费 - + + + + + + 最大可退款金额:{{orderInfo.ridingFee}}元 + + + 预约费 - + + + + + + 最大可退款金额:{{orderInfo.appointmentFee}}元 + + + 原因 - + @@ -764,8 +801,13 @@ ], typeidx: '2', areainfo:{}, - passList:[] - + passList:[], + dispatchFee:0, + manageFee:0, + ridingFee:0, + appointmentFee:0, + + } }, onShow() { @@ -919,7 +961,19 @@ appointmentFee: this.orderInfo.appointmentFee, reason: this.orderInfo.reason } - + if ( + data.dispatchFee > this.orderInfo.dispatchFee || + data.manageFee > this.orderInfo.manageFee || + data.ridingFee > this.orderInfo.ridingFee || + data.appointmentFee > this.orderInfo.appointmentFee + ) { + uni.showToast({ + title: '退款金额不能大于实际支付金额', + icon: 'none', + duration: 2000 + }); + return; // 阻止请求的发送 + } this.$u.put('/appVerify/order/refund', data).then((res) => { if (res.code === 200) { // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 diff --git a/pages_admin/admin_worke.vue b/pages_admin/admin_worke.vue index a355d64..2f9be70 100644 --- a/pages_admin/admin_worke.vue +++ b/pages_admin/admin_worke.vue @@ -54,6 +54,12 @@ 账户明细 + + + + 故障审核 + + @@ -212,6 +218,10 @@ uni.navigateTo({ url:'/pages_admin/worke/AccountDetails' }) + }else if(num==7){ + uni.navigateTo({ + url:'/pages_adminSet/shgl' + }) } } } diff --git a/pages_admin/order/device_detail.vue b/pages_admin/order/device_detail.vue index 1897b1e..d62d263 100644 --- a/pages_admin/order/device_detail.vue +++ b/pages_admin/order/device_detail.vue @@ -187,6 +187,9 @@ 车牌修改 + + 坐垫锁 + - - 锁状态:关锁 - - - 锁状态:开锁 - + @@ -310,7 +313,7 @@ - + @@ -399,41 +402,77 @@ 运营区外调度费 - + + + + + + 最大可退款金额:{{orderInfo.dispatchFee}}元 + + + 停车点外调度费 - + + + + + + 最大可退款金额:{{orderInfo.manageFee}}元 + + + 骑行费 - + + + + + + 最大可退款金额:{{orderInfo.ridingFee}}元 + + + 预约费 - + + + + + + 最大可退款金额:{{orderInfo.appointmentFee}}元 + + + 原因 @@ -520,7 +559,11 @@ showload:false, showfzhc:false, showgj:false, - deviceInfos:{} + deviceInfos:{}, + dispatchFee:0, + manageFee:0, + ridingFee:0, + appointmentFee:0, } }, @@ -1124,7 +1167,19 @@ appointmentFee: this.orderInfo.appointmentFee, reason: this.orderInfo.reason } - + if ( + data.dispatchFee > this.orderInfo.dispatchFee || + data.manageFee > this.orderInfo.manageFee || + data.ridingFee > this.orderInfo.ridingFee || + data.appointmentFee > this.orderInfo.appointmentFee + ) { + uni.showToast({ + title: '退款金额不能大于实际支付金额', + icon: 'none', + duration: 2000 + }); + return; // 阻止请求的发送 + } this.$u.put('/appVerify/order/refund', data).then((res) => { if (res.code === 200) { // 处理接口返回的数据,将边界数据转换为地图组件需要的折线结构 diff --git a/pages_admin/worke/woke_deviceMgmt.vue b/pages_admin/worke/woke_deviceMgmt.vue index a9c0819..6dce150 100644 --- a/pages_admin/worke/woke_deviceMgmt.vue +++ b/pages_admin/worke/woke_deviceMgmt.vue @@ -212,11 +212,17 @@ }, onLoad() { + // if(uni.getStorageSync('adminAreaid')){ + // this.areaId = uni.getStorageSync('adminAreaid') + // this.getDevice() + // } + + }, + onShow() { if(uni.getStorageSync('adminAreaid')){ this.areaId = uni.getStorageSync('adminAreaid') this.getDevice() } - }, computed: { isAllSelected() {