Commit 83fec59c by Adarsh K

Merge branch 'adarsh' into 'master'

Adarsh See merge request !84
parents 523b5916 2b6b7cdd
......@@ -21,6 +21,8 @@
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="KeyboardResize" value="true" />
<preference name="resizeOnFullScreen" value="true" />
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/network_security_config" />
......@@ -105,5 +107,4 @@
<plugin name="cordova-plugin-nativegeocoder" spec="3.2.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
<plugin name="cordova-plugin-ionic-keyboard" spec="2.2.0" />
<engine name="android" spec="7.1.4" />
</widget>
......@@ -29,6 +29,7 @@
"@ionic-native/google-plus": "^5.19.1",
"@ionic-native/keyboard": "^5.21.6",
"@ionic-native/native-geocoder": "^5.19.1",
"@ionic-native/navigation-bar": "^5.21.6",
"@ionic-native/social-sharing": "^5.20.0",
"@ionic-native/splash-screen": "^5.19.1",
"@ionic-native/status-bar": "^5.19.1",
......@@ -37,22 +38,25 @@
"@types/googlemaps": "^3.39.2",
"agm-direction": "^0.7.9",
"call-number": "^1.0.1",
"cordova-android": "7.1.4",
"cordova-android": "^8.1.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-googleplus": "^8.4.0",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-nativegeocoder": "^3.2.2",
"cordova-plugin-navigationbar": "^1.0.31",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.6.4",
"cordova-sqlite-storage": "^3.4.1",
"core-js": "^2.6.11",
"elementtree": "^0.1.7",
"es6-promise-plugin": "^4.2.2",
"firebase": "^6.6.2",
"firebase": "^7.6.1",
"mx.ferreyra.callnumber": "0.0.2",
"properties-parser": "^0.3.1",
"rxjs": "^6.5.4",
"rxjs-compat": "^6.5.4",
"tslib": "^1.9.0",
......@@ -108,10 +112,11 @@
},
"mx.ferreyra.callnumber": {},
"call-number": {},
"cordova-plugin-ionic-keyboard": {}
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-navigationbar": {}
},
"platforms": [
"android"
]
}
}
\ No newline at end of file
}
......@@ -18,7 +18,7 @@ import { CategoriesService } from './../config/category.service';
import { SearchmodalPage } from './searchmodal/searchmodal.page';
import { trigger, transition, animate, style } from '@angular/animations';
import { NavigationBar } from '@ionic-native/navigation-bar/ngx';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
......@@ -66,7 +66,8 @@ export class AppComponent {
public service: ServiceService,
public categoryService: CategoriesService,
public subjectService: SubjectService,
private route: ActivatedRoute
private route: ActivatedRoute,
private navigationBar: NavigationBar
) {
console.log(this.router.url);
this.state = true;
......@@ -101,6 +102,8 @@ export class AppComponent {
initializeApp() {
this.platform.ready().then(() => {
const autoHide = true;
this.navigationBar.setUp(autoHide);
this.statusBar.styleDefault();
this.statusBar.hide();
this.statusBar.overlaysWebView(false);
......
......@@ -8,6 +8,7 @@ import { StatusBar } from '@ionic-native/status-bar/ngx';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { IonicStorageModule } from '@ionic/storage';
import { GooglePlus } from '@ionic-native/google-plus/ngx';
import { NavigationBar } from '@ionic-native/navigation-bar/ngx';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
......@@ -62,8 +63,9 @@ import { Keyboard } from '@ionic-native/keyboard/ngx';
GooglePlus,
SocialSharing,
sanitizeHtmlPipe,
NavigationBar,
Keyboard
],
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule { }
......@@ -55,4 +55,10 @@
</div>
</div>
</div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</ion-content>
\ No newline at end of file
......@@ -31,6 +31,7 @@ export class CatStorelistPage implements OnInit {
slidesPerView: 1.5
};
data: any;
loader: boolean;
constructor(
public router: Router,
......@@ -41,15 +42,19 @@ export class CatStorelistPage implements OnInit {
private modalController: ModalController,
private subjectService: SubjectService
) {
this.loader = true;
this.service.get('catParams').then(val => {
this.data = val;
if (this.data.catId === '0') {
this.shopperService.shopperList(true, 'status');
} else {
console.log('error');
this.shopperService.shopperList(this.data.catId, 'catId');
this.shopperService.categoryShopperList(this.data.catId);
}
});
const This = this;
setTimeout(() => {
This.loader = false;
}, 2000);
}
async clickSearch() {
......
......@@ -47,7 +47,7 @@ export class ChangedetailsPage implements OnInit {
// });
}
ngOnInit() {}
ngOnInit() { }
goToPage(path, data = null) {
this.router.navigateByUrl(path, { queryParams: data });
......@@ -68,7 +68,7 @@ export class ChangedetailsPage implements OnInit {
form.value.password &&
form.value.password === form.value.confirmPassword
) {
this.register.updateData(form.value, this.userData.uid);
this.register.updateData(form.value, this.userData);
this.register.updatePassword(
form.value.currentPassword,
form.value.password
......
......@@ -6,7 +6,8 @@
<div class="nav_title floatLeft relative">
<!-- <input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" (input)="searchFun($event.target.value)" #searchText> -->
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="goToPage('searchmodal')" />
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..."
(click)="goToPage('searchmodal')" />
</div>
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow" (click)="goToPage('searchmodal')"></button>
<button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()"></button>
......@@ -31,7 +32,8 @@
<h5>{{center.centerName}}</h5>
<p>{{center.description}}</p>
</div>
<img [src]="center.centerImg" onerror="this.src='./../../assets/getmi_malls/mall_banner/mall_4.png'" />
<img [src]="center.centerImg"
onerror="this.src='./../../assets/getmi_malls/mall_banner/mall_4.png'" />
</ion-slide>
</ion-slides>
</div>
......@@ -39,10 +41,12 @@
Featured Stores
</div>
<div class="featured_slider">
<ion-slides pager="false" [options]="slideOpts" *ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0">
<ion-slides pager="false" [options]="slideOpts"
*ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0">
<ion-slide *ngFor="let shopper of shopperService.activeshoppers">
<div class="feature_product" (click)="goToPage('productlist', shopper)">
<img [src]="shopper.featuredImage" onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'" />
<img [src]="shopper.featuredImage"
onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'" />
<div class="feature_overlay">
<h5>{{shopper.name}}</h5>
<p>{{shopper.caption}}</p>
......@@ -71,7 +75,8 @@
<ul *ngIf="centerService.nearcenters && centerService.nearcenters.length > 0">
<li *ngFor="let center of centerService.nearcenters" (click)="goToPage('storelist', center)">
<div class="nearby_image">
<img [src]="center.centerImg" onerror="this.src='./../../assets/getmi_malls/mall_298/mall2.png'" />
<img [src]="center.centerImg"
onerror="this.src='./../../assets/getmi_malls/mall_298/mall2.png'" />
</div>
<div class="nearby_detail">
<h5>
......@@ -88,12 +93,14 @@
</ul>
</div>
<div class="home_sub_header">
Featured Catagories
Featured Categories
</div>
<div class="featured_catagory_list">
<ul *ngIf="categoriesService.activecategories && categoriesService.activecategories.length > 0">
<li *ngFor="let categories of categoriesService.activecategories" (click)="goToPage('catstorelist', categories)">
<img [src]="categories.catImage" onerror="this.src='../assets/handsome-man-outdoors-drinking-coffee-with-sunglasses-guy-with-beard-instagram-effect_1212-818@3x.png'" />
<li *ngFor="let categories of categoriesService.activecategories"
(click)="goToPage('catstorelist', categories)">
<img [src]="categories.catImage"
onerror="this.src='../assets/handsome-man-outdoors-drinking-coffee-with-sunglasses-guy-with-beard-instagram-effect_1212-818@3x.png'" />
<div class="featured_overlay">
<h4>{{categories.catName}}</h4>
</div>
......@@ -113,7 +120,8 @@
<div class="clear"></div>
</div>
<ion-content class="sort_wrappper">
<agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false" [backgroundColor]="'rgba(29, 27, 130,0.2)'">
<agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false"
[backgroundColor]="'rgba(29, 27, 130,0.2)'">
<agm-marker [latitude]="lat" [longitude]="lng" [iconUrl]="
{
url: './assets/pin.svg',
......@@ -133,7 +141,9 @@
<li *ngFor="let address of addressService.addressList; let i = index">
<div class="floatLeft">
{{address.default}}
<input class="styled-checkbox" name="addressId" id="styled-checkbox-{{i}}" type="radio" (click)="setDefault(address)" [value]="address.addressId" #addressType [checked]="address.defaultVal == 1" />
<input class="styled-checkbox" name="addressId" id="styled-checkbox-{{i}}" type="radio"
(click)="setDefault(address)" [value]="address.addressId" #addressType
[checked]="address.defaultVal == 1" />
<label for="styled-checkbox-{{i}}">
{{address.addressType}}
</label>
......
......@@ -25,6 +25,7 @@ export class ProductdetailPage implements OnInit {
data: any;
slideData: any[];
loader: boolean;
custId: any;
bannerOptions = {
slidesPerView: 1,
......@@ -70,6 +71,7 @@ export class ProductdetailPage implements OnInit {
const users = this.service.get('user').then(data => {
if (data) {
data = JSON.parse(data);
this.custId = data.uid;
const This = this;
this.cartService.cartList(data.uid);
}
......@@ -171,16 +173,16 @@ export class ProductdetailPage implements OnInit {
}
changeFav(index) {
this.prodService.changeFav(index, 'yes');
this.prodService.changeFav(index, 'yes', this.custId);
const state = this.prodService.fav.findIndex(x => x === index);
// console.log(state);
// console.log(this.prodService.fav);
if (state > -1) {
this.prodService.fav.splice(state, 1);
this.prodService.changeFav(index, 'yes');
this.prodService.changeFav(index, 'yes', this.custId);
} else {
this.prodService.fav.push(index);
this.prodService.changeFav(index, 'no');
this.prodService.changeFav(index, 'no', this.custId);
}
return;
// console.log(this.prodService.fav);
......
......@@ -46,7 +46,7 @@ export class ProductlistPage implements OnInit {
private subjectService: SubjectService
) {
this.loader = true;
const users = this.service.get('user').then(data => {
const users = this.service.get('userData').then(data => {
if (data) {
data = JSON.parse(data);
this.custId = data.uid;
......@@ -72,8 +72,10 @@ export class ProductlistPage implements OnInit {
}
});
const users = this.service.get('user').then(data => {
console.log(data);
if (data) {
data = JSON.parse(data);
this.custId = data.uid;
this.prodService.getFavlist(data.uid);
}
});
......@@ -129,10 +131,10 @@ export class ProductlistPage implements OnInit {
console.log(this.prodService.fav);
if (state > -1) {
this.prodService.fav.splice(state, 1);
this.prodService.changeFav(index, 'yes');
this.prodService.changeFav(index, 'yes', this.custId);
} else {
this.prodService.fav.push(index);
this.prodService.changeFav(index, 'no');
this.prodService.changeFav(index, 'no', this.custId);
}
return;
console.log(this.prodService.fav);
......
......@@ -59,8 +59,6 @@ export class ProfilePage implements OnInit {
this.service.get('user').then(data => {
if (data) {
this.userData = JSON.parse(data);
this.wishService.wishList(this.userData.uid);
console.log(this.userData);
}
});
......@@ -69,7 +67,9 @@ export class ProfilePage implements OnInit {
// Get user Data
this.service.get('userData').then(data => {
if (data) {
console.log(data);
this.loggedUser = JSON.parse(data);
this.wishService.wishList(this.loggedUser.uid);
}
});
});
......
......@@ -98,7 +98,6 @@
font-weight: 900;
}
.styled-checkbox {
// take it out of document flow
opacity: 0; // hide it
&+label {
position: relative;
......
......@@ -22,7 +22,8 @@ export class ProductsService {
this.product = [];
this.fav = [];
this.prodSlideImg = [];
this.service.get('user').then(data => {
this.service.get('userData').then(data => {
console.log(data);
this.user = JSON.parse(data);
this.getFavlist(this.user.uid);
});
......@@ -263,12 +264,12 @@ export class ProductsService {
});
}
public async changeFav(index, type) {
// console.log(index, type, this.user.uid);
public async changeFav(index, type, custId) {
console.log(index, type, custId);
if (type === 'no') {
this.afs
.collection('favourite')
.doc(this.user.uid)
.doc(custId)
.valueChanges()
.pipe(
take(1) // Here you can limit to only emit once, using the take operator
......@@ -277,7 +278,7 @@ export class ProductsService {
if (value === undefined) {
this.afs
.collection('favourite')
.doc(this.user.uid)
.doc(custId)
.set({
[index]: true
});
......@@ -287,14 +288,14 @@ export class ProductsService {
// console.log(value);
this.afs
.collection('favourite')
.doc(this.user.uid)
.doc(custId)
.set(value);
}
});
} else {
this.afs
.collection('favourite')
.doc(this.user.uid)
.doc(custId)
.valueChanges()
.pipe(
take(1) // Here you can limit to only emit once, using the take operator
......@@ -309,7 +310,7 @@ export class ProductsService {
// console.log(value);
this.afs
.collection('favourite')
.doc(this.user.uid)
.doc(custId)
.set(value);
} else {
// console.log(value);
......
......@@ -16,7 +16,11 @@ export class ShoppersService {
shoppers: Shopper[] = [];
activeshoppers: Shopper[] = [];
nearshoppers: Shopper[] = [];
constructor(public afs: AngularFirestore, public afAuth: AngularFireAuth, public service: ServiceService) {
constructor(
public afs: AngularFirestore,
public afAuth: AngularFireAuth,
public service: ServiceService
) {
this.featuredshopperList();
this.getNearBy(-33.87276, 151.20534, this.service.distance);
}
......@@ -62,6 +66,121 @@ export class ShoppersService {
});
}
public async categoryShopperList(catId = null) {
const This = this;
const state = true;
this.shoppers = [];
const catRef = this.afs.collection('shopcategories').doc(catId).get().subscribe((data) => {
console.log(data.data());
let shoppeerList = [];
const shoppers = data.data();
if (shoppers && Object.keys(shoppers).length > 0) {
Object.keys(shoppers)
.forEach(function eachKey(key) {
shoppeerList.push(key);
});
console.log(shoppeerList);
const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
'shoppers',
ref => ref.where('uid', 'in', shoppeerList).where('status', '==', state).orderBy('name', 'asc')
);
/* this.documentosCol = this.afs.collection('shoppers', ref => ref.where('pagada', 'in', [true, false]));*/
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.profilePic,
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,
location: item.location,
rate: item.rate,
centerId: item.centerId
};
this.shoppers.push(shopper);
});
// console.log(this.shoppers);
} else {
// alert('No Orders Found');
}
});
} else {
console.log(this.shoppers);
this.shoppers = [];
this.shoppers.length = 0;
}
});
/* .then(doc => {
if (!doc.exists) {
console.log('No such document!');
} else {
console.log('Document data:', doc.data());
}
})
.catch(err => {
console.log('Error getting document', err);
}); */
/*const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
'shoppers',
ref => ref.where(type, '==', centerId).where('status', '==', state).orderBy('name', 'asc')
);
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.profilePic,
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,
location: item.location,
rate: item.rate,
centerId: item.centerId
};
this.shoppers.push(shopper);
});
// console.log(this.shoppers);
} else {
// alert('No Orders Found');
}
});*/
}
public async featuredshopperList() {
const This = this;
const state = true;
......
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