Commit 39e3d8bb by Arjun

conflict fix

parents f676f61a eeb2ae01
...@@ -138,4 +138,4 @@ const routes: Routes = [ ...@@ -138,4 +138,4 @@ const routes: Routes = [
], ],
exports: [RouterModule] exports: [RouterModule]
}) })
export class AppRoutingModule {} export class AppRoutingModule { }
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
<div class="sub_menu"> <div class="sub_menu">
<ul *ngIf="categoryService.activecategories"> <ul *ngIf="categoryService.activecategories">
<ion-menu-toggle> <ion-menu-toggle>
<li *ngFor="let category of categoryService.activecategories" (click)="goToPage('catstorelist', category)"> <li *ngFor="let category of categoryService.activecategories"
(click)="goToPage('catstorelist', category)">
{{ category.catName }} {{ category.catName }}
</li> </li>
</ion-menu-toggle> </ion-menu-toggle>
......
...@@ -95,6 +95,10 @@ export class AppComponent { ...@@ -95,6 +95,10 @@ export class AppComponent {
}); });
} }
ionViewWillEnter() {
alert('enter');
}
initializeApp() { initializeApp() {
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.statusBar.styleDefault(); this.statusBar.styleDefault();
...@@ -147,7 +151,9 @@ export class AppComponent { ...@@ -147,7 +151,9 @@ export class AppComponent {
} }
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set('params', data); if (data !== null) {
this.service.set('catParams', 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;
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<li *ngFor="let carts of cartService.carts; let i= index"> <li *ngFor="let carts of cartService.carts; let i= index">
<div class="close" (click)="cartService.removeItem(i)"></div> <div class="close" (click)="cartService.removeItem(i)"></div>
<div class="cart_image"> <div class="cart_image">
<img [src]="carts.image" onerror="this.src=''" /> <img [src]="carts.image" onerror="this.src='./../../assets/cart.png'" />
</div> </div>
<div class="cart_detail"> <div class="cart_detail">
<h4>{{unEscape(carts.prodName)}}</h4> <h4>{{unEscape(carts.prodName)}}</h4>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<p class="textLeft">Total Price:</p> <p class="textLeft">Total Price:</p>
</ion-col> </ion-col>
<ion-col> <ion-col>
<p class="textRight">A$ {{cartService.cartTotal}}</p> <p class="textRight">A$ {{cartService.cartTotal.toFixed(2)}}</p>
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<hr /> <hr />
<h5> <h5>
<span class="floatLeft">PAYMENT</span> <span class="floatLeft">PAYMENT</span>
<span class="floatRight">CHANGE</span> <!-- <span class="floatRight">CHANGE</span> -->
<div class="clear"></div> <div class="clear"></div>
</h5> </h5>
<div class="payment_method"> <div class="payment_method">
...@@ -171,8 +171,8 @@ ...@@ -171,8 +171,8 @@
<hr /> <hr />
<div class="coupon_code"> <div class="coupon_code">
<div class="promo-row"> <div class="promo-row">
<input class="" placeholder="COUPON CODE: GET50" #promo /><button class="add_btn" <input class="" placeholder="COUPON CODE: GET50" #promo /><button
(click)="promoApply(promo.value)"> class="add_btn apply_btn" (click)="promoApply(promo.value)">
APPLY APPLY
</button> </button>
</div> </div>
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
<h6> <h6>
<span class="floatLeft">PRODUCT COST</span> <span class="floatLeft">PRODUCT COST</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$ <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{cartService.cartTotal}}</span> {{cartService.cartTotal.toFixed(2)}}</span>
<div class="clear"></div> <div class="clear"></div>
</h6> </h6>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="footer_btnbay" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 0"> <div class="footer_btnbay" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 0">
<div class="continue" (click)="goToPage('productlist')"> <div class="continue" (click)="goToPage('home')">
CONTINUE SHOPPING CONTINUE SHOPPING
</div> </div>
<div class="checkout" (click)="next(1)">CHECKOUT</div> <div class="checkout" (click)="next(1)">CHECKOUT</div>
......
...@@ -236,6 +236,9 @@ ...@@ -236,6 +236,9 @@
font-size: 17px; font-size: 17px;
font-weight: bolder; font-weight: bolder;
} }
.apply_btn {
display: flex;
}
} }
.promo-success { .promo-success {
color: #31b131; color: #31b131;
......
...@@ -341,6 +341,7 @@ export class CartPage implements OnInit { ...@@ -341,6 +341,7 @@ export class CartPage implements OnInit {
} }
unEscape(text: string) { unEscape(text: string) {
return unescape(text); const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
} }
} }
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
} }
} }
} }
......
...@@ -23,16 +23,16 @@ export class CatagoryPage implements OnInit { ...@@ -23,16 +23,16 @@ export class CatagoryPage implements OnInit {
private subjectService: SubjectService, private subjectService: SubjectService,
public modalController: ModalController public modalController: ModalController
) { ) {
this.service.get('params').then((val) => { /* this.service.get('catParams').then((val) => {
this.data = val; this.data = val;
}); }); */
} }
ngOnInit() { ngOnInit() {
} }
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set('params', data); this.service.set('catParams', 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;
} }
......
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"></button> <button class="nav_btn nav_back floatLeft" (click)="goBack()"></button>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<input <input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" />
class="search_bar"
placeholder="Search here.. eg:shirts, retailers etc..."
(click)="clickSearch()"
/>
</div> </div>
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow"></button> <button class="nav_btn nav_search floatRight" *ngIf="!searchShow"></button>
<button <button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()"></button>
class="nav_btn nav_close floatRight"
*ngIf="searchShow"
(click)="searchClose()"
></button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
...@@ -21,20 +13,11 @@ ...@@ -21,20 +13,11 @@
Featured Stores Featured Stores
</div> </div>
<div class="featured_slider"> <div class="featured_slider">
<ion-slides <ion-slides pager="false" [options]="slideOpts"
pager="false" *ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0">
[options]="slideOpts"
*ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0"
>
<ion-slide *ngFor="let shopper of shopperService.activeshoppers"> <ion-slide *ngFor="let shopper of shopperService.activeshoppers">
<div <div class="feature_product" (click)="goToPage('productlist', shopper)">
class="feature_product" <img [src]="shopper.featuredImage" onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'" />
(click)="goToPage('productlist', shopper)"
>
<img
[src]="shopper.featuredImage"
onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'"
/>
<div class="feature_overlay"> <div class="feature_overlay">
<h5>{{shopper.name}}</h5> <h5>{{shopper.name}}</h5>
<p>{{shopper.caption}}</p> <p>{{shopper.caption}}</p>
...@@ -48,21 +31,14 @@ ...@@ -48,21 +31,14 @@
</div> </div>
<div class="nearby_shop_list"> <div class="nearby_shop_list">
<ul *ngIf="shopperService.shoppers && shopperService.shoppers.length > 0"> <ul *ngIf="shopperService.shoppers && shopperService.shoppers.length > 0">
<li <li *ngFor="let shopper of shopperService.shoppers" (click)="goToPage('productlist', shopper)">
*ngFor="let shopper of shopperService.shoppers"
(click)="goToPage('productlist', shopper)"
>
<div class="nearby_image"> <div class="nearby_image">
<img <img [src]="shopper.profilePhoto" onerror="this.src='./../../assets/getmi_malls/store298/stores1.png'" />
[src]="shopper.profilePic"
onerror="this.src='./../../assets/getmi_malls/store298/stores1.png'"
/>
</div> </div>
<div class="nearby_detail"> <div class="nearby_detail">
<h5> <h5>
<span class="floatLeft">{{shopper.name}}</span> <span class="floatLeft">{{shopper.name}}</span>
<span class="floatRight" <span class="floatRight">0
>0
<img src="../assets/Path61_2.png" /> <img src="../assets/Path61_2.png" />
</span> </span>
<div class="clear"></div> <div class="clear"></div>
...@@ -72,10 +48,7 @@ ...@@ -72,10 +48,7 @@
<div class="clear"></div> <div class="clear"></div>
</li> </li>
</ul> </ul>
<div <div class="no-result-wrapper" *ngIf="shopperService.shoppers.length === 0">
class="no-result-wrapper"
*ngIf="shopperService.shoppers.length === 0"
>
<img src="../../assets/basket.png" /> <img src="../../assets/basket.png" />
<h1>No result found</h1> <h1>No result found</h1>
<button (click)="goToPage('home')">home</button> <button (click)="goToPage('home')">home</button>
......
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -41,7 +41,7 @@ export class CatStorelistPage implements OnInit { ...@@ -41,7 +41,7 @@ export class CatStorelistPage implements OnInit {
private modalController: ModalController, private modalController: ModalController,
private subjectService: SubjectService private subjectService: SubjectService
) { ) {
this.service.get('params').then(val => { this.service.get('catParams').then(val => {
this.data = val; this.data = val;
this.shopperService.shopperList(this.data.catId, 'catId'); this.shopperService.shopperList(this.data.catId, 'catId');
}); });
...@@ -61,10 +61,10 @@ export class CatStorelistPage implements OnInit { ...@@ -61,10 +61,10 @@ export class CatStorelistPage implements OnInit {
searchClose() { searchClose() {
this.searchShow = false; this.searchShow = false;
} }
ngOnInit() {} ngOnInit() { }
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set('params', data); this.service.set('shopParams', 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;
} }
......
...@@ -51,8 +51,12 @@ export class ContactPage implements OnInit { ...@@ -51,8 +51,12 @@ export class ContactPage implements OnInit {
this.submitted = true; this.submitted = true;
console.log(form.value); console.log(form.value);
if (form.valid && form.value.message !== '') { if (form.valid && form.value.message !== '') {
const contData = { ...this.contactData, from: this.userData.emailId }; this.service.get('orderId').then((orderId) => {
const newOrder = orderId;
const contData = { ...this.contactData, from: this.userData.emailId, orderId: newOrder };
this.contactService.contactCreate(contData); this.contactService.contactCreate(contData);
});
} else { } else {
console.log('form not valid'); console.log('form not valid');
this.submitted = false; this.submitted = false;
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
} }
} }
} }
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
.product_detail { .product_detail {
padding: 10px; padding: 10px;
hr { hr {
border-bottom: 1px solid rgba(176, 174, 199); border-bottom: 1px solid rgb(176, 174, 199);
height: 0px; height: 0px;
border-top: none; border-top: none;
} }
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
} }
} }
} }
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
.product_detail { .product_detail {
padding: 10px; padding: 10px;
hr { hr {
border-bottom: 1px solid rgba(176, 174, 199); border-bottom: 1px solid rgb(176, 174, 199);
height: 0px; height: 0px;
border-top: none; border-top: none;
} }
......
...@@ -22,13 +22,13 @@ export class FirstpagePage implements OnInit { ...@@ -22,13 +22,13 @@ export class FirstpagePage implements OnInit {
console.log(user); console.log(user);
if (user) { if (user) {
this.subjectService.sendLoginData(false); this.subjectService.sendLoginData(false);
this.goToPage('home'); this.goToPage('home', { replaceUrl: true });
} else { } else {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.goToPage('login'); this.goToPage('login', { replaceUrl: true });
} }
} else { } else {
this.goToPage('landing'); this.goToPage('landing', { replaceUrl: true });
} }
this.loader = false; this.loader = false;
}); });
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -12,9 +12,11 @@ import { SubjectService } from './../../config/subject.service'; ...@@ -12,9 +12,11 @@ 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';
import { from } from 'rxjs'; import { from } from 'rxjs';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { SearchmodalPage } from '../searchmodal/searchmodal.page'; import { SearchmodalPage } from '../searchmodal/searchmodal.page';
import { AuthService } from 'src/config/auth.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
...@@ -41,6 +43,7 @@ export class HomePage implements OnInit { ...@@ -41,6 +43,7 @@ export class HomePage implements OnInit {
address: any; address: any;
custId: any; custId: any;
private geoCoder; private geoCoder;
subscription: any;
slideOpts = { slideOpts = {
slidesPerView: 1.5 slidesPerView: 1.5
}; };
...@@ -59,7 +62,8 @@ export class HomePage implements OnInit { ...@@ -59,7 +62,8 @@ export class HomePage implements OnInit {
private mapsAPILoader: MapsAPILoader, private mapsAPILoader: MapsAPILoader,
private searchService: SearchService, private searchService: SearchService,
private productsService: ProductsService, private productsService: ProductsService,
private subjectService: SubjectService private subjectService: SubjectService,
private authService: AuthService
) { ) {
this.loader = false; this.loader = false;
} }
...@@ -136,11 +140,20 @@ export class HomePage implements OnInit { ...@@ -136,11 +140,20 @@ export class HomePage implements OnInit {
ionViewWillEnter() { ionViewWillEnter() {
this.menuCtrl.enable(true); this.menuCtrl.enable(true);
this.authService.checkLogin();
} }
goToPage(path, data = null) { goToPage(path, data = null) {
console.log(data); console.log(data);
this.service.set('params', data); if (path === 'storelist') {
this.service.set('centerParams', data);
} else if (path === 'productlist') {
this.service.set('shopParams', data);
} else if (path === 'catstorelist') {
this.service.set('catParams', data);
} else {
}
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;
} }
...@@ -161,11 +174,11 @@ export class HomePage implements OnInit { ...@@ -161,11 +174,11 @@ export class HomePage implements OnInit {
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('shopParams', 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('catParams', data);
url = 'catstorelist'; url = 'catstorelist';
} else { } else {
data = datas.data; data = datas.data;
......
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, Platform } from '@ionic/angular';
import { async } from 'q'; import { async } from 'q';
@Component({ @Component({
...@@ -10,11 +10,13 @@ import { async } from 'q'; ...@@ -10,11 +10,13 @@ import { async } from 'q';
styleUrls: ['./login.page.scss'] styleUrls: ['./login.page.scss']
}) })
export class LoginPage implements OnInit { export class LoginPage implements OnInit {
subscription: any;
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,
private platform: Platform
) { } ) { }
ngOnInit() { } ngOnInit() { }
...@@ -23,6 +25,18 @@ export class LoginPage implements OnInit { ...@@ -23,6 +25,18 @@ export class LoginPage implements OnInit {
this.menuCtrl.enable(false); this.menuCtrl.enable(false);
} }
ionViewDidEnter() {
this.subscription = this.platform.backButton.subscribe(() => {
console.log('cancelled');
// tslint:disable-next-line:no-string-literal
navigator['app'].exitApp();
});
}
ionViewWillLeave() {
this.subscription.unsubscribe();
}
goToPage(path, data = null) { goToPage(path, data = null) {
this.router.navigateByUrl(path, { replaceUrl: true, queryParams: data }); this.router.navigateByUrl(path, { replaceUrl: true, queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
......
...@@ -116,7 +116,8 @@ export class MyorderPage implements OnInit { ...@@ -116,7 +116,8 @@ export class MyorderPage implements OnInit {
} }
unEscape(text: string) { unEscape(text: string) {
return unescape(text); const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
} }
} }
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
} }
} }
} }
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
.product_detail { .product_detail {
padding: 10px; padding: 10px;
hr { hr {
border-bottom: 1px solid rgba(176, 174, 199); border-bottom: 1px solid rgb(176, 174, 199);
height: 0px; height: 0px;
border-top: none; border-top: none;
} }
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
{{data.deliveryAddress.building}}, <br /> {{data.deliveryAddress.building}}, <br />
{{data.deliveryAddress.landmark}} {{data.deliveryAddress.landmark}}
</h5> </h5>
<button class="cancel_btn" (click)="goToPage('contact')" <button class="cancel_btn" (click)="cancelOrder(data.orderId)"
*ngIf="cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"> *ngIf="cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8">
CANCEL THIS ORDER CANCEL THIS ORDER
</button> </button>
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
} }
} }
} }
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
.product_detail { .product_detail {
padding: 10px; padding: 10px;
hr { hr {
border-bottom: 1px solid rgba(176, 174, 199); border-bottom: 1px solid rgb(176, 174, 199);
height: 0px; height: 0px;
border-top: none; border-top: none;
} }
......
...@@ -42,7 +42,8 @@ export class OrderplacedPage implements OnInit { ...@@ -42,7 +42,8 @@ export class OrderplacedPage implements OnInit {
} }
unEscape(text: string) { unEscape(text: string) {
return unescape(text); const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
} }
getDeliveryTime(timeStamp) { getDeliveryTime(timeStamp) {
...@@ -78,6 +79,11 @@ export class OrderplacedPage implements OnInit { ...@@ -78,6 +79,11 @@ export class OrderplacedPage implements OnInit {
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
cancelOrder(orderId) {
this.service.set('orderId', orderId);
this.router.navigateByUrl('contact');
}
changeAddress(orderId) { changeAddress(orderId) {
this.service.set('orderId', orderId); this.service.set('orderId', orderId);
this.router.navigateByUrl('changeaddress'); this.router.navigateByUrl('changeaddress');
......
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()" *ngIf="type==0"> <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">
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
<ion-row *ngIf="categoriesService.activecategories && categoriesService.activecategories.length > 0"> <ion-row *ngIf="categoriesService.activecategories && categoriesService.activecategories.length > 0">
<ion-col size="6" *ngFor="let categories of categoriesService.categories"> <ion-col size="6" *ngFor="let categories of categoriesService.categories">
<div class="preference-box"> <div class="preference-box">
<input type="checkbox" class="preference" (click)="selectPrefernce(categories.catId)" [checked]="selectedPref(categories.catId)" /> <input type="checkbox" class="preference" (click)="selectPrefernce(categories.catId)"
<img [src]="categories.catImage" onerror="this.src='../assets/handsome-man-outdoors-drinking-coffee-with-sunglasses-guy-with-beard-instagram-effect_1212-818@3x.png'" /> [checked]="selectedPref(categories.catId)" />
<img [src]="categories.catImage"
onerror="this.src='../assets/handsome-man-outdoors-drinking-coffee-with-sunglasses-guy-with-beard-instagram-effect_1212-818@3x.png'" />
<h1>{{categories.catName}}</h1> <h1>{{categories.catName}}</h1>
</div> </div>
</ion-col> </ion-col>
......
...@@ -46,7 +46,7 @@ export class PreferencePage implements OnInit { ...@@ -46,7 +46,7 @@ export class PreferencePage implements OnInit {
}); });
} }
ngOnInit() {} ngOnInit() { }
selectPrefernce(preferenceId) { selectPrefernce(preferenceId) {
console.log(this.userPrefence); console.log(this.userPrefence);
...@@ -72,8 +72,8 @@ export class PreferencePage implements OnInit { ...@@ -72,8 +72,8 @@ export class PreferencePage implements OnInit {
setTimeout(() => { setTimeout(() => {
this.loader = false; this.loader = false;
this.successState = false; this.successState = false;
if (this.type === 1) {
this.service.set('type', 0); this.service.set('type', 0);
if (this.type === 1) {
this.router.navigateByUrl('home', { queryParams: null }); this.router.navigateByUrl('home', { queryParams: null });
} else { } else {
this.goBack(); this.goBack();
......
...@@ -75,7 +75,8 @@ export class ProductdetailPage implements OnInit { ...@@ -75,7 +75,8 @@ export class ProductdetailPage implements OnInit {
} }
unEscape(text: string) { unEscape(text: string) {
return unescape(text); const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
} }
getProd(params) { getProd(params) {
......
...@@ -46,7 +46,7 @@ export class ProductlistPage implements OnInit { ...@@ -46,7 +46,7 @@ export class ProductlistPage implements OnInit {
private subjectService: SubjectService private subjectService: SubjectService
) { ) {
this.loader = true; this.loader = true;
this.service.get('params').then(val => { this.service.get('shopParams').then(val => {
this.data = val; this.data = val;
this.shopperId = this.data.uid; this.shopperId = this.data.uid;
console.log(this.data); console.log(this.data);
...@@ -90,7 +90,8 @@ export class ProductlistPage implements OnInit { ...@@ -90,7 +90,8 @@ export class ProductlistPage implements OnInit {
} }
unEscape(text: string) { unEscape(text: string) {
return unescape(text); const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
} }
gridToggle() { gridToggle() {
...@@ -158,11 +159,11 @@ export class ProductlistPage implements OnInit { ...@@ -158,11 +159,11 @@ export class ProductlistPage implements OnInit {
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('shopParams', 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('catParams', data);
url = 'catstorelist'; url = 'catstorelist';
} else { } else {
data = datas.data; data = datas.data;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="profile_circle"> <div class="profile_circle">
<img [src]="loggedUser.profilePhoto" onerror="this.src='./../assets/asset_avatar.png'" /> <img [src]="loggedUser.profilePhoto" onerror="this.src='./../assets/asset_avatar.png'" />
<div class="edit"></div> <div class="edit"></div>
<input type="file" accept="image/*" (change)="fileChange($event)" /> <input type="file" accept="image/*;capture=camera" (change)="fileChange($event)" />
</div> </div>
<h5>{{loggedUser.name}}</h5> <h5>{{loggedUser.name}}</h5>
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<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 class="floatRight" (click)="goToPage('changedetails', user && user)"><img src="../../assets/edit.png"
src="../../assets/edit.png" /></span> /></span>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="row"> <div class="row">
...@@ -40,9 +40,11 @@ ...@@ -40,9 +40,11 @@
</ion-col> </ion-col>
<ion-col class="textRight p0"> <ion-col class="textRight p0">
<h6>{{loggedUser.phone}}</h6> <h6>{{loggedUser.phone}}</h6>
<span class="ar-span" *ngIf="loggedUser.phoneVerified == true">Verified</span> <span class="ar-span" *ngIf="loggedUser.phoneVerified == true">Verified</span
<span class="ar-span" *ngIf="loggedUser.phoneVerified == false" (click)="goToPage('verficationnumber')">Not >
Verified yet</span> <span class="ar-span" *ngIf="loggedUser.phoneVerified == false"
>Not Verified yet</span
>
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
...@@ -55,8 +57,12 @@ ...@@ -55,8 +57,12 @@
</ion-col> </ion-col>
<ion-col class="textRight p0"> <ion-col class="textRight p0">
<h6>{{loggedUser.emailId}}</h6> <h6>{{loggedUser.emailId}}</h6>
<span class="ar-span" *ngIf="loggedUser.emailVerified == true">Verified</span> <span class="ar-span" *ngIf="loggedUser.emailVerified == true"
<span class="ar-span" *ngIf="loggedUser.emailVerified == false">Not Verified yet</span> >Verified</span
>
<span class="ar-span" *ngIf="loggedUser.emailVerified == false"
>Not Verified yet</span
>
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
......
...@@ -80,6 +80,10 @@ export class ProfilePage implements OnInit { ...@@ -80,6 +80,10 @@ export class ProfilePage implements OnInit {
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
ionViewWillEnter() {
this.authService.checkLogin();
}
ngOnInit() { ngOnInit() {
console.log('profile page'); console.log('profile page');
const This = this; const This = this;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
img { img {
width: 16px; width: 16px;
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
} }
} }
} }
......
...@@ -46,11 +46,11 @@ export class SearchmodalPage implements OnInit { ...@@ -46,11 +46,11 @@ export class SearchmodalPage implements OnInit {
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('shopParams', 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('catParams', data);
url = 'catstorelist'; url = 'catstorelist';
} else { } else {
data = datas.data; data = datas.data;
...@@ -60,7 +60,7 @@ export class SearchmodalPage implements OnInit { ...@@ -60,7 +60,7 @@ export class SearchmodalPage implements OnInit {
this.productsService.setProd(data); this.productsService.setProd(data);
} }
this.searchClose(); this.searchClose();
this.router.navigateByUrl(url, { queryParams: data }); this.router.navigateByUrl(url, { queryParams: data, skipLocationChange: true });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
...@@ -70,7 +70,8 @@ export class SearchmodalPage implements OnInit { ...@@ -70,7 +70,8 @@ export class SearchmodalPage implements OnInit {
} }
unEscape(text: string) { unEscape(text: string) {
return unescape(text); const respVal = unescape(text);
return respVal.replace('�', '');
} }
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -43,7 +43,7 @@ export class StorelistPage implements OnInit { ...@@ -43,7 +43,7 @@ export class StorelistPage implements OnInit {
private subjectService: SubjectService private subjectService: SubjectService
) { ) {
this.loader = true; this.loader = true;
this.service.get('params').then(val => { this.service.get('centerParams').then(val => {
this.data = val; this.data = val;
this.centerId = this.data.cId; this.centerId = this.data.cId;
this.shopperService.shopperList(this.data.cId, 'centerId'); this.shopperService.shopperList(this.data.cId, 'centerId');
...@@ -53,10 +53,10 @@ export class StorelistPage implements OnInit { ...@@ -53,10 +53,10 @@ export class StorelistPage implements OnInit {
}); });
} }
ngOnInit() {} ngOnInit() { }
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set('params', data); this.service.set('shopParams', 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;
} }
......
...@@ -13,26 +13,15 @@ ...@@ -13,26 +13,15 @@
<ul *ngIf="wishService.whishItem && wishService.whishItem.length > 0"> <ul *ngIf="wishService.whishItem && wishService.whishItem.length > 0">
<li *ngFor="let product of wishService.whishItem; let i = index"> <li *ngFor="let product of wishService.whishItem; let i = index">
<div class="wishlist_image" (click)="prodDetails(i)"> <div class="wishlist_image" (click)="prodDetails(i)">
<img <img [src]="product.image" onerror="this.src='../../assets/img-list.png'" />
[src]="product.image"
onerror="this.src='../../assets/img-list.png'"
/>
</div> </div>
<div class="wishlist_detail"> <div class="wishlist_detail">
<p class="floatLeft" (click)="prodDetails(i)">{{product.prodName}}</p> <p class="floatLeft" (click)="prodDetails(i)">{{unEscape(product.prodName)}}</p>
<span class="floatRight" <span class="floatRight"><img src="../../assets/heart.png" (click)="removeItem(product.prodId)" /></span>
><img
src="../../assets/heart.png"
(click)="removeItem(product.prodId)"
/></span>
<div class="clear"></div> <div class="clear"></div>
<p (click)="prodDetails(i)"> <p (click)="prodDetails(i)">
<span *ngIf="product.color[0] !=='No-Color'" <span *ngIf="product.color[0] !=='No-Color'">{{product.color[0]}}</span>
>{{product.color[0]}}</span <span *ngIf="product.size[0] !=='Any-Size'">,{{product.size[0]}}</span>
>,
<span *ngIf="product.size[0] !=='Any-Size'"
>{{product.size[0]}}</span
>
</p> </p>
<h1 (click)="prodDetails(i)">A$ {{product.price}}</h1> <h1 (click)="prodDetails(i)">A$ {{product.price}}</h1>
</div> </div>
...@@ -46,11 +35,16 @@ ...@@ -46,11 +35,16 @@
<button (click)="goToPage('home')">shop now</button> <button (click)="goToPage('home')">shop now</button>
</div> </div>
</ion-content>
<ion-footer>
<div class="footer-btns-wrapper" *ngIf="wishService.whishItem.length > 0"> <div class="footer-btns-wrapper" *ngIf="wishService.whishItem.length > 0">
<button class="btn-clear" (click)="clearAll()">Clear All</button> <button class="btn-clear" (click)="clearAll()">Clear All</button>
<button class="btn-cart" (click)="addToCart()">add all to cart</button> <button class="btn-cart" (click)="addToCart()">add all to cart</button>
</div> </div>
</ion-content> </ion-footer>
<div class="loader" *ngIf="loader"> <div class="loader" *ngIf="loader">
<div class="lds-ripple"> <div class="lds-ripple">
<div></div> <div></div>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199); color: rgb(176, 174, 199);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -33,7 +33,7 @@ export class WishlistPage implements OnInit { ...@@ -33,7 +33,7 @@ export class WishlistPage implements OnInit {
}); });
} }
ngOnInit() {} ngOnInit() { }
goBack() { goBack() {
this.location.back(); this.location.back();
...@@ -58,8 +58,21 @@ export class WishlistPage implements OnInit { ...@@ -58,8 +58,21 @@ export class WishlistPage implements OnInit {
}); });
} }
addToCart() { async addToCart() {
this.loader = true; this.loader = true;
let centerId = '';
let state = false;
await this.wishService.whishItem.forEach((item) => {
if (centerId === '') {
centerId = item.centerId;
} else {
if (centerId !== item.centerId) {
state = true;
}
}
});
if (state === false) {
this.wishService this.wishService
.addToCart(this.custId, this.wishService.whishItem) .addToCart(this.custId, this.wishService.whishItem)
.then(data => { .then(data => {
...@@ -83,6 +96,15 @@ export class WishlistPage implements OnInit { ...@@ -83,6 +96,15 @@ export class WishlistPage implements OnInit {
this.loader = false; this.loader = false;
this.service.showToast('Something went wrong', 'top', 'my-error', 1000); this.service.showToast('Something went wrong', 'top', 'my-error', 1000);
}); });
} else {
this.loader = false;
this.service.showToast('You have selected products from different shopping centers', 'top', 'my-error', 2000);
}
}
unEscape(text: string) {
const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
} }
removeItem(prodId) { removeItem(prodId) {
......
src/assets/asset_avatar.png

26.5 KB | W: | H:

src/assets/asset_avatar.png

21.3 KB | W: | H:

src/assets/asset_avatar.png
src/assets/asset_avatar.png
src/assets/asset_avatar.png
src/assets/asset_avatar.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/img-list.png

125 KB | W: | H:

src/assets/img-list.png

4.8 KB | W: | H:

src/assets/img-list.png
src/assets/img-list.png
src/assets/img-list.png
src/assets/img-list.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/model1@3x.png

204 KB | W: | H:

src/assets/model1@3x.png

8.91 KB | W: | H:

src/assets/model1@3x.png
src/assets/model1@3x.png
src/assets/model1@3x.png
src/assets/model1@3x.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -55,7 +55,6 @@ export class AddressService { ...@@ -55,7 +55,6 @@ export class AddressService {
ref => ref.where('status', '==', state).where('uid', '==', userId).where('defaultVal', '==', 1) ref => ref.where('status', '==', state).where('uid', '==', userId).where('defaultVal', '==', 1)
); );
orderRef.valueChanges().subscribe(value => { orderRef.valueChanges().subscribe(value => {
this.addressList = [];
const res = value; const res = value;
if (res.length > 0) { if (res.length > 0) {
const item = res[0]; const item = res[0];
......
...@@ -40,7 +40,7 @@ export class AuthService { ...@@ -40,7 +40,7 @@ export class AuthService {
this.SetUserData(user); this.SetUserData(user);
this.loader = false; this.loader = false;
if (this.type === 1) { if (this.type === 1) {
this.router.navigateByUrl('home'); this.router.navigateByUrl('home', { replaceUrl: true });
} else { } else {
this.router.navigateByUrl('verification'); this.router.navigateByUrl('verification');
} }
...@@ -50,7 +50,15 @@ export class AuthService { ...@@ -50,7 +50,15 @@ export class AuthService {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.service.set('user', null); this.service.set('user', null);
JSON.parse(localStorage.getItem('user')); JSON.parse(localStorage.getItem('user'));
this.router.navigateByUrl('login'); this.router.navigateByUrl('login', { replaceUrl: true });
}
});
}
checkLogin() {
this.afAuth.authState.subscribe(user => {
if (!user) {
this.router.navigateByUrl('login', { replaceUrl: true });
} }
}); });
} }
...@@ -325,7 +333,7 @@ export class AuthService { ...@@ -325,7 +333,7 @@ export class AuthService {
.then(() => { .then(() => {
console.log('Address add Successfully'); console.log('Address add Successfully');
this.service.set('user', JSON.stringify(this.userData)); this.service.set('user', JSON.stringify(this.userData));
this.router.navigateByUrl('home'); this.router.navigateByUrl('home', { replaceUrl: true });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
}) })
.catch(err => { .catch(err => {
...@@ -342,7 +350,7 @@ export class AuthService { ...@@ -342,7 +350,7 @@ export class AuthService {
.then(() => { .then(() => {
this.service.showToast('Password reset mail has been sent your mail Id', 'top', 'my-toast', 2000); this.service.showToast('Password reset mail has been sent your mail Id', 'top', 'my-toast', 2000);
this.loader = false; this.loader = false;
this.router.navigateByUrl('login'); this.router.navigateByUrl('login', { replaceUrl: true });
}) })
.catch((error) => { .catch((error) => {
this.service.showToast(error, 'top', 'my-error', 1000); this.service.showToast(error, 'top', 'my-error', 1000);
......
...@@ -25,13 +25,13 @@ export class ContactService { ...@@ -25,13 +25,13 @@ export class ContactService {
this.loader = true; this.loader = true;
this.afs this.afs
.collection('contacts') .collection('contacts')
.add({}) .add(data)
.then(docRef => { .then(docRef => {
data.contactId = docRef.id; data.contactId = docRef.id;
this.afs this.afs
.collection('contacts') .collection('contacts')
.doc(data.contactId) .doc(data.contactId)
.set(data) .update({ contactId: data.contactId })
.then(() => { .then(() => {
this.service this.service
.showToast('Thank you for your feedback!', 'top', 'my-toast', 500) .showToast('Thank you for your feedback!', 'top', 'my-toast', 500)
......
...@@ -134,14 +134,7 @@ export class OrdersService { ...@@ -134,14 +134,7 @@ export class OrdersService {
const promise = new Promise(resolve => { const promise = new Promise(resolve => {
distinctShops.forEach(item => { distinctShops.forEach(item => {
console.log(item); console.log(item);
this.afs
.collection('orders')
.add({
shopper: firebase.firestore().doc('/shoppers/' + item),
bookDate: firebase.firestore.FieldValue.serverTimestamp()
})
.then(docRef => {
const neworderId = docRef.id;
const pickup = new firebase.firestore.GeoPoint(10.7231, 76.1234); const pickup = new firebase.firestore.GeoPoint(10.7231, 76.1234);
const products = {}; const products = {};
const cartItem = cartGroup[item]; const cartItem = cartGroup[item];
...@@ -174,7 +167,7 @@ export class OrdersService { ...@@ -174,7 +167,7 @@ export class OrdersService {
bookDate: firebase.firestore.FieldValue.serverTimestamp(), bookDate: firebase.firestore.FieldValue.serverTimestamp(),
orderDate: Math.floor(Date.now() / 1000), orderDate: Math.floor(Date.now() / 1000),
orderCode: this.orderCode(), orderCode: this.orderCode(),
orderId: neworderId, orderId: '',
orderStatus: 1, orderStatus: 1,
pickupAddress: '', pickupAddress: '',
pickupLocation: pickup, pickupLocation: pickup,
...@@ -200,8 +193,13 @@ export class OrdersService { ...@@ -200,8 +193,13 @@ export class OrdersService {
this.afs this.afs
.collection('orders') .collection('orders')
.add(orderItem)
.then(docRef => {
const neworderId = docRef.id;
this.afs
.collection('orders')
.doc(neworderId) .doc(neworderId)
.set(orderItem) .update({ orderId: neworderId })
.then(() => { .then(() => {
// console.log('Booking Successfully'); // console.log('Booking Successfully');
// this.router.navigateByUrl('cart'); // this.router.navigateByUrl('cart');
...@@ -209,8 +207,7 @@ export class OrdersService { ...@@ -209,8 +207,7 @@ export class OrdersService {
resolve('Cart to Order Successfully'); resolve('Cart to Order Successfully');
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
}); });
}) }).catch(error => {
.catch(error => {
console.error('Error adding document: ', error); console.error('Error adding document: ', error);
}); });
}); });
......
...@@ -453,7 +453,7 @@ app-success { ...@@ -453,7 +453,7 @@ app-success {
.not { .not {
background-color: #3b394d; background-color: #3b394d;
color: #fff; color: #fff;
width: 17px; min-width: 17px;
height: 17px; height: 17px;
border-radius: 50%; border-radius: 50%;
position: absolute; position: absolute;
......
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