From 56322153aae7f03312fbb2e4ff65e90a9e51f85e Mon Sep 17 00:00:00 2001
From: Sliverber <2622874537@qq.com>
Date: Mon, 12 Aug 2024 08:48:46 +0800
Subject: [PATCH] 2

---
 pages/index/index.vue                | 25 ++++++--
 pages_admin/worke/AccountDetails.vue | 90 ++++++++++++++++++++--------
 2 files changed, 85 insertions(+), 30 deletions(-)

diff --git a/pages/index/index.vue b/pages/index/index.vue
index c5f3611..4d341d3 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -280,7 +280,7 @@
 						</view>
 						<view class="cont">
 							<view class="left">
-								<view class="text">
+								<view class="text" v-if="OrderdeviceInfos.sn!='' ">
 									可继续行驶{{OrderdeviceInfos.remainingMileage}}公里
 								</view>
 								<view class="speed" style="background: #ccc; ">
@@ -288,9 +288,12 @@
 
 									</view>
 								</view>
-								<view class="mac">
+								<view class="mac" v-if="OrderdeviceInfos.sn ">
 									NO.{{orderinfo.sn}}
 								</view>
+								<view class="mac" v-if="!OrderdeviceInfos.sn " style="color: red;">
+								换车开锁失败,请点击换车按钮重新换车	
+								</view>
 							</view>
 							<view class="right">
 								<image src="https://api.ccttiot.com/smartmeter/img/static/uHTCZOVUbmBkKW4G0wuF" mode="">
@@ -321,16 +324,22 @@
 							</view>
 						</view>
 						<view class="btn" style="	margin-right: 16rpx;"
-							 v-if="OrderdeviceInfos.sn!='' && (OrderdeviceInfos.status == 3 || OrderdeviceInfos.status == 6)" @click="taploadmask (2)">
+							 v-if="OrderdeviceInfos.sn && (OrderdeviceInfos.status == 3 || OrderdeviceInfos.status == 6)" @click="taploadmask (2)">
 							临时锁车
 						</view>
 						<view class="btn" style="	margin-right: 16rpx;" v-if="OrderdeviceInfos.status==4"
 							@click=" taploadmask(3)">
 							解锁用车
 						</view>
-						<view class="btn1" @click=" taploadmask(4)">
+						<view class="btn" style="	margin-right: 16rpx;" @click="tochange()" v-if="!OrderdeviceInfos.sn">
+							继续换车
+						</view>
+						<view class="btn1" @click=" taploadmask(4)" v-if="OrderdeviceInfos.sn">
 							还车
 						</view>
+						<view class="btn1" @click=" taploadmask(4)"  v-if="!OrderdeviceInfos.sn">
+							结束订单
+						</view>
 					</view>
 
 				</view>
@@ -1669,6 +1678,7 @@
 							if (res.code === 200) {
 								this.isqrcode=false
 								this.mac = this.OrderdeviceInfos.mac;
+							
 								// this.OrderdeviceInfos.onlineStatus = '1'
 								if (this.OrderdeviceInfos.onlineStatus !== res.data.onlineStatus) {
 									this.OrderdeviceInfos = res.data;
@@ -2605,7 +2615,10 @@
 					let data = {
 					    longitude: this.deviceGps.longitude,
 					    latitude: this.deviceGps.latitude,
+						deptId :uni.getStorageSync('deptId')
+						
 					}
+				
 					
 					this.$u.get(`/app/vehicleLocalization?`, data).then((res) => {
 					    if (res.code === 200) {
@@ -4245,7 +4258,9 @@
 									clearInterval(this.timer)
 									this.starTime()
 								}
-
+								// if (this.areaInfo.areaId != res.data[0].areaId) {
+								// 	this.getArea()
+								// }
 							} else {
 								clearInterval(this.timer)
 								this.orderinfo = {}
diff --git a/pages_admin/worke/AccountDetails.vue b/pages_admin/worke/AccountDetails.vue
index 1720d0a..8f802a2 100644
--- a/pages_admin/worke/AccountDetails.vue
+++ b/pages_admin/worke/AccountDetails.vue
@@ -4,12 +4,23 @@
 			back-icon-color='#000'></u-navbar>
 
 		<view class="account_box">
-			<view class="txt">
-				账户余额
-			</view>
-			<view class="num">
-				{{info.balance}}元
+			<view class="li_box">
+				<view class="txt">
+					账户总余额
+				</view>
+				<view class="num">
+					{{info.balance}}元
+				</view>
+			</view>	
+			<view class="li_box">
+				<view class="txt">
+					待结算金额
+				</view>
+				<view class="num">
+					{{info.settlementAmount}}元
+				</view>
 			</view>
+		
 		</view>
 		<view class="ipt_box">
 			<view class="ipt">
@@ -21,6 +32,11 @@
 				元
 			</view>
 		</view>
+		<view class="" style="margin: 0 auto;
+			margin-top: 38rpx;
+			width: 676rpx;color: #ccc;" >
+			可提现金额:{{info.withdrawableAmount}}元
+		</view>
 		<view class="info_card">
 			<view class="info_li">
 				<view class="text">提现金额:{{price}}元</view>
@@ -97,7 +113,8 @@
 				realprice: 0,
 				Quantity: 0,
 				border: false,
-				isThrottled: false
+				isThrottled: false,
+				moneyInfo:{}
 			}
 		},
 		onLoad(e) {
@@ -119,10 +136,10 @@
 		methods: {
 			ckinpt() {
 
-				if (parseFloat(this.amount) > parseFloat(this.info.balance)) {
+				if (parseFloat(this.amount) > parseFloat(this.info.withdrawableAmount)) {
 
 					uni.showToast({
-						title: '提现金额不能大于账户余额',
+						title: '提现金额不能大于可提现金额',
 						icon: 'none',
 						duration: 2000
 					});
@@ -201,10 +218,19 @@
 						});
 						return;
 					}
-
+					
 					// 设置节流标志位
 					this.isThrottled = true;
-
+					
+					if (parseFloat(this.realprice) > parseFloat(this.info.withdrawableAmount)) {
+					
+						uni.showToast({
+							title: '提现金额不能大于可提现金额',
+							icon: 'none',
+							duration: 2000
+						});
+						
+					}
 					let data = {
 						amount: this.realprice,
 						areaId: this.areaId
@@ -252,13 +278,21 @@
 				let data = {
 					areaId: this.areaId
 				}
-				this.$u.get('/appVerify/getDept', data).then((res) => {
+				this.$u.get('/appVerify/getDept?', data).then((res) => {
 					if (res.code == 200) {
 						this.info = res.data
 					}
 				}).catch(error => {
 					console.error("Error fetching area data:", error);
 				});
+				this.$u.get('index/statistics?', data).then((res) => {
+					if (res.code == 200) {
+						this.moneyInfo = res.data
+						
+					}
+				}).catch(error => {
+					console.error("Error fetching area data:", error);
+				});
 			},
 			getlist() {
 				let data = {
@@ -351,21 +385,27 @@
 			height: 196rpx;
 			background: #12D2AC;
 			border-radius: 20rpx 20rpx 20rpx 20rpx;
-
-			.txt {
-				width: 100%;
-				font-weight: 400;
-				font-size: 32rpx;
-				color: #FFFFFF;
-			}
-
-			.num {
-				margin-top: 10rpx;
-				width: 100%;
-				font-weight: 400;
-				font-size: 48rpx;
-				color: #FFFFFF;
+			display: flex;
+			flex-wrap: nowrap;
+			align-items: center;
+			justify-content: space-between;
+			.li_box{
+				.txt {
+					width: 100%;
+					font-weight: 400;
+					font-size: 32rpx;
+					color: #FFFFFF;
+				}
+				
+				.num {
+					margin-top: 10rpx;
+					width: 100%;
+					font-weight: 400;
+					font-size: 48rpx;
+					color: #FFFFFF;
+				}
 			}
+			
 		}
 
 		.patBtn {