Commit 18196ae2 by Nabil Sadki

Some changes

parent 4579d295
...@@ -3,6 +3,9 @@ v1.0.8.1 ...@@ -3,6 +3,9 @@ v1.0.8.1
- Set geolocation param default to true - Set geolocation param default to true
- Add more values to notiftime parameter - Add more values to notiftime parameter
- Set notiftime param default to 1 day - Set notiftime param default to 1 day
- Add Allo Testeurs logo to menu
- Add presentation to menu
- Add skip presentation!
v1.0.8.0 v1.0.8.0
- Presentation - Presentation
......
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.allotesteurs.app" version="1.0.8.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget android-versionCode="10810" id="com.allotesteurs.app" version="1.0.8.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Allo Testeurs</name> <name>Allo Testeurs</name>
<description>Découvrir les bon plans à Kénitra et ailleurs!</description> <description>Découvrir les bon plans à Kénitra et ailleurs!</description>
<author email="contact@allo-testeurs.com" href="https://www.allo-testeurs.com">Allo Testeurs Agency</author> <author email="contact@allo-testeurs.com" href="https://www.allo-testeurs.com">Allo Testeurs Agency</author>
......
<ion-content> <ion-content>
<ion-slides pager="true"> <ion-slides #mainSlider pager="true">
<ion-slide color="primary" padding> <ion-slide color="primary" padding>
<ion-item lines="none" color="primary" class="skip">
<ion-button fill="outline" color="light" (click)="skipPresentation($event)">
Passer <ion-icon name="arrow-dropright-circle" slot="end"></ion-icon>
</ion-button>
</ion-item>
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col> <ion-col>
...@@ -54,6 +59,11 @@ ...@@ -54,6 +59,11 @@
<button ion-button class="round" color="light" margin-top full tappable (click)="getNotifs()">Notifs!</button>--> <button ion-button class="round" color="light" margin-top full tappable (click)="getNotifs()">Notifs!</button>-->
</ion-slide> </ion-slide>
<ion-slide padding> <ion-slide padding>
<ion-item lines="none" color="primary" class="skip">
<ion-button fill="outline" color="light" (click)="skipPresentation($event)">
Passer <ion-icon name="arrow-dropright-circle" slot="end"></ion-icon>
</ion-button>
</ion-item>
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col> <ion-col>
...@@ -82,6 +92,11 @@ ...@@ -82,6 +92,11 @@
</ion-grid> </ion-grid>
</ion-slide> </ion-slide>
<ion-slide padding> <ion-slide padding>
<ion-item lines="none" color="primary" class="skip">
<ion-button fill="outline" color="light" (click)="skipPresentation($event)">
Passer <ion-icon name="arrow-dropright-circle" slot="end"></ion-icon>
</ion-button>
</ion-item>
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col> <ion-col>
...@@ -110,6 +125,11 @@ ...@@ -110,6 +125,11 @@
</ion-grid> </ion-grid>
</ion-slide> </ion-slide>
<ion-slide padding> <ion-slide padding>
<ion-item lines="none" color="primary" class="skip">
<ion-button fill="outline" color="light" (click)="skipPresentation($event)">
Passer <ion-icon name="arrow-dropright-circle" slot="end"></ion-icon>
</ion-button>
</ion-item>
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col> <ion-col>
...@@ -192,7 +212,8 @@ ...@@ -192,7 +212,8 @@
<ion-grid no-margin no-padding> <ion-grid no-margin no-padding>
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-button class="round" color="light" margin-top full tappable href="/app/dashboard"> <ion-button class="round" color="light" margin-top full tappable
href="/app/dashboard">
Continuer sans &nbsp;<ion-icon name="arrow-dropright-circle"></ion-icon> Continuer sans &nbsp;<ion-icon name="arrow-dropright-circle"></ion-icon>
</ion-button> </ion-button>
</ion-col> </ion-col>
......
...@@ -9,6 +9,11 @@ ion-slides { ...@@ -9,6 +9,11 @@ ion-slides {
font-family: "Open Sans Light" !important; font-family: "Open Sans Light" !important;
text-align: justify; text-align: justify;
} }
.skip {
position: absolute;
top: 20px;
right: 20px;
}
} }
--bullet-background-active: var(--ion-color-light, #ffffff) !important; --bullet-background-active: var(--ion-color-light, #ffffff) !important;
......
import { Component, ViewChild } from '@angular/core'; import { Component, ViewChild } from '@angular/core';
import { Platform, NavController } from '@ionic/angular'; import { Platform, NavController, IonSlides } from '@ionic/angular';
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
// import { DashboardPage } from "../dashboard/dashboard"; // import { DashboardPage } from "../dashboard/dashboard";
import { PermService } from "../../services/perm-service"; import { PermService } from '../../services/perm-service';
import { LocationService } from "../../services/location-service"; import { LocationService } from '../../services/location-service';
// import { AlloService } from "../../services/allo-service"; // import { AlloService } from "../../services/allo-service";
// import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; // import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
@Component({ @Component({
selector: 'page-mainslider', selector: 'page-mainslider',
templateUrl: './mainslider.page.html', templateUrl: './mainslider.page.html',
styleUrls: ['./mainslider.page.scss'], styleUrls: ['./mainslider.page.scss'],
}) })
export class MainsliderPage { export class MainsliderPage {
// @ViewChild(Nav) nav: NavController; // @ViewChild(Nav) nav: NavController;
@ViewChild(IonSlides) mainSlider: IonSlides;
slideOpts = {
effect: 'flip' slideOpts = {
}; effect: 'flip'
public prmMainslider: boolean; };
public prmMainslider: boolean;
constructor(
public platform: Platform, constructor(
public navCtrl: NavController, public platform: Platform,
// public navParams: NavParams, public navCtrl: NavController,
// public LN: LocalNotifications, // public navParams: NavParams,
private _PERM: PermService, // public LN: LocalNotifications,
private _LOCATE: LocationService, private _PERM: PermService,
// private _ALLO: AlloService, private _LOCATE: LocationService,
private _STOR: Storage, // private _ALLO: AlloService,
private router: Router private _STOR: Storage,
) { private router: Router
this.prmMainslider = false; ) {
} this.prmMainslider = false;
}
// gpsStart() {
// this._LOCATE.startTracking(); // gpsStart() {
// } // this._LOCATE.startTracking();
// }
// gpsStop() {
// this._LOCATE.stopTracking(); // gpsStop() {
// } // this._LOCATE.stopTracking();
// }
// gpsStatus() {
// this._LOCATE.checkStatus(); // gpsStatus() {
// } // this._LOCATE.checkStatus();
// }
// gpsLocations() {
// this._LOCATE.getLocations(); // gpsLocations() {
// } // this._LOCATE.getLocations();
// }
// gpsLogEntries() {
// this._LOCATE.getLogEntries(); // gpsLogEntries() {
// } // this._LOCATE.getLogEntries();
// }
// setParam() {
// console.log(this.prmMainslider); // setParam() {
// this._STOR.set('PARAM_mainslider', this.prmMainslider); // console.log(this.prmMainslider);
// } // this._STOR.set('PARAM_mainslider', this.prmMainslider);
// }
getGps() {
if (this.platform.is('cordova')) { skipPresentation($event) {
console.log('cord'); this.mainSlider.getActiveIndex().then(index => {
this._PERM.checkGps(); this.mainSlider.slideTo(4);
this._LOCATE.initLocator(); });
} }
this._STOR.set('PARAM_geolocate', true);
this.goToDashboard(); getGps() {
} if (this.platform.is('cordova')) {
console.log('cord');
getDashboard() { this._PERM.checkGps();
this._STOR.set('PARAM_geolocate', false); this._LOCATE.initLocator();
this.goToDashboard(); }
} this._STOR.set('PARAM_geolocate', true);
this.goToDashboard();
goToDashboard() { }
this.router.navigateByUrl('/app/dashboard');
} getDashboard() {
this._STOR.set('PARAM_geolocate', false);
ionViewDidEnter() { this.goToDashboard();
console.log('ionViewDidEnter Mainslider'); }
// this._ALLO.presentLoading();
} goToDashboard() {
this.router.navigateByUrl('/app/dashboard');
ionViewDidLoad() { }
console.log('ionViewDidLoad Mainslider');
// this._ALLO.dismissLoading(); ionViewDidEnter() {
} console.log('ionViewDidEnter Mainslider');
// this._ALLO.presentLoading();
// getNearby() { }
// this._STOR.get('REST_services').then((services) => {
// if ('object' === typeof services && services.hasOwnProperty('brands')) { ionViewDidLoad() {
// let brands = this._ALLO.jsonToArray(services.brands); console.log('ionViewDidLoad Mainslider');
// this._ALLO.dismissLoading();
// this._STOR.get('PARAM_geoarea').then((area) => { }
// if (area === null) {
// area = 400; // getNearby() {
// } // this._STOR.get('REST_services').then((services) => {
// if ('object' === typeof services && services.hasOwnProperty('brands')) {
// this._STOR.get('NOTIF_shownpartners').then((shown) => { // let brands = this._ALLO.jsonToArray(services.brands);
// let shown_notifs = [];
// if (shown !== null) { // this._STOR.get('PARAM_geoarea').then((area) => {
// shown_notifs = shown; // if (area === null) {
// } // area = 400;
// }
// let notifs = [];
// brands.forEach(partner => { // this._STOR.get('NOTIF_shownpartners').then((shown) => {
// if (this.checkNotifTime(partner.id, shown_notifs)) { // let shown_notifs = [];
// let lat1 = partner.latitude; // if (shown !== null) {
// let lon1 = partner.longitude; // shown_notifs = shown;
// let lat2 = 34.253968; // }
// let lon2 = -6.580888;
// let distance = this._LOCATE.calculateDistance(lat1, lon1, lat2, lon2); // let notifs = [];
// brands.forEach(partner => {
// if (distance <= (area / 1000)) { // if (this.checkNotifTime(partner.id, shown_notifs)) {
// notifs.push({ // let lat1 = partner.latitude;
// id: partner.id, // let lon1 = partner.longitude;
// title: 'Spotted ! ' + partner.label, // let lat2 = 34.253968;
// text: 'Vous êtes tout prêt de ce partenaire!', // let lon2 = -6.580888;
// led: 'FFFFFF', // let distance = this._LOCATE.calculateDistance(lat1, lon1, lat2, lon2);
// attachments: [partner.thumb],
// sound: null // if (distance <= (area / 1000)) {
// }); // notifs.push({
// let current_date = new Date(); // id: partner.id,
// shown_notifs.push({ // title: 'Spotted ! ' + partner.label,
// id: partner.id, // text: 'Vous êtes tout prêt de ce partenaire!',
// time: current_date.getTime() // led: 'FFFFFF',
// }); // attachments: [partner.thumb],
// } // sound: null
// } // });
// }); // let current_date = new Date();
// shown_notifs = this.makeUnique(shown_notifs); // shown_notifs.push({
// this._STOR.set('NOTIF_shownpartners', shown_notifs); // id: partner.id,
// if (notifs) { // time: current_date.getTime()
// this.showMultipleNotification(notifs); // });
// } // }
// }); // }
// }); // });
// } // shown_notifs = this.makeUnique(shown_notifs);
// }); // this._STOR.set('NOTIF_shownpartners', shown_notifs);
// } // if (notifs) {
// this.showMultipleNotification(notifs);
// makeUnique(shown) { // }
// let filtred = []; // });
// shown.forEach(notif => { // });
// let exist = filtred.filter(obj => { // }
// return obj.id === notif.id; // });
// }); // }
// if (exist.length == 0) { // makeUnique(shown) {
// filtred.push(notif); // let filtred = [];
// } else { // shown.forEach(notif => {
// filtred = filtred.filter(function (obj) { // let exist = filtred.filter(obj => {
// return obj.id !== notif.id; // return obj.id === notif.id;
// }); // });
// filtred.push(notif);
// } // if (exist.length == 0) {
// }); // filtred.push(notif);
// } else {
// return filtred; // filtred = filtred.filter(function (obj) {
// } // return obj.id !== notif.id;
// });
// checkNotifTime(id, shown) { // filtred.push(notif);
// let valid = true; // }
// let notifs_count = shown.length; // });
// let i = 0;
// for (i = 0; i < notifs_count; i++) { // return filtred;
// let notif = shown[i]; // }
// let notif_date = new Date(notif.time);
// let current_date = new Date(); // checkNotifTime(id, shown) {
// if (notif.id == id && ((current_date.getTime() - notif_date.getTime()) / 1000) <= 3600) { // let valid = true;
// valid = false; // let notifs_count = shown.length;
// break; // let i = 0;
// } // for (i = 0; i < notifs_count; i++) {
// } // let notif = shown[i];
// let notif_date = new Date(notif.time);
// return valid; // let current_date = new Date();
// } // if (notif.id == id && ((current_date.getTime() - notif_date.getTime()) / 1000) <= 3600) {
// valid = false;
// showNotification(title, text) { // break;
// this.LN.requestPermission().then((granted) => { // }
// console.log(granted); // }
// if (granted) {
// this.LN.schedule({ // return valid;
// title: title, // }
// text: text,
// led: 'FFFFFF', // showNotification(title, text) {
// sound: null // this.LN.requestPermission().then((granted) => {
// }); // console.log(granted);
// } // if (granted) {
// }); // this.LN.schedule({
// } // title: title,
// text: text,
// showMultipleNotification(notifs) { // led: 'FFFFFF',
// this.LN.requestPermission().then((granted) => { // sound: null
// if (granted) { // });
// this.LN.schedule(notifs); // }
// } // });
// }); // }
// }
// showMultipleNotification(notifs) {
// this.LN.requestPermission().then((granted) => {
// if (granted) {
// this.LN.schedule(notifs);
// }
// });
// }
} }
<ion-menu contentId="content"> <ion-menu contentId="content">
<ion-content> <ion-header>
<ion-toolbar color="primary">
<!-- <ion-title>Menu</ion-title> -->
<!-- <ion-thumbnail size="large" slot="start" class="ion-margin-start"> -->
<ion-grid>
<ion-row>
<ion-col size="2"></ion-col>
<ion-col size="8">
<img src="../../../assets/logo-full-white.png">
</ion-col>
<ion-col size="2"></ion-col>
</ion-row>
</ion-grid>
<!-- </ion-thumbnail> -->
</ion-toolbar>
</ion-header>
<ion-content>
<div *ngFor="let p of pages"> <div *ngFor="let p of pages">
<!-- Standard Menu Item --> <!-- Standard Menu Item -->
<ion-menu-toggle *ngIf="p.url"> <ion-menu-toggle *ngIf="p.url">
<ion-item [routerLink]="p.url" routerDirection="root" routerLinkActive="active"> <ion-item [routerLink]="p.url" routerDirection="root" routerLinkActive="active">
<ion-icon [name]="p.icon" slot="start"></ion-icon> <ion-icon [name]="p.icon" slot="start"></ion-icon>
<ion-label> <ion-label>
{{ p.title }} {{ p.title }}
</ion-label> </ion-label>
</ion-item> </ion-item>
</ion-menu-toggle> </ion-menu-toggle>
<!-- Item with Children --> <!-- Item with Children -->
<ion-item button *ngIf="p.children?.length > 0" (click)="p.open = !p.open" [class.parent-active]="p.open" <ion-item button *ngIf="p.children?.length > 0" (click)="p.open = !p.open" [class.parent-active]="p.open"
detail="false"> detail="false">
<ion-icon slot="start" name="arrow-forward" *ngIf="!p.open"></ion-icon> <ion-icon slot="start" name="arrow-forward" *ngIf="!p.open"></ion-icon>
<ion-icon slot="start" name="arrow-down" *ngIf="p.open"></ion-icon> <ion-icon slot="start" name="arrow-down" *ngIf="p.open"></ion-icon>
<ion-label>{{ p.title }}</ion-label> <ion-label>{{ p.title }}</ion-label>
</ion-item> </ion-item>
<!-- Children List for clicked Item --> <!-- Children List for clicked Item -->
<ion-list *ngIf="p.open"> <ion-list *ngIf="p.open">
<ion-menu-toggle> <ion-menu-toggle>
<ion-item *ngFor="let sub of p.children" class="sub-item" [routerLink]="sub.url" routerDirection="root" <ion-item *ngFor="let sub of p.children" class="sub-item" [routerLink]="sub.url"
routerLinkActive="active"> routerDirection="root" routerLinkActive="active">
<ion-icon [name]="sub.icon" slot="start"></ion-icon> <ion-icon [name]="sub.icon" slot="start"></ion-icon>
<ion-label> <ion-label>
{{ sub.title }} {{ sub.title }}
</ion-label> </ion-label>
</ion-item> </ion-item>
</ion-menu-toggle> </ion-menu-toggle>
</ion-list> </ion-list>
</div> </div>
</ion-content> </ion-content>
</ion-menu> </ion-menu>
......
...@@ -32,6 +32,11 @@ export class MenuPage implements OnInit { ...@@ -32,6 +32,11 @@ export class MenuPage implements OnInit {
title: 'A propos', title: 'A propos',
url: '/app/a-propos', url: '/app/a-propos',
icon: 'alert' icon: 'alert'
},
{
title: 'Présentation',
url: '/mainslider',
icon: 'albums'
} }
]; ];
......
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