envoyer carte v3

thierry
Tmadkaud 7 years ago
parent 0b3b24b021
commit fea435705f

@ -23,6 +23,7 @@ import { ProfilComponent } from './components/profil/profil.component';
import { OpCommercialComponent } from './components/opCommercial/op-commercial/op-commercial.component';
import { CreationOpComComponent } from './components/opCommercial/creation-op-com/creation-op-com.component';
import { CarteParrainageComponent } from './components/carteParrainage/carte-parrainage/carte-parrainage.component';
import { EnvoyerCarteComponent } from './components/opCommercial/envoyer-carte/envoyer-carte.component';
@NgModule({
@ -35,7 +36,8 @@ import { CarteParrainageComponent } from './components/carteParrainage/carte-par
ProfilComponent,
OpCommercialComponent,
CreationOpComComponent,
CarteParrainageComponent
CarteParrainageComponent,
EnvoyerCarteComponent
],
imports: [
BrowserModule,

@ -5,6 +5,7 @@ import { ProfilComponent } from './components/profil/profil.component';
import { OpCommercialComponent } from './components/opCommercial/op-commercial/op-commercial.component';
import { CreationOpComComponent } from './components/opCommercial/creation-op-com/creation-op-com.component';
import { CarteParrainageComponent } from './components/carteParrainage/carte-parrainage/carte-parrainage.component';
import { EnvoyerCarteComponent } from './components/opCommercial/envoyer-carte/envoyer-carte.component';
export const AppRoutes = [
{path: '', component: HomeComponent},
@ -14,4 +15,5 @@ export const AppRoutes = [
{path: 'opCommercial', component: OpCommercialComponent},
{path: 'creationOpCommercial', component: CreationOpComComponent},
{path: 'carteParrainageComponent', component: CarteParrainageComponent},
{path: 'EnvoyerCarte', component: EnvoyerCarteComponent},
];

@ -5,6 +5,7 @@
</logo>
<links>
<ul class="navbar-nav mr-auto">
<!--
<li class="nav-item active waves-light" mdbRippleRadius>
<a class="nav-link" >Home <span class="sr-only">(current)</span></a>
</li>

@ -21,6 +21,7 @@ import { AuthService } from '../../services/auth/auth.service';
})
export class NavigationBarComponent implements OnInit, OnDestroy{
/*
user: Observable<firebase.User>;
localUser: any;
parrain: Parrain;
@ -77,7 +78,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy{
this.updateNavBar();
this.router.navigate(['/']);
}
*/
ngOnInit() {
}

@ -73,7 +73,7 @@
</div>
<button (click)="goToOpCom()">Opération Commerciales</button>
</div>
<button (click)="logout()">Logout</button>
<button (click)="logout()"> <!--*ngIf="(user | async)?.uid"-->Logout</button>
<!--Quotation-->

@ -71,6 +71,7 @@ export class ProfilComponent implements OnInit, OnDestroy {
}
logout() {
firebase.auth().signOut();
this.authService.logout();
this.user = null;
this.router.navigate(['/']);
@ -88,7 +89,7 @@ export class ProfilComponent implements OnInit, OnDestroy {
}
ngOnDestroy() {
firebase.auth().signOut();
//firebase.auth().signOut();
/*
this.localUser = {
uid: '',

@ -5,11 +5,11 @@
<label>
<form class="form-inline">
<div class="md-form">
<input name="group2" type="radio" class="with-gap" id="parrain" value="Parrain" [(ngModel)]="currentUser.status">
<input name="group2" type="radio" class="with-gap" id="parrain" (click)="ngOnDestroy()" value="Parrain" [(ngModel)]="currentUser.status">
<label for="parrain">Parrain</label>
</div>
<div class="md-form">
<input name="group2" type="radio" class="with-gap" id="commercant" value="Commercant" [(ngModel)]="currentUser.status">
<input name="group2" type="radio" class="with-gap" id="commercant" (click)="ngOnDestroy()" value="Commercant" [(ngModel)]="currentUser.status">
<label for="commercant">Commercant</label>
</div>
</form>

@ -21,11 +21,13 @@ export class RegisterComponent implements OnInit, OnDestroy {
commercant: Commercant;
ConfirmPasswordParrain: String;
ConfirmPasswordCommercant: String;
test: boolean;
constructor(private router: Router, private authService: AuthService) {
this.currentUser = new User();
this.parrain = new Parrain();
this.commercant = new Commercant();
this.test = false;
}
register() {
@ -33,10 +35,16 @@ export class RegisterComponent implements OnInit, OnDestroy {
this.parrain.status = this.currentUser.status;
this.parrain.secretCode = this.getRandomArbitrary(1111, 9999).toString();
this.authService.signUp(this.parrain);
this.test = true;
}else if (this.currentUser.status === 'Commercant') {
this.commercant.status = this.currentUser.status;
this.authService.signUp(this.commercant);
}
this.test = true;
}else if (this.test) {
this.ngOnDestroy();
this.currentUser.status = '';
this.test = false;
}
}
// On renvoie un nombre aléatoire entre une valeur min (incluse)
@ -48,6 +56,10 @@ export class RegisterComponent implements OnInit, OnDestroy {
loadHomeComponent() {
this.router.navigate(['/']);
}
clicktest(){
}
/*
luhn(str) {
return str.split('').reduceRight(function(prev, curr, idx){
@ -73,7 +85,7 @@ export class RegisterComponent implements OnInit, OnDestroy {
email: '',
emailVerified: false,
password: '',
status: ''
status: this.currentUser.status
};
this.parrain = {
uid: '',

Loading…
Cancel
Save