replace address page placeholders with real data
This commit is contained in:
parent
22351df704
commit
866b45457d
@ -61,10 +61,9 @@ export class TransactionsComponent {
|
||||
*/
|
||||
}
|
||||
|
||||
public goToAddress(address: string): void {
|
||||
console.log('address', address);
|
||||
public goToAddress(addrStr: string): void {
|
||||
this.navCtrl.push('address', {
|
||||
'address': address
|
||||
'addrStr': addrStr
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
<ion-row>
|
||||
<ion-col col-12>
|
||||
<h1>Address</h1>
|
||||
<p>0 BTC</p>
|
||||
<p>{{ address }}</p>
|
||||
<p>{{ address.addrStr }}</p>
|
||||
<p>{{ address.balance }} BTC</p>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
@ -27,19 +27,19 @@
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col col-6>Total Received:</ion-col>
|
||||
<ion-col col-6 text-right>0.00000000 BTC</ion-col>
|
||||
<ion-col col-6 text-right>{{ address.totalReceived }} BTC</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col col-6>Total Sent:</ion-col>
|
||||
<ion-col col-6 text-right>0.00000000 BTC</ion-col>
|
||||
<ion-col col-6 text-right>{{ address.totalSent }} BTC</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col col-6>Final Balance:</ion-col>
|
||||
<ion-col col-6 text-right>0.00000000 BTC</ion-col>
|
||||
<ion-col col-6 text-right>{{ address.balance }} BTC</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col col-6>No. Transactions:</ion-col>
|
||||
<ion-col col-6 text-right>0</ion-col>
|
||||
<ion-col col-6 text-right>{{ address.txApperances }}</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col col-12 text-center>QR CODE</ion-col>
|
||||
@ -49,5 +49,5 @@
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
<transactions [queryType]="'address'" [queryValue]="address"></transactions>
|
||||
<transactions [queryType]="'address'" [queryValue]="addrStr"></transactions>
|
||||
</ion-content>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
import { Http } from '@angular/http';
|
||||
|
||||
/**
|
||||
* Generated class for the AddressPage page.
|
||||
@ -9,7 +10,7 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
*/
|
||||
@IonicPage({
|
||||
name: 'address',
|
||||
segment: 'address/:address'
|
||||
segment: 'address/:addrStr'
|
||||
})
|
||||
@Component({
|
||||
selector: 'page-address',
|
||||
@ -18,14 +19,26 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
export class AddressPage {
|
||||
|
||||
public loading: boolean = true;
|
||||
private address: string;
|
||||
private addrStr: string;
|
||||
public address: any = {};
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
||||
this.address = navParams.get('address');
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http) {
|
||||
this.addrStr = navParams.get('addrStr');
|
||||
}
|
||||
|
||||
public ionViewDidLoad(): void {
|
||||
console.log('ionViewDidLoad AddressPage');
|
||||
let apiPrefix: string = 'http://localhost:3001/insight-api/';
|
||||
|
||||
this.http.get(apiPrefix + 'addr/' + this.addrStr + '/?noTxList=1').subscribe(
|
||||
(data) => {
|
||||
this.address = JSON.parse(data['_body']);
|
||||
this.loading = false;
|
||||
},
|
||||
(err) => {
|
||||
console.log('err is', err);
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user