1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { Router, ActivatedRoute } from '@angular/router';
import { MenuController } from '@ionic/angular';
import { CenterService } from './../../config/center.service';
import { ShoppersService } from './../../config/shopper.service';
import { CategoriesService } from './../../config/category.service';
import { ServiceService } from './../../config/service.service';
import { from } from 'rxjs';
@Component({
selector: 'app-home',
templateUrl: './home.page.html',
styleUrls: ['./home.page.scss'],
animations: [
trigger('slideInOut', [
transition(':enter', [
style({ transform: 'translateY(100%)' }),
animate('200ms ease-in', style({ transform: 'translateY(0%)' }))
]),
transition(':leave', [
animate('200ms ease-out', style({ transform: 'translateY(100%)' }))
])
])
]
})
export class HomePage implements OnInit {
isShow = false;
public lat = 51.678418;
public lng = 7.809007;
slideOpts = {
slidesPerView: 1.5
};
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location,
public menuCtrl: MenuController,
public centerService: CenterService,
public shopperService: ShoppersService,
public categoriesService: CategoriesService,
public service: ServiceService
) { }
ngOnInit() {
this.menuCtrl.enable(true);
}
ionViewWillEnter() {
this.menuCtrl.enable(true);
}
goToPage(path, data = null) {
console.log(data);
this.service.set('params', data);
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
goBack() {
this.location.back();
}
istoggle() {
this.isShow = !this.isShow;
}
}