From f93f455134ff234be9d257c0f432c8052f1c32cd Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 18 七月 2025 19:20:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 small-program/pages/withdrawal/withdrawal.vue |   57 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 9 deletions(-)

diff --git a/small-program/pages/withdrawal/withdrawal.vue b/small-program/pages/withdrawal/withdrawal.vue
index 63b5460..765f968 100644
--- a/small-program/pages/withdrawal/withdrawal.vue
+++ b/small-program/pages/withdrawal/withdrawal.vue
@@ -3,7 +3,7 @@
 		<view class="tx-content">
 			<view class="tx-content-title">鍙彁鐜颁綑棰�(鍏�)</view>
 			<view class="tx-content-price">
-				<text>1000.00</text>
+				<text>{{((userInfo.amount|| 0)/100).toFixed(2)}}</text>
 				<view class="tx-content-price-btn" @click="jump">浣欓鏄庣粏</view>
 			</view>
 			<view class="content">
@@ -16,10 +16,10 @@
 					<view class="content-input-icon">
 						<image src="/static/icon/ic_money@2x.png" mode="widthFix"></image>
 					</view>
-					<input type="number" placeholder="璇疯緭鍏ユ彁鐜伴噾棰�" />
-					<view class="content-input-btn">鍏ㄩ儴鎻愮幇</view>
+					<input type="number" v-model="amount" @input="changeAmount" placeholder="璇疯緭鍏ユ彁鐜伴噾棰�" />
+					<view class="content-input-btn" @click="inputAll">鍏ㄩ儴鎻愮幇</view>
 				</view>
-				<view class="content-tips">杈撳叆鐨勯噾棰濆凡缁忚秴杩囧彲鎻愮幇閲戦</view>
+				<view class="content-tips">{{tips}}</view>
 				<view class="content-button" @click="submit">2灏忔椂鍒拌处锛岀‘璁ゆ彁鐜�</view>
 			</view>
 		</view>
@@ -27,10 +27,16 @@
 </template>
 
 <script>
+	import { mapState } from 'vuex'
 	export default {
+		computed: {
+			...mapState(['userInfo' ])
+		},
 		data() {
 			return {
-				
+				tips:'',//
+				changing1:false,
+				amount: null
 			};
 		},
 		methods: {
@@ -39,11 +45,44 @@
 					url: '/pages/balance-details/balance-details'
 				})
 			},
+			inputAll(){
+				this.amount = ((this.userInfo.amount|| 0)/100).toFixed(2)
+			},
+			changeAmount(){
+				this.tips=''
+			},
 			submit() {
-				uni.navigateTo({
-					url: '/pages/withdrawal-successful/withdrawal-successful'
-				})
-			}
+				  if(this.changing1){
+						return
+				  }
+				  this.changing1 = true
+				  if(this.amount == null || this.amount<=0){
+					  this.tips = '鎻愪氦閲戦蹇呴』澶т簬0锛岃嚦灏戞彁鐜�0.1鍏�'
+					  this.changing1 = false
+					  return
+				  }
+				  if(this.amount *100 > this.userInfo.amount){
+					  this.tips = '杈撳叆鐨勯噾棰濆凡缁忚秴杩囧彲鎻愮幇閲戦'
+					  this.changing1 = false
+					  return
+				  }
+				  this.changing1 = true
+				  var that = this
+				  var param ={amount:this.amount }
+				  that.$u.api.applyWithdrawal(param)
+				  .then(res =>{
+						if(res.code ===200){
+							uni.navigateTo({
+								url: '/pages/withdrawal-successful/withdrawal-successful'
+							})
+						} 
+				   }).finally(() => {
+						that.changing1 = false
+						that.tips=''
+						that.amount =null
+					})
+			},
+			
 		}
 	}
 </script>

--
Gitblit v1.9.3