50% des bug xjc

thierry
Tmadkaud 7 years ago
parent 6dac42ed88
commit 09c0182cae

@ -14,7 +14,7 @@
<div class="card-block row no-margin">
<div class="col-md-8" id="subCard2Part1">
<div id="opTitle">
<label>ID Operation Commerciale: {{crt.operationCommercialID}}</label>
<label>Operation Commerciale: {{crt.operationCommercialID}}</label>
<label>Nom: {{crt.parrainCarte.familyname}}</label>
<label>Prénom: {{crt.parrainCarte.firstname}}</label>
<label>ID: {{crt.uid}}</label>

@ -2,6 +2,17 @@
<div class="container">
<h4 class="mb-5 mt-1 font-bold wow fadeInDown text-center" style="padding-top: 5%;">Cartes de parrainage ({{(carteParrData | async)?.length}})</h4>
<div *ngIf="(carteParrData | async)?.length == 0" class="alert alert-danger">
Cher,<strong><i> {{parrain.firstname}} </i></strong>
<p>Le principe est simple :</p>
<ul>
<li>- Reçoit tes cartes de parrainage ici</li>
<li>- Partage-les à tes amis via Facebook, Whatsapp, ect.</li>
<li>- Gagne de l'argent chaque fois qu'un de tes amis présente ta carte lors de ses achats</li>
</ul>
<p>N'attends plus, et rends toi vite chez un des commerçcant affiliés de ton choix pour obtenir ta </p>
<p>carte de parrainage !</p>
</div>
<div class="list-group wow fadeInUpBig">
<div class="card mainCard" *ngFor="let crt of carteParrData | async">
<div class="row no-margin">

@ -11,14 +11,14 @@
<i class="fa fa-calendar-check-o prefix grey-text"></i>
<input type="date" id="orangeForm-Date" [(ngModel)]="opComm.dateDebut" placeholder="Date debut" required min="minDateTimeTest" max="maxDateTimeTest" name="dateDeb" #dateDeb="ngModel">
<div *ngIf="(validationDateDebut()) && (dateDeb.dirty || dateDeb.touched)" class="alert alert-danger">
La date de début doit être comprise entre <strong><i>{{todayDateTimeTest}} et 01/01/2117</i></strong>.
La date de début doit être comprise entre <strong><i>{{todayDateTimeTest | date:'dd/MM/yyyy'}} et 01/01/2117</i></strong>.
</div>
</div>
<div class="md-form">
<i class="fa fa-calendar-times-o prefix grey-text"></i>
<input type="date" id="orangeForm-Date" [(ngModel)]="opComm.dateFin" placeholder="Date fin" required min="minDateTimeTest" max="maxDateTimeTest" name="dateFin" #dateFin="ngModel">
<div *ngIf="(validationDateFin()) && (dateFin.dirty || dateFin.touched)" class="alert alert-danger">
La date de fin doit être comprise entre <strong><i>{{todayDateTimeTest}} et 01/01/2117</i></strong>.
La date de fin doit être comprise entre <strong><i>{{todayDateTimeTest | date:'dd/MM/yyyy'}} et 01/01/2117</i></strong>.
</div>
</div>

@ -92,7 +92,7 @@ export class CreationOpComComponent implements OnInit, OnDestroy {
this.debutDateTimeTest = new Date(this.opComm.dateDebut);
this.finDateTimeTest = new Date(this.opComm.dateFin);
this.todayDateTimeTest = new Date(Date.now());
this.todayDateTimeTest = new Date(this.todayDateTimeTest.getTime() - 50000000);
this.todayDateTimeTest = new Date(this.todayDateTimeTest.getTime() - 100000000);
if (this.debutDateTimeTest.getTime() <= (this.todayDateTimeTest.getTime())
|| this.debutDateTimeTest.getTime() >= this.maxDateTimeTest.getTime()) {
return true;

@ -372,9 +372,9 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
console.log('blob : ' + blob);
console.log('maCarteP.uid: ' + maCarteP.uid);
storageRef.child('CarteParrainage/' + maCarteP.uid + '/carteTemplate').put(blob).then((snapshot) => {
storageRef.child('CarteParrainage/' + maCarteP.uid + '/carteTemplate.jpg').put(blob).then((snapshot) => {
const updates = {};
maCarteP.carteTemplate.path = 'CarteParrainage/' + maCarteP.uid + '/carteTemplate';
maCarteP.carteTemplate.path = 'CarteParrainage/' + maCarteP.uid + '/carteTemplate.jpg';
maCarteP.carteTemplate.filename = maCarteP.name;
maCarteP.carteTemplate.downloadURL = snapshot.downloadURL;
console.log('maCarteP.carteTemplate.filename : ' + maCarteP.carteTemplate.filename);

@ -17,6 +17,16 @@
<button class="btn btn-primary btn-rounded waves-light" id="nouvelleOp" (click)="goToCreaOpCom()">Nouvelle opération commerciale</button>
<!--<button class="btn btn-primary btn-rounded waves-light" (click)="goToCarteEnvoyer()">Historique carte envoyer</button>-->
<!--<button class="btn btn-default btn-rounded waves-light" (click)="goToProfil()">Profil</button>-->
<div *ngIf="(opCommData | async)?.length == 0" class="alert alert-danger">
Cher,<strong><i> {{commercant.commercialName}} </i></strong>
<p>Le principe est simple :</p>
<ul>
<li>- Crées tes opérations commerciales ici</li>
<li>- Envoie-les à tes client, ils deviendront tes parrains affiliés</li>
<li>- Gagne des clients à chaque fois qu'un de tes parrains envoie sa carte à ses amis</li>
</ul>
<p>N'attends plus, crées tes opérations commerciale et envoie les aux futurs parrains affiliés de ton choix !</p>
</div>
</div>
<div class="list-group wow fadeInUpBig">

@ -245,9 +245,9 @@ export class ScannerCarteComponent implements OnInit, OnDestroy {
var elementCarteHist = 'Le ' + (this.scan.dateCreation).getDate() + '/' + (this.scan.dateCreation).getMonth()
+ '/' + (this.scan.dateCreation).getFullYear() + ' à ' + (this.scan.dateCreation).getHours() + ':'
+ (this.scan.dateCreation).getMinutes() + ', ' + ' la visite de : '
+ this.filleul.familyname.toUpperCase() + ' ' + this.filleul.firstname.toUpperCase() + ' (' + this.filleul.uid
+ ') a credité cette carte de ' + this.opComm.avantageParrain + '€, à valoir lors d un prochain achat.';
+ (this.scan.dateCreation).getMinutes() + ', ' + ' la visite de '+ this.filleul.familyname.toUpperCase()
+ ' ' + this.filleul.firstname.toUpperCase() + ' a credité cette carte de ' + this.opComm.avantageParrain
+ '€ supplémentaires, à valoir lors d un prochain achat.';
console.log(elementCarteHist);
// this.cartePar.historique = [];

@ -15,20 +15,25 @@
<div class="avatar"><img src="{{imageProfil}}" class="rounded-circle img-responsive">
</div>
<div class="card-body" style="padding-left: 20%; padding-right: 20%;">
<!--Name-->
<!--Name
<div class="flex-center">
<!--<i class="fa fa-file-picture-o prefix grey-text"></i>-->
<!--<input type="file" id="orangeForm-File" name="file" class="inputfile" accept=".jpg, .jpeg, .png">
<label for="orangeForm-File">Choose a file</label>-->
<i class="fa fa-file-picture-o prefix grey-text"></i>
<input type="file" id="orangeForm-File" name="file" class="inputfile" accept=".jpg, .jpeg, .png">
<label for="orangeForm-File">Choose a file</label>
</div>
-->
<div class="md-form">
<i class="fa fa-file-picture-o prefix grey-text"></i>
<input type="file" id="orangeForm-File" name="file" style="padding-top: 1%;" accept=".jpg, .jpeg, .png">
</div>
<!--
<div class="btn-block">
<input type="file" name="file-1[]" id="orangeForm-File" class="inputfile inputfile-1" data-multiple-caption="{count} files selected" multiple />
<label class="waves-effect" for="orangeForm-File"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg> <span>Choisir image</span></label>
<button class="btn btn-deep-orange" style="margin-top: 2%;" (click)="modifyPasswordSection()">Modifier Email/Mot de passe</button>
</div>
-->
<div class="card" style="margin-bottom: 5%" *ngIf="modifiermdp">
<div class="md-form">
@ -139,19 +144,23 @@
<div class="avatar"><img src="{{imageProfil}}" class="rounded-circle img-responsive">
</div>
<div class="card-body" style="padding-left: 20%; padding-right: 20%;">
<!--Name-->
<!--Name
<div class="flex-center">
<!--<i class="fa fa-file-picture-o prefix grey-text"></i>-->
<!--<input type="file" id="orangeForm-File" name="file" class="inputfile" accept=".jpg, .jpeg, .png">
<label for="orangeForm-File">Choose a file</label>-->
<i class="fa fa-file-picture-o prefix grey-text"></i>
<input type="file" id="orangeForm-File" name="file" class="inputfile" accept=".jpg, .jpeg, .png">
<label for="orangeForm-File">Choose a file</label>
</div>-->
<div class="md-form">
<i class="fa fa-file-picture-o prefix grey-text"></i>
<input type="file" id="orangeForm-File" name="file" style="padding-top: 1%;" accept=".jpg, .jpeg, .png">
</div>
<!--
<div class="flex-column flex-center">
<input type="file" name="file-1[]" id="orangeForm-File" class="inputfile inputfile-1" data-multiple-caption="{count} files selected" multiple />
<label class="waves-effect" for="orangeForm-File"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg> <span>Choisir image</span></label>
<button class="btn btn-deep-orange" style="margin-top: 2%;" (click)="modifyPasswordSection()">Modifier Email/Mot de passe</button>
</div>
</div>-->
<div class="card" style="margin-bottom: 5%" *ngIf="modifiermdp">
<div class="md-form">
<i class="fa fa-lock prefix grey-text"></i>

@ -35,9 +35,9 @@
<h4 class="card-title wow fadeInDown"><p>{{localUser.firstname}} {{localUser.familyname}}</p></h4>
<hr>
<ul class="list-group wow fadeInLeft">
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Status :</label> {{localUser.status}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Statut :</label> {{localUser.status}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Email :</label> {{localUser.email}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Sex :</label> {{localUser.sex}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Sexe :</label> {{localUser.sex}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Date de naissance :</label> {{localUser.birthday | date:'dd/MM/yyyy'}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Téléphone :</label> {{localUser.telephone}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Code Secret :</label> {{localUser.secretCode}}</li>
@ -107,7 +107,7 @@
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Numéro de siret :</label> {{localUser.siret}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Email :</label> {{localUser.email}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Date d'inscription :</label> {{localUser.dateInscription}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Status :</label> {{localUser.status}}</li>
<li class="list-group-item text-left"><label class="h5-responsive mt-1 font-bold">Statut :</label> {{localUser.status}}</li>
</ul>

@ -26,10 +26,10 @@
<i class="fa fa-user prefix grey-text"></i>
<input type="text" id="orangeForm-Firstname" [(ngModel)]="parrain.firstname" placeholder="Prénom" name="firstname">
</div>
<!--<div class="md-form">
<div class="md-form">
<i class="fa fa-file-picture-o prefix grey-text"></i>
<input type="file" id="orangeForm-File" name="file" style="padding-top: 1%;">
</div>-->
</div>
<form class="form-inline">
<div class="md-form" style="padding-left: 2%;">
<i class="fa fa-venus-mars prefix grey-text"></i>
@ -80,16 +80,21 @@
Ecrivez le même <strong><i>mot de passe</i></strong>.
</div>
</div>
<!--
<input type="file" name="file-1[]" id="orangeForm-File" class="inputfile inputfile-1" data-multiple-caption="{count} files selected" multiple />
<label class="waves-effect" for="orangeForm-File"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg> <span>Choisir image</span></label>
-->
<label>
En cliquant sur Créer un compte, vous acceptez nos Conditions
et indiquez que vous aves lu notre Politique d'utilisation des
données, y compris notre Utilisation des cookies.
</label>
<div class="text-center" style="margin-top:5%">
<button class="btn btn-deep-orange" [disabled]="email.errors || password.errors || (parrain.password != ConfirmPasswordParrain) || parrain.familyname == '' || parrain.firstname == '' || parrain.sex == ''" (click)="register()">S'inscrire</button>
<button class="btn btn-deep-orange" [disabled]="email.errors || password.errors || (parrain.password != ConfirmPasswordParrain) || parrain.familyname == '' || parrain.firstname == '' || parrain.sex == '' || !test" (click)="register()">S'inscrire</button>
<!--<button class="btn btn-cyan" (click)="loadHomeComponent()">Back</button>-->
<div *ngIf="test" class="alert alert-danger">
<strong><i>{{parrain.familyname}} {{parrain.firstname}}, </i></strong> votre compte à bien été créé, un email de validation vient de vous être envoyé à l'adresse <strong><i>{{commercant.email}}</i></strong> !
</div>
</div>
</form>
</div>
@ -106,10 +111,10 @@
<i class="fa fa-user prefix grey-text"></i>
<input type="text" id="orangeForm-Firstname" [(ngModel)]="commercant.commercialName" placeholder="Nom de l'entreprise" name="commercialName">
</div>
<!--<div class="md-form">
<div class="md-form">
<i class="fa fa-file-picture-o prefix grey-text"></i>
<input type="file" id="orangeForm-File" name="file" style="padding-top: 1%;">
</div>-->
</div>
<div class="md-form">
<i class="fa fa-info prefix grey-text"></i>
<input type="number" id="orangeForm-Username" [(ngModel)]="commercant.siret" placeholder="Siret" required pattern=".{14,}" minlength="14" name="siret" #siret="ngModel">
@ -139,16 +144,21 @@
Ecrivez le même <strong><i>mot de passe</i></strong>.
</div>
</div>
<!--
<input type="file" name="file-1[]" id="orangeForm-File" class="inputfile inputfile-1" data-multiple-caption="{count} files selected" multiple />
<label class="waves-effect" for="orangeForm-File"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg> <span>Choisir image</span></label>
-->
<label>
En cliquant sur Créer un compte, vous acceptez nos Conditions
et indiquez que vous aves lu notre Politique d'utilisation des
données, y compris notre Utilisation des cookies.
</label>
<div class="text-center" style="margin-top:5%">
<button class="btn btn-deep-orange" [disabled]="email.errors || password.errors || siret.errors || commercant.raisonSociale == '' || commercant.commercialName == '' || (commercant.password != ConfirmPasswordCommercant)" (click)="register()">S'inscrire</button>
<button class="btn btn-deep-orange" [disabled]="email.errors || password.errors || siret.errors || commercant.raisonSociale == '' || commercant.commercialName == '' || (commercant.password != ConfirmPasswordCommercant) || !test" (click)="register()">S'inscrire</button>
<!--<button class="btn btn-cyan" (click)="loadHomeComponent()">Back</button>-->
<div *ngIf="test" class="alert alert-danger">
<strong><i>{{commercant.commercialName}}, </i></strong> votre compte à bien été créé, un email de validation vient de vous être envoyé à l'adresse <strong><i>{{commercant.email}}</i></strong> !
</div>
</div>
</form>
</div>

@ -58,6 +58,7 @@ export class AuthService {
infoUser.uid = user.uid;
userRef.set(infoUser);
this.upload(infoUser);
firebase.auth().signOut();
//this.router.navigate(['/carteParrainageComponent']);
}else if (infoUser.status === 'Commercant') {
const userReff = this.databaseRef.child('Commercant').child(user.uid);
@ -65,6 +66,7 @@ export class AuthService {
infoUser.uid = user.uid;
userReff.set(infoUser);
this.upload(infoUser);
firebase.auth().signOut();
//this.router.navigate(['/opCommercial']);
}
}

@ -2,6 +2,7 @@
import { FireImg } from './FireImg';
import { Commercant } from './Commercant';
import { Parrain } from './Parrain';
import { OperationCommerciale } from './OperationCommerciale';
export class CarteParrainage
{
uid: string;

Loading…
Cancel
Save