|
@@ -21,7 +21,16 @@ export class WithdrawalComponent implements OnInit {
|
|
|
private aiServ: AiChatService
|
|
|
) {}
|
|
|
price: number = 0;
|
|
|
- balance: number = 0;
|
|
|
+ income:{
|
|
|
+ balance:number,
|
|
|
+ used:number,
|
|
|
+ total:number
|
|
|
+ } = {
|
|
|
+ balance:0,
|
|
|
+ used:0,
|
|
|
+ total:0
|
|
|
+ }
|
|
|
+
|
|
|
bankinfo: {
|
|
|
bankname: string;
|
|
|
name: string;
|
|
@@ -53,7 +62,10 @@ export class WithdrawalComponent implements OnInit {
|
|
|
}
|
|
|
console.log(this.account);
|
|
|
let anthorWallet = await this.aiServ.getAuthorWallet(id!);
|
|
|
- this.balance = anthorWallet.balance;
|
|
|
+ this.income = anthorWallet;
|
|
|
+ }
|
|
|
+ onChangePrice(){
|
|
|
+ this.price = Math.round(this.price * 100) / 100;
|
|
|
}
|
|
|
async withdrawal() {
|
|
|
if (
|
|
@@ -68,7 +80,7 @@ export class WithdrawalComponent implements OnInit {
|
|
|
this.toast('请输入正确金额', 1500);
|
|
|
return;
|
|
|
}
|
|
|
- if (this.balance < this.price) {
|
|
|
+ if (this.income.balance < this.price) {
|
|
|
this.toast('提现金额不得超过余额!', 1500);
|
|
|
return;
|
|
|
}
|