From b9f702e309f61f5678630c92a8f53344ded0aa91 Mon Sep 17 00:00:00 2001 From: Sliverber <2622874537@qq.com> Date: Wed, 15 May 2024 18:02:17 +0800 Subject: [PATCH] 11 --- common/http.interceptor.js | 4 +- page_user/yj.vue | 71 ++++++++++--- pages/index/index.vue | 54 +++++++++- pages/my.vue | 45 +++++++-- pages_admin/admin_worke.vue | 10 +- pages_admin/order/order_detail.vue | 128 ++++++++++++++++++++---- pages_admin/worke/worke_user_detail.vue | 2 +- 7 files changed, 263 insertions(+), 51 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 0a196af..939d93b 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -20,9 +20,9 @@ const install = (Vue, vm) => { // }, // }); Vue.prototype.$u.http.setConfig({ - baseUrl: 'http://61.174.243.28:15861', + // baseUrl: 'http://61.174.243.28:15861', // baseUrl: 'http://192.168.2.6:8080', - // baseUrl: 'https://dianche.chuantewulian.cn/prod-api', + baseUrl: 'https://dianche.chuantewulian.cn/prod-api', loadingText: '努力加载中~', loadingTime: 800, // 设置自定义头部content-type diff --git a/page_user/yj.vue b/page_user/yj.vue index bdda2af..676660a 100644 --- a/page_user/yj.vue +++ b/page_user/yj.vue @@ -39,7 +39,7 @@ <view class="btn " v-if="false"> 充值 </view> - <view class="btn"> + <view class="btn" @click="show=true"> 提现 </view> </view> @@ -54,25 +54,46 @@ </view> </view> <view class="cardcont"> - <view class="cont_li" v-for="(item,index) in orderList" :key="index" > - <view class="cont_li_left"> - <view class="txt"> - 押金提现 + <view v-for="(item,index) in orderList" :key="index" style="display: flex;flex-wrap: wrap;"> + <view class="cont_li" > + <view class="cont_li_left"> + <view class="txt"> + 押金充值 + </view> + <view class="data"> + {{item.payTime}} + </view> </view> - <view class="data"> - 2024-04-02 10:14:41 + <view class="cont_li_right"> + <view class="cont_price"> + +{{item.totalFee}} + </view> + <view class="cont_data"> + 充值成功 + </view> </view> </view> - <view class="cont_li_right"> - <view class="cont_price"> - -99 + <view class="cont_li" v-if="item.etRefund!=null&&item.etRefund.refundResult=='SUEECSS'"> + <view class="cont_li_left"> + <view class="txt"> + 押金提现 + </view> + <view class="data"> + {{item.etRefund.createTime}} + </view> </view> - <view class="cont_data"> - 提现成功 + <view class="cont_li_right"> + <view class="cont_price"> + -{{item.etRefund.amount}} + </view> + <view class="cont_data"> + 提现成功 + </view> </view> </view> </view> + </view> </view> </view> @@ -90,7 +111,7 @@ <view class="bot_left" @click="show=false"> 取消 </view> - <view class="bot_right"> + <view class="bot_right" @click="tixian()"> 继续提现 </view> </view> @@ -105,7 +126,7 @@ bgc: { backgroundColor: "#7bb2ec", }, - show: true, + show: false, bindDeviceNum: null, userinfo: {}, orderList:[], @@ -156,6 +177,22 @@ }, }, methods: { + tixian(){ + this.$u.post("/appVerify/order/withdraw").then((res) => { + + if (res.code == 200) { + this.getinfo() + this.getlist() + this.show=false + } else { + uni.showToast({ + title:res.msg, + icon: 'none', + duration: 2000 + }); + } + }); + }, getlist() { this.$u.get("/appVerify/order/list?type=2&userId="+this.userId).then((res) => { @@ -163,7 +200,11 @@ this.orderList=res.rows this.total=res.total } else { - + uni.showToast({ + title:res.msg, + icon: 'none', + duration: 2000 + }); } }); }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 98a3075..55b425f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -458,7 +458,7 @@ }, fail: function(error) { - + that.getmarks() // 在这里处理获取位置信息失败的情况 } @@ -553,6 +553,58 @@ const timePassed = currentTime - createTimeTimestamp; const secondsPassed = Math.floor(timePassed / 1000); + // 转换为时分秒格式 + const hours = Math.floor(secondsPassed / 3600); + const minutes = Math.floor((secondsPassed % 3600) / 60); + const seconds = secondsPassed % 60; + const timeString = `${hours < 10 ? '0' : ''}${hours}:${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`; + const tenMinuteIntervals = Math.floor((hours * 60 + minutes) / 10)+1 ; // 加1是因为不满十分钟也算一个十分钟 + + this.timeString=timeString + // console.log("已经过去了:" + timeString); + + this.showdevice = true + this.deviceIndex=3 + }else if(this.orderinfo.status==2&&this.orderinfo.ruleId==null){ + // this.topay() + this.showdevice = true + this.deviceIndex=2 + const createTimeTimestamp = new Date(this.orderinfo.createTime).getTime(); + + // 定义定时器 + this.timer = setInterval(() => { + const currentTime = Date.now(); + const timePassed = currentTime - createTimeTimestamp; + const secondsPassed = Math.floor(timePassed / 1000); + + // 转换为时分秒格式 + const hours = Math.floor(secondsPassed / 3600); + const minutes = Math.floor((secondsPassed % 3600) / 60); + const seconds = secondsPassed % 60; + const timeString = `${hours < 10 ? '0' : ''}${hours}:${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`; + const tenMinuteIntervals = Math.floor((hours * 60 + minutes) / 10)+1 ; // 加1是因为不满十分钟也算一个十分钟 + let money =0 + // 增加费用逻辑,假设每次增加10元 + this.money = this.appointmentServiceFee* tenMinuteIntervals; + // console.log("已经过去了:" + timeString); + // console.log("增加了" +money+ "元费用"); + // 每隔十分钟增加费用 + if (minutes % 10 === 0 && seconds === 0) { + + } + this.timeString=timeString + // console.log("已经过去了:" + timeString); + }, 1000); + }else if(this.orderinfo.status==3&&this.orderinfo.ruleId==null){ + // this.topay() + const createTimeTimestamp = new Date(this.orderinfo.createTime).getTime(); + + // 定义定时器 + + const currentTime = Date.now(); + const timePassed = currentTime - createTimeTimestamp; + const secondsPassed = Math.floor(timePassed / 1000); + // 转换为时分秒格式 const hours = Math.floor(secondsPassed / 3600); const minutes = Math.floor((secondsPassed % 3600) / 60); diff --git a/pages/my.vue b/pages/my.vue index 9e6e954..b8f0007 100644 --- a/pages/my.vue +++ b/pages/my.vue @@ -78,6 +78,30 @@ </view> <view class="iconfont icon-xiangyou1" > + </view> + </view> + <view class="card_li" @click="topage(8)" v-if="info.role==3||info.role==2"> + <view class="card_left"> + <image src="https://lxnapi.ccttiot.com/bike/img/static/unIGXFEhvTgtXVcfPH33" mode=""></image> + <view class="text"> + 维护入口 + </view> + + </view> + <view class="iconfont icon-xiangyou1" > + + </view> + </view> + <view class="card_li" @click="topage(9)" v-if="info.role==3"> + <view class="card_left"> + <image src="https://lxnapi.ccttiot.com/bike/img/static/unIGXFEhvTgtXVcfPH33" mode=""></image> + <view class="text"> + 管理入口 + </view> + + </view> + <view class="iconfont icon-xiangyou1" > + </view> </view> </view> @@ -107,7 +131,7 @@ </view> </view> - <view class="card_li" style="border-bottom:2rpx solid #fff ;" @click="topage(7)"> + <view class="card_li" style="border-bottom:2rpx solid #fff ;" @click="topage(7)" > <view class="card_left"> <image src="https://api.ccttiot.com/smartmeter/img/static/uJ1TRgb6xURsKZo5GUj8" mode=""></image> <view class="text"> @@ -119,6 +143,7 @@ </view> </view> + </view> </view> </view> @@ -169,16 +194,16 @@ uni.navigateTo({ url:'/page_user/jfgz' }) + }else if(num==8){ + uni.navigateTo({ + url:'/page_fix/fix_index' + }) + }else if(num=9){ + uni.navigateTo({ + url:'/pages_admin/admin_index' + }) } - // else if(num==6){ - // uni.navigateTo({ - // url:'/pages/my' - // }) - // }else if(num==7){ - // uni.navigateTo({ - // url:'/page_user/gzsb?mac='+this.mac - // }) - // } + }, getuserInfo(){ this.$u.get("/getAppInfo").then((res) => { diff --git a/pages_admin/admin_worke.vue b/pages_admin/admin_worke.vue index bd4a5e0..cab7448 100644 --- a/pages_admin/admin_worke.vue +++ b/pages_admin/admin_worke.vue @@ -33,12 +33,12 @@ 用户管理 </view> </view> - <!-- <view class="cont"> + <view class="cont" @click="topage(4)"> <image src="https://lxnapi.ccttiot.com/bike/img/static/uM4rBBaXc7b3TmsqQTvz" mode=""></image> <view class="text"> - 运营区域 + 用户页面 </view> - </view> --> + </view> </view> </view> @@ -86,6 +86,10 @@ uni.navigateTo({ url:'/pages_admin/worke/worke_user' }) + }else if(num==4){ + uni.navigateTo({ + url:'/pages/index/index' + }) } } } diff --git a/pages_admin/order/order_detail.vue b/pages_admin/order/order_detail.vue index 0c315c8..0a01767 100644 --- a/pages_admin/order/order_detail.vue +++ b/pages_admin/order/order_detail.vue @@ -3,7 +3,7 @@ <u-navbar title="订单详情" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36' height='36'></u-navbar> <map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude" - :show-location='true' :markers="markers" :polygons="polyline"> </map> + :show-location='true' :markers="markers" :polygons="polygons" :polyline="polyline"> </map> <view class="info_card"> <view class="info_tit"> 基本信息 @@ -61,13 +61,31 @@ </view> <view class="lines"></view> <view class="cont"> - - <view class="info_li"> - 开锁时间:<span>{{orderInfo.unlock_time}}</span> - </view> - <view class="info_li"> - 开锁地点:<span>{{orderInfo.unlock_time}}</span> + <view v-for="(item,index) in orderInfo.tripLogs" :key="index"> + <view class="info_lis" v-if="item.type==1"> + 开锁时间:<view class="text">{{item.createTime}}</view> + </view> + <view class="info_lis" v-if="item.type==1"> + 开锁地点:<view class="text"> {{item.address}}</view> + </view> + <view class="info_lis" v-if="item.type==2"> + 临时锁车时间:<view class="text">{{item.createTime}}</view> + </view> + <view class="info_lis" v-if="item.type==2"> + 临时锁车地点:<view class="text">{{item.address}}</view> + </view> + <view class="info_lis" v-if="item.type==3"> + 解除时间:<view class="text">{{item.createTime}}</view> + </view> + + <view class="info_lis" v-if="item.type==4"> + 关锁时间:<view class="text">{{item.createTime}}</view> + </view> + <view class="info_lis" v-if="item.type==4"> + 关锁地点:<view class="text">{{item.address}}</view> + </view> </view> + <!-- <view class="info_li"> 锁车时间:<span>120.56189,27.12379</span> </view> @@ -77,12 +95,7 @@ <!-- <view class="info_li"> 解除时间:<span>120.56189,27.12379</span> </view> --> - <view class="info_li"> - 关锁时间:<span>{{}}</span> - </view> - <view class="info_li"> - 关锁地点:<span>120.56189,27.12379</span> - </view> + </view> </view> <view class="info_card" style="margin-top: 20rpx;"> @@ -175,7 +188,15 @@ isMap: false, zoomSize: 15, markers: [], - polyline: [], + polyline: [{ + points: [], + width:8, + arrowLine:true, + color:'#00AF99' + // strokeWidth: 2, + // strokeColor: '#00AF99', + // fillColor: '#00AF99' + }, ], polygons: [], cardId: '001区域', @@ -214,6 +235,23 @@ return polyline; }, + convertBoundaryToPolyliness(boundary) { + if (!boundary) return null; + + const points = JSON.parse(boundary).map(coord => ({ + latitude: coord[1], + longitude: coord[0] + })); + + const polyline = { + points: points, + width:8, + arrowLine:true, + color:'#00AF99' + }; + + return polyline; + }, convertBoundaryToPolylines(boundaries) { return boundaries.map(boundary => { if (!boundary) return null; @@ -233,7 +271,7 @@ longitude: coord[0] })); return { - points: points, + points: points, fillColor: "#55888840", //填充颜色 strokeColor: "#558888", //描边颜色 strokeWidth: 2, //描边宽度 @@ -249,9 +287,10 @@ const validBoundaries = res.rows.map(row => row.boundaryStr).filter(boundary => typeof boundary === 'string' && boundary.trim() !== ''); const polylines = this.convertBoundaryToPolylines(validBoundaries); - + // 将处理后的数据添加到 this.polyline 中 - this.polyline = this.polyline.concat(polylines); + this.polygons = this.polygons.concat(polylines); + // console.log(this.polyline); res.rows.forEach(item => { this.markers.push({ @@ -287,7 +326,7 @@ .filter(area => area.boundaryStr) // 过滤掉boundary为空的数据 .map(area => this.convertBoundaryToPolyline(area.boundaryStr)); // 更新折线数据 - this.polyline = polylines; + this.polygons = polylines; // console.log(this.polyline); } }).catch(error => { @@ -318,7 +357,14 @@ this.loading=true this.latitude= parseFloat(this.orderInfo.device.latitude) this.longitude= parseFloat(this.orderInfo.device.longitude ) + this.polyline[0].points = JSON.parse(res.data.tripRouteStr).map(coord => ({ + latitude: coord[1], + longitude: coord[0] + })); } + + // console.log(points,''); + // this.polyline[0].points=points }).catch(error => { console.error("Error fetching area data:", error); }); @@ -329,6 +375,7 @@ <style lang="scss"> page { + overflow-x: hidden; background-color: #F3F3F3; } @@ -369,14 +416,23 @@ padding: 26rpx 28rpx; .info_li { + display: flex; flex-wrap: nowrap; font-weight: 400; font-size: 28rpx; color: #808080; - + .text{ + width: 70%; + white-space: nowrap; + /* 禁止换行 */ + overflow: hidden; + /* 超出部分隐藏 */ + text-overflow: ellipsis; + } span { color: #3D3D3D; + } line-height: 48rpx; @@ -387,6 +443,40 @@ font-size: 28rpx; color: #808080; + span { + color: #3D3D3D; + } + } + } + .info_lis { + + display: inline-block; + // flex-wrap: nowrap; + font-weight: 400; + font-size: 28rpx; + color: #808080; + .text{ + display: inline; + // width: 70%; + // white-space: nowrap; + // /* 禁止换行 */ + // overflow: hidden; + // /* 超出部分隐藏 */ + // text-overflow: ellipsis; + } + span { + color: #3D3D3D; + + } + + line-height: 48rpx; + + .half_infoli { + width: 50%; + font-weight: 400; + font-size: 28rpx; + color: #808080; + span { color: #3D3D3D; } diff --git a/pages_admin/worke/worke_user_detail.vue b/pages_admin/worke/worke_user_detail.vue index 913cad2..b6256dc 100644 --- a/pages_admin/worke/worke_user_detail.vue +++ b/pages_admin/worke/worke_user_detail.vue @@ -56,7 +56,7 @@ <view class="lines"></view> <view class="cont"> <view class="info_li"> - 支付时间:<span >>{{item.createTime}}</span> + 支付时间:<span >{{item.createTime}}</span> </view>