wattle.component.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { Component, OnInit } from '@angular/core';
  2. import { IonicModule } from '@ionic/angular';
  3. import * as Parse from 'parse';
  4. import { Router, ActivatedRoute } from '@angular/router';
  5. import { NavComponent } from '../../../app/components/nav/nav.component';
  6. @Component({
  7. selector: 'app-wattle',
  8. templateUrl: './wattle.component.html',
  9. styleUrls: ['./wattle.component.scss'],
  10. standalone: true,
  11. imports: [IonicModule,NavComponent],
  12. })
  13. export class WattleComponent implements OnInit {
  14. company: any = localStorage.getItem('company');
  15. constructor(private activatRoute: ActivatedRoute,
  16. private router: Router,) { }
  17. account: any = {}
  18. ngOnInit() {
  19. this.activatRoute.paramMap.subscribe(parms => {
  20. this.getAccount()
  21. })
  22. }
  23. back() {
  24. this.router.navigate(['metayoung/tabs/my'])
  25. }
  26. async getAccount() {
  27. let id = Parse.User.current()?.id
  28. let Account = new Parse.Query("Account")
  29. Account.equalTo("user", id)
  30. Account.equalTo("company", this.company)
  31. let account = await Account.first()
  32. this.account = account?.toJSON()
  33. }
  34. // showBalance(balance:number) {
  35. // if (balance) {
  36. // return Number(balance.toFixed(2))
  37. // } else {
  38. // return 0
  39. // }
  40. // }
  41. record() {
  42. this.router.navigate(['metayoung/record'])
  43. }
  44. records() {
  45. this.router.navigate(['metayoung/records'])
  46. }
  47. recharge() {
  48. this.router.navigate(['metayoung/recharge'])
  49. }
  50. withdrawal() {
  51. this.router.navigate(['metayoung/withdrawal'])
  52. }
  53. toBank() {
  54. this.router.navigate(['account/bankcard'])
  55. }
  56. }