From 062c9255818a2800561bb9d8dba25045c66a3345 Mon Sep 17 00:00:00 2001
From: tx <2622874537@qq.com>
Date: Thu, 1 Aug 2024 17:06:10 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=EF=BC=8C?=
 =?UTF-8?q?=E6=8F=90=E7=8E=B0=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=89=AB=E7=A0=81?=
 =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 package-lock.json                    |  7 ++-
 pages/index/index.vue                |  9 ++-
 pages/my.vue                         | 66 +++++++++++++++++--
 pages_admin/worke/AccountDetails.vue | 94 +++++++++++++++++-----------
 4 files changed, 129 insertions(+), 47 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 6e40181..16dc971 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -326,6 +326,7 @@
     },
     "fast-xml-parser": {
       "version": "4.3.2",
+      "integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==",
       "requires": {
         "strnum": "^1.0.5"
       }
@@ -387,7 +388,8 @@
       "peer": true
     },
     "strnum": {
-      "version": "1.0.5"
+      "version": "1.0.5",
+      "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
     },
     "update-browserslist-db": {
       "version": "1.0.16",
@@ -400,7 +402,8 @@
       }
     },
     "uview-ui": {
-      "version": "1.8.8"
+      "version": "1.8.8",
+      "integrity": "sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg=="
     }
   }
 }
diff --git a/pages/index/index.vue b/pages/index/index.vue
index e1f989a..8a196b3 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -366,7 +366,7 @@
 			</view>
 
 			<view class="bot_btn">
-				<view class="cont" @click="topage(1)">
+				<view class="cont" @click="topage(1)" v-if="areaInfo.deposit!=0">
 					<image src="https://lxnapi.ccttiot.com/bike/img/static/uYfTj4a3NkSNY0AqYHFc" mode=""></image>
 					<view class="text">
 						押金充值
@@ -4409,8 +4409,11 @@
 
 						}
 						if (this.sn) {
-							this.deviceInfo(0)
-							this.qParam = null
+							setTimeout(()=>{
+								this.deviceInfo(0)
+								this.qParam = null
+							},500)
+						
 						}
 
 						// if(!hasShownPopup){
diff --git a/pages/my.vue b/pages/my.vue
index a6521b7..612b45b 100644
--- a/pages/my.vue
+++ b/pages/my.vue
@@ -34,7 +34,7 @@
 			<view class="btnbg" v-if="false">
 				<view class="btnbox">
 					<view class="btncard">
-						<view class="card_li" @click="topage(1)">
+						<view class="card_li" @click="topage(1)"  v-if="areaInfo.deposit!=0">
 							<view class="card_left">
 								<image src="https://api.ccttiot.com/smartmeter/img/static/u3ILM6aE0MdFo3ZKiYPH" mode="">
 								</image>
@@ -187,7 +187,7 @@
 			</view>
 		</view>
 		<view class="tocont">
-			<view class="cont_li" @click="topage(1)">
+			<view class="cont_li" @click="topage(1)" v-if="areaInfo.deposit!=0">
 				<image src="https://lxnapi.ccttiot.com/bike/img/static/uYfTj4a3NkSNY0AqYHFc" mode=""></image>
 				<view class="txt">
 					押金
@@ -242,6 +242,9 @@
 				 <view class="iconfont icon-xiangyou1" ></view>
 			</view>
 		</view>
+		<view class="btns" @click="layout">
+			退出登录
+		</view>
 		<u-select v-model="show" :list="list" title='选择运营区' @confirm="confirm"></u-select>
 	</view>
 </template>
@@ -265,7 +268,8 @@
 				show: false,
 				deptId: 0,
 				statusBarHeight: 0,
-				navBarHeight: 0
+				navBarHeight: 0,
+				areaInfo:{}
 
 
 
@@ -291,6 +295,7 @@
 		onShow() {
 			this.deptId = uni.getStorageSync('deptId');
 			this.getuserInfo()
+			this.getarea()
 		},
 		computed: {
 			maskedPhoneNumber() {
@@ -303,6 +308,48 @@
 			}
 		},
 		methods: {
+			getarea() {
+				let id = uni.getStorageSync('areaId');
+				this.$u.get("/app/area/" + id).then((res) => {
+			
+					if (res.code == 200) {
+						this.areaInfo = res.data
+						
+					} else {
+						// uni.showToast({
+						// 	title: res.msg,
+						// 	icon: 'none',
+						// 	duration: 2000
+						// });
+					}
+				});
+			},
+			layout(){
+				this.$u.post('/logout').then((res) => {
+					if (res.code == 200) {
+						// 获取所有缓存键
+						  const keys = uni.getStorageInfoSync().keys;
+						  
+						  // 指定要保留的缓存键
+						  const preserveKey = 'deptId'; // 替换为你想要保留的缓存键
+						  
+						  // 遍历所有缓存键并删除除指定键以外的所有键
+						  keys.forEach(key => {
+						      if (key !== preserveKey) {
+						          uni.removeStorageSync(key);
+						      }
+						  });
+									
+						  // 进行重定向
+						  uni.redirectTo({
+						      url: '/pages/index/index'
+						  });
+					}
+				}).catch(error => {
+					console.error("Error fetching area data:", error);
+				});
+			
+			},
 			topage(num) {
 				if (num == 0) {
 					// uni.navigateTo({
@@ -489,7 +536,18 @@
 
 	.page {
 		width: 750rpx;
-
+		.btns{
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			width: 680rpx;
+			height: 90rpx;
+			background: #64B6A7 ;
+			color: #fff;
+			font-size: 36rpx;
+			border-radius: 20rpx;
+			margin: 40rpx auto;
+		}
 		.fixed {
 			z-index: 999;
 			position: fixed;
diff --git a/pages_admin/worke/AccountDetails.vue b/pages_admin/worke/AccountDetails.vue
index 8cc2273..f025429 100644
--- a/pages_admin/worke/AccountDetails.vue
+++ b/pages_admin/worke/AccountDetails.vue
@@ -97,6 +97,7 @@
 				realprice:0,
 				Quantity:0,
 				border: false,
+				isThrottled:false
 			}
 		},
 		onLoad(e) {
@@ -190,44 +191,61 @@
 			   return `${month}-${day} ${hours}:${minutes}`;
 			 },
 			payBtn() {
-				if(this.realprice!=0){
-					let data = {
-						amount: this.realprice
-					}
-					this.$u.post('/appVerify/admin/withdraw',data).then((res) => {
-						if (res.code == 200) {
-							this.amount=''
-							this.Quantity=0
-							this.realprice=0
-							this.price=0
-							this.list=[]
-							this.pageNum=1
-							this.getareaInfo()
-							this.getlist()
-							uni.showToast({
-							  title: '提现成功',
-							  icon: 'none',
-							  duration: 2000
-							});
-							
-						}else{
-							uni.showToast({
-							  title: res.msg,
-							  icon: 'none',
-							  duration: 2000
-							});
-						}
-					}).catch(error => {
-						console.error("Error fetching area data:", error);
-					});
-				}else{
-					uni.showToast({
-					  title: '提现金额不能为0',
-					  icon: 'none',
-					  duration: 2000
-					});
-					
-				}
+				    if (this.realprice != 0) {
+				        // 检查是否已经在等待三秒的时间内
+				        if (this.isThrottled) {
+				            uni.showToast({
+				                title: '请勿重复点击',
+				                icon: 'none',
+				                duration: 2000
+				            });
+				            return;
+				        }
+				        
+				        // 设置节流标志位
+				        this.isThrottled = true;
+				        
+				        let data = {
+				            amount: this.realprice,
+				            areaId: this.areaId
+				        }
+				        this.$u.post('/appVerify/admin/withdraw', data).then((res) => {
+				            if (res.code == 200) {
+				                this.amount = ''
+				                this.Quantity = 0
+				                this.realprice = 0
+				                this.price = 0
+				                this.list = []
+				                this.pageNum = 1
+				                this.getareaInfo()
+				                this.getlist()
+				                uni.showToast({
+				                    title: '提现成功',
+				                    icon: 'none',
+				                    duration: 2000
+				                });
+				            } else {
+				                uni.showToast({
+				                    title: res.msg,
+				                    icon: 'none',
+				                    duration: 2000
+				                });
+				            }
+				        }).catch(error => {
+				            console.error("Error fetching area data:", error);
+				        }).finally(() => {
+				            // 三秒后解除节流
+				            setTimeout(() => {
+				                this.isThrottled = false;
+				            }, 3000);
+				        });
+				    } else {
+				        uni.showToast({
+				            title: '提现金额不能为0',
+				            icon: 'none',
+				            duration: 2000
+				        });
+				    }
 				
 			},
 			getareaInfo() {