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 {
|
public goToAddress(addrStr: string): void {
|
||||||
console.log('address', address);
|
|
||||||
this.navCtrl.push('address', {
|
this.navCtrl.push('address', {
|
||||||
'address': address
|
'addrStr': addrStr
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,8 +18,8 @@
|
|||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-12>
|
<ion-col col-12>
|
||||||
<h1>Address</h1>
|
<h1>Address</h1>
|
||||||
<p>0 BTC</p>
|
<p>{{ address.addrStr }}</p>
|
||||||
<p>{{ address }}</p>
|
<p>{{ address.balance }} BTC</p>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
@ -27,19 +27,19 @@
|
|||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-6>Total Received:</ion-col>
|
<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-row>
|
<ion-row>
|
||||||
<ion-col col-6>Total Sent:</ion-col>
|
<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-row>
|
<ion-row>
|
||||||
<ion-col col-6>Final Balance:</ion-col>
|
<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-row>
|
<ion-row>
|
||||||
<ion-col col-6>No. Transactions:</ion-col>
|
<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-row>
|
<ion-row>
|
||||||
<ion-col col-12 text-center>QR CODE</ion-col>
|
<ion-col col-12 text-center>QR CODE</ion-col>
|
||||||
@ -49,5 +49,5 @@
|
|||||||
</ion-row>
|
</ion-row>
|
||||||
</ion-grid>
|
</ion-grid>
|
||||||
|
|
||||||
<transactions [queryType]="'address'" [queryValue]="address"></transactions>
|
<transactions [queryType]="'address'" [queryValue]="addrStr"></transactions>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||||
|
import { Http } from '@angular/http';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the AddressPage page.
|
* Generated class for the AddressPage page.
|
||||||
@ -9,7 +10,7 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
|||||||
*/
|
*/
|
||||||
@IonicPage({
|
@IonicPage({
|
||||||
name: 'address',
|
name: 'address',
|
||||||
segment: 'address/:address'
|
segment: 'address/:addrStr'
|
||||||
})
|
})
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-address',
|
selector: 'page-address',
|
||||||
@ -18,14 +19,26 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
|||||||
export class AddressPage {
|
export class AddressPage {
|
||||||
|
|
||||||
public loading: boolean = true;
|
public loading: boolean = true;
|
||||||
private address: string;
|
private addrStr: string;
|
||||||
|
public address: any = {};
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http) {
|
||||||
this.address = navParams.get('address');
|
this.addrStr = navParams.get('addrStr');
|
||||||
}
|
}
|
||||||
|
|
||||||
public ionViewDidLoad(): void {
|
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