|  | @ -9,10 +9,12 @@ | 
														
													
														
															
																|  |  | <view class="balance-title">总余额(元)</view> |  |  | <view class="balance-title">总余额(元)</view> | 
														
													
														
															
																|  |  | <view class="balance-amount">{{ walletData.balance.toFixed(2) }}</view> |  |  | <view class="balance-amount">{{ walletData.balance.toFixed(2) }}</view> | 
														
													
														
															
																|  |  | <view class="balance-actions"> |  |  | <view class="balance-actions"> | 
														
													
														
															
																|  |  | <view class="action-btn recharge-btn" @click="navigateToRecharge"> |  |  |  | 
														
													
														
															
																|  |  |  |  |  | <view class="action-btn recharge-btn" v-if="!isRecharge"        @tap="navigateToRecharge"> | 
														
													
														
															
																|  |  | <text>去充值</text> |  |  | <text>去充值</text> | 
														
													
														
															
																|  |  |  |  |  | <text class="arrow">></text> | 
														
													
														
															
																|  |  | </view> |  |  | </view> | 
														
													
														
															
																|  |  | <view class="action-btn detail-btn" @click="navigateToDetail"> |  |  |  | 
														
													
														
															
																|  |  |  |  |  | <view class="action-btn" v-else /> | 
														
													
														
															
																|  |  |  |  |  | <view class="action-btn detail-btn" @tap="navigateToDetail"> | 
														
													
														
															
																|  |  | <text>资产明细</text> |  |  | <text>资产明细</text> | 
														
													
														
															
																|  |  | <text class="arrow">></text> |  |  | <text class="arrow">></text> | 
														
													
														
															
																|  |  | </view> |  |  | </view> | 
														
													
												
													
														
															
																|  | @ -22,23 +24,25 @@ | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | <!-- 提现表单 --> |  |  | <!-- 提现表单 --> | 
														
													
														
															
																|  |  | <view class="withdraw-section"> |  |  | <view class="withdraw-section"> | 
														
													
														
															
																|  |  | <view class="section-title">我要提现</view> |  |  |  | 
														
													
														
															
																|  |  |  |  |  | <view class="section-title">{{ isRecharge ? '我要充值' : '我要提现' }}</view> | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | <!-- 提现金额输入框 --> |  |  | <!-- 提现金额输入框 --> | 
														
													
														
															
																|  |  | <view class="input-item"> |  |  | <view class="input-item"> | 
														
													
														
															
																|  |  | <text class="currency-symbol">¥</text> |  |  | <text class="currency-symbol">¥</text> | 
														
													
														
															
																|  |  | <input class="amount-input" type="digit" v-model="withdrawAmount" placeholder="请输入提现金额" |  |  |  | 
														
													
														
															
																|  |  |  |  |  | <input v-if="!isRecharge" class="amount-input"  type="digit" v-model="withdrawAmount" placeholder="请输入提现金额" | 
														
													
														
															
																|  |  |  |  |  | @blur="validateAmount" /> | 
														
													
														
															
																|  |  |  |  |  | <input v-else class="amount-input"  type="digit" v-model="rechargeAmount" placeholder="请输入充值金额" | 
														
													
														
															
																|  |  | @blur="validateAmount" /> |  |  | @blur="validateAmount" /> | 
														
													
														
															
																|  |  | </view> |  |  | </view> | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | <!-- 真实姓名输入框 --> |  |  | <!-- 真实姓名输入框 --> | 
														
													
														
															
																|  |  | <view class="input-item"> |  |  |  | 
														
													
														
															
																|  |  |  |  |  | <view class="input-item" v-if="!isRecharge"> | 
														
													
														
															
																|  |  | <input class="name-input" type="nickname" v-model="realName" placeholder="请输入真实姓名" |  |  | <input class="name-input" type="nickname" v-model="realName" placeholder="请输入真实姓名" | 
														
													
														
															
																|  |  | @blur="validateName" /> |  |  | @blur="validateName" /> | 
														
													
														
															
																|  |  | </view> |  |  | </view> | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | <!-- 提现说明 --> |  |  | <!-- 提现说明 --> | 
														
													
														
															
																|  |  | <view class="withdraw-notes"> |  |  |  | 
														
													
														
															
																|  |  |  |  |  | <view class="withdraw-notes" v-if="!isRecharge"> | 
														
													
														
															
																|  |  | <view class="notes-title">提现说明</view> |  |  | <view class="notes-title">提现说明</view> | 
														
													
														
															
																|  |  | <view class="notes-list"> |  |  | <view class="notes-list"> | 
														
													
														
															
																|  |  | <view class="note-item" v-for="(rule, index) in walletData.withdrawRules" :key="index"> |  |  | <view class="note-item" v-for="(rule, index) in walletData.withdrawRules" :key="index"> | 
														
													
												
													
														
															
																|  | @ -50,8 +54,8 @@ | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | <!-- 提现按钮 --> |  |  | <!-- 提现按钮 --> | 
														
													
														
															
																|  |  | <view class="submit-btn-wrapper"> |  |  | <view class="submit-btn-wrapper"> | 
														
													
														
															
																|  |  | <button class="submit-btn" @click="submitWithdraw" :disabled="!isFormValid"> |  |  |  | 
														
													
														
															
																|  |  | 立即提现 |  |  |  | 
														
													
														
															
																|  |  |  |  |  | <button class="submit-btn" @tap="submitWithdraw" :disabled="!isFormValid"> | 
														
													
														
															
																|  |  |  |  |  | {{ isRecharge ? '立即充值' : '立即提现' }} | 
														
													
														
															
																|  |  | </button> |  |  | </button> | 
														
													
														
															
																|  |  | </view> |  |  | </view> | 
														
													
														
															
																|  |  | </view> |  |  | </view> | 
														
													
												
													
														
															
																|  | @ -69,33 +73,29 @@ export default { | 
														
													
														
															
																|  |  | return { |  |  | return { | 
														
													
														
															
																|  |  | walletData: null, |  |  | walletData: null, | 
														
													
														
															
																|  |  | withdrawAmount: '', |  |  | withdrawAmount: '', | 
														
													
														
															
																|  |  |  |  |  | rechargeAmount: '', | 
														
													
														
															
																|  |  | realName: '', |  |  | realName: '', | 
														
													
														
															
																|  |  | amountError: '', |  |  | amountError: '', | 
														
													
														
															
																|  |  | nameError: '' |  |  |  | 
														
													
														
															
																|  |  | } |  |  |  | 
														
													
														
															
																|  |  | }, |  |  |  | 
														
													
														
															
																|  |  | computed: { |  |  |  | 
														
													
														
															
																|  |  | isFormValid() { |  |  |  | 
														
													
														
															
																|  |  | return this.withdrawAmount && this.realName && !this.amountError && !this.nameError |  |  |  | 
														
													
														
															
																|  |  |  |  |  | nameError: '', | 
														
													
														
															
																|  |  |  |  |  | isFormValid: true, | 
														
													
														
															
																|  |  |  |  |  | isRecharge: false | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | onLoad() { |  |  | onLoad() { | 
														
													
														
															
																|  |  | this.walletData = walletData |  |  | this.walletData = walletData | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  | methods: { |  |  | methods: { | 
														
													
														
															
																|  |  | // 导航到充值页面 |  |  | // 导航到充值页面 | 
														
													
														
															
																|  |  | navigateToRecharge() { |  |  | navigateToRecharge() { | 
														
													
														
															
																|  |  | uni.showToast({ |  |  |  | 
														
													
														
															
																|  |  | title: '充值功能暂未开放', |  |  |  | 
														
													
														
															
																|  |  | icon: 'none' |  |  |  | 
														
													
														
															
																|  |  | }) |  |  |  | 
														
													
														
															
																|  |  |  |  |  | this.isRecharge = true | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | // 导航到资产明细页面 |  |  | // 导航到资产明细页面 | 
														
													
														
															
																|  |  | navigateToDetail() { |  |  | navigateToDetail() { | 
														
													
														
															
																|  |  | uni.showToast({ |  |  | uni.showToast({ | 
														
													
														
															
																|  |  | title: '资产明细功能暂未开放', |  |  | title: '资产明细功能暂未开放', | 
														
													
														
															
																|  |  | icon: 'none' |  |  |  | 
														
													
														
															
																|  |  |  |  |  | icon: 'error' | 
														
													
														
															
																|  |  | }) |  |  | }) | 
														
													
														
															
																|  |  | }, |  |  | }, | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
												
													
														
															
																|  | @ -144,13 +144,19 @@ export default { | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | // 提交提现申请 |  |  | // 提交提现申请 | 
														
													
														
															
																|  |  | submitWithdraw() { |  |  | submitWithdraw() { | 
														
													
														
															
																|  |  |  |  |  | if (this.isRecharge) { | 
														
													
														
															
																|  |  |  |  |  | return this.recharge() | 
														
													
														
															
																|  |  |  |  |  | } | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | // 再次验证表单 |  |  | // 再次验证表单 | 
														
													
														
															
																|  |  | if (!this.validateAmount() || !this.validateName()) { |  |  | if (!this.validateAmount() || !this.validateName()) { | 
														
													
														
															
																|  |  |  |  |  | console.log(2); | 
														
													
														
															
																|  |  | // 显示具体错误 |  |  | // 显示具体错误 | 
														
													
														
															
																|  |  | if (this.amountError) { |  |  | if (this.amountError) { | 
														
													
														
															
																|  |  |  |  |  | console.log(3); | 
														
													
														
															
																|  |  | uni.showToast({ |  |  | uni.showToast({ | 
														
													
														
															
																|  |  | title: this.amountError, |  |  | title: this.amountError, | 
														
													
														
															
																|  |  | icon: 'none' |  |  |  | 
														
													
														
															
																|  |  |  |  |  | icon: 'error' | 
														
													
														
															
																|  |  | }) |  |  | }) | 
														
													
														
															
																|  |  | return |  |  | return | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
												
													
														
															
																|  | @ -158,7 +164,7 @@ export default { | 
														
													
														
															
																|  |  | if (this.nameError) { |  |  | if (this.nameError) { | 
														
													
														
															
																|  |  | uni.showToast({ |  |  | uni.showToast({ | 
														
													
														
															
																|  |  | title: this.nameError, |  |  | title: this.nameError, | 
														
													
														
															
																|  |  | icon: 'none' |  |  |  | 
														
													
														
															
																|  |  |  |  |  | icon: 'error' | 
														
													
														
															
																|  |  | }) |  |  | }) | 
														
													
														
															
																|  |  | return |  |  | return | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
												
													
														
															
																|  | @ -166,6 +172,11 @@ export default { | 
														
													
														
															
																|  |  | return |  |  | return | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  |  |  |  | // 如果在isFormVaild为false的情况下进入函数 则为多次点击 直接返回 | 
														
													
														
															
																|  |  |  |  |  | if (this.isFormValid) { | 
														
													
														
															
																|  |  |  |  |  | this.isFormValid = false | 
														
													
														
															
																|  |  |  |  |  | }else return | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | // 显示提交中状态 |  |  | // 显示提交中状态 | 
														
													
														
															
																|  |  | uni.showLoading({ |  |  | uni.showLoading({ | 
														
													
														
															
																|  |  | title: '提交中...' |  |  | title: '提交中...' | 
														
													
												
													
														
															
																|  | @ -185,7 +196,40 @@ export default { | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | // 模拟余额变更 |  |  | // 模拟余额变更 | 
														
													
														
															
																|  |  | this.walletData.balance -= parseFloat(this.withdrawAmount) |  |  | this.walletData.balance -= parseFloat(this.withdrawAmount) | 
														
													
														
															
																|  |  |  |  |  | this.isFormValid = true | 
														
													
														
															
																|  |  | }, 1500) |  |  | }, 1500) | 
														
													
														
															
																|  |  |  |  |  | }, | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  |  |  |  | recharge() { | 
														
													
														
															
																|  |  |  |  |  | uni.showModal({ | 
														
													
														
															
																|  |  |  |  |  | title: '确认充值', | 
														
													
														
															
																|  |  |  |  |  | content: '充值金额为' + this.rechargeAmount + '元', | 
														
													
														
															
																|  |  |  |  |  | confirmColor: '#019245', | 
														
													
														
															
																|  |  |  |  |  | success: (res) => { | 
														
													
														
															
																|  |  |  |  |  | // 这里编写函数逻辑 | 
														
													
														
															
																|  |  |  |  |  | if (res.confirm) { | 
														
													
														
															
																|  |  |  |  |  | uni.showLoading({ | 
														
													
														
															
																|  |  |  |  |  | title: '充值中...' | 
														
													
														
															
																|  |  |  |  |  | }) | 
														
													
														
															
																|  |  |  |  |  | // 执行重置逻辑 | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  |  |  |  | // 模拟重置时间 | 
														
													
														
															
																|  |  |  |  |  | setTimeout(() => { | 
														
													
														
															
																|  |  |  |  |  | uni.hideLoading() | 
														
													
														
															
																|  |  |  |  |  | uni.showToast({ | 
														
													
														
															
																|  |  |  |  |  | title: '充值成功', | 
														
													
														
															
																|  |  |  |  |  | icon: 'success' | 
														
													
														
															
																|  |  |  |  |  | }) | 
														
													
														
															
																|  |  |  |  |  | // 重置表单 | 
														
													
														
															
																|  |  |  |  |  | this.rechargeAmount = '' | 
														
													
														
															
																|  |  |  |  |  | this.isRecharge = false | 
														
													
														
															
																|  |  |  |  |  | }, 1500) | 
														
													
														
															
																|  |  |  |  |  | } | 
														
													
														
															
																|  |  |  |  |  | }, | 
														
													
														
															
																|  |  |  |  |  | fail: (err) => { | 
														
													
														
															
																|  |  |  |  |  | console.log(err); | 
														
													
														
															
																|  |  |  |  |  | } | 
														
													
														
															
																|  |  |  |  |  | }) | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
												
													
														
															
																|  | @ -245,12 +289,12 @@ export default { | 
														
													
														
															
																|  |  | justify-content: center; |  |  | justify-content: center; | 
														
													
														
															
																|  |  | font-size: 24rpx; |  |  | font-size: 24rpx; | 
														
													
														
															
																|  |  | font-weight: normal; |  |  | font-weight: normal; | 
														
													
														
															
																|  |  |  |  |  | gap: 4rpx; | 
														
													
														
															
																|  |  | // line-height: 1; |  |  | // line-height: 1; | 
														
													
														
															
																|  |  | padding: 0 20rpx; |  |  | padding: 0 20rpx; | 
														
													
														
															
																|  |  | } |  |  | } | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | .detail-btn { |  |  | .detail-btn { | 
														
													
														
															
																|  |  | // border: 1px solid rgba(255, 255, 255, 0.6); |  |  |  | 
														
													
														
															
																|  |  |  |  |  |  | 
														
													
														
															
																|  |  | .arrow { |  |  | .arrow { | 
														
													
														
															
																|  |  | margin-left: 10rpx; |  |  | margin-left: 10rpx; | 
														
													
												
													
														
															
																|  | @ -275,7 +319,7 @@ export default { | 
														
													
														
															
																|  |  | align-items: center; |  |  | align-items: center; | 
														
													
														
															
																|  |  | padding: 24rpx 20rpx; |  |  | padding: 24rpx 20rpx; | 
														
													
														
															
																|  |  | margin-bottom: 20rpx; |  |  | margin-bottom: 20rpx; | 
														
													
														
															
																|  |  | // background-color: red; |  |  |  | 
														
													
														
															
																|  |  |  |  |  | background-color: #e7e7e7; | 
														
													
														
															
																|  |  | border-radius: 20rpx; |  |  | border-radius: 20rpx; | 
														
													
														
															
																|  |  | .currency-symbol { |  |  | .currency-symbol { | 
														
													
														
															
																|  |  | color: #FF0000; |  |  | color: #FF0000; | 
														
													
												
													
														
															
																|  | 
 |