Commit f7e28111 by Adarsh K

css

parent d9cb1f13
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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',
......@@ -59,7 +61,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 +139,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 +173,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;
......
......@@ -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;
}
......
......@@ -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;
}
......
<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 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);
......@@ -159,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>
......@@ -28,7 +28,7 @@
<div class="account_header">
<h5 class="floatLeft">ACCOUNT INFORMATION</h5>
<span class="floatRight" (click)="goToPage('changedetails', user && user)"><img
src="../../assets/edit.png" /></span>
src="../../assets/edit.png" /></span>
<div class="clear"></div>
</div>
<div class="row">
......@@ -41,8 +41,8 @@
<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>
<span class="ar-span" *ngIf="loggedUser.phoneVerified == false">Not
Verified yet</span>
</ion-col>
</ion-row>
</div>
......@@ -133,11 +133,11 @@
<p>Are you sure to Logout ?</p>
<div class="logout_footer">
<button class="btn-cancel floatLeft" (click)="istoggle();">
Cancel
</button>
Cancel
</button>
<button class="btn-logout floatRight" (click)="authService.SignOut(); istoggle()">
Logout
</button>
Logout
</button>
</div>
<div class="clear"></div>
......
......@@ -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, replaceUrl: true });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
......@@ -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>
......@@ -56,4 +45,4 @@
<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) {
......
......@@ -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 });
}
});
}
......@@ -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);
......
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