Commit b6fc1e0f by Adarsh K

latest changes

parent 64c30445
...@@ -24,15 +24,9 @@ ...@@ -24,15 +24,9 @@
"@angular/platform-browser-dynamic": "~8.1.2", "@angular/platform-browser-dynamic": "~8.1.2",
"@angular/router": "~8.1.2", "@angular/router": "~8.1.2",
"@ionic-native/core": "^5.0.0", "@ionic-native/core": "^5.0.0",
<<<<<<< HEAD
"@ionic-native/geolocation": "^5.15.1", "@ionic-native/geolocation": "^5.15.1",
"@ionic-native/google-plus": "^5.0.0-beta.0", "@ionic-native/google-plus": "^5.0.0-beta.0",
"@ionic-native/native-geocoder": "^5.15.1", "@ionic-native/native-geocoder": "^5.15.1",
=======
"@ionic-native/geolocation": "^5.0.0",
"@ionic-native/google-plus": "^5.0.0-beta.0",
"@ionic-native/native-geocoder": "^5.0.0",
>>>>>>> master
"@ionic-native/splash-screen": "^5.0.0", "@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.12.0", "@ionic-native/status-bar": "^5.12.0",
"@ionic/angular": "^4.7.1", "@ionic/angular": "^4.7.1",
...@@ -52,10 +46,7 @@ ...@@ -52,10 +46,7 @@
"core-js": "^2.5.4", "core-js": "^2.5.4",
"firebase": "^6.4.0", "firebase": "^6.4.0",
"rxjs": "~6.5.1", "rxjs": "~6.5.1",
<<<<<<< HEAD
"rxjs-compat": "^6.5.3", "rxjs-compat": "^6.5.3",
=======
>>>>>>> master
"tslib": "^1.9.0", "tslib": "^1.9.0",
"zone.js": "~0.9.1" "zone.js": "~0.9.1"
}, },
...@@ -109,8 +100,4 @@ ...@@ -109,8 +100,4 @@
"android" "android"
] ]
} }
<<<<<<< HEAD
}
=======
} }
>>>>>>> master
...@@ -23,27 +23,13 @@ ...@@ -23,27 +23,13 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
<ion-slides pager="true"> <ion-slides pager="true" *ngIf="centerService.centers && centerService.centers.length > 0">
<ion-slide> <ion-slide *ngFor="let center of centerService.centers">
<div class="banner_slide" (click)="goToPage('storelist')"> <div class="banner_slide" (click)="goToPage('storelist')">
<h5>Chadstone</h5> <h5>{{center.centerName}}</h5>
<p>The fashion capital</p> <p>{{center.description}}</p>
</div>
<img src="./../../assets/getmi_malls/mall_banner/mall_4.png">
</ion-slide>
<ion-slide>
<div class="banner_slide" (click)="goToPage('storelist')">
<h5>Westfield Knox</h5>
<p>Your one-stop hub for Shopping & Fun</p>
</div>
<img src="./../../assets/getmi_malls/mall_banner/mall_1.png">
</ion-slide>
<ion-slide>
<div class="banner_slide" (click)="goToPage('storelist')">
<h5>Emporium Melbourne</h5>
<p>The luxury shopping centre</p>
</div> </div>
<img src="./../../assets/getmi_malls/mall_banner/mall_5.png"> <img [src]="center.centerImg" onerror="this.src='./../../assets/getmi_malls/mall_banner/mall_4.png'">
</ion-slide> </ion-slide>
</ion-slides> </ion-slides>
</div> </div>
...@@ -51,22 +37,13 @@ ...@@ -51,22 +37,13 @@
Featured Stores Featured Stores
</div> </div>
<div class="featured_slider"> <div class="featured_slider">
<ion-slides pager="false" [options]="slideOpts"> <ion-slides pager="false" [options]="slideOpts" *ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0">
<ion-slide> <ion-slide *ngFor="let shopper of shopperService.activeshoppers">
<div class="feature_product" (click)="goToPage('productlist')">
<img src="./../../assets/getmi_malls/featured/featured1.png">
<div class="feature_overlay">
<h5>Witchery</h5>
<p>Shop Women's Fashion</p>
</div>
</div>
</ion-slide>
<ion-slide>
<div class="feature_product" (click)="goToPage('productlist')"> <div class="feature_product" (click)="goToPage('productlist')">
<img src="./../../assets/getmi_malls/featured/featured2.png"> <img [src]="shopper.featuredImage" onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'">
<div class="feature_overlay"> <div class="feature_overlay">
<h5>VonZipper</h5> <h5>{{shopper.name}}</h5>
<p>Lifestyle & Personality</p> <p>{{shopper.caption}}</p>
</div> </div>
</div> </div>
</ion-slide> </ion-slide>
......
...@@ -3,6 +3,9 @@ import { Location } from '@angular/common'; ...@@ -3,6 +3,9 @@ import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations'; import { trigger, transition, animate, style } from '@angular/animations';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { MenuController } from '@ionic/angular'; import { MenuController } from '@ionic/angular';
import { CenterService } from './../../config/center.service';
import { ShoppersService } from './../../config/shopper.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
templateUrl: './home.page.html', templateUrl: './home.page.html',
...@@ -33,7 +36,9 @@ export class HomePage implements OnInit { ...@@ -33,7 +36,9 @@ export class HomePage implements OnInit {
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private location: Location, private location: Location,
public menuCtrl: MenuController public menuCtrl: MenuController,
public centerService: CenterService,
public shopperService: ShoppersService
) { } ) { }
ngOnInit() { ngOnInit() {
......
import { Injectable } from '@angular/core';
import { AngularFirestore, AngularFirestoreDocument, AngularFirestoreCollection } from '@angular/fire/firestore';
import { Centers, CenterData } from './services/center';
import * as firebase from 'firebase';
@Injectable({
providedIn: 'root'
})
export class CenterService {
centers: Centers[] = [];
constructor(
public afs: AngularFirestore
) {
this.centerList();
}
public async centerList() {
const This = this;
const state = true;
const orderRef: AngularFirestoreCollection<any> = this.afs.collection('centers', ref => ref.where('featured', '==', state)
.where('status', '==', state));
orderRef.valueChanges().subscribe((value) => {
this.centers = [];
const res = value;
if (res.length > 0) {
res.forEach((item) => {
console.log(item);
if (item.centerName === undefined) {
return;
}
const center: Centers = {
centerName: item.centerName,
description: item.description,
location: item.location,
latLng: item.latLng,
featured: item.featured,
centerImg: item.centerImg,
status: item.status,
cId: item.cId
};
this.centers.push(center);
});
console.log(this.centers);
} else {
// alert('No Orders Found');
}
});
}
}
export class Centers {
constructor(
public centerName: string,
public location: string,
public description: string,
public latLng: any,
public featured: boolean,
public centerImg: any,
public status: boolean,
public cId?: string,
) {
}
}
export interface CenterData {
centerName: string;
location: string;
description: string;
latLng: any;
centerImg: any;
featured: boolean;
status: boolean;
cId: string;
}
export interface Shopper {
name: string;
emailId: string;
phone: string;
caption: string;
profilePhoto: string;
status: boolean;
uid: string;
shopName: string;
address: string;
featured: boolean;
shopStatus: boolean;
centre: object;
rate: any;
workingHours: string;
featuredImage: string;
}
export interface ShopperData {
centre: object;
abn: string;
category: object;
name: string;
address: string;
emailId: string;
phone: string;
caption: string;
featured: boolean;
profilePic: any;
featuredImage: string;
shopStatus: boolean;
centerId: string;
uid: string;
shopName: string;
status: boolean;
rate: any;
workingHours: string;
}
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFirestore, AngularFirestoreDocument, AngularFirestoreCollection } from '@angular/fire/firestore';
import { Shopper } from './services/shopper';
import * as firebase from 'firebase';
@Injectable({
providedIn: 'root'
})
export class ShoppersService {
shoppers: Shopper[] = [];
activeshoppers: Shopper[] = [];
constructor(
public afs: AngularFirestore,
public afAuth: AngularFireAuth,
) {
this.featuredshopperList();
}
public async shopperList(centerId: string) {
const This = this;
const state = true;
const orderRef: AngularFirestoreCollection<any> = this.afs.collection('shoppers', ref => ref.where('centerId', '==', centerId)
.where('status', '==', state));
orderRef.valueChanges().subscribe((value) => {
this.shoppers = [];
const res = value;
if (res.length > 0) {
res.forEach((item) => {
console.log(item);
const shopper: Shopper = {
name: item.name,
emailId: item.emailId,
phone: item.phone,
uid: item.uid,
profilePhoto: item.profilePhoto,
status: item.status,
address: item.address,
featured: item.featured,
featuredImage: item.featuredImage,
shopName: item.shopName,
shopStatus: item.shopStatus,
workingHours: item.workingHours,
caption: item.caption,
centre: item.centre,
rate: item.rate
};
this.shoppers.push(shopper);
});
console.log(this.shoppers);
} else {
// alert('No Orders Found');
}
});
}
public async featuredshopperList() {
const This = this;
const state = true;
const orderRef: AngularFirestoreCollection<any> = this.afs.collection('shoppers', ref => ref.where('featured', '==', state)
.where('status', '==', state));
orderRef.valueChanges().subscribe((value) => {
this.activeshoppers = [];
const res = value;
if (res.length > 0) {
res.forEach((item) => {
console.log(item);
const shopper: Shopper = {
name: item.name,
emailId: item.emailId,
phone: item.phone,
uid: item.uid,
profilePhoto: item.profilePhoto,
status: item.status,
address: item.address,
featured: item.featured,
featuredImage: item.featuredImage,
shopName: item.shopName,
shopStatus: item.shopStatus,
workingHours: item.workingHours,
caption: item.caption,
centre: item.centre,
rate: item.rate
};
this.activeshoppers.push(shopper);
});
console.log(this.activeshoppers);
} else {
// alert('No Orders Found');
}
});
}
}
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