Merge branch 'matt' into guillaume
This commit is contained in:
commit
3e907cf5f2
|
@ -7,12 +7,43 @@
|
||||||
<ion-header>
|
<ion-header>
|
||||||
|
|
||||||
<ion-navbar>
|
<ion-navbar>
|
||||||
<ion-title>buy</ion-title>
|
<ion-title>Échange de monnaie</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
|
<ion-list>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label stacked>Montant</ion-label>
|
||||||
|
<ion-input [(ngModel)]="amount" name="amount" type="number" value="10"></ion-input>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label stacked>N° de carte</ion-label>
|
||||||
|
<ion-input type="number"></ion-input>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label stacked>Titulaire de la carte</ion-label>
|
||||||
|
<ion-input type="text"></ion-input>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label stacked>Date d'expiration</ion-label>
|
||||||
|
<ion-input type="number"></ion-input>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label stacked>Cryptogramme</ion-label>
|
||||||
|
<ion-input type="number"></ion-input>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<button ion-button (click)="sendTransaction(amount)">Payer {{amount}} €</button>
|
||||||
|
|
||||||
|
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
</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 { AlertController } from 'ionic-angular';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the BuyPage page.
|
* Generated class for the BuyPage page.
|
||||||
|
@ -15,11 +16,26 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||||
})
|
})
|
||||||
export class BuyPage {
|
export class BuyPage {
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
constructor(public navCtrl: NavController, public navParams: NavParams, public alertCtrl: AlertController) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
console.log('ionViewDidLoad BuyPage');
|
console.log('ionViewDidLoad BuyPage');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendTransaction($amount) {
|
||||||
|
//TODO : Contacter l'API et proposer la transaction. L'API répondra true ou False
|
||||||
|
if (true === true) {
|
||||||
|
this.navCtrl.popToRoot();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const alert = this.alertCtrl.create({
|
||||||
|
title: 'Erreur',
|
||||||
|
subTitle: 'La transaction a échoué. Vérifiez les données saisies et réessayez.',
|
||||||
|
buttons: ['OK']
|
||||||
|
});
|
||||||
|
alert.present();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,17 +7,31 @@
|
||||||
<ion-header>
|
<ion-header>
|
||||||
|
|
||||||
<ion-navbar>
|
<ion-navbar>
|
||||||
<ion-title>home</ion-title>
|
<ion-title>Mon compte</ion-title>
|
||||||
|
<ion-buttons>
|
||||||
|
<button ion-item (click)="closeConnexion()">Se déconnecter</button>
|
||||||
|
</ion-buttons>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
|
<p class="welcome-text">Bonjour, François Pignon</p>
|
||||||
|
<ion-card>
|
||||||
|
<ion-card-header>
|
||||||
|
Solde actuel
|
||||||
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
|
<p class="balance">567,38</p>
|
||||||
|
<p>Gonettes</p>
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
|
||||||
<ion-buttons>
|
<ion-buttons>
|
||||||
<button ion-button (click)="changePage('buy')">Acheter de la monnaie locale</button>
|
<button ion-item (click)="changePage('contact')">Contacts</button>
|
||||||
<button ion-button (click)="changePage('send')">Payer</button>
|
<button ion-item (click)="changePage('buy')">Acheter de la monnaie locale</button>
|
||||||
<button ion-button (click)="changePage('history')">Historique des transactions</button>
|
<button ion-item (click)="changePage('send')">Faire un virement</button>
|
||||||
<button ion-button color="danger" (click)="closeConnexion()">Disconnect</button>
|
<button ion-item (click)="changePage('history')">Historique des transactions</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<ion-header>
|
<ion-header>
|
||||||
|
|
||||||
<ion-navbar>
|
<ion-navbar>
|
||||||
<ion-title>send</ion-title>
|
<ion-title>Effectuer un virement</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
Loading…
Reference in a new issue