Commit 84688180 by Adarsh K

Merge branch 'adarsh' into 'master'

Adarsh See merge request !50
parents 7219db02 b25de556
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
<ion-menu-toggle *ngIf="userData"> <ion-menu-toggle *ngIf="userData">
<div class="top_banner"> <div class="top_banner">
<div class="top_image"> <div class="top_image">
<img [src]="userData.profilePhoto" /> <img
[src]="userData.profilePhoto"
onerror="this.src='./../assets/asset_avatar.png'"
/>
</div> </div>
<div class="top_detail"> <div class="top_detail">
<h4>{{ userData.name }}</h4> <h4>{{ userData.name }}</h4>
......
...@@ -38,6 +38,7 @@ export class AppComponent { ...@@ -38,6 +38,7 @@ export class AppComponent {
menuw: number; menuw: number;
userData: any; userData: any;
tabData = true;
constructor( constructor(
private platform: Platform, private platform: Platform,
...@@ -52,7 +53,9 @@ export class AppComponent { ...@@ -52,7 +53,9 @@ export class AppComponent {
public subjectService: SubjectService, public subjectService: SubjectService,
private route: ActivatedRoute private route: ActivatedRoute
) { ) {
console.log(this.router.url);
this.state = true; this.state = true;
this.initializeApp(); this.initializeApp();
this.subjectService.getLoginData().subscribe(loginData => { this.subjectService.getLoginData().subscribe(loginData => {
this.state = loginData; this.state = loginData;
...@@ -67,13 +70,20 @@ export class AppComponent { ...@@ -67,13 +70,20 @@ export class AppComponent {
console.log(userData); console.log(userData);
} }
}); });
this.subjectService.getTabData().subscribe(tabData => {
console.log(tabData);
if (tabData !== null) {
this.tabData = tabData;
console.log(this.tabData);
}
});
} }
initializeApp() { initializeApp() {
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.statusBar.styleDefault(); this.statusBar.styleDefault();
this.statusBar.overlaysWebView(false); this.statusBar.overlaysWebView(false);
this.statusBar.show();
this.statusBar.backgroundColorByHexString('#29285b'); this.statusBar.backgroundColorByHexString('#29285b');
}); });
} }
...@@ -88,16 +98,22 @@ export class AppComponent { ...@@ -88,16 +98,22 @@ export class AppComponent {
fetchCase() { fetchCase() {
const restrictedUrl = [ const restrictedUrl = [
'',
'productdetail', 'productdetail',
'cart', 'cart',
'nearby', 'nearby',
'verification', 'verification',
'orderplaced' 'orderplaced',
'landing',
'login',
'signup',
'address'
]; ];
const currentUrl = this.router.url.split('/'); const currentUrl = this.router.url.split('/');
const index = restrictedUrl.findIndex(x => x === currentUrl[1]); const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
// console.log(currentUrl[1], index, this.state); // console.log(currentUrl[1], index, this.state);
if (index > -1 || this.state === true) { console.log(this.tabData);
if (index > -1 || this.tabData === false) {
return true; return true;
} else { } else {
return false; return false;
......
...@@ -12,7 +12,6 @@ import { AddressList } from './../../config/services/address'; ...@@ -12,7 +12,6 @@ import { AddressList } from './../../config/services/address';
import { trigger, transition, animate, style } from '@angular/animations'; import { trigger, transition, animate, style } from '@angular/animations';
import { zip } from 'rxjs'; import { zip } from 'rxjs';
@Component({ @Component({
selector: 'app-cart', selector: 'app-cart',
templateUrl: './cart.page.html', templateUrl: './cart.page.html',
...@@ -30,7 +29,6 @@ import { zip } from 'rxjs'; ...@@ -30,7 +29,6 @@ import { zip } from 'rxjs';
] ]
}) })
export class CartPage implements OnInit { export class CartPage implements OnInit {
@ViewChild(IonSlides, { static: false }) slides: IonSlides; @ViewChild(IonSlides, { static: false }) slides: IonSlides;
currentIndex: any; currentIndex: any;
isShow = false; isShow = false;
...@@ -70,14 +68,17 @@ export class CartPage implements OnInit { ...@@ -70,14 +68,17 @@ export class CartPage implements OnInit {
this.discountApplied = false; this.discountApplied = false;
this.discount = 0; this.discount = 0;
this.cartService.cartList(); this.cartService.cartList();
const users = this.service.get('user').then((data) => { this.loader = true;
const users = this.service.get('user').then(data => {
if (data) { if (data) {
data = JSON.parse(data); data = JSON.parse(data);
this.custId = data.uid; this.custId = data.uid;
this.addressService.addList(data.uid); this.addressService.addList(data.uid);
} }
}); });
setTimeout(() => {
this.loader = false;
}, 1000);
} }
ngOnInit() { ngOnInit() {
...@@ -85,10 +86,11 @@ export class CartPage implements OnInit { ...@@ -85,10 +86,11 @@ export class CartPage implements OnInit {
this.setAddress(); this.setAddress();
} }
setAddress() { setAddress() {
if (this.addressService.addressList.length > 0) { if (this.addressService.addressList.length > 0) {
let address = this.addressService.addressList.find(x => x.defaultVal === 1); let address = this.addressService.addressList.find(
x => x.defaultVal === 1
);
if (!address) { if (!address) {
address = this.addressService.addressList[0]; address = this.addressService.addressList[0];
} }
...@@ -114,7 +116,7 @@ export class CartPage implements OnInit { ...@@ -114,7 +116,7 @@ export class CartPage implements OnInit {
} }
getTax(amount) { getTax(amount) {
return this.taxAmount = (amount * 10) / 100; return (this.taxAmount = (amount * 10) / 100);
} }
getwaypayk() { getwaypayk() {
...@@ -128,8 +130,6 @@ export class CartPage implements OnInit { ...@@ -128,8 +130,6 @@ export class CartPage implements OnInit {
return await modal.present(); return await modal.present();
} }
goToPage(path, data = null) { goToPage(path, data = null) {
this.router.navigateByUrl(path, { queryParams: data }); this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
...@@ -146,8 +146,6 @@ export class CartPage implements OnInit { ...@@ -146,8 +146,6 @@ export class CartPage implements OnInit {
this.custAddress = this.addressService.addressList[index]; this.custAddress = this.addressService.addressList[index];
} }
next(index: number = null) { next(index: number = null) {
this.loader = true; this.loader = true;
const This = this; const This = this;
...@@ -158,17 +156,19 @@ export class CartPage implements OnInit { ...@@ -158,17 +156,19 @@ export class CartPage implements OnInit {
if (index === 2) { if (index === 2) {
if (this.custAddress !== undefined) { if (this.custAddress !== undefined) {
const otherCharges = { const otherCharges = {
deliveryCharge : this.deliveryCharge, deliveryCharge: this.deliveryCharge,
taxAmount: this.taxAmount, taxAmount: this.taxAmount,
discount: this.discount, discount: this.discount,
discountApplied: this.discountApplied, discountApplied: this.discountApplied,
totalAmt: this.totalAmt, totalAmt: this.totalAmt,
custAddress: this.custAddress custAddress: this.custAddress
}; };
const state = this.orderService.checkOut(this.cartService.carts, otherCharges).then((data) => { const state = this.orderService
console.log('ready for slide'); .checkOut(this.cartService.carts, otherCharges)
this.slides.slideNext(); .then(data => {
}); console.log('ready for slide');
this.slides.slideNext();
});
} else { } else {
alert('Please choose delivery location'); alert('Please choose delivery location');
} }
...@@ -192,7 +192,6 @@ export class CartPage implements OnInit { ...@@ -192,7 +192,6 @@ export class CartPage implements OnInit {
} }
} }
slideChanged() { slideChanged() {
this.slides.getActiveIndex().then(index => { this.slides.getActiveIndex().then(index => {
this.currentIndex = index; this.currentIndex = index;
...@@ -210,14 +209,15 @@ export class CartPage implements OnInit { ...@@ -210,14 +209,15 @@ export class CartPage implements OnInit {
} }
getTotal(total) { getTotal(total) {
const actualTotal = (this.deliveryCharge + this.taxAmount + total) - this.discount; const actualTotal =
this.deliveryCharge + this.taxAmount + total - this.discount;
this.totalAmt = actualTotal; this.totalAmt = actualTotal;
return actualTotal; return actualTotal;
} }
promoApply(code) { promoApply(code) {
console.log(code); console.log(code);
this.cartService.checkPromo(code).subscribe((value) => { this.cartService.checkPromo(code).subscribe(value => {
if (value.length > 0) { if (value.length > 0) {
const promo = value[0]; const promo = value[0];
this.discountApplied = true; this.discountApplied = true;
...@@ -239,7 +239,20 @@ export class CartPage implements OnInit { ...@@ -239,7 +239,20 @@ export class CartPage implements OnInit {
formatDate() { formatDate() {
const date = new Date(); const date = new Date();
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; const months = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'June',
'July',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec'
];
let hours = date.getHours(); let hours = date.getHours();
const minutes = date.getMinutes(); const minutes = date.getMinutes();
const ampm = hours >= 12 ? 'PM' : 'AM'; const ampm = hours >= 12 ? 'PM' : 'AM';
...@@ -247,7 +260,14 @@ export class CartPage implements OnInit { ...@@ -247,7 +260,14 @@ export class CartPage implements OnInit {
hours = hours ? hours : 12; // the hour '0' should be '12' hours = hours ? hours : 12; // the hour '0' should be '12'
const newminutes = minutes < 10 ? '0' + minutes : minutes; const newminutes = minutes < 10 ? '0' + minutes : minutes;
const strTime = hours + ':' + newminutes + ' ' + ampm; const strTime = hours + ':' + newminutes + ' ' + ampm;
return months[date.getMonth()] + ' ' + date.getDate() + ',' + date.getFullYear() + ' ' + strTime; return (
months[date.getMonth()] +
' ' +
date.getDate() +
',' +
date.getFullYear() +
' ' +
strTime
);
} }
} }
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router"; import { Router } from '@angular/router';
import { Location } from "@angular/common"; import { Location } from '@angular/common';
import { ServiceService } from "./../../config/service.service"; import { ServiceService } from './../../config/service.service';
import { ShoppersService } from "./../../config/shopper.service"; import { ShoppersService } from './../../config/shopper.service';
import { SearchService } from "../../config/search.service"; import { SearchService } from '../../config/search.service';
import { trigger, transition, animate, style } from "@angular/animations"; import { trigger, transition, animate, style } from '@angular/animations';
import { ModalController } from '@ionic/angular';
import { SearchmodalPage } from '../searchmodal/searchmodal.page';
import { SubjectService } from './../../config/subject.service';
@Component({ @Component({
selector: "app-catstorelist", selector: 'app-catstorelist',
templateUrl: "./catstorelist.page.html", templateUrl: './catstorelist.page.html',
styleUrls: ["./catstorelist.page.scss"], styleUrls: ['./catstorelist.page.scss'],
animations: [ animations: [
trigger("slideInOut", [ trigger('slideInOut', [
transition(":enter", [ transition(':enter', [
style({ transform: "translateY(100%)" }), style({ transform: 'translateY(100%)' }),
animate("200ms ease-in", style({ transform: "translateY(0%)" })) animate('200ms ease-in', style({ transform: 'translateY(0%)' }))
]), ]),
transition(":leave", [ transition(':leave', [
animate("200ms ease-out", style({ transform: "translateY(100%)" })) animate('200ms ease-out', style({ transform: 'translateY(100%)' }))
]) ])
]) ])
] ]
...@@ -34,17 +37,25 @@ export class CatStorelistPage implements OnInit { ...@@ -34,17 +37,25 @@ export class CatStorelistPage implements OnInit {
public location: Location, public location: Location,
public service: ServiceService, public service: ServiceService,
public shopperService: ShoppersService, public shopperService: ShoppersService,
private searchService: SearchService private searchService: SearchService,
private modalController: ModalController,
private subjectService: SubjectService
) { ) {
this.service.get("params").then(val => { this.service.get('params').then(val => {
this.data = val; this.data = val;
this.shopperService.shopperList(this.data.catId, "catId"); this.shopperService.shopperList(this.data.catId, 'catId');
}); });
} }
clickSearch() { async clickSearch() {
this.searchShow = true; this.subjectService.setTabData(false);
this.searchService.searchList = []; const modal = await this.modalController.create({
component: SearchmodalPage
});
modal.onDidDismiss().then(dataReturned => {
this.subjectService.setTabData(true);
});
return await modal.present();
} }
searchClose() { searchClose() {
...@@ -53,7 +64,7 @@ export class CatStorelistPage implements OnInit { ...@@ -53,7 +64,7 @@ export class CatStorelistPage implements OnInit {
ngOnInit() {} ngOnInit() {}
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set("params", data); this.service.set('params', data);
this.router.navigateByUrl(path, { queryParams: data }); this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
......
...@@ -8,6 +8,7 @@ import { CenterService } from './../../config/center.service'; ...@@ -8,6 +8,7 @@ import { CenterService } from './../../config/center.service';
import { ShoppersService } from './../../config/shopper.service'; import { ShoppersService } from './../../config/shopper.service';
import { CategoriesService } from './../../config/category.service'; import { CategoriesService } from './../../config/category.service';
import { ServiceService } from './../../config/service.service'; import { ServiceService } from './../../config/service.service';
import { SubjectService } from './../../config/subject.service';
import { AddressService } from './../../config/address.service'; import { AddressService } from './../../config/address.service';
import { SearchService } from './../../config/search.service'; import { SearchService } from './../../config/search.service';
import { ProductsService } from './../../config/products.service'; import { ProductsService } from './../../config/products.service';
...@@ -56,7 +57,8 @@ export class HomePage implements OnInit { ...@@ -56,7 +57,8 @@ export class HomePage implements OnInit {
public modalController: ModalController, public modalController: ModalController,
private mapsAPILoader: MapsAPILoader, private mapsAPILoader: MapsAPILoader,
private searchService: SearchService, private searchService: SearchService,
private productsService: ProductsService private productsService: ProductsService,
private subjectService: SubjectService
) {} ) {}
ngOnInit() { ngOnInit() {
...@@ -135,6 +137,8 @@ export class HomePage implements OnInit { ...@@ -135,6 +137,8 @@ export class HomePage implements OnInit {
istoggle() { istoggle() {
this.isShow = !this.isShow; this.isShow = !this.isShow;
console.log(this.isShow);
this.subjectService.setTabData(!this.isShow);
} }
viewPage(datas: any) { viewPage(datas: any) {
...@@ -167,10 +171,13 @@ export class HomePage implements OnInit { ...@@ -167,10 +171,13 @@ export class HomePage implements OnInit {
} }
async searchModal() { async searchModal() {
this.subjectService.setTabData(false);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: SearchmodalPage component: SearchmodalPage
}); });
modal.onDidDismiss().then(dataReturned => {}); modal.onDidDismiss().then(dataReturned => {
this.subjectService.setTabData(true);
});
return await modal.present(); return await modal.present();
} }
} }
<ion-content> <ion-content>
<div class="start_wizard_wrapper"> <div class="start_wizard_wrapper">
<ion-slides pager="true" [options]="landingOptions" (ionSlideDidChange)="slideChanged()"> <ion-slides
<ion-slide> pager="true"
<div class="wizard_inner_wrapper"> [options]="landingOptions"
<img src="../assets/Group 229_2.png"> (ionSlideDidChange)="slideChanged()"
<div class="wizard_textarea"> >
<h3>EASY PURCHASE</h3> <ion-slide>
<p> <div class="wizard_inner_wrapper">
Purchase your products from your<br> favourite shops <img src="../assets/Group 229_2.png" />
</p> <div class="wizard_textarea">
</div> <h3>EASY PURCHASE</h3>
</div> <p>
</ion-slide> Purchase your products from your<br />
<ion-slide> favourite shops
<div class="wizard_inner_wrapper"> </p>
<img src="../assets/Group 230_2.png"> </div>
<div class="wizard_textarea"> </div>
<h3>1 HOUR DELIVERY</h3> </ion-slide>
<p> <ion-slide>
The products will be delivered<br>within 1 hour <div class="wizard_inner_wrapper">
</p> <img src="../assets/Group 230_2.png" />
</div> <div class="wizard_textarea">
</div> <h3>1 HOUR DELIVERY</h3>
</ion-slide> <p>The products will be delivered<br />within 1 hour</p>
<ion-slide> </div>
<div class="wizard_inner_wrapper"> </div>
<img src="../assets/Group 231_2.png"> </ion-slide>
<div class="wizard_textarea"> <ion-slide>
<h3>EASY PAYMENT</h3> <div class="wizard_inner_wrapper">
<p> <img src="../assets/Group 231_2.png" />
Easy Online payment system <div class="wizard_textarea">
</p> <h3>EASY PAYMENT</h3>
</div> <p>
</div> Easy Online payment system
</ion-slide> </p>
</ion-slides> </div>
<div class="btn_row"> </div>
<div class="btn_bay" [hidden]="currentIndex == 2"> </ion-slide>
<div class="btn_next" (click)="next()"> </ion-slides>
NEXT <div class="btn_row">
</div> <div class="btn_bay" [hidden]="currentIndex == 2">
</div> <div class="btn_next" (click)="next()">
NEXT
</div>
</div>
<div class="btn_bay" [hidden]="currentIndex != 2"> <div class="btn_bay" [hidden]="currentIndex != 2">
<div class="btn_getstarted" (click)="goToPage('login')"> <div class="btn_getstarted" (click)="goToPage('login')">
GET STARTED GET STARTED
</div>
</div>
</div> </div>
</div>
</div>
</div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div> </div>
</ion-content> </div>
\ No newline at end of file </ion-content>
import { Component, OnInit, ViewChild } from "@angular/core"; import { Component, OnInit, ViewChild } from '@angular/core';
import { IonSlides } from "@ionic/angular"; import { IonSlides } from '@ionic/angular';
import { Router, ActivatedRoute } from "@angular/router"; import { Router, ActivatedRoute } from '@angular/router';
import { ServiceService } from "./../../config/service.service"; import { ServiceService } from './../../config/service.service';
import { SubjectService } from "./../../config/subject.service"; import { SubjectService } from './../../config/subject.service';
@Component({ @Component({
selector: "app-landing", selector: 'app-landing',
templateUrl: "./landing.page.html", templateUrl: './landing.page.html',
styleUrls: ["./landing.page.scss"] styleUrls: ['./landing.page.scss']
}) })
export class LandingPage implements OnInit { export class LandingPage implements OnInit {
loader: boolean;
constructor( constructor(
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private service: ServiceService, private service: ServiceService,
public subjectService: SubjectService public subjectService: SubjectService
) { ) {
this.service.get("landing").then(data => { this.loader = true;
this.service.get('landing').then(data => {
if (data === true) { if (data === true) {
const user = JSON.parse(localStorage.getItem("user")); const user = JSON.parse(localStorage.getItem('user'));
console.log(user); console.log(user);
if (user) { if (user) {
this.subjectService.sendLoginData(false); this.subjectService.sendLoginData(false);
this.goToPage("home"); this.goToPage('home');
} else { } else {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.goToPage("login"); this.goToPage('login');
} }
} }
this.loader = false;
}); });
} }
...@@ -49,7 +52,7 @@ export class LandingPage implements OnInit { ...@@ -49,7 +52,7 @@ export class LandingPage implements OnInit {
ngOnInit() {} ngOnInit() {}
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set("landing", true); this.service.set('landing', true);
this.router.navigateByUrl(path, { queryParams: data }); this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
......
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn floatLeft"> <button class="nav_btn floatLeft"></button>
</button> <div class="nav_title floatLeft">
<div class="nav_title floatLeft"> <h4>LOGIN</h4>
<h4>LOGIN</h4> </div>
</div> <div class="clear"></div>
<div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="login_wrapper"> <div class="login_wrapper">
<div class="logo_wrapper"> <div class="logo_wrapper">
<img src="../assets/logo.png"> <img src="../assets/logo.png" />
</div> </div>
<div class="form_div"> <div class="form_div">
<div class="row"> <div class="row">
<input class="" type="text" placeholder="User Name/ Email" #userName required> <input
</div> class=""
<div class="row"> type="text"
<input class="" type="password" placeholder="Password" #userPassword required> placeholder="User Name/ Email"
</div> #userName
<div class="row"> required
<button class="login_btn" (click)="authService.SignIn(userName.value, userPassword.value)">LOGIN</button> />
</div> </div>
<div class="row"> <div class="row">
<hr> <input
<p><span>OR</span></p> class=""
</div> type="password"
<div class="row"> placeholder="Password"
<div class="social_div"> #userPassword
<div class="social_btn" style="border-right:1px solid rgba(215, 213, 228, 1);" (click)="authService.facebook(1)"> required
Facebook />
</div> </div>
<div class="social_btn" (click)="authService.google(1)"> <div class="row">
Google <button
</div> class="login_btn"
</div> (click)="authService.SignIn(userName.value, userPassword.value)"
</div> >
<div class="row"> LOGIN
<h4><strong (click)="goToPage('forgot')">FORGOT PASSWORD?</strong></h4> </button>
<h4>Don't have an account? <strong (click)="goToPage('signup')">SIGNUP</strong></h4> </div>
<div class="row">
</div> <hr />
<!-- <button (click)="goToPage('addaddresss')">Address</button> --> <p><span>OR</span></p>
</div>
<div class="row">
<div class="social_div">
<div
class="social_btn"
style="border-right:1px solid rgba(215, 213, 228, 1);"
(click)="authService.facebook(1)"
>
Facebook
</div>
<div class="social_btn" (click)="authService.google(1)">
Google
</div>
</div> </div>
</div>
<div class="row">
<h4><strong (click)="goToPage('forgot')">FORGOT PASSWORD?</strong></h4>
<h4>
Don't have an account?
<strong (click)="goToPage('signup')">SIGNUP</strong>
</h4>
</div>
<!-- <button (click)="goToPage('addaddresss')">Address</button> -->
</div>
</div>
<div class="loader" *ngIf="authService.loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div> </div>
</ion-content> </div>
\ No newline at end of file </ion-content>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { AuthService } from './../../config/auth.service'; import { AuthService } from './../../config/auth.service';
import { MenuController } from '@ionic/angular'; import { MenuController } from '@ionic/angular';
import { async } from 'q'; import { async } from 'q';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.page.html', templateUrl: './login.page.html',
styleUrls: ['./login.page.scss'], styleUrls: ['./login.page.scss']
}) })
export class LoginPage implements OnInit { export class LoginPage implements OnInit {
constructor( constructor(
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
public authService: AuthService, public authService: AuthService,
public menuCtrl: MenuController public menuCtrl: MenuController
) { } ) {}
ngOnInit() { ngOnInit() {}
}
ionViewWillEnter() { ionViewWillEnter() {
this.menuCtrl.enable(false); this.menuCtrl.enable(false);
...@@ -30,8 +27,4 @@ export class LoginPage implements OnInit { ...@@ -30,8 +27,4 @@ export class LoginPage implements OnInit {
this.router.navigateByUrl(path, { queryParams: data }); this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
} }
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()" *ngIf="type === 0"> <button
<img src="../assets/Group17_2.png"> class="nav_btn nav_back floatLeft"
(click)="goBack()"
*ngIf="type === 0"
>
<img src="../assets/Group17_2.png" />
</button> </button>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<h4>NEAR BY STORES</h4> <h4>NEAR BY STORES</h4>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="nearby_map"> <div class="nearby_map">
<agm-map
<agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="8" [backgroundColor]="'rgba(29, 27, 130,0.2)'"> [latitude]="latitude"
<agm-marker [latitude]="latitude" [longitude]="longitude" [markerDraggable]="true" (dragEnd)="markerDragEnd($event)"></agm-marker> [longitude]="longitude"
</agm-map> [zoom]="8"
<form (ngSubmit)="onSubmit(addressForm.value); addressForm.reset()" #addressForm="ngForm" method="post" class="form-horizontal"> [backgroundColor]="'rgba(29, 27, 130,0.2)'"
<div class="add_address_wrapper"> >
<h5>DELIVERY</h5> <agm-marker
<p>{{address}}</p> [latitude]="latitude"
<input [(ngModel)]="addressForm.building" name="building" #building="ngModel" name="building" required placeholder="House No./ Building No"> [longitude]="longitude"
<div class="md-errors-spacer" [hidden]="building.valid || landmark.pristine" class="ion-padding-start"> [markerDraggable]="true"
Building Name is required (dragEnd)="markerDragEnd($event)"
</div> ></agm-marker>
<input [(ngModel)]="addressForm.landmark" name="landmark" #landmark="ngModel" name="landmark" required placeholder="Landmark"> </agm-map>
<div class="md-errors-spacer" [hidden]="landmark.valid || landmark.pristine" class="ion-padding-start"> <form
Landmark is required (ngSubmit)="onSubmit(addressForm.value); addressForm.reset()"
</div> #addressForm="ngForm"
<ion-grid> method="post"
<ion-row> class="form-horizontal"
<ion-col> >
<h6> <div class="add_address_wrapper">
<input class="styled-checkbox" id="styled-check-1" type="radio" value="Home" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required> <h5>DELIVERY</h5>
<label for="styled-check-1"><span>Home</span></label></h6> <p>{{address}}</p>
</ion-col> <input
<ion-col> [(ngModel)]="addressForm.building"
<h6> name="building"
<input class="styled-checkbox" id="styled-check-2" type="radio" value="Work" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required> #building="ngModel"
<label for="styled-check-2"><span>Office</span></label></h6> name="building"
</ion-col> required
<ion-col> placeholder="House No./ Building No"
<h6> />
<input class="styled-checkbox" id="styled-check-3" type="radio" value="Other" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required> <div
<label for="styled-check-3"><span>Others</span></label></h6> class="md-errors-spacer"
</ion-col> [hidden]="building.valid || landmark.pristine"
</ion-row> class="ion-padding-start"
<div class="md-errors-spacer" [hidden]="addressType.valid || addressType.pristine" class="ion-padding-start"> >
Address Type is required Building Name is required
</div> </div>
</ion-grid> <input
<button class="add_btn" type="submit" [disabled]="!addressForm.form.valid">ADD</button> [(ngModel)]="addressForm.landmark"
</div> name="landmark"
</form> #landmark="ngModel"
name="landmark"
required
placeholder="Landmark"
/>
<div
class="md-errors-spacer"
[hidden]="landmark.valid || landmark.pristine"
class="ion-padding-start"
>
Landmark is required
</div>
<ion-grid>
<ion-row>
<ion-col>
<h6>
<input
class="styled-checkbox"
id="styled-check-1"
type="radio"
value="Home"
[(ngModel)]="addressForm.addressType"
name="addressType"
#addressType="ngModel"
required
/>
<label for="styled-check-1"><span>Home</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input
class="styled-checkbox"
id="styled-check-2"
type="radio"
value="Work"
[(ngModel)]="addressForm.addressType"
name="addressType"
#addressType="ngModel"
required
/>
<label for="styled-check-2"><span>Office</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input
class="styled-checkbox"
id="styled-check-3"
type="radio"
value="Other"
[(ngModel)]="addressForm.addressType"
name="addressType"
#addressType="ngModel"
required
/>
<label for="styled-check-3"><span>Others</span></label>
</h6>
</ion-col>
</ion-row>
<div
class="md-errors-spacer"
[hidden]="addressType.valid || addressType.pristine"
class="ion-padding-start"
>
Address Type is required
</div>
</ion-grid>
<button
class="add_btn"
type="submit"
[disabled]="!addressForm.form.valid"
>
ADD
</button>
</div>
</form>
</div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div> </div>
</ion-content> </div>
\ No newline at end of file </ion-content>
import {Component, OnInit, ViewChild, ElementRef, NgZone} from '@angular/core'; import {
Component,
OnInit,
ViewChild,
ElementRef,
NgZone
} from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { MapsAPILoader, MouseEvent } from '@agm/core'; import { MapsAPILoader, MouseEvent } from '@agm/core';
...@@ -14,7 +20,6 @@ import * as firebase from 'firebase'; ...@@ -14,7 +20,6 @@ import * as firebase from 'firebase';
templateUrl: './nearby.page.html', templateUrl: './nearby.page.html',
styleUrls: ['./nearby.page.scss'] styleUrls: ['./nearby.page.scss']
}) })
export class NearbyPage implements OnInit { export class NearbyPage implements OnInit {
latitude: number; latitude: number;
longitude: number; longitude: number;
...@@ -26,6 +31,7 @@ export class NearbyPage implements OnInit { ...@@ -26,6 +31,7 @@ export class NearbyPage implements OnInit {
successState: boolean; successState: boolean;
uid: string; uid: string;
type: any; type: any;
loader: boolean;
public searchElementRef: ElementRef; public searchElementRef: ElementRef;
constructor( constructor(
...@@ -39,14 +45,14 @@ export class NearbyPage implements OnInit { ...@@ -39,14 +45,14 @@ export class NearbyPage implements OnInit {
) { ) {
this.successState = false; this.successState = false;
this.type = 0; this.type = 0;
const users = this.service.get('user').then((data) => { const users = this.service.get('user').then(data => {
if (data) { if (data) {
data = JSON.parse(data); data = JSON.parse(data);
this.uid = data.uid; this.uid = data.uid;
} }
}); });
this.service.get('type').then((data) => { this.service.get('type').then(data => {
this.type = data; this.type = data;
}); });
} }
...@@ -109,6 +115,7 @@ export class NearbyPage implements OnInit { ...@@ -109,6 +115,7 @@ export class NearbyPage implements OnInit {
} }
onSubmit(data: any) { onSubmit(data: any) {
this.loader = true;
console.log(data); console.log(data);
const postData: Address = { const postData: Address = {
address: this.address, address: this.address,
...@@ -122,7 +129,9 @@ export class NearbyPage implements OnInit { ...@@ -122,7 +129,9 @@ export class NearbyPage implements OnInit {
}; };
this.addressService.addressCreate(postData); this.addressService.addressCreate(postData);
this.successState = true; this.successState = true;
setTimeout(() => { setTimeout(() => {
this.loader = false;
this.successState = false; this.successState = false;
if (this.type === 1) { if (this.type === 1) {
this.service.set('type', 0); this.service.set('type', 0);
......
...@@ -20,10 +20,7 @@ ...@@ -20,10 +20,7 @@
<div class="featured_badge" *ngIf="product.featured">Featured</div> <div class="featured_badge" *ngIf="product.featured">Featured</div>
<ion-slides pager="true" [options]="bannerOptions" *ngIf="slideData"> <ion-slides pager="true" [options]="bannerOptions" *ngIf="slideData">
<ion-slide *ngFor="let prodImg of slideData"> <ion-slide *ngFor="let prodImg of slideData">
<img <img [src]="prodImg" onerror="this.src='../assets/[email protected]'" />
[src]="prodImg"
onerror="this.src='../assets/[email protected]'"
/>
</ion-slide> </ion-slide>
<!-- <ion-slide> <!-- <ion-slide>
<img <img
...@@ -45,10 +42,13 @@ ...@@ -45,10 +42,13 @@
<h3>{{product.prodName}}</h3> <h3>{{product.prodName}}</h3>
<p> <p>
<strong <strong
><span><img src="../assets/Path61_2.png"/></span>0</strong ><span><img src="../assets/Path61_2.png"/></span
>{{product.rating}}</strong
>&nbsp; {{product.category}}, {{product.subCate}} >&nbsp; {{product.category}}, {{product.subCate}}
<br /> <br />
<span *ngFor="let tag of product.tag">#{{tag}}&nbsp;</span> <span *ngFor="let tag of product.tag"
><span *ngIf="tag !=='No-Tag'">#{{tag}}&nbsp;</span></span
>
</p> </p>
</ion-col> </ion-col>
<ion-col size="4"> <ion-col size="4">
...@@ -265,6 +265,12 @@ ...@@ -265,6 +265,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="footer_div"> <div class="footer_div">
......
...@@ -21,6 +21,7 @@ export class ProductdetailPage implements OnInit { ...@@ -21,6 +21,7 @@ export class ProductdetailPage implements OnInit {
order: Order; order: Order;
data: any; data: any;
slideData: any[]; slideData: any[];
loader: boolean;
bannerOptions = { bannerOptions = {
slidesPerView: 1, slidesPerView: 1,
...@@ -45,6 +46,7 @@ export class ProductdetailPage implements OnInit { ...@@ -45,6 +46,7 @@ export class ProductdetailPage implements OnInit {
) { ) {
const params = this.prodService.selItem; const params = this.prodService.selItem;
this.service.state = true; this.service.state = true;
this.loader = true;
this.prodService.similarProd( this.prodService.similarProd(
params.shopperId, params.shopperId,
params.category, params.category,
...@@ -55,6 +57,9 @@ export class ProductdetailPage implements OnInit { ...@@ -55,6 +57,9 @@ export class ProductdetailPage implements OnInit {
this.data = val; this.data = val;
}); });
this.cartService.cartList(); this.cartService.cartList();
setTimeout(() => {
this.loader = false;
}, 1000);
// console.log(this.prodService.fav); // console.log(this.prodService.fav);
} }
...@@ -87,6 +92,7 @@ export class ProductdetailPage implements OnInit { ...@@ -87,6 +92,7 @@ export class ProductdetailPage implements OnInit {
image: params.image, image: params.image,
price: params.price, price: params.price,
qty: params.qty, qty: params.qty,
rating: params.rating,
shopper: params.shopper, shopper: params.shopper,
skuCode: params.skuCode, skuCode: params.skuCode,
status: params.status, status: params.status,
......
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> <button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png" /> <img src="../assets/Group17_2.png" />
</button> </button>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" /> <input
</div> class="search_bar"
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow" (click)="clickSearch()"></button> placeholder="Search here.. eg:shirts, retailers etc..."
<button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()"></button> (click)="clickSearch()"
<div class="clear"></div> />
</div>
<button
class="nav_btn nav_search floatRight"
*ngIf="!searchShow"
(click)="clickSearch()"
></button>
<button
class="nav_btn nav_close floatRight"
*ngIf="searchShow"
(click)="searchClose()"
></button>
<div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="product_list">
<div class="product_list"> <div class="product_taskbar">
<div class="product_taskbar"> <div class="filter floatLeft" (click)="istoggle()"></div>
<div class="filter floatLeft" (click)="istoggle()"> <div class="viewset floatRight">
<div
</div> class="grid_view grid_act floatRight"
<div class="viewset floatRight"> (click)="gridToggle()"
<div class="grid_view grid_act floatRight" (click)="gridToggle()" [class.line_view]="onGrid"> [class.line_view]="onGrid"
</div> ></div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="product_title" *ngIf="data"> <div class="product_title" *ngIf="data">
{{data.shopName}} {{data.shopName}}
</div>
<ul [class.grid_view]="onGrid" *ngIf="prodService.product && prodService.product.length > 0">
<li *ngFor="let product of prodService.product; let i = index">
<div class="product_image">
<div class="load-back">
<img [src]="product.image" onerror="this.src='../assets/[email protected]'" (click)="prodDetails(i)">
</div>
<div [ngClass]="checkFavStatus(product.prodId)" (click)="changeFav(product.prodId)">
</div>
<div class="featured_badge" *ngIf="product.featured">Featured</div>
</div>
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5>
<p (click)="prodDetails(i)">A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0">-{{product.discount}}%</span></p>
</li>
</ul>
</div> </div>
<ul [class.grid_view]="onGrid" *ngIf="prodService.product && prodService.product.length > 0"> <ul
<li *ngFor="let product of prodService.product; let i = index"> [class.grid_view]="onGrid"
<div class="product_image"> *ngIf="prodService.product && prodService.product.length > 0"
<img [src]="product.image" onerror="this.src='../assets/[email protected]'" (click)="prodDetails(i)" /> >
<div [ngClass]="checkFavStatus(product.prodId)" (click)="changeFav(product.prodId)"></div> <li *ngFor="let product of prodService.product; let i = index">
<div class="featured_badge" *ngIf="product.featured">Featured</div> <div class="product_image">
</div> <div class="load-back">
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5> <img
<p (click)="prodDetails(i)"> [src]="product.image"
A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0">-{{product.discount}}%</span onerror="this.src='../assets/[email protected]'"
(click)="prodDetails(i)"
/>
</div>
<div
[ngClass]="checkFavStatus(product.prodId)"
(click)="changeFav(product.prodId)"
></div>
<div class="featured_badge" *ngIf="product.featured">Featured</div>
</div>
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5>
<p (click)="prodDetails(i)">
A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0"
>-{{product.discount}}%</span
> >
</p> </p>
</li> </li>
</ul> </ul>
</div> </div>
<ul
[class.grid_view]="onGrid"
*ngIf="prodService.product && prodService.product.length > 0"
>
<li *ngFor="let product of prodService.product; let i = index">
<div class="product_image">
<img
[src]="product.image"
onerror="this.src='../assets/[email protected]'"
(click)="prodDetails(i)"
/>
<div
[ngClass]="checkFavStatus(product.prodId)"
(click)="changeFav(product.prodId)"
></div>
<div class="featured_badge" *ngIf="product.featured">Featured</div>
</div>
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5>
<p (click)="prodDetails(i)">
A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0"
>-{{product.discount}}%</span
>
</p>
</li>
</ul>
<div class="no-result-wrapper" *ngIf="prodService.product.length === 0">
<img src="../../assets/basket.png" />
<h1>No result found</h1>
<button (click)="goToPage('home')">home</button>
</div>
<div class="sort_wrappper" *ngIf="isShow" [@slideInOut]> <div class="sort_wrappper" *ngIf="isShow" [@slideInOut]>
<div class="sort_inner"> <div class="sort_inner">
<h4>Sort By</h4> <h4>Sort By</h4>
...@@ -104,9 +145,20 @@ ...@@ -104,9 +145,20 @@
</div> </div>
</div> </div>
</div> </div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</ion-content> </ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]> <div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul *ngIf="searchService.searchList"> <ul *ngIf="searchService.searchList">
<li *ngFor="let search of searchService.searchList" (click)="viewPage(search)">{{search.text}}</li> <li
</ul> *ngFor="let search of searchService.searchList"
</div> (click)="viewPage(search)"
\ No newline at end of file >
{{search.text}}
</li>
</ul>
</div>
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { Location } from "@angular/common"; import { Location } from '@angular/common';
import { trigger, transition, animate, style } from "@angular/animations"; import { trigger, transition, animate, style } from '@angular/animations';
import { Router, ActivatedRoute, NavigationExtras } from "@angular/router"; import { Router, ActivatedRoute, NavigationExtras } from '@angular/router';
import { ProductsService } from "./../../config/products.service"; import { ProductsService } from './../../config/products.service';
import { ServiceService } from "./../../config/service.service"; import { ServiceService } from './../../config/service.service';
import { SearchService } from "./../../config/search.service"; import { SearchService } from './../../config/search.service';
import { ModalController } from '@ionic/angular';
import { SearchmodalPage } from '../searchmodal/searchmodal.page';
import { SubjectService } from './../../config/subject.service';
@Component({ @Component({
selector: "app-productlist", selector: 'app-productlist',
templateUrl: "./productlist.page.html", templateUrl: './productlist.page.html',
styleUrls: ["./productlist.page.scss"], styleUrls: ['./productlist.page.scss'],
animations: [ animations: [
trigger("slideInOut", [ trigger('slideInOut', [
transition(":enter", [ transition(':enter', [
style({ transform: "translateY(100%)" }), style({ transform: 'translateY(100%)' }),
animate("200ms ease-in", style({ transform: "translateY(0%)" })) animate('200ms ease-in', style({ transform: 'translateY(0%)' }))
]), ]),
transition(":leave", [ transition(':leave', [
animate("200ms ease-out", style({ transform: "translateY(100%)" })) animate('200ms ease-out', style({ transform: 'translateY(100%)' }))
]) ])
]) ])
] ]
...@@ -28,6 +31,7 @@ export class ProductlistPage implements OnInit { ...@@ -28,6 +31,7 @@ export class ProductlistPage implements OnInit {
data: any; data: any;
searchShow = false; searchShow = false;
sortValue: string; sortValue: string;
loader: boolean;
constructor( constructor(
private router: Router, private router: Router,
...@@ -35,12 +39,18 @@ export class ProductlistPage implements OnInit { ...@@ -35,12 +39,18 @@ export class ProductlistPage implements OnInit {
private location: Location, private location: Location,
public prodService: ProductsService, public prodService: ProductsService,
public service: ServiceService, public service: ServiceService,
public searchService: SearchService public searchService: SearchService,
private modalController: ModalController,
private subjectService: SubjectService
) { ) {
this.service.get("params").then(val => { this.loader = true;
this.service.get('params').then(val => {
this.data = val; this.data = val;
console.log(this.data); console.log(this.data);
this.prodService.prodList(this.data.uid); this.prodService.prodList(this.data.uid);
setTimeout(() => {
this.loader = false;
}, 2000);
}); });
} }
...@@ -64,9 +74,15 @@ export class ProductlistPage implements OnInit { ...@@ -64,9 +74,15 @@ export class ProductlistPage implements OnInit {
this.onGrid = !this.onGrid; this.onGrid = !this.onGrid;
} }
clickSearch() { async clickSearch() {
this.searchShow = true; this.subjectService.setTabData(false);
this.searchService.searchList = []; const modal = await this.modalController.create({
component: SearchmodalPage
});
modal.onDidDismiss().then(dataReturned => {
this.subjectService.setTabData(true);
});
return await modal.present();
} }
searchClose() { searchClose() {
...@@ -75,7 +91,7 @@ export class ProductlistPage implements OnInit { ...@@ -75,7 +91,7 @@ export class ProductlistPage implements OnInit {
prodDetails(index: number) { prodDetails(index: number) {
this.prodService.setProd(this.prodService.product[index]); this.prodService.setProd(this.prodService.product[index]);
this.router.navigateByUrl("productdetail"); this.router.navigateByUrl('productdetail');
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
...@@ -85,10 +101,10 @@ export class ProductlistPage implements OnInit { ...@@ -85,10 +101,10 @@ export class ProductlistPage implements OnInit {
console.log(this.prodService.fav); console.log(this.prodService.fav);
if (state > -1) { if (state > -1) {
this.prodService.fav.splice(state, 1); this.prodService.fav.splice(state, 1);
this.prodService.changeFav(index, "yes"); this.prodService.changeFav(index, 'yes');
} else { } else {
this.prodService.fav.push(index); this.prodService.fav.push(index);
this.prodService.changeFav(index, "no"); this.prodService.changeFav(index, 'no');
} }
return; return;
console.log(this.prodService.fav); console.log(this.prodService.fav);
...@@ -106,7 +122,7 @@ export class ProductlistPage implements OnInit { ...@@ -106,7 +122,7 @@ export class ProductlistPage implements OnInit {
checkFavStatus(index) { checkFavStatus(index) {
const state = this.prodService.fav.findIndex(x => x === index); const state = this.prodService.fav.findIndex(x => x === index);
return state > -1 ? "fav_fill" : "fav_icon"; return state > -1 ? 'fav_fill' : 'fav_icon';
} }
searchFun(data: string) { searchFun(data: string) {
...@@ -117,19 +133,19 @@ export class ProductlistPage implements OnInit { ...@@ -117,19 +133,19 @@ export class ProductlistPage implements OnInit {
console.log(datas); console.log(datas);
let data; let data;
let url; let url;
if (datas.type === "shopper") { if (datas.type === 'shopper') {
data = datas.data; data = datas.data;
this.service.set("params", data); this.service.set('params', data);
url = "productlist"; url = 'productlist';
} else if (datas.type === "category") { } else if (datas.type === 'category') {
data = datas.data; data = datas.data;
this.service.set("params", data); this.service.set('params', data);
url = "catstorelist"; url = 'catstorelist';
} else { } else {
data = datas.data; data = datas.data;
data.size = this.service.splitSep(data.size); data.size = this.service.splitSep(data.size);
data.tag = this.service.splitSep(data.tag); data.tag = this.service.splitSep(data.tag);
(data.color = this.service.splitSep(data.color)), (url = "productdetail"); (data.color = this.service.splitSep(data.color)), (url = 'productdetail');
this.prodService.setProd(data); this.prodService.setProd(data);
} }
this.searchClose(); this.searchClose();
......
<div class="nav_header"> <div class="nav_header">
<ion-menu-toggle> <ion-menu-toggle>
<button class="nav_btn nav_menu floatLeft"></button> <button class="nav_btn nav_menu floatLeft"></button>
</ion-menu-toggle> </ion-menu-toggle>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<img src="../../assets/Group [email protected]" /> <img src="../../assets/Group [email protected]" />
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="profile_wrapper" *ngIf="loggedUser"> <div class="profile_wrapper" *ngIf="loggedUser">
<div class="profile_banner"> <div class="profile_banner">
<!-- <div class="profile_circle"> <!-- <div class="profile_circle">
<div class="edit"></div> <div class="edit"></div>
</div> --> </div> -->
<div class="profile_circle"> <div class="profile_circle">
<img [src]="loggedUser.profilePhoto" onerror="this.src='./../../assets/profile_banner.png'" /> <img
<div class="edit"></div> [src]="loggedUser.profilePhoto"
<input type="file" accept="image/*" (change)="fileChange($event)" /> onerror="this.src='./../../assets/profile_banner.png'"
</div> />
<div class="edit"></div>
<input type="file" accept="image/*" (change)="fileChange($event)" />
</div>
<h5>{{loggedUser.name}}</h5> <h5>{{loggedUser.name}}</h5>
<p (click)="istoggle()">LOGOUT</p> <p (click)="istoggle()">LOGOUT</p>
</div> </div>
<div class="account_wrapper"> <div class="account_wrapper">
<div class="account_header"> <div class="account_header">
<h5 class="floatLeft">ACCOUNT INFORMATION</h5> <h5 class="floatLeft">ACCOUNT INFORMATION</h5>
<span class="floatRight" (click)="goToPage('changedetails', user && user)"><img <span
src="../../assets/edit.png" /></span> class="floatRight"
<div class="clear"></div> (click)="goToPage('changedetails', user && user)"
</div> ><img src="../../assets/edit.png"
<div class="row"> /></span>
<ion-row> <div class="clear"></div>
<ion-col class="textLeft p0"> </div>
<p> <div class="row">
Phone <ion-row>
<span *ngIf="loggedUser.phoneVerified == true">Verified</span> <ion-col class="textLeft p0">
<span *ngIf="loggedUser.phoneVerified == false">Not Verified yet</span> <p>
</p> Phone
</ion-col> <span *ngIf="loggedUser.phoneVerified == true">Verified</span>
<ion-col class="textRight p0"> <span *ngIf="loggedUser.phoneVerified == false"
<h6>{{loggedUser.phone}}</h6> >Not Verified yet</span
</ion-col> >
</ion-row> </p>
</div> </ion-col>
<div class="row"> <ion-col class="textRight p0">
<ion-row> <h6>{{loggedUser.phone}}</h6>
<ion-col class="textLeft p0"> </ion-col>
<p> </ion-row>
Email<span *ngIf="userData && userData.emailVerified == true">Verified</span> </div>
<span *ngIf="loggedUser.emailVerified == false">Not Verified yet</span> <div class="row">
</p> <ion-row>
</ion-col> <ion-col class="textLeft p0">
<ion-col class="textRight p0"> <p>
<h6>{{loggedUser.emailId}}</h6> Email<span *ngIf="userData && userData.emailVerified == true"
</ion-col> >Verified</span
</ion-row> >
</div> <span *ngIf="loggedUser.emailVerified == false"
<hr /> >Not Verified yet</span
<ion-row> >
<ion-col class="textLeft p0"> </p>
<p>Wishlist</p> </ion-col>
</ion-col> <ion-col class="textRight p0">
<ion-col class="textRight p0"> <h6>{{loggedUser.emailId}}</h6>
<h6>(3)</h6> </ion-col>
</ion-col> </ion-row>
</ion-row> </div>
<hr /> <hr />
<ion-row> <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>Address</p> <p>Wishlist</p>
</ion-col> </ion-col>
<ion-col class="textRight p0"> <ion-col class="textRight p0" (click)="goToPage('wishlist')">
<h6>(1)</h6> <h6>(0)</h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> <hr />
<ion-row> <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>My Cards</p> <p>Address</p>
</ion-col> </ion-col>
<ion-col class="textRight p0"> <ion-col class="textRight p0" (click)="goToPage('address')">
<h6> <h6 *ngIf="addressService.addList">
<ion-icon name="arrow-forward"></ion-icon> ({{addressService.addressList.length}})
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> <hr />
<ion-row> <!-- <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>My Order</p> <p>My Cards</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('myorder')"> <ion-col class="textRight p0" (click)="goToPage('addcard')">
<h6> <h6>
<ion-icon name="arrow-forward"></ion-icon> <ion-icon name="arrow-forward"></ion-icon>
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> <hr /> -->
<ion-row> <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>Currency</p> <p>My Order</p>
</ion-col> </ion-col>
<ion-col class="textRight p0"> <ion-col class="textRight p0" (click)="goToPage('myorder')">
<h6> <h6>
<span>AUD</span> <ion-icon name="arrow-forward"></ion-icon>
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> <hr />
<div class="logout-pop-wrapper" *ngIf="isShow" [@slideInOut]> <ion-row>
<div class="logout_inner"> <ion-col class="textLeft p0">
<h4>Logout</h4> <p>Currency</p>
<p>Are you sure to Logout ?</p> </ion-col>
<div class="logout_footer"> <ion-col class="textRight p0">
<button class="btn-cancel floatLeft" (click)="istoggle();"> <h6>
<span>AUD</span>
</h6>
</ion-col>
</ion-row>
</div>
<div class="logout-pop-wrapper" *ngIf="isShow" [@slideInOut]>
<div class="logout_inner">
<h4>Logout</h4>
<p>Are you sure to Logout ?</p>
<div class="logout_footer">
<button class="btn-cancel floatLeft" (click)="istoggle();">
Cancel Cancel
</button> </button>
<button class="btn-logout floatRight" (click)="authService.SignOut(); istoggle()"> <button
class="btn-logout floatRight"
(click)="authService.SignOut(); istoggle()"
>
Logout Logout
</button> </button>
<div class="clear"></div>
</div>
</div>
</div> </div>
<div class="clear"></div>
</div>
</div> </div>
</div> </div>
</ion-content> </ion-content>
\ No newline at end of file
...@@ -174,6 +174,12 @@ ...@@ -174,6 +174,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="loader" *ngIf="register.loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</ion-content> </ion-content>
<div class="terms_wrapper" *ngIf="menuShow" [@slideInOut]> <div class="terms_wrapper" *ngIf="menuShow" [@slideInOut]>
<div class="terms_inner"> <div class="terms_inner">
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<input <input
class="search_bar" class="search_bar"
placeholder="Search here.. eg:shirts, retailers etc..." placeholder="Search here.. eg:shirts, retailers etc..."
(click)="clickSearch()" (click)="searchModal()"
/> />
</div> </div>
<button <button
class="nav_btn nav_search floatRight" class="nav_btn nav_search floatRight"
*ngIf="!searchShow" *ngIf="!searchShow"
(click)="clickSearch()" (click)="searchModal()"
></button> ></button>
<button <button
class="nav_btn nav_close floatRight" class="nav_btn nav_close floatRight"
...@@ -78,6 +78,12 @@ ...@@ -78,6 +78,12 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</ion-content> </ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]> <div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
......
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { trigger, transition, animate, style } from "@angular/animations"; import { trigger, transition, animate, style } from '@angular/animations';
import { Router } from "@angular/router"; import { Router } from '@angular/router';
import { Location } from "@angular/common"; import { Location } from '@angular/common';
import { ServiceService } from "./../../config/service.service"; import { ServiceService } from './../../config/service.service';
import { ShoppersService } from "./../../config/shopper.service"; import { ShoppersService } from './../../config/shopper.service';
import { SearchService } from "../../config/search.service"; import { SearchService } from '../../config/search.service';
import { ModalController } from '@ionic/angular';
import { SearchmodalPage } from '../searchmodal/searchmodal.page';
import { SubjectService } from './../../config/subject.service';
@Component({ @Component({
selector: "app-storelist", selector: 'app-storelist',
templateUrl: "./storelist.page.html", templateUrl: './storelist.page.html',
styleUrls: ["./storelist.page.scss"], styleUrls: ['./storelist.page.scss'],
animations: [ animations: [
trigger("slideInOut", [ trigger('slideInOut', [
transition(":enter", [ transition(':enter', [
style({ transform: "translateY(100%)" }), style({ transform: 'translateY(100%)' }),
animate("200ms ease-in", style({ transform: "translateY(0%)" })) animate('200ms ease-in', style({ transform: 'translateY(0%)' }))
]), ]),
transition(":leave", [ transition(':leave', [
animate("200ms ease-out", style({ transform: "translateY(100%)" })) animate('200ms ease-out', style({ transform: 'translateY(100%)' }))
]) ])
]) ])
] ]
...@@ -27,24 +30,31 @@ export class StorelistPage implements OnInit { ...@@ -27,24 +30,31 @@ export class StorelistPage implements OnInit {
slidesPerView: 1.5 slidesPerView: 1.5
}; };
data: any; data: any;
loader: boolean;
constructor( constructor(
public router: Router, public router: Router,
public location: Location, public location: Location,
public service: ServiceService, public service: ServiceService,
public shopperService: ShoppersService, public shopperService: ShoppersService,
private searchService: SearchService private searchService: SearchService,
private modalController: ModalController,
private subjectService: SubjectService
) { ) {
this.service.get("params").then(val => { this.loader = true;
this.service.get('params').then(val => {
this.data = val; this.data = val;
this.shopperService.shopperList(this.data.cId, "centerId"); this.shopperService.shopperList(this.data.cId, 'centerId');
setTimeout(() => {
this.loader = false;
}, 2000);
}); });
} }
ngOnInit() {} ngOnInit() {}
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set("params", data); this.service.set('params', data);
this.router.navigateByUrl(path, { queryParams: data }); this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
...@@ -58,6 +68,17 @@ export class StorelistPage implements OnInit { ...@@ -58,6 +68,17 @@ export class StorelistPage implements OnInit {
this.searchService.searchList = []; this.searchService.searchList = [];
} }
async searchModal() {
this.subjectService.setTabData(false);
const modal = await this.modalController.create({
component: SearchmodalPage
});
modal.onDidDismiss().then(dataReturned => {
this.subjectService.setTabData(true);
});
return await modal.present();
}
searchClose() { searchClose() {
this.searchShow = false; this.searchShow = false;
} }
......
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> <button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png"> <img src="../assets/Group17_2.png" />
</button> </button>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<h4>VERIFICATION</h4> <h4>VERIFICATION</h4>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="verification_div"> <div class="verification_div" *ngIf="authService.userPostData">
<div class="form_div"> <div class="form_div">
<div class="row"> <div class="row">
<p>We have sent and OTP to</p> <p>We have sent and OTP to</p>
<h6>+01 {{authService.userPostData.phone}} </h6> <h6>+01 {{authService.userPostData.phone}}</h6>
</div> </div>
<div class="row"> <div class="row">
<input class="" type="number" placeholder="Type OTP" maxlength="4" #otp required> <input
</div> class=""
<div class="row"> type="number"
<button class="login_btn" (click)="authService.verify(otp.value)">SUBMIT</button> placeholder="Type OTP"
</div> maxlength="4"
<div class="row"> #otp
<button class="resend_btn" (click)="authService.resend()">RESEND</button> required
</div> />
<h6>OTP: {{authService.userPostData.otp}}</h6> </div>
</div> <div class="row">
<button class="login_btn" (click)="authService.verify(otp.value)">
SUBMIT
</button>
</div>
<div class="row">
<button class="resend_btn" (click)="authService.resend()">
RESEND
</button>
</div>
<h6>OTP: {{authService.userPostData.otp}}</h6>
</div>
</div>
<div class="loader" *ngIf="authService.loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div> </div>
</div>
</ion-content> </ion-content>
\ No newline at end of file
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> <button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png"> <img src="../assets/Group17_2.png" />
</button> </button>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<h4>WISHLIST</h4> <h4>WISHLIST</h4>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<!-- <div class="wishlist-wrapper">
<div class="wishlist-wrapper">
<ul> <ul>
<li> <li>
<div class="wishlist_image"> <div class="wishlist_image">
...@@ -39,17 +38,16 @@ ...@@ -39,17 +38,16 @@
<div class="clear"></div> <div class="clear"></div>
</li> </li>
</ul> </ul>
</div> </div> -->
<div class="empty-wishlist-wrapper">
<img src="../../assets/wishlist.png">
<h1>There is no products added</h1>
<button>shop now</button>
</div>
<div class="footer-btns-wrapper"> <div class="empty-wishlist-wrapper">
<button class="btn-clear">Clear All</button> <img src="../../assets/wishlist.png" />
<button class="btn-cart">add all to cart</button> <h1>There is no products added</h1>
</div> <button (click)="goToPage('home')">shop now</button>
</div>
</ion-content> <div class="footer-btns-wrapper">
\ No newline at end of file <button class="btn-clear">Clear All</button>
<button class="btn-cart">add all to cart</button>
</div>
</ion-content>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { Router, ActivatedRoute } from '@angular/router';
@Component({ @Component({
selector: 'app-wishlist', selector: 'app-wishlist',
...@@ -7,11 +8,16 @@ import { Location } from '@angular/common'; ...@@ -7,11 +8,16 @@ import { Location } from '@angular/common';
styleUrls: ['./wishlist.page.scss'] styleUrls: ['./wishlist.page.scss']
}) })
export class WishlistPage implements OnInit { export class WishlistPage implements OnInit {
constructor(private location: Location) {} constructor(private location: Location, private router: Router) {}
ngOnInit() {} ngOnInit() {}
goBack() { goBack() {
this.location.back(); this.location.back();
} }
goToPage(path, data = null) {
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
} }
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from '@angular/fire/firestore'; import {
AngularFirestore,
AngularFirestoreCollection,
AngularFirestoreDocument
} from '@angular/fire/firestore';
import { take } from 'rxjs/operators'; import { take } from 'rxjs/operators';
import { ServiceService } from './../config/service.service'; import { ServiceService } from './../config/service.service';
import { Products } from './services/product'; import { Products } from './services/product';
...@@ -30,7 +34,7 @@ export class ProductsService { ...@@ -30,7 +34,7 @@ export class ProductsService {
const state = true; const state = true;
// firebase query // firebase query
return new Promise (resolve => { return new Promise(resolve => {
const prodRef: AngularFirestoreCollection<any> = this.afs.collection( const prodRef: AngularFirestoreCollection<any> = this.afs.collection(
`product_gallery`, `product_gallery`,
ref => ref.where('skuId', '==', skuID) ref => ref.where('skuId', '==', skuID)
...@@ -39,7 +43,7 @@ export class ProductsService { ...@@ -39,7 +43,7 @@ export class ProductsService {
this.prodSlideImg = []; this.prodSlideImg = [];
const res = value; const res = value;
if (res.length > 0) { if (res.length > 0) {
res.forEach((item) => { res.forEach(item => {
this.prodSlideImg.push(item.downloadURL); this.prodSlideImg.push(item.downloadURL);
}); });
resolve(this.prodSlideImg); resolve(this.prodSlideImg);
...@@ -83,6 +87,7 @@ export class ProductsService { ...@@ -83,6 +87,7 @@ export class ProductsService {
shopper: item.shopper, shopper: item.shopper,
skuCode: item.skuCode, skuCode: item.skuCode,
status: item.status, status: item.status,
rating: item.rating,
size: this.service.splitSep(item.size), size: this.service.splitSep(item.size),
subCate: item.subCate, subCate: item.subCate,
tag: this.service.splitSep(item.tag) tag: this.service.splitSep(item.tag)
...@@ -143,6 +148,7 @@ export class ProductsService { ...@@ -143,6 +148,7 @@ export class ProductsService {
image: item.image, image: item.image,
price: item.price, price: item.price,
qty: item.qty, qty: item.qty,
rating: item.rating,
shopper: item.shopper, shopper: item.shopper,
skuCode: item.skuCode, skuCode: item.skuCode,
status: item.status, status: item.status,
...@@ -196,6 +202,7 @@ export class ProductsService { ...@@ -196,6 +202,7 @@ export class ProductsService {
price: item.price, price: item.price,
qty: item.qty, qty: item.qty,
shopper: item.shopper, shopper: item.shopper,
rating: item.rating,
skuCode: item.skuCode, skuCode: item.skuCode,
status: item.status, status: item.status,
size: this.service.splitSep(item.size), size: this.service.splitSep(item.size),
......
export interface Products { export interface Products {
brand: string; brand: string;
category: string; category: string;
color: any; color: any;
discount: number; discount: number;
featured: boolean; featured: boolean;
image: string; image: string;
price: number; price: number;
prodCode: string; prodCode: string;
prodDesc: string; prodDesc: string;
prodId: string; prodId: string;
prodName: string; prodName: string;
prodStatus: boolean; prodStatus: boolean;
shopperId: string; shopperId: string;
qty: number; qty: number;
shopper: string; shopper: string;
size: string[]; size: string[];
skuCode: string; skuCode: string;
status: boolean; status: boolean;
subCate: boolean; subCate: boolean;
tag: string[]; rating: string;
tag: string[];
} }
...@@ -8,6 +8,7 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject'; ...@@ -8,6 +8,7 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
export class SubjectService { export class SubjectService {
private loginState = new BehaviorSubject<any>(null); private loginState = new BehaviorSubject<any>(null);
private DataState = new BehaviorSubject<any>(null); private DataState = new BehaviorSubject<any>(null);
private TabState = new BehaviorSubject<any>(null);
sendLoginData(state: any) { sendLoginData(state: any) {
this.loginState.next(state); this.loginState.next(state);
...@@ -24,4 +25,12 @@ export class SubjectService { ...@@ -24,4 +25,12 @@ export class SubjectService {
getUserData(): Observable<any> { getUserData(): Observable<any> {
return this.DataState.asObservable(); return this.DataState.asObservable();
} }
setTabData(state: any) {
return this.TabState.next(state);
}
getTabData(): Observable<any> {
return this.TabState.asObservable();
}
} }
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