Commit 18196ae2 by Nabil Sadki

Some changes

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