2018-06-21 15:16:53 +03:00
|
|
|
import {Component, OnDestroy} from '@angular/core';
|
|
|
|
|
import { NbThemeService } from '@nebular/theme';
|
2018-11-19 15:40:01 +02:00
|
|
|
import { takeWhile } from 'rxjs/operators' ;
|
2019-01-18 16:25:35 +03:00
|
|
|
import { SolarData } from '../../@core/data/solar';
|
2024-10-23 18:48:28 -03:00
|
|
|
import { Banner } from '../../admin/banner/banner.model';
|
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
|
import { Category } from '../../admin/category/category.model';
|
|
|
|
|
import { Product } from '../../admin/product/product';
|
2018-06-21 15:16:53 +03:00
|
|
|
|
2018-06-21 19:01:32 +03:00
|
|
|
interface CardSettings {
|
2018-06-21 15:16:53 +03:00
|
|
|
title: string;
|
|
|
|
|
iconClass: string;
|
|
|
|
|
type: string;
|
|
|
|
|
}
|
2017-04-13 14:24:23 +03:00
|
|
|
|
|
|
|
|
@Component({
|
2024-10-13 16:57:31 -03:00
|
|
|
selector: 'ngx-home',
|
|
|
|
|
styleUrls: ['./home.component.scss'],
|
|
|
|
|
templateUrl: './home.component.html',
|
2017-04-13 14:24:23 +03:00
|
|
|
})
|
2024-10-13 16:57:31 -03:00
|
|
|
export class HomeComponent implements OnDestroy {
|
2024-10-23 18:48:28 -03:00
|
|
|
private destroy$: Subject<void> = new Subject<void>();
|
|
|
|
|
banners: Banner[];
|
|
|
|
|
categories: Category[];
|
|
|
|
|
products: any[];
|
2018-06-21 15:16:53 +03:00
|
|
|
|
2024-10-23 18:48:28 -03:00
|
|
|
constructor() {}
|
2018-06-21 15:16:53 +03:00
|
|
|
|
2024-10-23 18:48:28 -03:00
|
|
|
ngOnInit(): void {
|
|
|
|
|
console.log('init');
|
2018-06-21 15:16:53 +03:00
|
|
|
|
2024-10-23 18:48:28 -03:00
|
|
|
this.categories = [
|
2018-06-21 15:16:53 +03:00
|
|
|
{
|
2024-10-23 18:48:28 -03:00
|
|
|
"name": "Nutrientes",
|
|
|
|
|
"id": "Nutrientes",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-star"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Iluminação",
|
|
|
|
|
"id": "Decoração",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-lightbulb"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Hidroponia",
|
|
|
|
|
"id": "Hidroponia",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-shower"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Irrigação",
|
|
|
|
|
"id": "Irrigação",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-faucet"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Colheita",
|
|
|
|
|
"id": "Colheita",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-tree"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Pragas",
|
|
|
|
|
"id": "Pragas",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-bug"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Potes e Vasos",
|
|
|
|
|
"id": "Potes e Vasos",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-toilet"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Substratos",
|
|
|
|
|
"id": "Substratos",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
2024-10-23 21:08:42 -03:00
|
|
|
"icon": "fa-solid fa-sack-xmark"
|
2024-10-23 18:48:28 -03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Controle",
|
|
|
|
|
"id": "Controle",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
|
|
|
|
"icon": "arrow-ios-back-outline"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Clonagem",
|
|
|
|
|
"id": "Clonagem",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
|
|
|
|
"icon": "copy-outline"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Tendas",
|
|
|
|
|
"id": "Tendas",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
|
|
|
|
"icon": "arrow-ios-back-outline"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Circulação",
|
|
|
|
|
"id": "Circulação",
|
|
|
|
|
"updatedAt": new Date(),
|
|
|
|
|
"createdAt": new Date(),
|
|
|
|
|
"icon": "arrow-ios-back-outline"
|
|
|
|
|
},
|
|
|
|
|
]
|
2019-01-08 16:17:20 +03:00
|
|
|
|
2024-10-23 18:48:28 -03:00
|
|
|
this.products = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
|
2018-06-21 15:16:53 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
2024-10-23 18:48:28 -03:00
|
|
|
this.destroy$.next();
|
|
|
|
|
this.destroy$.complete();
|
2018-06-21 15:16:53 +03:00
|
|
|
}
|
2017-04-13 14:24:23 +03:00
|
|
|
}
|