Commit d0836db7 by Adarsh K

Merge branch 'adarsh' into 'master'

comments See merge request !53
parents dba0e182 b79b7ad8
......@@ -20,7 +20,7 @@
</ion-menu-toggle>
<div class="sidemenu_list">
<ul>
<ion-menu-toggle>
<ion-menu-toggle (click)="hideTab()">
<li (click)="vieworder('home')">Shop</li>
</ion-menu-toggle>
<!-- <li>About us</li> -->
......
......@@ -89,6 +89,10 @@ export class AppComponent {
});
}
hideTab() {
alert('asdasdas');
}
async finishpop(data: any) {
const modal = await this.modalController.create({
component: DeliverypopPage,
......@@ -109,12 +113,12 @@ export class AppComponent {
'login',
'signup',
'address',
'forgot'
'forgot',
'feedback'
];
const currentUrl = this.router.url.split('/');
const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
// console.log(currentUrl[1], index, this.state);
console.log(this.tabData);
if (index > -1 || this.tabData === false) {
return true;
} else {
......
<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"></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.catName}}
</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.catName}}
</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
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>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul>
<li>sample</li>
</ul>
</div>
\ No newline at end of file
.home_wrapper {
width: 100%;
.home_banner {
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%;
height: 300px;
padding-top: 80px;
height: 100%;
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;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
}
ion-slides {
width: 100%;
height: 100%;
ion-slide {
width: 100%;
height: 100%;
position: relative;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
.banner_slide {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
-webkit-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
-moz-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
padding-top: 160px;
padding-left: 20px;
padding-right: 20px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 5px;
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;
}
}
}
.banner_slide {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
-webkit-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
-moz-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
padding-top: 160px;
padding-left: 20px;
padding-right: 20px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 5px;
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;
}
}
}
}
.home_sub_header {
padding: 10px;
padding-top: 20px;
padding-bottom: 20px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
}
.home_sub_header {
padding: 10px;
padding-top: 20px;
padding-bottom: 20px;
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;
padding-right: 10px;
.feature_product {
}
.nearby_shop_list {
ul {
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%;
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;
}
}
height: 100%;
object-fit: cover;
object-position: center;
}
}
}
.nearby_shop_list {
ul {
.nearby_detail {
width: calc(100% - 120px);
float: left;
padding-left: 20px;
padding-top: 40px;
h5 {
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%;
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;
}
}
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;
}
}
}
.featured_catagory_list {
padding: 10px;
ul {
}
p {
margin: 0px;
padding: 0px;
li {
list-style: none;
position: relative;
height: 120px;
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;
}
}
}
color: rgba(176, 174, 199);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
}
}
.sort_wrappper {
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
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;
}
.featured_catagory_list {
padding: 10px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
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;
height: 120px;
width: 100%;
border-radius: 8px;
margin-bottom: 10px;
&:nth-child(odd) {
text-align: left;
}
.search_box {
width: calc(100% - 100px);
height: 45px;
border: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
&:nth-child(even) {
text-align: right;
}
.search_btn {
width: 100px;
height: 45px;
background-color: rgba(41, 40, 91, 1);
border: none;
color: #fff;
font-size: 16px;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
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;
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);
}
}
}
font-size: 26px;
font-weight: 900;
}
}
.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);
}
}
}
}
}
.sort_wrappper {
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
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;
-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 @@
</div>
</div>
<div class="row">
<button (click)="onFeedbackSubmit(feedbackForm)" class="login_btn">
<button
(click)="onFeedbackSubmit(feedbackForm)"
class="login_btn"
[disabled]="submitted"
>
SENT
</button>
</div>
</div>
</form>
</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';
import { NgForm } from '@angular/forms';
import { FeedbackData } from '../../config/services/feedback';
import { FeedbackService } from '../../config/feedback.service';
import { ToastController } from '@ionic/angular';
import { ServiceService } from '../../config/service.service';
@Component({
selector: 'app-feedback',
templateUrl: './feedback.page.html',
......@@ -24,7 +24,7 @@ export class FeedbackPage implements OnInit {
private location: Location,
public subjectService: SubjectService,
public feedService: FeedbackService,
public toastController: ToastController
public service: ServiceService
) {
// Gets userdata
this.subjectService.getUserData().subscribe(userData => {
......@@ -39,8 +39,12 @@ export class FeedbackPage implements OnInit {
onFeedbackSubmit(form: NgForm) {
this.submitted = true;
if (form.valid) {
console.log(form.value);
if (form.valid && form.value.message !== '') {
this.feedService.feedbackCreate(form.value);
} else {
this.submitted = false;
this.service.showToast('Invalid request!', 'top', 'my-error', 1000);
}
}
......
......@@ -205,14 +205,3 @@
</div>
</ion-content>
</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 @@
<!-- <button (click)="goToPage('addaddresss')">Address</button> -->
</div>
</div>
<div class="loader" *ngIf="loader">
<div class="loader" *ngIf="authService.loader">
<div class="lds-ripple">
<div></div>
<div></div>
......
......@@ -112,6 +112,17 @@
<li>
<input
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"
type="radio"
value="low"
......@@ -131,6 +142,7 @@
/>
<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>
......@@ -152,13 +164,3 @@
</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>
......@@ -32,6 +32,7 @@ export class ProductlistPage implements OnInit {
searchShow = false;
sortValue: string;
loader: boolean;
shopperId: any;
constructor(
private router: Router,
......@@ -46,6 +47,7 @@ export class ProductlistPage implements OnInit {
this.loader = true;
this.service.get('params').then(val => {
this.data = val;
this.shopperId = this.data.uid;
console.log(this.data);
this.prodService.prodList(this.data.uid);
setTimeout(() => {
......@@ -117,7 +119,7 @@ export class ProductlistPage implements OnInit {
submit() {
console.log(this.sortValue);
this.prodService.filterSearch(this.sortValue);
this.prodService.filterSearch(this.sortValue, this.shopperId);
}
checkFavStatus(index) {
......
......@@ -28,9 +28,11 @@
<ion-slides
pager="false"
[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
class="feature_product"
(click)="goToPage('productlist', shopper)"
......@@ -85,9 +87,3 @@
</div>
</div>
</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 {
};
data: any;
loader: boolean;
centerId: any;
constructor(
public router: Router,
......@@ -44,6 +45,7 @@ export class StorelistPage implements OnInit {
this.loader = true;
this.service.get('params').then(val => {
this.data = val;
this.centerId = this.data.cId;
this.shopperService.shopperList(this.data.cId, 'centerId');
setTimeout(() => {
this.loader = false;
......@@ -82,4 +84,8 @@ export class StorelistPage implements OnInit {
searchClose() {
this.searchShow = false;
}
filterFunction(featuredStore): any[] {
return featuredStore.filter(store => store.centerId === this.centerId);
}
}
......@@ -76,7 +76,7 @@ export class AuthService {
})
.catch(error => {
this.loader = false;
window.alert(error.message);
this.service.showToast(error.message, 'bottom', 'my-error', 1000);
});
}
......@@ -100,7 +100,12 @@ export class AuthService {
this.router.navigateByUrl('nearby');
} else {
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 {
console.log(result);
})
.catch(err => {
alert(err.message);
this.service.showToast(err.message, 'bottom', 'my-error', 1000);
});
} catch (error) {
This.loader = false;
......
......@@ -5,21 +5,24 @@ import {
} from '@angular/fire/firestore';
import { take } from 'rxjs/operators';
import { FeedbackData } from './services/feedback';
import { ToastController } from '@ionic/angular';
import { ServiceService } from './service.service';
import { Router, ActivatedRoute } from '@angular/router';
@Injectable({
providedIn: 'root'
})
export class FeedbackService {
loader: boolean;
constructor(
public afs: AngularFirestore,
public toastController: ToastController,
private router: Router
) {}
private router: Router,
private service: ServiceService
) {
this.loader = false;
}
feedbackCreate(data: FeedbackData) {
console.log(data);
this.loader = true;
this.afs
.collection('feedback')
.add({})
......@@ -30,19 +33,21 @@ export class FeedbackService {
.doc(data.feedbackId)
.set(data)
.then(() => {
// SHows success toast
this.toastController
.create({
message: 'Thank you for your Feedback!',
duration: 2000,
position: 'top',
cssClass: 'my-toast'
})
.then(res => {
res.present();
this.service
.showToast(
'Thank you for your feedback!',
'top',
'my-toast',
2000
)
.then(() => {
this.loader = false;
setTimeout(() => {
this.router.navigateByUrl('home');
}, 2100);
})
.catch(err => {
this.loader = false;
});
});
});
......
......@@ -61,7 +61,10 @@ export class ProductsService {
const prodRef: AngularFirestoreCollection<any> = this.afs.collection(
`products`,
ref =>
ref.where('shopperId', '==', shopperId).where('status', '==', state)
ref
.orderBy('category', 'asc')
.where('shopperId', '==', shopperId)
.where('status', '==', state)
);
prodRef.valueChanges().subscribe(value => {
this.product = [];
......@@ -101,7 +104,7 @@ export class ProductsService {
});
}
public async filterSearch(sortValue: string) {
public async filterSearch(sortValue: string, shopperId: string) {
const This = this;
const state = true;
// console.log(sortValue);
......@@ -117,15 +120,19 @@ export class ProductsService {
order = 'desc';
}
if (sortValue === 'rate') {
// field = 'price';
// order = 'desc';
if (sortValue === 'a-z') {
field = 'prodName';
order = 'asc';
}
// tslint:disable-next-line:max-line-length
const prodRef: AngularFirestoreCollection<any> = this.afs.collection(
`products`,
ref => ref.where('status', '==', state).orderBy(field, order)
ref =>
ref
.where('status', '==', state)
.where('shopperId', '==', shopperId)
.orderBy(field, order)
);
prodRef.valueChanges().subscribe(value => {
this.product = [];
......
......@@ -28,8 +28,8 @@ export class SearchService {
ref =>
ref
.where('status', '==', state)
.orderBy('name')
.startAt(inputText.toUpperCase())
.orderBy('searchName')
.startAt(inputText.toLowerCase())
.endAt(inputText.toLowerCase() + '\uf8ff')
.limit(5)
);
......@@ -55,7 +55,7 @@ export class SearchService {
ref
.where('status', '==', state)
.orderBy('prodName')
.startAt(inputText.toUpperCase())
.startAt(inputText.toLowerCase())
.endAt(inputText.toLowerCase() + '\uf8ff')
.limit(5)
);
......@@ -82,7 +82,7 @@ export class SearchService {
ref
.where('status', '==', state)
.orderBy('catName')
.startAt(inputText.toUpperCase())
.startAt(inputText.toLowerCase())
.endAt(inputText.toLowerCase() + '\uf8ff')
.limit(5)
);
......
import { Injectable } from "@angular/core";
import { Storage } from "@ionic/storage";
import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';
import { ToastController } from '@ionic/angular';
@Injectable({
providedIn: "root"
providedIn: 'root'
})
export class ServiceService {
state: boolean;
constructor(public storage: Storage) {
constructor(
public storage: Storage,
public toastController: ToastController
) {
this.state = true;
}
......@@ -25,7 +29,7 @@ export class ServiceService {
public clear() {
this.storage.clear().then(() => {
console.log("all keys cleared");
console.log('all keys cleared');
});
}
......@@ -48,4 +52,25 @@ export class ServiceService {
}
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 {
name: string;
emailId: string;
phone: string;
caption: string;
profilePhoto: string;
status: boolean;
uid: string;
shopName: string;
address: string;
featured: boolean;
shopStatus: boolean;
centre: object;
rate: any;
workingHours: string;
featuredImage: string;
name: string;
emailId: string;
phone: string;
caption: string;
profilePhoto: string;
status: boolean;
uid: string;
shopName: string;
address: string;
featured: boolean;
shopStatus: boolean;
centre: object;
rate: any;
workingHours: string;
featuredImage: string;
centerId: string;
}
export interface ShopperData {
centre: object;
abn: string;
category: object;
name: string;
address: string;
emailId: string;
phone: string;
caption: string;
featured: boolean;
profilePic: any;
featuredImage: string;
shopStatus: boolean;
centerId: string;
uid: string;
shopName: string;
status: boolean;
rate: any;
workingHours: string;
centre: object;
abn: string;
category: object;
name: string;
address: string;
emailId: string;
phone: string;
caption: string;
featured: boolean;
profilePic: any;
featuredImage: string;
shopStatus: boolean;
centerId: string;
uid: string;
shopName: string;
status: boolean;
rate: any;
workingHours: string;
}
import { Injectable } from "@angular/core";
import { AngularFireAuth } from "@angular/fire/auth";
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import {
AngularFirestore,
AngularFirestoreDocument,
AngularFirestoreCollection
} from "@angular/fire/firestore";
import { Shopper } from "./services/shopper";
import * as firebase from "firebase";
} from '@angular/fire/firestore';
import { Shopper } from './services/shopper';
import * as firebase from 'firebase';
@Injectable({
providedIn: "root"
providedIn: 'root'
})
export class ShoppersService {
shoppers: Shopper[] = [];
......@@ -24,8 +24,8 @@ export class ShoppersService {
const This = this;
const state = true;
const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
"shoppers",
ref => ref.where(type, "==", centerId).where("status", "==", state)
'shoppers',
ref => ref.where(type, '==', centerId).where('status', '==', state)
);
orderRef.valueChanges().subscribe(value => {
this.shoppers = [];
......@@ -48,7 +48,8 @@ export class ShoppersService {
workingHours: item.workingHours,
caption: item.caption,
centre: item.centre,
rate: item.rate
rate: item.rate,
centerId: item.centerId
};
this.shoppers.push(shopper);
});
......@@ -63,8 +64,8 @@ export class ShoppersService {
const This = this;
const state = true;
const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
"shoppers",
ref => ref.where("featured", "==", state).where("status", "==", state)
'shoppers',
ref => ref.where('featured', '==', state).where('status', '==', state)
);
orderRef.valueChanges().subscribe(value => {
this.activeshoppers = [];
......@@ -87,7 +88,8 @@ export class ShoppersService {
workingHours: item.workingHours,
caption: item.caption,
centre: item.centre,
rate: item.rate
rate: item.rate,
centerId: item.centerId
};
this.activeshoppers.push(shopper);
});
......@@ -117,12 +119,12 @@ export class ShoppersService {
greaterLon
);
const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
"shoppers",
'shoppers',
ref =>
ref
.where("centre.latLng", ">", lesserGeopoint)
.where("centre.latLng", "<", greaterGeopoint)
.where("status", "==", state)
.where('centre.latLng', '>', lesserGeopoint)
.where('centre.latLng', '<', greaterGeopoint)
.where('status', '==', state)
);
orderRef.valueChanges().subscribe(value => {
this.nearshoppers = [];
......@@ -145,7 +147,8 @@ export class ShoppersService {
workingHours: item.workingHours,
caption: item.caption,
centre: item.centre,
rate: item.rate
rate: item.rate,
centerId: item.centerId
};
this.nearshoppers.push(shopper);
});
......
......@@ -417,7 +417,7 @@ app-deliverypop {
}
app-success {
padding: 0px !important;
padding: 0px !important;
}
.nav_header {
......@@ -665,3 +665,9 @@ ion-header {
--border-radius: 4px;
--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