Commit b79b7ad8 by Adarsh K

comments

parent 522787f4
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</ion-menu-toggle> </ion-menu-toggle>
<div class="sidemenu_list"> <div class="sidemenu_list">
<ul> <ul>
<ion-menu-toggle> <ion-menu-toggle (click)="hideTab()">
<li (click)="vieworder('home')">Shop</li> <li (click)="vieworder('home')">Shop</li>
</ion-menu-toggle> </ion-menu-toggle>
<!-- <li>About us</li> --> <!-- <li>About us</li> -->
......
...@@ -89,6 +89,10 @@ export class AppComponent { ...@@ -89,6 +89,10 @@ export class AppComponent {
}); });
} }
hideTab() {
alert('asdasdas');
}
async finishpop(data: any) { async finishpop(data: any) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: DeliverypopPage, component: DeliverypopPage,
...@@ -109,12 +113,12 @@ export class AppComponent { ...@@ -109,12 +113,12 @@ export class AppComponent {
'login', 'login',
'signup', 'signup',
'address', 'address',
'forgot' 'forgot',
'feedback'
]; ];
const currentUrl = this.router.url.split('/'); const currentUrl = this.router.url.split('/');
const index = restrictedUrl.findIndex(x => x === currentUrl[1]); const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
// console.log(currentUrl[1], index, this.state); // console.log(currentUrl[1], index, this.state);
console.log(this.tabData);
if (index > -1 || this.tabData === false) { if (index > -1 || this.tabData === false) {
return true; return true;
} else { } else {
......
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> <button class="nav_btn nav_back floatLeft" (click)="goBack()"></button>
</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"
</div> placeholder="Search here.. eg:shirts, retailers etc..."
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow"> (click)="clickSearch()"
</button> />
<button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()"> </div>
</button> <button class="nav_btn nav_search floatRight" *ngIf="!searchShow"></button>
<div class="clear"></div> <button
class="nav_btn nav_close floatRight"
*ngIf="searchShow"
(click)="searchClose()"
></button>
<div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="home_wrapper"> <div class="home_wrapper">
<div class="home_sub_header"> <div class="home_sub_header">
Featured Stores Featured Stores
</div> </div>
<div class="featured_slider"> <div class="featured_slider">
<ion-slides pager="false" [options]="slideOpts" *ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0"> <ion-slides
<ion-slide *ngFor="let shopper of shopperService.activeshoppers"> pager="false"
<div class="feature_product" (click)="goToPage('productlist', shopper)"> [options]="slideOpts"
<img [src]="shopper.featuredImage" onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'"> *ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0"
<div class="feature_overlay"> >
<h5>{{shopper.name}}</h5> <ion-slide *ngFor="let shopper of shopperService.activeshoppers">
<p>{{shopper.caption}}</p> <div
</div> class="feature_product"
</div> (click)="goToPage('productlist', shopper)"
</ion-slide> >
</ion-slides> <img
</div> [src]="shopper.featuredImage"
<div class="home_sub_header" *ngIf="data"> onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'"
{{data.catName}} />
</div> <div class="feature_overlay">
<div class="nearby_shop_list"> <h5>{{shopper.name}}</h5>
<ul *ngIf="shopperService.shoppers && shopperService.shoppers.length > 0"> <p>{{shopper.caption}}</p>
<li *ngFor="let shopper of shopperService.shoppers" (click)="goToPage('productlist', shopper)"> </div>
<div class="nearby_image"> </div>
<img [src]="shopper.profilePic" onerror="this.src='./../../assets/getmi_malls/store298/stores1.png'"> </ion-slide>
</div> </ion-slides>
<div class="nearby_detail"> </div>
<h5> <div class="home_sub_header" *ngIf="data">
<span class="floatLeft">{{shopper.name}}</span> {{data.catName}}
<span class="floatRight">0 </div>
<img src="../assets/Path61_2.png"> <div class="nearby_shop_list">
</span> <ul *ngIf="shopperService.shoppers && shopperService.shoppers.length > 0">
<div class="clear"></div> <li
</h5> *ngFor="let shopper of shopperService.shoppers"
<p>{{shopper.caption}}</p> (click)="goToPage('productlist', shopper)"
</div> >
<div class="clear"></div> <div class="nearby_image">
</li> <img
</ul> [src]="shopper.profilePic"
</div> 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
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>
</div>
</ion-content> </ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul>
<li>sample</li>
</ul>
</div>
\ No newline at end of file
.home_wrapper { .home_wrapper {
width: 100%;
.home_banner {
width: 100%; width: 100%;
.home_banner { height: 300px;
padding-top: 80px;
position: relative;
background-color: #fff;
.home_banner_title {
padding: 10px;
position: absolute;
top: 0px;
left: 0px;
right: 0px;
img {
width: 100px;
}
p {
margin: 0px;
text-align: right;
background-image: url('../../assets/Path 55_2.png');
background-position: left;
background-repeat: no-repeat;
background-size: 12px;
padding-left: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
ion-slides {
width: 100%;
height: 100%;
ion-slide {
width: 100%; width: 100%;
height: 300px; height: 100%;
padding-top: 80px;
position: relative; position: relative;
background-color: #fff; img {
.home_banner_title { width: 100%;
padding: 10px; height: 100%;
position: absolute; object-fit: cover;
top: 0px;
left: 0px;
right: 0px;
img {
width: 100px;
}
p {
margin: 0px;
text-align: right;
background-image: url("../../assets/Path 55_2.png");
background-position: left;
background-repeat: no-repeat;
background-size: 12px;
padding-left: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
} }
ion-slides { .banner_slide {
width: 100%; position: absolute;
height: 100%; top: 0px;
ion-slide { left: 0px;
width: 100%; right: 0px;
height: 100%; bottom: 0px;
position: relative; -webkit-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
img { -moz-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
width: 100%; box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
height: 100%; padding-top: 160px;
object-fit: cover; padding-left: 20px;
} padding-right: 20px;
.banner_slide { h5 {
position: absolute; color: #fff;
top: 0px; margin: 0px;
left: 0px; padding: 0px;
right: 0px; text-align: left;
bottom: 0px; font-weight: bold;
-webkit-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75); letter-spacing: 2px;
-moz-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75); padding-bottom: 5px;
box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75); font-size: 14px;
padding-top: 160px; overflow: hidden;
padding-left: 20px; white-space: nowrap;
padding-right: 20px; text-overflow: ellipsis;
h5 { }
color: #fff; p {
margin: 0px; color: #fff;
padding: 0px; margin: 0px;
text-align: left; padding: 0px;
font-weight: bold; text-align: left;
letter-spacing: 2px; font-size: 20px;
padding-bottom: 5px; font-weight: lighter;
font-size: 14px; overflow: hidden;
overflow: hidden; white-space: nowrap;
white-space: nowrap; text-overflow: ellipsis;
text-overflow: ellipsis; }
}
p {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-size: 20px;
font-weight: lighter;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
} }
}
} }
.home_sub_header { }
padding: 10px; .home_sub_header {
padding-top: 20px; padding: 10px;
padding-bottom: 20px; padding-top: 20px;
color: rgba(59, 57, 77, 1); padding-bottom: 20px;
font-weight: 900; color: rgba(59, 57, 77, 1);
font-weight: 900;
}
.featured_slider {
padding-left: 10px;
padding-right: 10px;
.feature_product {
width: 100%;
height: 130px;
position: relative;
background-color: #a8a8a8;
border: 2px solid #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.feature_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.75);
padding: 15px;
padding-top: 60px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 2px;
font-size: 14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
p {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-size: 20px;
font-weight: lighter;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
} }
.featured_slider { }
padding-left: 10px; .nearby_shop_list {
padding-right: 10px; ul {
.feature_product { margin: 0px;
padding-left: 10px;
padding-right: 10px;
li {
list-style: none;
padding-bottom: 10px;
.nearby_image {
width: 120px;
height: 125px;
float: left;
background-color: #a8a8a8;
border-radius: 8px;
img {
width: 100%; width: 100%;
height: 130px; height: 100%;
position: relative; object-fit: cover;
background-color: #a8a8a8; object-position: center;
border: 2px solid #fff; }
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.feature_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.75);
padding: 15px;
padding-top: 60px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 2px;
font-size: 14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
p {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-size: 20px;
font-weight: lighter;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
} }
} .nearby_detail {
.nearby_shop_list { width: calc(100% - 120px);
ul { float: left;
padding-left: 20px;
padding-top: 40px;
h5 {
margin: 0px; margin: 0px;
padding-left: 10px; padding: 0px;
padding-right: 10px; color: rgba(59, 57, 77, 1);
li { font-weight: 900;
list-style: none; padding-bottom: 2px;
padding-bottom: 10px; overflow: hidden;
.nearby_image { white-space: nowrap;
width: 120px; text-overflow: ellipsis;
height: 125px; img {
float: left; width: 16px;
background-color: #a8a8a8;
border-radius: 8px;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
}
.nearby_detail {
width: calc(100% - 120px);
float: left;
padding-left: 20px;
padding-top: 40px;
h5 {
margin: 0px;
padding: 0px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
padding-bottom: 2px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
img {
width: 16px;
}
}
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
} }
} }
} p {
.featured_catagory_list {
padding: 10px;
ul {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
li { color: rgba(176, 174, 199);
list-style: none; overflow: hidden;
position: relative; white-space: nowrap;
height: 120px; text-overflow: ellipsis;
width: 100%; }
border-radius: 8px;
margin-bottom: 10px;
&:nth-child(odd) {
text-align: left;
}
&:nth-child(even) {
text-align: right;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.featured_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
border-radius: 8px;
background-color: rgba(0, 0, 0, 0.75);
color: #fff;
padding: 45px;
padding-left: 20px;
padding-right: 20px;
h4 {
margin: 0px;
font-size: 26px;
font-weight: 900;
}
}
}
} }
}
} }
} }
.featured_catagory_list {
.sort_wrappper { padding: 10px;
height: 100vh; ul {
width: 100%; margin: 0px;
position: fixed; padding: 0px;
top: 0px; li {
left: 0px; list-style: none;
right: 0px;
bottom: 0px;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
.sort_inner {
margin: 0 auto;
width: 90%;
padding: 10px;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
background-color: #fff;
position: relative; position: relative;
-webkit-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3); height: 120px;
-moz-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3); width: 100%;
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3); border-radius: 8px;
top: 25%; margin-bottom: 10px;
border-radius: 0px; &:nth-child(odd) {
h4 { text-align: left;
text-align: center;
color: rgba(59, 57, 77, 1);
margin: 0px;
font-weight: bold;
padding: 10px;
font-size: 18px;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-bottom: 20px;
margin-bottom: 30px;
} }
.search_box { &:nth-child(even) {
width: calc(100% - 100px); text-align: right;
height: 45px;
border: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
} }
.search_btn { img {
width: 100px; width: 100%;
height: 45px; height: 100%;
background-color: rgba(41, 40, 91, 1); object-fit: cover;
border: none; object-position: center;
color: #fff;
font-size: 16px;
} }
ul { .featured_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
border-radius: 8px;
background-color: rgba(0, 0, 0, 0.75);
color: #fff;
padding: 45px;
padding-left: 20px;
padding-right: 20px;
h4 {
margin: 0px; margin: 0px;
padding: 0px; font-size: 26px;
li { font-weight: 900;
list-style: none; }
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-top: 10px;
padding-bottom: 10px;
.styled-checkbox {
position: absolute; // take it out of document flow
opacity: 0; // hide it
&+label {
position: relative;
cursor: pointer;
padding: 0;
width: 100%;
}
// Box.
&+label:before {
content: '';
margin-right: 10px;
display: inline-block;
vertical-align: text-top;
width: 20px;
height: 20px;
border-radius: 5px;
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
&:checked+label:before {
background: #29285b;
}
// Disabled state label.
&:disabled+label {
color: #b8b8b8;
cursor: auto;
}
// Disabled box.
&:disabled+label:before {
box-shadow: none;
background: #ddd;
}
// Checkmark. Could be replaced with an image
&:checked+label:after {
content: '';
position: absolute;
left: 6px;
top: 10px;
background: white;
width: 2px;
height: 2px;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
transform: rotate(45deg);
}
}
}
} }
.sort_footer { }
padding-top: 10px; }
button { }
border-radius: 8px; }
height: 40px;
width: 48%; .sort_wrappper {
color: #fff; height: 100vh;
font-size: 15px; width: 100%;
font-weight: lighter; position: fixed;
} top: 0px;
.submit { left: 0px;
background-color: rgba(41, 40, 91, 1); right: 0px;
} bottom: 0px;
.cancel { background: rgba(0, 0, 0, 0.6);
background-color: rgba(215, 213, 228, 1); z-index: 99;
} .sort_inner {
margin: 0 auto;
width: 90%;
padding: 10px;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
background-color: #fff;
position: relative;
-webkit-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
top: 25%;
border-radius: 0px;
h4 {
text-align: center;
color: rgba(59, 57, 77, 1);
margin: 0px;
font-weight: bold;
padding: 10px;
font-size: 18px;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-bottom: 20px;
margin-bottom: 30px;
}
.search_box {
width: calc(100% - 100px);
height: 45px;
border: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
}
.search_btn {
width: 100px;
height: 45px;
background-color: rgba(41, 40, 91, 1);
border: none;
color: #fff;
font-size: 16px;
}
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-top: 10px;
padding-bottom: 10px;
.styled-checkbox {
position: absolute; // take it out of document flow
opacity: 0; // hide it
& + label {
position: relative;
cursor: pointer;
padding: 0;
width: 100%;
}
// Box.
& + label:before {
content: '';
margin-right: 10px;
display: inline-block;
vertical-align: text-top;
width: 20px;
height: 20px;
border-radius: 5px;
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
&:checked + label:before {
background: #29285b;
}
// Disabled state label.
&:disabled + label {
color: #b8b8b8;
cursor: auto;
}
// Disabled box.
&:disabled + label:before {
box-shadow: none;
background: #ddd;
}
// Checkmark. Could be replaced with an image
&:checked + label:after {
content: '';
position: absolute;
left: 6px;
top: 10px;
background: white;
width: 2px;
height: 2px;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white,
4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
transform: rotate(45deg);
}
} }
}
}
.sort_footer {
padding-top: 10px;
button {
border-radius: 8px;
height: 40px;
width: 48%;
color: #fff;
font-size: 15px;
font-weight: lighter;
}
.submit {
background-color: rgba(41, 40, 91, 1);
}
.cancel {
background-color: rgba(215, 213, 228, 1);
}
} }
} }
\ No newline at end of file }
.no-result-wrapper {
text-align: center;
img {
width: 100px;
}
h1 {
font-size: 18px;
font-weight: bolder;
text-transform: uppercase;
color: #3b394d;
}
button {
background-color: #29285b;
border-radius: 8px;
height: 50px;
width: 48%;
color: #fff;
font-size: 18px;
font-weight: lighter;
text-transform: uppercase;
margin-top: 10px;
}
}
...@@ -59,10 +59,21 @@ ...@@ -59,10 +59,21 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<button (click)="onFeedbackSubmit(feedbackForm)" class="login_btn"> <button
(click)="onFeedbackSubmit(feedbackForm)"
class="login_btn"
[disabled]="submitted"
>
SENT SENT
</button> </button>
</div> </div>
</div> </div>
</form> </form>
</ion-content> </ion-content>
<div class="loader" *ngIf="feedService.loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
...@@ -4,7 +4,7 @@ import { SubjectService } from '../../config/subject.service'; ...@@ -4,7 +4,7 @@ import { SubjectService } from '../../config/subject.service';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { FeedbackData } from '../../config/services/feedback'; import { FeedbackData } from '../../config/services/feedback';
import { FeedbackService } from '../../config/feedback.service'; import { FeedbackService } from '../../config/feedback.service';
import { ToastController } from '@ionic/angular'; import { ServiceService } from '../../config/service.service';
@Component({ @Component({
selector: 'app-feedback', selector: 'app-feedback',
templateUrl: './feedback.page.html', templateUrl: './feedback.page.html',
...@@ -24,7 +24,7 @@ export class FeedbackPage implements OnInit { ...@@ -24,7 +24,7 @@ export class FeedbackPage implements OnInit {
private location: Location, private location: Location,
public subjectService: SubjectService, public subjectService: SubjectService,
public feedService: FeedbackService, public feedService: FeedbackService,
public toastController: ToastController public service: ServiceService
) { ) {
// Gets userdata // Gets userdata
this.subjectService.getUserData().subscribe(userData => { this.subjectService.getUserData().subscribe(userData => {
...@@ -39,8 +39,12 @@ export class FeedbackPage implements OnInit { ...@@ -39,8 +39,12 @@ export class FeedbackPage implements OnInit {
onFeedbackSubmit(form: NgForm) { onFeedbackSubmit(form: NgForm) {
this.submitted = true; this.submitted = true;
if (form.valid) { console.log(form.value);
if (form.valid && form.value.message !== '') {
this.feedService.feedbackCreate(form.value); this.feedService.feedbackCreate(form.value);
} else {
this.submitted = false;
this.service.showToast('Invalid request!', 'top', 'my-error', 1000);
} }
} }
......
...@@ -205,14 +205,3 @@ ...@@ -205,14 +205,3 @@
</div> </div>
</ion-content> </ion-content>
</div> </div>
<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>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<!-- <button (click)="goToPage('addaddresss')">Address</button> --> <!-- <button (click)="goToPage('addaddresss')">Address</button> -->
</div> </div>
</div> </div>
<div class="loader" *ngIf="loader"> <div class="loader" *ngIf="authService.loader">
<div class="lds-ripple"> <div class="lds-ripple">
<div></div> <div></div>
<div></div> <div></div>
......
...@@ -112,6 +112,17 @@ ...@@ -112,6 +112,17 @@
<li> <li>
<input <input
class="styled-checkbox" class="styled-checkbox"
id="styled-checkbox-5"
type="radio"
value="a-z"
name="sort"
(click)="setValue($event.target.value)"
/>
<label for="styled-checkbox-5">Name A - Z</label>
</li>
<li>
<input
class="styled-checkbox"
id="styled-checkbox-3" id="styled-checkbox-3"
type="radio" type="radio"
value="low" value="low"
...@@ -131,6 +142,7 @@ ...@@ -131,6 +142,7 @@
/> />
<label for="styled-checkbox-4">Price High - Low</label> <label for="styled-checkbox-4">Price High - Low</label>
</li> </li>
<!-- <li> <!-- <li>
<input class="styled-checkbox" id="styled-checkbox-5" type="radio" value="rate" name="sort" (click)="setValue($event.target.value)"> <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> <label for="styled-checkbox-5">Rating</label>
...@@ -152,13 +164,3 @@ ...@@ -152,13 +164,3 @@
</div> </div>
</div> </div>
</ion-content> </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>
...@@ -32,6 +32,7 @@ export class ProductlistPage implements OnInit { ...@@ -32,6 +32,7 @@ export class ProductlistPage implements OnInit {
searchShow = false; searchShow = false;
sortValue: string; sortValue: string;
loader: boolean; loader: boolean;
shopperId: any;
constructor( constructor(
private router: Router, private router: Router,
...@@ -46,6 +47,7 @@ export class ProductlistPage implements OnInit { ...@@ -46,6 +47,7 @@ export class ProductlistPage implements OnInit {
this.loader = true; this.loader = true;
this.service.get('params').then(val => { this.service.get('params').then(val => {
this.data = val; this.data = val;
this.shopperId = this.data.uid;
console.log(this.data); console.log(this.data);
this.prodService.prodList(this.data.uid); this.prodService.prodList(this.data.uid);
setTimeout(() => { setTimeout(() => {
...@@ -117,7 +119,7 @@ export class ProductlistPage implements OnInit { ...@@ -117,7 +119,7 @@ export class ProductlistPage implements OnInit {
submit() { submit() {
console.log(this.sortValue); console.log(this.sortValue);
this.prodService.filterSearch(this.sortValue); this.prodService.filterSearch(this.sortValue, this.shopperId);
} }
checkFavStatus(index) { checkFavStatus(index) {
......
...@@ -28,9 +28,11 @@ ...@@ -28,9 +28,11 @@
<ion-slides <ion-slides
pager="false" pager="false"
[options]="slideOpts" [options]="slideOpts"
*ngIf="shopperService.activeshoppers && shopperService.activeshoppers.length > 0" *ngIf="shopperService.activeshoppers && filterFunction(shopperService.activeshoppers).length > 0"
> >
<ion-slide *ngFor="let shopper of shopperService.activeshoppers"> <ion-slide
*ngFor="let shopper of filterFunction(shopperService.activeshoppers)"
>
<div <div
class="feature_product" class="feature_product"
(click)="goToPage('productlist', shopper)" (click)="goToPage('productlist', shopper)"
...@@ -85,9 +87,3 @@ ...@@ -85,9 +87,3 @@
</div> </div>
</div> </div>
</ion-content> </ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul>
<li>sample</li>
</ul>
</div>
...@@ -31,6 +31,7 @@ export class StorelistPage implements OnInit { ...@@ -31,6 +31,7 @@ export class StorelistPage implements OnInit {
}; };
data: any; data: any;
loader: boolean; loader: boolean;
centerId: any;
constructor( constructor(
public router: Router, public router: Router,
...@@ -44,6 +45,7 @@ export class StorelistPage implements OnInit { ...@@ -44,6 +45,7 @@ export class StorelistPage implements OnInit {
this.loader = true; this.loader = true;
this.service.get('params').then(val => { this.service.get('params').then(val => {
this.data = val; this.data = val;
this.centerId = this.data.cId;
this.shopperService.shopperList(this.data.cId, 'centerId'); this.shopperService.shopperList(this.data.cId, 'centerId');
setTimeout(() => { setTimeout(() => {
this.loader = false; this.loader = false;
...@@ -82,4 +84,8 @@ export class StorelistPage implements OnInit { ...@@ -82,4 +84,8 @@ export class StorelistPage implements OnInit {
searchClose() { searchClose() {
this.searchShow = false; this.searchShow = false;
} }
filterFunction(featuredStore): any[] {
return featuredStore.filter(store => store.centerId === this.centerId);
}
} }
...@@ -76,7 +76,7 @@ export class AuthService { ...@@ -76,7 +76,7 @@ export class AuthService {
}) })
.catch(error => { .catch(error => {
this.loader = false; this.loader = false;
window.alert(error.message); this.service.showToast(error.message, 'bottom', 'my-error', 1000);
}); });
} }
...@@ -100,7 +100,12 @@ export class AuthService { ...@@ -100,7 +100,12 @@ export class AuthService {
this.router.navigateByUrl('nearby'); this.router.navigateByUrl('nearby');
} else { } else {
this.loader = false; this.loader = false;
window.alert('Please input valid OTP'); this.service.showToast(
'Please input valid OTP',
'bottom',
'my-error',
1000
);
} }
}); });
} }
...@@ -149,7 +154,7 @@ export class AuthService { ...@@ -149,7 +154,7 @@ export class AuthService {
console.log(result); console.log(result);
}) })
.catch(err => { .catch(err => {
alert(err.message); this.service.showToast(err.message, 'bottom', 'my-error', 1000);
}); });
} catch (error) { } catch (error) {
This.loader = false; This.loader = false;
......
...@@ -5,21 +5,24 @@ import { ...@@ -5,21 +5,24 @@ import {
} from '@angular/fire/firestore'; } from '@angular/fire/firestore';
import { take } from 'rxjs/operators'; import { take } from 'rxjs/operators';
import { FeedbackData } from './services/feedback'; import { FeedbackData } from './services/feedback';
import { ToastController } from '@ionic/angular'; import { ServiceService } from './service.service';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class FeedbackService { export class FeedbackService {
loader: boolean;
constructor( constructor(
public afs: AngularFirestore, public afs: AngularFirestore,
public toastController: ToastController, private router: Router,
private router: Router private service: ServiceService
) {} ) {
this.loader = false;
}
feedbackCreate(data: FeedbackData) { feedbackCreate(data: FeedbackData) {
console.log(data); this.loader = true;
this.afs this.afs
.collection('feedback') .collection('feedback')
.add({}) .add({})
...@@ -30,19 +33,21 @@ export class FeedbackService { ...@@ -30,19 +33,21 @@ export class FeedbackService {
.doc(data.feedbackId) .doc(data.feedbackId)
.set(data) .set(data)
.then(() => { .then(() => {
// SHows success toast this.service
this.toastController .showToast(
.create({ 'Thank you for your feedback!',
message: 'Thank you for your Feedback!', 'top',
duration: 2000, 'my-toast',
position: 'top', 2000
cssClass: 'my-toast' )
}) .then(() => {
.then(res => { this.loader = false;
res.present();
setTimeout(() => { setTimeout(() => {
this.router.navigateByUrl('home'); this.router.navigateByUrl('home');
}, 2100); }, 2100);
})
.catch(err => {
this.loader = false;
}); });
}); });
}); });
......
...@@ -61,7 +61,10 @@ export class ProductsService { ...@@ -61,7 +61,10 @@ export class ProductsService {
const prodRef: AngularFirestoreCollection<any> = this.afs.collection( const prodRef: AngularFirestoreCollection<any> = this.afs.collection(
`products`, `products`,
ref => ref =>
ref.where('shopperId', '==', shopperId).where('status', '==', state) ref
.orderBy('category', 'asc')
.where('shopperId', '==', shopperId)
.where('status', '==', state)
); );
prodRef.valueChanges().subscribe(value => { prodRef.valueChanges().subscribe(value => {
this.product = []; this.product = [];
...@@ -101,7 +104,7 @@ export class ProductsService { ...@@ -101,7 +104,7 @@ export class ProductsService {
}); });
} }
public async filterSearch(sortValue: string) { public async filterSearch(sortValue: string, shopperId: string) {
const This = this; const This = this;
const state = true; const state = true;
// console.log(sortValue); // console.log(sortValue);
...@@ -117,15 +120,19 @@ export class ProductsService { ...@@ -117,15 +120,19 @@ export class ProductsService {
order = 'desc'; order = 'desc';
} }
if (sortValue === 'rate') { if (sortValue === 'a-z') {
// field = 'price'; field = 'prodName';
// order = 'desc'; order = 'asc';
} }
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
const prodRef: AngularFirestoreCollection<any> = this.afs.collection( const prodRef: AngularFirestoreCollection<any> = this.afs.collection(
`products`, `products`,
ref => ref.where('status', '==', state).orderBy(field, order) ref =>
ref
.where('status', '==', state)
.where('shopperId', '==', shopperId)
.orderBy(field, order)
); );
prodRef.valueChanges().subscribe(value => { prodRef.valueChanges().subscribe(value => {
this.product = []; this.product = [];
......
...@@ -28,8 +28,8 @@ export class SearchService { ...@@ -28,8 +28,8 @@ export class SearchService {
ref => ref =>
ref ref
.where('status', '==', state) .where('status', '==', state)
.orderBy('name') .orderBy('searchName')
.startAt(inputText.toUpperCase()) .startAt(inputText.toLowerCase())
.endAt(inputText.toLowerCase() + '\uf8ff') .endAt(inputText.toLowerCase() + '\uf8ff')
.limit(5) .limit(5)
); );
...@@ -55,7 +55,7 @@ export class SearchService { ...@@ -55,7 +55,7 @@ export class SearchService {
ref ref
.where('status', '==', state) .where('status', '==', state)
.orderBy('prodName') .orderBy('prodName')
.startAt(inputText.toUpperCase()) .startAt(inputText.toLowerCase())
.endAt(inputText.toLowerCase() + '\uf8ff') .endAt(inputText.toLowerCase() + '\uf8ff')
.limit(5) .limit(5)
); );
...@@ -82,7 +82,7 @@ export class SearchService { ...@@ -82,7 +82,7 @@ export class SearchService {
ref ref
.where('status', '==', state) .where('status', '==', state)
.orderBy('catName') .orderBy('catName')
.startAt(inputText.toUpperCase()) .startAt(inputText.toLowerCase())
.endAt(inputText.toLowerCase() + '\uf8ff') .endAt(inputText.toLowerCase() + '\uf8ff')
.limit(5) .limit(5)
); );
......
import { Injectable } from "@angular/core"; import { Injectable } from '@angular/core';
import { Storage } from "@ionic/storage"; import { Storage } from '@ionic/storage';
import { ToastController } from '@ionic/angular';
@Injectable({ @Injectable({
providedIn: "root" providedIn: 'root'
}) })
export class ServiceService { export class ServiceService {
state: boolean; state: boolean;
constructor(public storage: Storage) { constructor(
public storage: Storage,
public toastController: ToastController
) {
this.state = true; this.state = true;
} }
...@@ -25,7 +29,7 @@ export class ServiceService { ...@@ -25,7 +29,7 @@ export class ServiceService {
public clear() { public clear() {
this.storage.clear().then(() => { this.storage.clear().then(() => {
console.log("all keys cleared"); console.log('all keys cleared');
}); });
} }
...@@ -48,4 +52,25 @@ export class ServiceService { ...@@ -48,4 +52,25 @@ export class ServiceService {
} }
return response; return response;
} }
showToast(msg, positions, className, durations = 2000) {
try {
const promise1 = new Promise((resolve, reject) => {
this.toastController
.create({
message: msg,
duration: durations,
position: positions,
cssClass: className
})
.then(res => {
res.present();
resolve(true);
});
});
return promise1;
} catch (error) {
console.log('error: ' + error);
}
}
} }
export interface Shopper { export interface Shopper {
name: string; name: string;
emailId: string; emailId: string;
phone: string; phone: string;
caption: string; caption: string;
profilePhoto: string; profilePhoto: string;
status: boolean; status: boolean;
uid: string; uid: string;
shopName: string; shopName: string;
address: string; address: string;
featured: boolean; featured: boolean;
shopStatus: boolean; shopStatus: boolean;
centre: object; centre: object;
rate: any; rate: any;
workingHours: string; workingHours: string;
featuredImage: string; featuredImage: string;
centerId: string;
} }
export interface ShopperData { export interface ShopperData {
centre: object; centre: object;
abn: string; abn: string;
category: object; category: object;
name: string; name: string;
address: string; address: string;
emailId: string; emailId: string;
phone: string; phone: string;
caption: string; caption: string;
featured: boolean; featured: boolean;
profilePic: any; profilePic: any;
featuredImage: string; featuredImage: string;
shopStatus: boolean; shopStatus: boolean;
centerId: string; centerId: string;
uid: string; uid: string;
shopName: string; shopName: string;
status: boolean; status: boolean;
rate: any; rate: any;
workingHours: string; workingHours: string;
} }
import { Injectable } from "@angular/core"; import { Injectable } from '@angular/core';
import { AngularFireAuth } from "@angular/fire/auth"; import { AngularFireAuth } from '@angular/fire/auth';
import { import {
AngularFirestore, AngularFirestore,
AngularFirestoreDocument, AngularFirestoreDocument,
AngularFirestoreCollection AngularFirestoreCollection
} from "@angular/fire/firestore"; } from '@angular/fire/firestore';
import { Shopper } from "./services/shopper"; import { Shopper } from './services/shopper';
import * as firebase from "firebase"; import * as firebase from 'firebase';
@Injectable({ @Injectable({
providedIn: "root" providedIn: 'root'
}) })
export class ShoppersService { export class ShoppersService {
shoppers: Shopper[] = []; shoppers: Shopper[] = [];
...@@ -24,8 +24,8 @@ export class ShoppersService { ...@@ -24,8 +24,8 @@ export class ShoppersService {
const This = this; const This = this;
const state = true; const state = true;
const orderRef: AngularFirestoreCollection<any> = this.afs.collection( const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
"shoppers", 'shoppers',
ref => ref.where(type, "==", centerId).where("status", "==", state) ref => ref.where(type, '==', centerId).where('status', '==', state)
); );
orderRef.valueChanges().subscribe(value => { orderRef.valueChanges().subscribe(value => {
this.shoppers = []; this.shoppers = [];
...@@ -48,7 +48,8 @@ export class ShoppersService { ...@@ -48,7 +48,8 @@ export class ShoppersService {
workingHours: item.workingHours, workingHours: item.workingHours,
caption: item.caption, caption: item.caption,
centre: item.centre, centre: item.centre,
rate: item.rate rate: item.rate,
centerId: item.centerId
}; };
this.shoppers.push(shopper); this.shoppers.push(shopper);
}); });
...@@ -63,8 +64,8 @@ export class ShoppersService { ...@@ -63,8 +64,8 @@ export class ShoppersService {
const This = this; const This = this;
const state = true; const state = true;
const orderRef: AngularFirestoreCollection<any> = this.afs.collection( const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
"shoppers", 'shoppers',
ref => ref.where("featured", "==", state).where("status", "==", state) ref => ref.where('featured', '==', state).where('status', '==', state)
); );
orderRef.valueChanges().subscribe(value => { orderRef.valueChanges().subscribe(value => {
this.activeshoppers = []; this.activeshoppers = [];
...@@ -87,7 +88,8 @@ export class ShoppersService { ...@@ -87,7 +88,8 @@ export class ShoppersService {
workingHours: item.workingHours, workingHours: item.workingHours,
caption: item.caption, caption: item.caption,
centre: item.centre, centre: item.centre,
rate: item.rate rate: item.rate,
centerId: item.centerId
}; };
this.activeshoppers.push(shopper); this.activeshoppers.push(shopper);
}); });
...@@ -117,12 +119,12 @@ export class ShoppersService { ...@@ -117,12 +119,12 @@ export class ShoppersService {
greaterLon greaterLon
); );
const orderRef: AngularFirestoreCollection<any> = this.afs.collection( const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
"shoppers", 'shoppers',
ref => ref =>
ref ref
.where("centre.latLng", ">", lesserGeopoint) .where('centre.latLng', '>', lesserGeopoint)
.where("centre.latLng", "<", greaterGeopoint) .where('centre.latLng', '<', greaterGeopoint)
.where("status", "==", state) .where('status', '==', state)
); );
orderRef.valueChanges().subscribe(value => { orderRef.valueChanges().subscribe(value => {
this.nearshoppers = []; this.nearshoppers = [];
...@@ -145,7 +147,8 @@ export class ShoppersService { ...@@ -145,7 +147,8 @@ export class ShoppersService {
workingHours: item.workingHours, workingHours: item.workingHours,
caption: item.caption, caption: item.caption,
centre: item.centre, centre: item.centre,
rate: item.rate rate: item.rate,
centerId: item.centerId
}; };
this.nearshoppers.push(shopper); this.nearshoppers.push(shopper);
}); });
......
...@@ -417,7 +417,7 @@ app-deliverypop { ...@@ -417,7 +417,7 @@ app-deliverypop {
} }
app-success { app-success {
padding: 0px !important; padding: 0px !important;
} }
.nav_header { .nav_header {
...@@ -665,3 +665,9 @@ ion-header { ...@@ -665,3 +665,9 @@ ion-header {
--border-radius: 4px; --border-radius: 4px;
--color: #fff; --color: #fff;
} }
.my-error {
--background: rgb(212, 43, 38);
--border-radius: 4px;
--color: #fff;
}
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