Merge branch 'anis' of ssh://git.marbelium.com:10023/Viiciouss/XJC into thierry
commit
759a89dce5
@ -0,0 +1,51 @@
|
||||
<div class="container">
|
||||
<h4 class="h5 text-center mb-4" style="padding-top: 5%;">Historique des cartes envoyées</h4>
|
||||
<button class="btn btn-primary btn-rounded waves-light" (click)="goToOpCom()">Retour aux Opérations commerciales</button>
|
||||
<div class="list-group">
|
||||
<div *ngFor="let op of opCommData | async; let i = index;">
|
||||
<div class="card mainCard">
|
||||
<div class="row" id="testt">
|
||||
<div class="col-md-6 mb-1 subCard1" id="subCard1">
|
||||
<img src="{{op.carteTemplate.downloadURL}}" id="image1" class="mx-auto d-block flex-center card-img-overlay" alt="Responsive image">
|
||||
<div class="view">
|
||||
<div class="row firstRow">
|
||||
<div class="col-md-6 flex-center card-block cardPart1">{{commercant.commercialName}}</div>
|
||||
<div class="col-md-6 flex-center card-block card-image mb-1 cardPart2 image2" [ngStyle]="{ 'background-image': 'url(' + commercant.image.downloadURL + ')'}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row secondRow">
|
||||
<div class="col-md-6 flex-center cardPart3"><p>{{op.name}}</p></div>
|
||||
<div class="col-md-6 flex-center cardPart4"><p>{{op.uid}}</p></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 card subCard2">
|
||||
<div class="card-block row">
|
||||
<div class="col-md-8" id="subCard2Part1">
|
||||
<div id="opTitle">
|
||||
<label>Nom: {{op.name}}</label>
|
||||
<label>Prénom: {{op.firstname}}</label>
|
||||
<label>ID: {{op.uid}}</label>
|
||||
</div>
|
||||
<div id="opAvantages">
|
||||
<label>Avantage cummulé:</label>
|
||||
<label>Avantage récupérer:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" id="subCard2Part2">
|
||||
<button class="btn btn-outline-primary btn-rounded" (click)="hideme[i] = !hideme[i]">{{show ? 'Cacher Détails' : 'Détails'}}</button>
|
||||
|
||||
<!--<button class="btn btn-outline-info btn-rounded" (click)="sectionToImage(op.carteTemplate.downloadURL, commercant.image.downloadURL)">screenShot</button>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-block col-md-12" id="subCard2Part3">
|
||||
<h100 class="float-right">Du {{op.dateDebut | date:'dd/MM/yyyy'}} au {{op.dateFin | date:'dd/MM/yyyy'}}</h100>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" [hidden]="!hideme[i]" style="width: 101%; height:20rem;">TEXT TO SHOW</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,86 @@
|
||||
.container {
|
||||
padding-top: 5%;
|
||||
}
|
||||
.mainCard {
|
||||
margin-top: 5%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.view {
|
||||
height:102%;
|
||||
width: 103%;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-top:5%;
|
||||
}
|
||||
|
||||
.subCard1 {
|
||||
height: auto;
|
||||
background-color: white;
|
||||
// background-repeat: no-repeat;
|
||||
// background-size:20% auto;
|
||||
// background-position : center;
|
||||
}
|
||||
|
||||
.firstRow {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.secondRow {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
|
||||
.cardPart1 {
|
||||
//background-color: red;
|
||||
}
|
||||
|
||||
.cardPart2 {
|
||||
//background-color: orange;
|
||||
background-repeat: no-repeat;
|
||||
background-size:50% auto;
|
||||
background-position : center;
|
||||
}
|
||||
|
||||
|
||||
.cardPart3 {
|
||||
//background-color: green;
|
||||
}
|
||||
|
||||
.cardPart4 {
|
||||
//background-color: yellow;
|
||||
}
|
||||
|
||||
#subCard2Part1 {
|
||||
padding-top: 5%;
|
||||
display: flex;
|
||||
flex-direction: column
|
||||
}
|
||||
|
||||
#subCard2Part2 {
|
||||
padding-top: 5%;
|
||||
}
|
||||
|
||||
#subCard2Part3 {
|
||||
padding-right: 5%;
|
||||
padding-top: 0%;
|
||||
padding-bottom: 1%;
|
||||
}
|
||||
|
||||
#opTitle {
|
||||
display: flex;
|
||||
flex-direction: column
|
||||
}
|
||||
|
||||
#opAvantages {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 2%;
|
||||
}
|
||||
|
||||
#opLogs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 5%;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CarteEnvoyerComponent } from './carte-envoyer.component';
|
||||
|
||||
describe('CarteEnvoyerComponent', () => {
|
||||
let component: CarteEnvoyerComponent;
|
||||
let fixture: ComponentFixture<CarteEnvoyerComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CarteEnvoyerComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CarteEnvoyerComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,82 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { OperationCommerciale } from '../../../../models/OperationCommerciale';
|
||||
import { AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2/database';
|
||||
|
||||
import * as firebase from 'firebase/app';
|
||||
import { AngularFireAuth } from 'angularfire2/auth';
|
||||
import { AuthService } from '../../../services/auth/auth.service';
|
||||
import { OpCommercialService } from '../../../services/opCommercial/op-commercial.service';
|
||||
import { Commercant } from '../../../../models/Commercant';
|
||||
|
||||
@Component({
|
||||
selector: 'app-carte-envoyer',
|
||||
templateUrl: './carte-envoyer.component.html',
|
||||
styleUrls: ['./carte-envoyer.component.scss'],
|
||||
providers: [AuthService, OpCommercialService]
|
||||
})
|
||||
export class CarteEnvoyerComponent implements OnInit {
|
||||
opComm: OperationCommerciale;
|
||||
user: Observable<firebase.User>;
|
||||
opCommData: FirebaseListObservable<any[]>;
|
||||
profileData: FirebaseListObservable<any[]>;
|
||||
// Cas2Image: Observable<Canvas2Image>;
|
||||
commercant: Commercant;
|
||||
show: boolean = false;
|
||||
i: number;
|
||||
hideme = {};
|
||||
|
||||
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
|
||||
private router: Router, private authService: AuthService, private opComService: OpCommercialService) {
|
||||
this.opComm = new OperationCommerciale();
|
||||
this.hideme = {}; // init is required
|
||||
|
||||
this.user = afAuth.authState;
|
||||
this.commercant = new Commercant();
|
||||
this.user.subscribe(
|
||||
(auth) => {
|
||||
// console.log("afAuth.authState : " + auth.toJSON());
|
||||
if (auth) {
|
||||
this.opCommData = this.afDb.list('/CarteParrainage/', {
|
||||
query: {
|
||||
orderByChild: 'commercantCarte/uid',
|
||||
equalTo: auth.uid.toString()
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.profileData = this.afDb.list('/' + auth.displayName + '/', {
|
||||
query: {
|
||||
orderByChild: 'uid',
|
||||
equalTo: auth.uid.toString()
|
||||
}
|
||||
}
|
||||
);
|
||||
this.profileData.forEach(utilisateur => {
|
||||
utilisateur.forEach(element => {
|
||||
this.commercant = element;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
goToOpCom(){
|
||||
this.router.navigate(['/opCommercial']);
|
||||
}
|
||||
|
||||
showDetails(item){
|
||||
Object.keys(this.hideme).forEach(h => {
|
||||
this.hideme[h] = false;
|
||||
});
|
||||
this.hideme[item.id] = true;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue