Commit 39e3d8bb by Arjun

conflict fix

parents f676f61a eeb2ae01
......@@ -138,4 +138,4 @@ const routes: Routes = [
],
exports: [RouterModule]
})
export class AppRoutingModule {}
export class AppRoutingModule { }
......@@ -28,7 +28,8 @@
<div class="sub_menu">
<ul *ngIf="categoryService.activecategories">
<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 }}
</li>
</ion-menu-toggle>
......
......@@ -95,6 +95,10 @@ export class AppComponent {
});
}
ionViewWillEnter() {
alert('enter');
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
......@@ -147,7 +151,9 @@ export class AppComponent {
}
goToPage(path, data = null) {
this.service.set('params', data);
if (data !== null) {
this.service.set('catParams', data);
}
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
......@@ -36,7 +36,7 @@
<li *ngFor="let carts of cartService.carts; let i= index">
<div class="close" (click)="cartService.removeItem(i)"></div>
<div class="cart_image">
<img [src]="carts.image" onerror="this.src=''" />
<img [src]="carts.image" onerror="this.src='./../../assets/cart.png'" />
</div>
<div class="cart_detail">
<h4>{{unEscape(carts.prodName)}}</h4>
......@@ -59,7 +59,7 @@
<p class="textLeft">Total Price:</p>
</ion-col>
<ion-col>
<p class="textRight">A$ {{cartService.cartTotal}}</p>
<p class="textRight">A$ {{cartService.cartTotal.toFixed(2)}}</p>
</ion-col>
</ion-row>
</div>
......@@ -112,7 +112,7 @@
<hr />
<h5>
<span class="floatLeft">PAYMENT</span>
<span class="floatRight">CHANGE</span>
<!-- <span class="floatRight">CHANGE</span> -->
<div class="clear"></div>
</h5>
<div class="payment_method">
......@@ -171,8 +171,8 @@
<hr />
<div class="coupon_code">
<div class="promo-row">
<input class="" placeholder="COUPON CODE: GET50" #promo /><button class="add_btn"
(click)="promoApply(promo.value)">
<input class="" placeholder="COUPON CODE: GET50" #promo /><button
class="add_btn apply_btn" (click)="promoApply(promo.value)">
APPLY
</button>
</div>
......@@ -185,7 +185,7 @@
<h6>
<span class="floatLeft">PRODUCT COST</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$
{{cartService.cartTotal}}</span>
{{cartService.cartTotal.toFixed(2)}}</span>
<div class="clear"></div>
</h6>
......@@ -240,7 +240,7 @@
</ion-content>
<ion-footer>
<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
</div>
<div class="checkout" (click)="next(1)">CHECKOUT</div>
......
......@@ -236,6 +236,9 @@
font-size: 17px;
font-weight: bolder;
}
.apply_btn {
display: flex;
}
}
.promo-success {
color: #31b131;
......
......@@ -341,6 +341,7 @@ export class CartPage implements OnInit {
}
unEscape(text: string) {
return unescape(text);
const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
}
}
......@@ -165,7 +165,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
}
}
}
......
......@@ -23,16 +23,16 @@ export class CatagoryPage implements OnInit {
private subjectService: SubjectService,
public modalController: ModalController
) {
this.service.get('params').then((val) => {
/* this.service.get('catParams').then((val) => {
this.data = val;
});
}); */
}
ngOnInit() {
}
goToPage(path, data = null) {
this.service.set('params', data);
this.service.set('catParams', data);
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"></button>
<div class="nav_title floatLeft">
<input
class="search_bar"
placeholder="Search here.. eg:shirts, retailers etc..."
(click)="clickSearch()"
/>
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" />
</div>
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow"></button>
<button
class="nav_btn nav_close floatRight"
*ngIf="searchShow"
(click)="searchClose()"
></button>
<button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()"></button>
<div class="clear"></div>
</div>
<ion-content>
......@@ -21,20 +13,11 @@
Featured Stores
</div>
<div class="featured_slider">
<ion-slides
pager="false"
[options]="slideOpts"
*ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0"
>
<ion-slides pager="false" [options]="slideOpts"
*ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0">
<ion-slide *ngFor="let shopper of shopperService.activeshoppers">
<div
class="feature_product"
(click)="goToPage('productlist', shopper)"
>
<img
[src]="shopper.featuredImage"
onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'"
/>
<div class="feature_product" (click)="goToPage('productlist', shopper)">
<img [src]="shopper.featuredImage" onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'" />
<div class="feature_overlay">
<h5>{{shopper.name}}</h5>
<p>{{shopper.caption}}</p>
......@@ -48,21 +31,14 @@
</div>
<div class="nearby_shop_list">
<ul *ngIf="shopperService.shoppers && shopperService.shoppers.length > 0">
<li
*ngFor="let shopper of shopperService.shoppers"
(click)="goToPage('productlist', shopper)"
>
<li *ngFor="let shopper of shopperService.shoppers" (click)="goToPage('productlist', shopper)">
<div class="nearby_image">
<img
[src]="shopper.profilePic"
onerror="this.src='./../../assets/getmi_malls/store298/stores1.png'"
/>
<img [src]="shopper.profilePhoto" onerror="this.src='./../../assets/getmi_malls/store298/stores1.png'" />
</div>
<div class="nearby_detail">
<h5>
<span class="floatLeft">{{shopper.name}}</span>
<span class="floatRight"
>0
<span class="floatRight">0
<img src="../assets/Path61_2.png" />
</span>
<div class="clear"></div>
......@@ -72,14 +48,11 @@
<div class="clear"></div>
</li>
</ul>
<div
class="no-result-wrapper"
*ngIf="shopperService.shoppers.length === 0"
>
<div class="no-result-wrapper" *ngIf="shopperService.shoppers.length === 0">
<img src="../../assets/basket.png" />
<h1>No result found</h1>
<button (click)="goToPage('home')">home</button>
</div>
</div>
</div>
</ion-content>
</ion-content>
\ No newline at end of file
......@@ -180,7 +180,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
......
......@@ -41,7 +41,7 @@ export class CatStorelistPage implements OnInit {
private modalController: ModalController,
private subjectService: SubjectService
) {
this.service.get('params').then(val => {
this.service.get('catParams').then(val => {
this.data = val;
this.shopperService.shopperList(this.data.catId, 'catId');
});
......@@ -61,10 +61,10 @@ export class CatStorelistPage implements OnInit {
searchClose() {
this.searchShow = false;
}
ngOnInit() {}
ngOnInit() { }
goToPage(path, data = null) {
this.service.set('params', data);
this.service.set('shopParams', data);
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
......@@ -51,8 +51,12 @@ export class ContactPage implements OnInit {
this.submitted = true;
console.log(form.value);
if (form.valid && form.value.message !== '') {
const contData = { ...this.contactData, from: this.userData.emailId };
this.contactService.contactCreate(contData);
this.service.get('orderId').then((orderId) => {
const newOrder = orderId;
const contData = { ...this.contactData, from: this.userData.emailId, orderId: newOrder };
this.contactService.contactCreate(contData);
});
} else {
console.log('form not valid');
this.submitted = false;
......
......@@ -117,7 +117,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
}
}
}
......@@ -126,7 +126,7 @@
.product_detail {
padding: 10px;
hr {
border-bottom: 1px solid rgba(176, 174, 199);
border-bottom: 1px solid rgb(176, 174, 199);
height: 0px;
border-top: none;
}
......
......@@ -117,7 +117,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
}
}
}
......@@ -126,7 +126,7 @@
.product_detail {
padding: 10px;
hr {
border-bottom: 1px solid rgba(176, 174, 199);
border-bottom: 1px solid rgb(176, 174, 199);
height: 0px;
border-top: none;
}
......
......@@ -22,13 +22,13 @@ export class FirstpagePage implements OnInit {
console.log(user);
if (user) {
this.subjectService.sendLoginData(false);
this.goToPage('home');
this.goToPage('home', { replaceUrl: true });
} else {
this.subjectService.sendLoginData(true);
this.goToPage('login');
this.goToPage('login', { replaceUrl: true });
}
} else {
this.goToPage('landing');
this.goToPage('landing', { replaceUrl: true });
}
this.loader = false;
});
......
......@@ -189,7 +189,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
......
......@@ -12,9 +12,11 @@ import { SubjectService } from './../../config/subject.service';
import { AddressService } from './../../config/address.service';
import { SearchService } from './../../config/search.service';
import { ProductsService } from './../../config/products.service';
import { from } from 'rxjs';
import { ModalController } from '@ionic/angular';
import { SearchmodalPage } from '../searchmodal/searchmodal.page';
import { AuthService } from 'src/config/auth.service';
@Component({
selector: 'app-home',
......@@ -41,6 +43,7 @@ export class HomePage implements OnInit {
address: any;
custId: any;
private geoCoder;
subscription: any;
slideOpts = {
slidesPerView: 1.5
};
......@@ -59,7 +62,8 @@ export class HomePage implements OnInit {
private mapsAPILoader: MapsAPILoader,
private searchService: SearchService,
private productsService: ProductsService,
private subjectService: SubjectService
private subjectService: SubjectService,
private authService: AuthService
) {
this.loader = false;
}
......@@ -136,11 +140,20 @@ export class HomePage implements OnInit {
ionViewWillEnter() {
this.menuCtrl.enable(true);
this.authService.checkLogin();
}
goToPage(path, data = null) {
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 });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......@@ -161,11 +174,11 @@ export class HomePage implements OnInit {
let url;
if (datas.type === 'shopper') {
data = datas.data;
this.service.set('params', data);
this.service.set('shopParams', data);
url = 'productlist';
} else if (datas.type === 'category') {
data = datas.data;
this.service.set('params', data);
this.service.set('catParams', data);
url = 'catstorelist';
} else {
data = datas.data;
......
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { AuthService } from './../../config/auth.service';
import { MenuController } from '@ionic/angular';
import { MenuController, Platform } from '@ionic/angular';
import { async } from 'q';
@Component({
......@@ -10,11 +10,13 @@ import { async } from 'q';
styleUrls: ['./login.page.scss']
})
export class LoginPage implements OnInit {
subscription: any;
constructor(
private router: Router,
private route: ActivatedRoute,
public authService: AuthService,
public menuCtrl: MenuController
public menuCtrl: MenuController,
private platform: Platform
) { }
ngOnInit() { }
......@@ -23,6 +25,18 @@ export class LoginPage implements OnInit {
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) {
this.router.navigateByUrl(path, { replaceUrl: true, queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
......
......@@ -116,7 +116,8 @@ export class MyorderPage implements OnInit {
}
unEscape(text: string) {
return unescape(text);
const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
}
}
......@@ -114,7 +114,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
}
}
}
......@@ -123,7 +123,7 @@
.product_detail {
padding: 10px;
hr {
border-bottom: 1px solid rgba(176, 174, 199);
border-bottom: 1px solid rgb(176, 174, 199);
height: 0px;
border-top: none;
}
......
......@@ -106,7 +106,7 @@
{{data.deliveryAddress.building}}, <br />
{{data.deliveryAddress.landmark}}
</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">
CANCEL THIS ORDER
</button>
......
......@@ -113,7 +113,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
}
}
}
......@@ -122,7 +122,7 @@
.product_detail {
padding: 10px;
hr {
border-bottom: 1px solid rgba(176, 174, 199);
border-bottom: 1px solid rgb(176, 174, 199);
height: 0px;
border-top: none;
}
......
......@@ -42,7 +42,8 @@ export class OrderplacedPage implements OnInit {
}
unEscape(text: string) {
return unescape(text);
const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
}
getDeliveryTime(timeStamp) {
......@@ -78,6 +79,11 @@ export class OrderplacedPage implements OnInit {
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
cancelOrder(orderId) {
this.service.set('orderId', orderId);
this.router.navigateByUrl('contact');
}
changeAddress(orderId) {
this.service.set('orderId', orderId);
this.router.navigateByUrl('changeaddress');
......
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()" *ngIf="type==0">
<img src="../assets/Group17_2.png" />
</button>
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png" />
</button>
<div class="nav_title floatLeft">
<h4>Preferences</h4>
</div>
......@@ -15,8 +15,10 @@
<ion-row *ngIf="categoriesService.activecategories && categoriesService.activecategories.length > 0">
<ion-col size="6" *ngFor="let categories of categoriesService.categories">
<div class="preference-box">
<input type="checkbox" class="preference" (click)="selectPrefernce(categories.catId)" [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'" />
<input type="checkbox" class="preference" (click)="selectPrefernce(categories.catId)"
[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>
</div>
</ion-col>
......@@ -29,8 +31,8 @@
<ion-footer>
<div class="bottom-button">
<button class="show-btn" (click)="onSubmit()">
Continue
</button>
Continue
</button>
<!-- <span>SKIP</span> -->
</div>
</ion-footer>
......
......@@ -46,7 +46,7 @@ export class PreferencePage implements OnInit {
});
}
ngOnInit() {}
ngOnInit() { }
selectPrefernce(preferenceId) {
console.log(this.userPrefence);
......@@ -72,8 +72,8 @@ export class PreferencePage implements OnInit {
setTimeout(() => {
this.loader = false;
this.successState = false;
this.service.set('type', 0);
if (this.type === 1) {
this.service.set('type', 0);
this.router.navigateByUrl('home', { queryParams: null });
} else {
this.goBack();
......
......@@ -75,7 +75,8 @@ export class ProductdetailPage implements OnInit {
}
unEscape(text: string) {
return unescape(text);
const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
}
getProd(params) {
......
......@@ -46,7 +46,7 @@ export class ProductlistPage implements OnInit {
private subjectService: SubjectService
) {
this.loader = true;
this.service.get('params').then(val => {
this.service.get('shopParams').then(val => {
this.data = val;
this.shopperId = this.data.uid;
console.log(this.data);
......@@ -90,7 +90,8 @@ export class ProductlistPage implements OnInit {
}
unEscape(text: string) {
return unescape(text);
const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
}
gridToggle() {
......@@ -158,11 +159,11 @@ export class ProductlistPage implements OnInit {
let url;
if (datas.type === 'shopper') {
data = datas.data;
this.service.set('params', data);
this.service.set('shopParams', data);
url = 'productlist';
} else if (datas.type === 'category') {
data = datas.data;
this.service.set('params', data);
this.service.set('catParams', data);
url = 'catstorelist';
} else {
data = datas.data;
......
......@@ -18,7 +18,7 @@
<div class="profile_circle">
<img [src]="loggedUser.profilePhoto" onerror="this.src='./../assets/asset_avatar.png'" />
<div class="edit"></div>
<input type="file" accept="image/*" (change)="fileChange($event)" />
<input type="file" accept="image/*;capture=camera" (change)="fileChange($event)" />
</div>
<h5>{{loggedUser.name}}</h5>
......@@ -27,8 +27,8 @@
<div class="account_wrapper">
<div class="account_header">
<h5 class="floatLeft">ACCOUNT INFORMATION</h5>
<span class="floatRight" (click)="goToPage('changedetails', user && user)"><img
src="../../assets/edit.png" /></span>
<span class="floatRight" (click)="goToPage('changedetails', user && user)"><img src="../../assets/edit.png"
/></span>
<div class="clear"></div>
</div>
<div class="row">
......@@ -40,50 +40,56 @@
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.phone}}</h6>
<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>
</ion-col>
</ion-row>
</div>
<div class="row">
<ion-row>
<ion-col class="textLeft p0">
<p>
Email
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.emailId}}</h6>
<span class="ar-span" *ngIf="loggedUser.emailVerified == true">Verified</span>
<span class="ar-span" *ngIf="loggedUser.emailVerified == false">Not Verified yet</span>
</ion-col>
</ion-row>
</div>
<hr />
<ion-row (click)="goToPage('wishlist')">
<ion-col class="textLeft p0">
<p>Wishlist</p>
</ion-col>
<ion-col class="textRight p0">
<h6 *ngIf="wishService.whishItem">
({{wishService.whishItem.length}})
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row (click)="goToPage('address')">
<ion-col class="textLeft p0">
<p>Address</p>
</ion-col>
<ion-col class="textRight p0">
<h6 *ngIf="addressService.addList">
({{addressService.addressList.length}})
</h6>
</ion-col>
</ion-row>
<hr />
<!-- <ion-row>
<span class="ar-span" *ngIf="loggedUser.phoneVerified == true">Verified</span
>
<span class="ar-span" *ngIf="loggedUser.phoneVerified == false"
>Not Verified yet</span
>
</ion-col>
</ion-row>
</div>
<div class="row">
<ion-row>
<ion-col class="textLeft p0">
<p>
Email
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.emailId}}</h6>
<span class="ar-span" *ngIf="loggedUser.emailVerified == true"
>Verified</span
>
<span class="ar-span" *ngIf="loggedUser.emailVerified == false"
>Not Verified yet</span
>
</ion-col>
</ion-row>
</div>
<hr />
<ion-row (click)="goToPage('wishlist')">
<ion-col class="textLeft p0">
<p>Wishlist</p>
</ion-col>
<ion-col class="textRight p0">
<h6 *ngIf="wishService.whishItem">
({{wishService.whishItem.length}})
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row (click)="goToPage('address')">
<ion-col class="textLeft p0">
<p>Address</p>
</ion-col>
<ion-col class="textRight p0">
<h6 *ngIf="addressService.addList">
({{addressService.addressList.length}})
</h6>
</ion-col>
</ion-row>
<hr />
<!-- <ion-row>
<ion-col class="textLeft p0">
<p>My Cards</p>
</ion-col>
......@@ -94,56 +100,56 @@
</ion-col>
</ion-row>
<hr /> -->
<ion-row (click)="goToPage('myorder')">
<ion-col class="textLeft p0">
<p>My Order</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row (click)="goToPage('preference')">
<ion-col class="textLeft p0">
<p>Preferences</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Currency</p>
</ion-col>
<ion-col class="textRight p0">
<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
</button>
<button class="btn-logout floatRight" (click)="authService.SignOut(); istoggle()">
Logout
</button>
</div>
<ion-row (click)="goToPage('myorder')">
<ion-col class="textLeft p0">
<p>My Order</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row (click)="goToPage('preference')">
<ion-col class="textLeft p0">
<p>Preferences</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Currency</p>
</ion-col>
<ion-col class="textRight p0">
<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
</button>
<button class="btn-logout floatRight" (click)="authService.SignOut(); istoggle()">
Logout
</button>
</div>
<div class="clear"></div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</ion-content>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
......
......@@ -80,6 +80,10 @@ export class ProfilePage implements OnInit {
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
ionViewWillEnter() {
this.authService.checkLogin();
}
ngOnInit() {
console.log('profile page');
const This = this;
......
......@@ -35,7 +35,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
img {
width: 16px;
}
......
......@@ -37,7 +37,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
}
}
}
......
......@@ -46,11 +46,11 @@ export class SearchmodalPage implements OnInit {
let url;
if (datas.type === 'shopper') {
data = datas.data;
this.service.set('params', data);
this.service.set('shopParams', data);
url = 'productlist';
} else if (datas.type === 'category') {
data = datas.data;
this.service.set('params', data);
this.service.set('catParams', data);
url = 'catstorelist';
} else {
data = datas.data;
......@@ -60,7 +60,7 @@ export class SearchmodalPage implements OnInit {
this.productsService.setProd(data);
}
this.searchClose();
this.router.navigateByUrl(url, { queryParams: data });
this.router.navigateByUrl(url, { queryParams: data, skipLocationChange: true });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......@@ -70,7 +70,8 @@ export class SearchmodalPage implements OnInit {
}
unEscape(text: string) {
return unescape(text);
const respVal = unescape(text);
return respVal.replace('�', '');
}
......
......@@ -175,7 +175,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
......
......@@ -43,7 +43,7 @@ export class StorelistPage implements OnInit {
private subjectService: SubjectService
) {
this.loader = true;
this.service.get('params').then(val => {
this.service.get('centerParams').then(val => {
this.data = val;
this.centerId = this.data.cId;
this.shopperService.shopperList(this.data.cId, 'centerId');
......@@ -53,10 +53,10 @@ export class StorelistPage implements OnInit {
});
}
ngOnInit() {}
ngOnInit() { }
goToPage(path, data = null) {
this.service.set('params', data);
this.service.set('shopParams', data);
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
......@@ -13,26 +13,15 @@
<ul *ngIf="wishService.whishItem && wishService.whishItem.length > 0">
<li *ngFor="let product of wishService.whishItem; let i = index">
<div class="wishlist_image" (click)="prodDetails(i)">
<img
[src]="product.image"
onerror="this.src='../../assets/img-list.png'"
/>
<img [src]="product.image" onerror="this.src='../../assets/img-list.png'" />
</div>
<div class="wishlist_detail">
<p class="floatLeft" (click)="prodDetails(i)">{{product.prodName}}</p>
<span class="floatRight"
><img
src="../../assets/heart.png"
(click)="removeItem(product.prodId)"
/></span>
<p class="floatLeft" (click)="prodDetails(i)">{{unEscape(product.prodName)}}</p>
<span class="floatRight"><img src="../../assets/heart.png" (click)="removeItem(product.prodId)" /></span>
<div class="clear"></div>
<p (click)="prodDetails(i)">
<span *ngIf="product.color[0] !=='No-Color'"
>{{product.color[0]}}</span
>,
<span *ngIf="product.size[0] !=='Any-Size'"
>{{product.size[0]}}</span
>
<span *ngIf="product.color[0] !=='No-Color'">{{product.color[0]}}</span>
<span *ngIf="product.size[0] !=='Any-Size'">,{{product.size[0]}}</span>
</p>
<h1 (click)="prodDetails(i)">A$ {{product.price}}</h1>
</div>
......@@ -46,14 +35,19 @@
<button (click)="goToPage('home')">shop now</button>
</div>
</ion-content>
<ion-footer>
<div class="footer-btns-wrapper" *ngIf="wishService.whishItem.length > 0">
<button class="btn-clear" (click)="clearAll()">Clear All</button>
<button class="btn-cart" (click)="addToCart()">add all to cart</button>
</div>
</ion-content>
</ion-footer>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -31,7 +31,7 @@
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
color: rgb(176, 174, 199);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
......
......@@ -33,7 +33,7 @@ export class WishlistPage implements OnInit {
});
}
ngOnInit() {}
ngOnInit() { }
goBack() {
this.location.back();
......@@ -58,31 +58,53 @@ export class WishlistPage implements OnInit {
});
}
addToCart() {
async addToCart() {
this.loader = true;
this.wishService
.addToCart(this.custId, this.wishService.whishItem)
.then(data => {
this.wishService
.clearWish(this.custId)
.then(datas => {
this.loader = false;
this.service.showToast('Added to cart', 'top', 'my-toast', 2000);
})
.catch(err => {
this.loader = false;
this.service.showToast(
'Something went wrong',
'top',
'my-error',
1000
);
});
})
.catch(err => {
this.loader = false;
this.service.showToast('Something went wrong', 'top', 'my-error', 1000);
});
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
.addToCart(this.custId, this.wishService.whishItem)
.then(data => {
this.wishService
.clearWish(this.custId)
.then(datas => {
this.loader = false;
this.service.showToast('Added to cart', 'top', 'my-toast', 2000);
})
.catch(err => {
this.loader = false;
this.service.showToast(
'Something went wrong',
'top',
'my-error',
1000
);
});
})
.catch(err => {
this.loader = false;
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) {
......
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 {
ref => ref.where('status', '==', state).where('uid', '==', userId).where('defaultVal', '==', 1)
);
orderRef.valueChanges().subscribe(value => {
this.addressList = [];
const res = value;
if (res.length > 0) {
const item = res[0];
......
......@@ -40,7 +40,7 @@ export class AuthService {
this.SetUserData(user);
this.loader = false;
if (this.type === 1) {
this.router.navigateByUrl('home');
this.router.navigateByUrl('home', { replaceUrl: true });
} else {
this.router.navigateByUrl('verification');
}
......@@ -50,7 +50,15 @@ export class AuthService {
this.subjectService.sendLoginData(true);
this.service.set('user', null);
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 {
.then(() => {
console.log('Address add Successfully');
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;
})
.catch(err => {
......@@ -342,7 +350,7 @@ export class AuthService {
.then(() => {
this.service.showToast('Password reset mail has been sent your mail Id', 'top', 'my-toast', 2000);
this.loader = false;
this.router.navigateByUrl('login');
this.router.navigateByUrl('login', { replaceUrl: true });
})
.catch((error) => {
this.service.showToast(error, 'top', 'my-error', 1000);
......
......@@ -25,13 +25,13 @@ export class ContactService {
this.loader = true;
this.afs
.collection('contacts')
.add({})
.add(data)
.then(docRef => {
data.contactId = docRef.id;
this.afs
.collection('contacts')
.doc(data.contactId)
.set(data)
.update({ contactId: data.contactId })
.then(() => {
this.service
.showToast('Thank you for your feedback!', 'top', 'my-toast', 500)
......
......@@ -134,74 +134,72 @@ export class OrdersService {
const promise = new Promise(resolve => {
distinctShops.forEach(item => {
console.log(item);
const pickup = new firebase.firestore.GeoPoint(10.7231, 76.1234);
const products = {};
const cartItem = cartGroup[item];
let prodPrice = 0;
cartItem.forEach(prodItem => {
prodPrice += prodItem.price;
products[prodItem.prodId] = {
prodId: prodItem.prodId,
prodName: prodItem.prodName,
image: prodItem.image,
price: prodItem.price,
color: prodItem.color,
size: prodItem.size,
qty: prodItem.qty,
discount: ''
};
this.afs.doc(`carts/${prodItem.cartId}`).delete();
});
// console.log(cartItem);
// console.log(products);
const product = cartItem[0];
this.custId = this.custId.trim();
const orderItem: Order = {
amount: 'A$ ' + otherCharge.totalAmt,
customer: firebase.firestore().doc('/customer/' + this.custId),
shopper: product.shopper,
deliveryAddress: otherCharge.custAddress,
deliveryCharge: 'A$ ' + otherCharge.deliveryCharge,
deliveryLocation: otherCharge.custAddress.latLng,
bookDate: firebase.firestore.FieldValue.serverTimestamp(),
orderDate: Math.floor(Date.now() / 1000),
orderCode: this.orderCode(),
orderId: '',
orderStatus: 1,
pickupAddress: '',
pickupLocation: pickup,
promoId: null,
rider: firebase
.firestore()
.doc('/riders/qbTKza18mWVzYG9NLIbmjMbrYjG2'),
status: 1,
custId: this.custId,
riderId: 'qbTKza18mWVzYG9NLIbmjMbrYjG2',
shopperId: product.shopperId,
custName: 'Customer',
riderName: 'John',
shopperState: 0,
paymentMethod: otherCharge.paymentMethod,
shopperName: '',
product: products,
discount: 'A$ ' + otherCharge.discount,
promoApplied: otherCharge.discountApplied,
tax: 'A$ ' + otherCharge.taxAmount
};
// console.log(orderItem);
this.afs
.collection('orders')
.add({
shopper: firebase.firestore().doc('/shoppers/' + item),
bookDate: firebase.firestore.FieldValue.serverTimestamp()
})
.add(orderItem)
.then(docRef => {
const neworderId = docRef.id;
const pickup = new firebase.firestore.GeoPoint(10.7231, 76.1234);
const products = {};
const cartItem = cartGroup[item];
let prodPrice = 0;
cartItem.forEach(prodItem => {
prodPrice += prodItem.price;
products[prodItem.prodId] = {
prodId: prodItem.prodId,
prodName: prodItem.prodName,
image: prodItem.image,
price: prodItem.price,
color: prodItem.color,
size: prodItem.size,
qty: prodItem.qty,
discount: ''
};
this.afs.doc(`carts/${prodItem.cartId}`).delete();
});
// console.log(cartItem);
// console.log(products);
const product = cartItem[0];
this.custId = this.custId.trim();
const orderItem: Order = {
amount: 'A$ ' + otherCharge.totalAmt,
customer: firebase.firestore().doc('/customer/' + this.custId),
shopper: product.shopper,
deliveryAddress: otherCharge.custAddress,
deliveryCharge: 'A$ ' + otherCharge.deliveryCharge,
deliveryLocation: otherCharge.custAddress.latLng,
bookDate: firebase.firestore.FieldValue.serverTimestamp(),
orderDate: Math.floor(Date.now() / 1000),
orderCode: this.orderCode(),
orderId: neworderId,
orderStatus: 1,
pickupAddress: '',
pickupLocation: pickup,
promoId: null,
rider: firebase
.firestore()
.doc('/riders/qbTKza18mWVzYG9NLIbmjMbrYjG2'),
status: 1,
custId: this.custId,
riderId: 'qbTKza18mWVzYG9NLIbmjMbrYjG2',
shopperId: product.shopperId,
custName: 'Customer',
riderName: 'John',
shopperState: 0,
paymentMethod: otherCharge.paymentMethod,
shopperName: '',
product: products,
discount: 'A$ ' + otherCharge.discount,
promoApplied: otherCharge.discountApplied,
tax: 'A$ ' + otherCharge.taxAmount
};
// console.log(orderItem);
this.afs
.collection('orders')
.doc(neworderId)
.set(orderItem)
.update({ orderId: neworderId })
.then(() => {
// console.log('Booking Successfully');
// this.router.navigateByUrl('cart');
......@@ -209,8 +207,7 @@ export class OrdersService {
resolve('Cart to Order Successfully');
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
})
.catch(error => {
}).catch(error => {
console.error('Error adding document: ', error);
});
});
......
......@@ -453,7 +453,7 @@ app-success {
.not {
background-color: #3b394d;
color: #fff;
width: 17px;
min-width: 17px;
height: 17px;
border-radius: 50%;
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