Commit f6b936e8 by muhsin

fixed search bar issue, initial userdata issue

parent 0e941d48
......@@ -3,17 +3,14 @@
<ion-menu>
<ion-content>
<div class="side_menu_wrapper">
<<<<<<< HEAD
<ion-menu-toggle>
<div class="top_banner" (click)="goToPage('profile')">
=======
<ion-menu-toggle *ngIf="userData">
<div class="top_banner">
>>>>>>> b35f226916e6e5b4feacc30b355445f087230416
<div class="top_image"></div>
<div class="top_image">
<img [src]="userData.profilePhoto" />
</div>
<div class="top_detail">
<h4>{{userData.name}}</h4>
<p>{{userData.emailId}}</p>
<h4>{{ userData.name }}</h4>
<p>{{ userData.emailId }}</p>
</div>
<div class="clear"></div>
</div>
......@@ -62,7 +59,7 @@
</ion-split-pane>
</ion-app>
<div class="common_tab" [hidden]="fetchCase() === true">
<div class="common_tab" [hidden]="fetchCase() === true" *ngIf="!isSearchOpen">
<ul>
<li (click)="goToPage('home')">
<div
......@@ -100,7 +97,8 @@
class="icon_sec m6_icon"
[class.m6_icon_act]="sec_active6"
(click)="setActive6()"
menuClose></div>
menuClose
></div>
</li>
</ul>
</div>
......@@ -23,6 +23,8 @@ import { SearchmodalPage } from './searchmodal/searchmodal.page';
styleUrls: ['app.component.scss']
})
export class AppComponent {
isSearchOpen = false;
sec_active1 = true;
sec_active2 = false;
sec_active3 = false;
......@@ -56,7 +58,7 @@ export class AppComponent {
this.state = loginData;
});
this.service.get('userData').then(userData => {
this.subjectService.getUserData().subscribe(userData => {
if (userData) {
this.userData = JSON.parse(userData);
console.log(userData);
......@@ -109,7 +111,7 @@ export class AppComponent {
}
setActive1() {
this.sec_active1 = !this.sec_active1;
this.sec_active1 = true;
this.sec_active2 = false;
this.sec_active3 = false;
this.sec_active4 = false;
......@@ -117,7 +119,7 @@ export class AppComponent {
this.sec_active6 = false;
}
setActive2() {
this.sec_active2 = !this.sec_active2;
this.sec_active2 = true;
this.sec_active1 = false;
this.sec_active3 = false;
this.sec_active4 = false;
......@@ -125,7 +127,7 @@ export class AppComponent {
this.sec_active6 = false;
}
setActive3() {
this.sec_active3 = !this.sec_active3;
this.sec_active3 = true;
this.sec_active1 = false;
this.sec_active2 = false;
this.sec_active4 = false;
......@@ -133,7 +135,7 @@ export class AppComponent {
this.sec_active6 = false;
}
setActive4() {
this.sec_active4 = !this.sec_active4;
this.sec_active4 = true;
this.sec_active1 = false;
this.sec_active2 = false;
this.sec_active3 = false;
......@@ -141,7 +143,7 @@ export class AppComponent {
this.sec_active6 = false;
}
setActive5() {
this.sec_active5 = !this.sec_active5;
this.sec_active5 = true;
this.sec_active1 = false;
this.sec_active2 = false;
this.sec_active3 = false;
......@@ -149,7 +151,7 @@ export class AppComponent {
this.sec_active6 = false;
}
setActive6() {
this.sec_active6 = !this.sec_active6;
this.sec_active6 = true;
this.sec_active1 = false;
this.sec_active2 = false;
this.sec_active3 = false;
......@@ -199,10 +201,19 @@ export class AppComponent {
}
async searchModal() {
// Hides Bottom navbar items
this.isSearchOpen = true;
const modal = await this.modalController.create({
component: SearchmodalPage
});
modal.onDidDismiss().then(dataReturned => {});
// modal.onDidDismiss().then(dataReturned => {
//
// });
// Shows bottom navbar items on component unmount
modal.onWillDismiss().then(() => {
this.isSearchOpen = false;
});
return await modal.present();
}
}
......@@ -58,13 +58,13 @@ export class ChangedetailsPage implements OnInit {
form.value.password &&
form.value.password != form.value.confirmPassword
) {
this.register.updatePassword(form.value.password);
// this.register.updatePassword(form.value.password);
} else {
alert('Password should match');
}
// Calls update user data fn
this.register.updateData(form.value, this.userData.uid);
// this.register.updateData(form.value, this.userData.uid);
console.log('valid form values', form.value);
}
}
......
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png">
</button>
<div class="nav_title floatLeft">
<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>
<div class="clear"></div>
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png" />
</button>
<div class="nav_title floatLeft">
<input
class="search_bar"
placeholder="Search here.. eg:shirts, retailers etc..."
(click)="clickSearch()"
/>
</div>
<button
class="nav_btn nav_search floatRight"
*ngIf="!searchShow"
(click)="clickSearch()"
></button>
<button
class="nav_btn nav_close floatRight"
*ngIf="searchShow"
(click)="searchClose()"
></button>
<div class="clear"></div>
</div>
<ion-content>
<div class="product_list">
<div class="product_taskbar">
<div class="filter floatLeft" (click)="istoggle()">
</div>
<div class="viewset floatRight">
<div class="grid_view grid_act floatRight" (click)="gridToggle()" [class.line_view]="onGrid">
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="product_title" *ngIf="data">
{{data.shopName}}
</div>
<ul [class.grid_view]="onGrid" *ngIf="prodService.product && prodService.product.length > 0">
<li *ngFor="let product of prodService.product; let i = index">
<div class="product_image">
<img [src]="product.image" onerror="this.src='../assets/model1@3x.png'" (click)="prodDetails(i)">
<div [ngClass]="checkFavStatus(product.prodId)" (click)="changeFav(product.prodId)">
</div>
<div class="featured_badge" *ngIf="product.featured">Featured</div>
</div>
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5>
<p (click)="prodDetails(i)">A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0">-{{product.discount}}%</span></p>
</li>
</ul>
<div class="product_list">
<div class="product_taskbar">
<div class="filter floatLeft" (click)="istoggle()"></div>
<div class="viewset floatRight">
<div
class="grid_view grid_act floatRight"
(click)="gridToggle()"
[class.line_view]="onGrid"
></div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="product_title" *ngIf="data">
{{data.shopName}}
</div>
<div class="sort_wrappper" *ngIf="isShow" [@slideInOut]>
<div class="sort_inner">
<h4>Sort By</h4>
<ul>
<!-- <li>
<ul
[class.grid_view]="onGrid"
*ngIf="prodService.product && prodService.product.length > 0"
>
<li *ngFor="let product of prodService.product; let i = index">
<div class="product_image">
<img
[src]="product.image"
onerror="this.src='../assets/model1@3x.png'"
(click)="prodDetails(i)"
/>
<div
[ngClass]="checkFavStatus(product.prodId)"
(click)="changeFav(product.prodId)"
></div>
<div class="featured_badge" *ngIf="product.featured">Featured</div>
</div>
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5>
<p (click)="prodDetails(i)">
A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0"
>-{{product.discount}}%</span
>
</p>
</li>
</ul>
</div>
<div class="sort_wrappper" *ngIf="isShow" [@slideInOut]>
<div class="sort_inner">
<h4>Sort By</h4>
<ul>
<!-- <li>
<input class="styled-checkbox" id="styled-checkbox-1" type="radio" value="popular" name="sort" (click)="setValue($event.target.value)">
<label for="styled-checkbox-1">Popularity</label>
</li> -->
<!-- <li>
<!-- <li>
<input class="styled-checkbox" id="styled-checkbox-2" type="radio" value="relevance" name="sort" (click)="setValue($event.target.value)">
<label for="styled-checkbox-2">Relevence</label>
</li> -->
<li>
<input class="styled-checkbox" id="styled-checkbox-3" type="radio" value="low" name="sort" (click)="setValue($event.target.value)">
<label for="styled-checkbox-3">Price Low - High</label>
</li>
<li>
<input class="styled-checkbox" id="styled-checkbox-4" type="radio" value="high" name="sort" (click)="setValue($event.target.value)">
<label for="styled-checkbox-4">Price High - Low</label>
</li>
<!-- <li>
<li>
<input
class="styled-checkbox"
id="styled-checkbox-3"
type="radio"
value="low"
name="sort"
(click)="setValue($event.target.value)"
/>
<label for="styled-checkbox-3">Price Low - High</label>
</li>
<li>
<input
class="styled-checkbox"
id="styled-checkbox-4"
type="radio"
value="high"
name="sort"
(click)="setValue($event.target.value)"
/>
<label for="styled-checkbox-4">Price High - Low</label>
</li>
<!-- <li>
<input class="styled-checkbox" id="styled-checkbox-5" type="radio" value="rate" name="sort" (click)="setValue($event.target.value)">
<label for="styled-checkbox-5">Rating</label>
</li> -->
</ul>
<div class="sort_footer">
<button class="cancel floatLeft" (click)="istoggle()">CANCEL</button>
<button class="submit floatRight" (click)="istoggle(); submit()">SUBMIT</button>
<div class="clear"></div>
</div>
</div>
</ul>
<div class="sort_footer">
<button class="cancel floatLeft" (click)="istoggle()">CANCEL</button>
<button class="submit floatRight" (click)="istoggle(); submit()">
SUBMIT
</button>
<div class="clear"></div>
</div>
</div>
</div>
</ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul *ngIf="searchService.searchList">
<li *ngFor="let search of searchService.searchList" (click)="viewPage(search)">{{search.text}}</li>
</ul>
</div>
\ No newline at end of file
<ul *ngIf="searchService.searchList">
<li
*ngFor="let search of searchService.searchList"
(click)="viewPage(search)"
>
{{search.text}}
</li>
</ul>
</div>
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="closeModal()">
</button>
<div class="nav_title floatLeft relative">
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" (input)="searchFun($event.target.value)" #searchText>
</div>
<button class="nav_btn nav_close floatRight" (click)="closeModal()">
</button>
<div class="clear"></div>
<button class="nav_btn nav_back floatLeft" (click)="closeModal()"></button>
<div class="nav_title floatLeft relative">
<input
class="search_bar"
placeholder="Search here.. eg:shirts, retailers etc..."
(click)="clickSearch()"
(input)="searchFun($event.target.value)"
#searchText
/>
</div>
<button class="nav_btn nav_close floatRight" (click)="closeModal()"></button>
<div class="clear"></div>
</div>
<div class="search_item_list">
<ul *ngIf="searchService.searchList">
<li *ngFor="let search of searchService.searchList" (click)="viewPage(search)">{{search.text}} </li>
</ul>
</div>
\ No newline at end of file
<ul *ngIf="searchService.searchList">
<li
*ngFor="let search of searchService.searchList"
(click)="viewPage(search)"
>
{{search.text}}
</li>
</ul>
</div>
<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()">
</div>
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow">
</button>
<button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()">
</button>
<div class="clear"></div>
<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()"
/>
</div>
<button
class="nav_btn nav_search floatRight"
*ngIf="!searchShow"
(click)="clickSearch()"
></button>
<button
class="nav_btn nav_close floatRight"
*ngIf="searchShow"
(click)="searchClose()"
></button>
<div class="clear"></div>
</div>
<ion-content>
<div class="home_wrapper">
<div class="home_sub_header">
Featured Stores
</div>
<div class="featured_slider">
<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_overlay">
<h5>{{shopper.name}}</h5>
<p>{{shopper.caption}}</p>
</div>
</div>
</ion-slide>
</ion-slides>
</div>
<div class="home_sub_header" *ngIf="data">
{{data.centerName}}
</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)">
<div class="nearby_image">
<img [src]="shopper.profilePic" 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
<img src="../assets/Path61_2.png">
</span>
<div class="clear"></div>
</h5>
<p>{{shopper.caption}}</p>
</div>
<div class="clear"></div>
</li>
</ul>
</div>
<div class="home_wrapper">
<div class="home_sub_header">
Featured Stores
</div>
<div class="featured_slider">
<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_overlay">
<h5>{{shopper.name}}</h5>
<p>{{shopper.caption}}</p>
</div>
</div>
</ion-slide>
</ion-slides>
</div>
<div class="home_sub_header" *ngIf="data">
{{data.centerName}}
</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)"
>
<div class="nearby_image">
<img
[src]="shopper.profilePic"
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
<img src="../assets/Path61_2.png" />
</span>
<div class="clear"></div>
</h5>
<p>{{shopper.caption}}</p>
</div>
<div class="clear"></div>
</li>
</ul>
</div>
</div>
</ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul>
<li>sample</li>
</ul>
</div>
\ No newline at end of file
<ul>
<li>sample</li>
</ul>
</div>
......@@ -150,6 +150,7 @@ export class AuthService {
};
this.loggedUser = userData;
this.service.set('userData', JSON.stringify(this.loggedUser));
this.subjectService.sendUserData(JSON.stringify(this.loggedUser));
console.log(this.loggedUser);
});
}
......
......@@ -6,13 +6,22 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
providedIn: 'root'
})
export class SubjectService {
private loginState = new BehaviorSubject<any>(null);
private loginState = new BehaviorSubject<any>(null);
private DataState = new BehaviorSubject<any>(null);
sendLoginData(state: any) {
this.loginState.next(state);
}
sendLoginData(state: any) {
this.loginState.next(state);
}
getLoginData(): Observable<any> {
return this.loginState.asObservable();
}
getLoginData(): Observable<any> {
return this.loginState.asObservable();
}
sendUserData(state: any) {
this.DataState.next(state);
}
getUserData(): Observable<any> {
return this.DataState.asObservable();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment