Commit 595c9876 by Nabil Sadki

Quests

parent 8a6d2099
...@@ -114,6 +114,7 @@ export class AppComponent { ...@@ -114,6 +114,7 @@ export class AppComponent {
PARAM_notifnbr: 'all', PARAM_notifnbr: 'all',
NOTIF_shownpartners: [], NOTIF_shownpartners: [],
}); });
this.storage.set('APP_QUESTS', {});
} }
}); });
this.storage.get('WISHLIST').then((val) => { this.storage.get('WISHLIST').then((val) => {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
} }
} }
h2 { h2 {
white-space: initial !important; white-space: initial !important;
} }
} }
.leaflet-popup-close-button { .leaflet-popup-close-button {
...@@ -37,7 +37,7 @@ div.start { ...@@ -37,7 +37,7 @@ div.start {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
transition: .5s; transition: 0.5s;
ion-img { ion-img {
width: 20vw; width: 20vw;
} }
...@@ -45,9 +45,11 @@ div.start { ...@@ -45,9 +45,11 @@ div.start {
transform: scale(3); transform: scale(3);
} }
} }
ion-alert{ ion-alert {
--width: 90vw !important; --width: 90vw !important;
--max-width: 90vw !important; --max-width: 90vw !important;
transition: 1s box-shadow;
box-shadow: 0 5px 35px 0px rgba(0, 0, 0, 0.1);
} }
div.hide { div.hide {
display: none !important; display: none !important;
...@@ -69,4 +71,35 @@ ion-modal .modal-wrapper { ...@@ -69,4 +71,35 @@ ion-modal .modal-wrapper {
width: 90vw !important; width: 90vw !important;
max-height: 90vh !important; max-height: 90vh !important;
border-radius: 10px !important; border-radius: 10px !important;
} }
\ No newline at end of file
ion-alert .alert-wrapper {
box-shadow: 0 0 0 rgba(249, 49, 41, 0.8);
animation: pulse 2s infinite;
}
@-webkit-keyframes pulse {
0% {
-webkit-box-shadow: 0 0 0 0 rgba(249, 49, 41, 0.8);
}
70% {
-webkit-box-shadow: 0 0 0 30px rgba(249, 49, 41, 0);
}
100% {
-webkit-box-shadow: 0 0 0 0 rgba(249, 49, 41, 0);
}
}
@keyframes pulse {
0% {
-moz-box-shadow: 0 0 0 0 rgba(249, 49, 41, 0.8);
box-shadow: 0 0 0 0 rgba(249, 49, 41, 0.8);
}
70% {
-moz-box-shadow: 0 0 0 30px rgba(249, 49, 41, 0);
box-shadow: 0 0 0 30px rgba(249, 49, 41, 0);
}
100% {
-moz-box-shadow: 0 0 0 0 rgba(249, 49, 41, 0);
box-shadow: 0 0 0 0 rgba(249, 49, 41, 0);
}
}
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<ion-toolbar> <ion-toolbar>
<ion-button slot="end" color="dark" size="small" (click)="_TRIP.resetData(); modalController.dismiss();"> <ion-button slot="end" color="dark" size="small" (click)="_TRIP.reinitialiserFiltres(); modalController.dismiss();">
Réinitialiser</ion-button> Réinitialiser</ion-button>
</ion-toolbar> </ion-toolbar>
</ion-footer> </ion-footer>
\ No newline at end of file
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
</ion-grid> --> </ion-grid> -->
<ion-chip slot="end"> <ion-chip slot="end">
<ion-icon name="trending-up" color="blue"></ion-icon> <ion-icon name="trending-up" color="blue"></ion-icon>
<ion-label color="dark" class="ion-padding-end">10 542</ion-label> <ion-label color="dark" class="ion-padding-end">{{ _QST.pointsExp }}</ion-label>
<ion-icon name="ribbon" color="secondary"></ion-icon> <ion-icon name="ribbon" color="secondary"></ion-icon>
<ion-label color="dark">10 542</ion-label> <ion-label color="dark">{{ _QST.pointsMerites }}</ion-label>
</ion-chip> </ion-chip>
<!-- <ion-buttons slot="end"> <!-- <ion-buttons slot="end">
<ion-button (click)="showHideMoreFilters()"> <ion-button (click)="showHideMoreFilters()">
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { TripService } from '../../../services/trip-service'; import { TripService } from '../../../services/trip-service';
import { QuestsService } from "../../../services/quests.service";
@Component({ @Component({
selector: 'app-dashboard', selector: 'app-dashboard',
...@@ -14,7 +15,8 @@ export class DashboardPage implements OnInit { ...@@ -14,7 +15,8 @@ export class DashboardPage implements OnInit {
public show_more_filters = false; public show_more_filters = false;
constructor( constructor(
public _TRIP: TripService public _TRIP: TripService,
public _QST: QuestsService
) { ) {
} }
......
...@@ -67,6 +67,55 @@ ...@@ -67,6 +67,55 @@
</li> </li>
</ul> </ul>
</div> </div>
<ion-list-header>Nouvelles offres</ion-list-header>
<div class="app" *ngIf="_TRIP.products.length > 0">
<ul class="hs">
<li class="item" *ngFor="let trip of _TRIP.products">
<div class="badges ion-text-right">
<div class="bookmark" *ngIf="!_AUTH.isAnonymous">
<ion-button color="light" fill="solid" class="bookmark" (click)="_TRIP.wishList(trip, 'add')"
*ngIf="!trip.bookmarked" no-padding>
<ion-icon name="heart-empty"></ion-icon>
</ion-button>
<ion-button color="light" fill="solid" class="bookmark" (click)="_TRIP.wishList(trip, 'remove')"
*ngIf="trip.bookmarked" no-padding>
<ion-icon name="heart" color="danger"></ion-icon>
</ion-button>
</div>
<ion-badge color="blue">
<ion-icon name="trending-up"></ion-icon> 400
</ion-badge>
<ion-badge color="secondary" margin-left>
<ion-text color="light">
<ion-icon name="ribbon"></ion-icon> 200
</ion-text>
</ion-badge>
</div>
<div (click)="viewDetail(trip.id)"
[ngStyle]="{'background-image': 'url(' + trip.thumb + ')', 'background-repeat': 'no-repeat', 'background-size': 'cover', 'width': '100%', 'height': '100%', 'border-radius': '8px'}">
<div class="mask">
<ion-grid no-padding>
<ion-row>
<ion-col no-padding> {{trip.name}} </ion-col>
</ion-row>
<ion-row>
<ion-col no-padding>
<ion-badge color="light">
<ion-text color="primary">
<ion-label>
<ion-icon name="pin"></ion-icon> {{ trip.location }}
</ion-label>
</ion-text>
</ion-badge>
</ion-col>
</ion-row>
</ion-grid>
</div>
</div>
<!-- <ion-img src="../../../../assets/img/avatar.jpeg"></ion-img> -->
</li>
</ul>
</div>
<div padding> <div padding>
<div *ngIf="_TRIP.filtredProducts.length <= 0"> <div *ngIf="_TRIP.filtredProducts.length <= 0">
<ion-card class="skeleton" tappable no-margin margin-bottom> <ion-card class="skeleton" tappable no-margin margin-bottom>
......
import { AlertController } from '@ionic/angular'; import { AlertController } from '@ionic/angular';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class QuestsService { export class QuestsService {
public pointsMerites = 0;
public pointsExp = 0;
constructor( constructor(
private alertCtrl: AlertController private alertCtrl: AlertController,
) { } private storage: Storage
) {
// setTimeout(() => {
// this.presentAlert('Congrats!', 'You are now ranked as a legendary tester!');
// }, 4000);
this._questFirstConnection();
}
async presentAlert(title, message) { async presentAlert(title, message) {
const alert = await this.alertCtrl.create({ const alert = await this.alertCtrl.create({
...@@ -24,4 +34,17 @@ export class QuestsService { ...@@ -24,4 +34,17 @@ export class QuestsService {
showMsg() { showMsg() {
setInterval(() => { console.log('Still here!'); }, 2000); setInterval(() => { console.log('Still here!'); }, 2000);
} }
_questFirstConnection() {
this.pointsExp = this.pointsExp + 200;
this.storage.get('APP_QUESTS').then((appQuests) => {
console.log(appQuests);
if (null === appQuests) {
appQuests = { firstConnection: true };
this.storage.set('APP_QUESTS', appQuests).then(() => {
this.presentAlert('Première connection', '+200 points d\'experience pour votre première connection');
});
}
});
}
} }
...@@ -160,6 +160,16 @@ export class TripService { ...@@ -160,6 +160,16 @@ export class TripService {
this.offersCardList = this.filtredProducts.slice(0, 2); this.offersCardList = this.filtredProducts.slice(0, 2);
} }
reinitialiserFiltres() {
this.filters = {
cat: 'all',
type: 'all',
brand: 'all'
};
this.filterOffers();
}
filterList(categoryId) { filterList(categoryId) {
const category = this.getItemById('cats', categoryId); const category = this.getItemById('cats', categoryId);
this.ga.trackEvent('Filtres', 'Tapped button', 'Catégorie : [' + categoryId + '] ' + category.label); this.ga.trackEvent('Filtres', 'Tapped button', 'Catégorie : [' + categoryId + '] ' + category.label);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment