Commit 7b96db67 by Arjun

fix

parents 529f7e3f 003e409a
......@@ -22,14 +22,16 @@
<ion-grid *ngFor="let address of addressService.addressList; let i = index">
<ion-row>
<ion-col size="1">
<input type="radio" id="address_{{i}}" class="address-radio" name="address" (change)="setDefault(address.addressId)" [checked]="address.defaultVal == 1" />
<input type="radio" id="address_{{i}}" class="address-radio" name="address"
(change)="setDefault(address.addressId)" [checked]="address.defaultVal == 1" />
</ion-col>
<ion-col size="9">
<h1>{{address.addressType}}</h1>
<h1>{{address.address}}</h1>
<!-- <h1>{{address.address}}</h1> -->
<p>{{address.building}}, {{address.landmark}}</p>
</ion-col>
<ion-col size="2" [hidden]="address.defaultVal == 1"><button class="show-btn" (click)="addressService.deleteAddress(address.addressId)">
<ion-col size="2" [hidden]="address.defaultVal == 1"><button class="show-btn"
(click)="addressService.deleteAddress(address.addressId)">
<img src="../../assets/delete.png" /></button></ion-col>
</ion-row>
</ion-grid>
......
......@@ -59,6 +59,10 @@ const routes: Routes = [
loadChildren: './productlist/productlist.module#ProductlistPageModule'
},
{
path: 'keywordlist',
loadChildren: './keywordlist/keywordlist.module#KeywordlistPageModule'
},
{
path: 'productdetail',
loadChildren: './productdetail/productdetail.module#ProductdetailPageModule'
},
......
......@@ -23,10 +23,10 @@ const routes: Routes = [
IonicModule,
AgmDirectionModule,
AgmCoreModule.forRoot({
apiKey: 'AIzaSyBn6hOlr6YHcZAmbptlsmbhvH5iQllWflE'
apiKey: 'AIzaSyBnCzDk6ec1OJFcW5FYgxP3LWVHMNumGDM'
}),
RouterModule.forChild(routes)
],
declarations: [CartPage]
})
export class CartPageModule {}
export class CartPageModule { }
......@@ -68,7 +68,8 @@
<p class="textLeft">Total Price:</p>
</ion-col>
<ion-col>
<p class="textRight">A$ {{service.formatNumber(cartService.cartTotal.toFixed(2))}}
<p class="textRight">A$
{{service.formatNumber(cartService.cartTotal.toFixed(2))}}
</p>
</ion-col>
</ion-row>
......@@ -113,7 +114,8 @@
<ion-row>
<ion-col class="p0">
<h6>
{{addressService.custAddress.building}},<br /> {{addressService.custAddress.landmark}},
{{addressService.custAddress.building}},<span
*ngIf="addressService.custAddress.landmark && addressService.custAddress.landmark!==''">{{addressService.custAddress.landmark}},</span>
<br /> {{addressService.custAddress.address}}
</h6>
</ion-col>
......@@ -125,15 +127,16 @@
<!-- <span class="floatRight">CHANGE</span> -->
<div class="clear"></div>
</h5>
<!-- <div class="payment_method">
<div class="payment_method">
<input type="radio" name="payments" id="cod" name="radio-group" checked="true"
(click)="getwaycod()" />
<label for="cod">
<p>COD</p>
<p>Credit Card</p>
</label>
</div> -->
</div>
<div class="payment_method">
<input type="radio" name="payments" id="paypal" name="radio-group" (click)="getwaypaypal()" checked="true" />
<input type="radio" name="payments" id="paypal" name="radio-group"
(click)="getwaypaypal()" />
<label for="paypal">
<p>PayPal</p>
</label>
......@@ -142,7 +145,8 @@
<input class="card_no borderNone widthFull" placeholder="PayPal ID" />
</div> -->
<div class="payment_method">
<input type="radio" name="payments" id="afterpay" name="radio-group" (click)="getwayafterpay()" />
<input type="radio" name="payments" id="afterpay" name="radio-group"
(click)="getwayafterpay()" />
<label for="afterpay">
<p>AfterPay</p>
</label>
......@@ -152,7 +156,8 @@
<input class="cv_number" placeholder="CVV" />
</div> -->
<div class="payment_method">
<input type="radio" name="payments" id="payk" name="radio-group" (click)="getwaypayk()" />
<input type="radio" name="payments" id="payk" name="radio-group"
(click)="getwaypayk()" />
<label for="payk">
<p>PayK</p>
</label>
......@@ -178,7 +183,8 @@
<hr />
<div class="coupon_code">
<div class="promo-row">
<input class="" placeholder="COUPON CODE: GET50" #promo /><button class="add_btn apply_btn" (click)="promoApply(promo.value)">
<input class="" placeholder="COUPON CODE: GET50" #promo /><button
class="add_btn apply_btn" (click)="promoApply(promo.value)">
APPLY
</button>
</div>
......@@ -252,7 +258,8 @@
</div>
<div class="checkout" (click)="next(1)">CHECKOUT</div>
</div>
<div class="footer_btn" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 1" (click)="next(2);">
<div class="footer_btn" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 1"
(click)="next(2);">
PAY
</div>
......@@ -283,7 +290,8 @@
</ion-grid>
</div>
<ion-content class="sort_wrappper">
<agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false" [backgroundColor]="'rgba(29, 27, 130,0.2)'">
<agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false"
[backgroundColor]="'rgba(29, 27, 130,0.2)'">
<agm-marker [latitude]="lat" [longitude]="lng" [iconUrl]="
{
url: './assets/pin-2.svg',
......@@ -299,23 +307,28 @@
<div class="clear"></div>
</h5>
<ul *ngIf="addressService.addressList && addressService.addressList.length > 0">
<li *ngFor="let address of addressService.addressList; let i = index" [ngClass]="{'no-devlivery': !address.nearest}">
<li *ngFor="let address of addressService.addressList; let i = index"
[ngClass]="{'no-devlivery': !address.nearest}">
<h4 *ngIf="address.nearest === true">DELIVERS TO</h4>
<h4 *ngIf="address.nearest === false">DOES NOT DELIVER TO</h4>
<div class="floatLeft">
{{address.default}}
<input class="styled-checkbox" name="addressId" id="styled-checkbox-{{i}}" type="radio" (click)="setDefault(address.addressId, i)" [value]="address.addressId" #addressType [checked]="address.defaultVal == 1" />
<input class="styled-checkbox" name="addressId" id="styled-checkbox-{{i}}" type="radio"
(click)="setDefault(address.addressId, i)" [value]="address.addressId" #addressType />
<label for="styled-checkbox-{{i}}"> {{address.addressType}} </label>
</div>
<div class="floatLeft">
<p>
{{address.building}}, {{address.landmark}}, {{address.address}}
{{address.building}}, <span
*ngIf="address.landmark && address.landmark!==''">{{address.landmark}},</span>
<!-- {{address.address}} -->
</p>
</div>
<div class="clear"></div>
</li>
</ul>
<div class="textCenter" *ngIf="addressService.addressList && addressService.addressList.length === 0">No Address Found</div>
<div class="textCenter" *ngIf="addressService.addressList && addressService.addressList.length === 0">No
Address Found</div>
</div>
<!-- <div class="loader" *ngIf="loader">
......
......@@ -70,7 +70,7 @@ export class CartPage implements OnInit {
this.bookDate = this.formatDate();
this.currentIndex = 0;
this.count = 1;
this.gateway = 1;
this.gateway = 4;
this.deliveryCharge = 0;
this.taxAmount = 0;
this.discountApplied = 0;
......@@ -157,7 +157,7 @@ export class CartPage implements OnInit {
getwaycod() {
this.gateway = 4;
this.paymentMethod = 'COD';
this.paymentMethod = 'Credit Card';
}
async finishpop() {
......
<ion-header>
<div class="nav_header">
<ion-grid class="no-gutter">
<ion-row class="no-gutter">
<ion-col class="no-gutter" size="2">
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group22_2.png">
</button>
</ion-col>
<ion-col class="no-gutter" size="8">
<div class="nav_title floatLeft">
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="goToSearch('searchmodal')">
</div>
</ion-col>
<ion-col class="no-gutter" size="2">
<button class="nav_btn nav_search floatRight">
</button>
</ion-col>
</ion-row>
</ion-grid>
<div class="custom-header">
<div class="menu-sctn">
<ion-menu-toggle>
<button class="nav_btn nav_menu floatLeft"></button>
</ion-menu-toggle>
</div>
<div class="mid-sctn">
<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> -->
<h1 class="search_bar" (click)="goToPage('searchmodal')">Search here.. eg:shirts, retailers etc...
</h1>
</div>
</div>
<div class="search-sctn">
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow"
(click)="goToPage('searchmodal')"></button>
</div>
</div>
</div>
</ion-header>
......@@ -28,8 +29,10 @@
</div>
<div class="featured_catagory_list">
<ul *ngIf="categoriesService.activecategories && categoriesService.activecategories.length > 0">
<li *ngFor="let categories of categoriesService.activecategories" (click)="goToPage('catstorelist', categories)">
<img [src]="categories.catImage" onerror="this.src='../assets/handsome-man-outdoors-drinking-coffee-with-sunglasses-guy-with-beard-instagram-effect_1212-818@3x.png'">
<li *ngFor="let categories of categoriesService.activecategories"
(click)="goToPage('catstorelist', categories)">
<img [src]="categories.catImage"
onerror="this.src='../assets/handsome-man-outdoors-drinking-coffee-with-sunglasses-guy-with-beard-instagram-effect_1212-818@3x.png'">
<div class="featured_overlay">
<h4>{{categories.catName}}</h4>
</div>
......
......@@ -345,3 +345,30 @@
}
}
}
.custom-header {
display: flex;
justify-content: space-between;
.menu-sctn {
width: 15%;
}
.mid-sctn {
width: 70%;
display: flex;
align-items: center;
height: 100%;
margin-top: 2px;
}
.search-sctn {
width: 15%;
}
h1 {
font-size: 16px;
margin: 0 10px;
text-align: left;
overflow: hidden;
white-space: nowrap;
color: #6d6d6d;
}
}
\ No newline at end of file
......@@ -7,7 +7,8 @@
</ion-col>
<ion-col class="no-gutter" size="8">
<div class="nav_title floatLeft">
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" />
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..."
(click)="clickSearch()" />
</div>
</ion-col>
<ion-col class="no-gutter" size="2">
......@@ -24,10 +25,12 @@
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">
<ion-slides pager="false" [options]="slideOpts"
*ngIf="shopperService.shoppers && shopperService.shoppers.length > 0">
<ion-slide *ngFor="let shopper of shopperService.shoppers" [hidden]="!shopper.featured">
<div class="feature_product" (click)="goToPage('productlist', shopper)">
<img [src]="shopper.featuredImage" onerror="this.src='./../../assets/getmi_malls/featured/featured1.png'" />
<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>
......@@ -43,7 +46,8 @@
<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.profilePhoto" onerror="this.src='./../../assets/getmi_malls/store298/stores1.png'" />
<img [src]="shopper.profilePhoto"
onerror="this.src='./../../assets/getmi_malls/store298/stores1.png'" />
</div>
<div class="nearby_detail">
<h5>
......
......@@ -23,7 +23,7 @@ const routes: Routes = [
IonicModule,
AgmDirectionModule,
AgmCoreModule.forRoot({
apiKey: 'AIzaSyBn6hOlr6YHcZAmbptlsmbhvH5iQllWflE',
apiKey: 'AIzaSyBnCzDk6ec1OJFcW5FYgxP3LWVHMNumGDM',
libraries: ['geometry']
}),
RouterModule.forChild(routes)
......
......@@ -31,17 +31,20 @@
class="form-horizontal">
<div class="add_address_wrapper">
<h5>DELIVERY</h5>
<p>{{address}}</p>
<input [(ngModel)]="addressForm.building" name="building" #building="ngModel" name="building" required
<!-- <p>{{address}}</p> -->
<!-- <input [(ngModel)]="addressForm.building" name="building" #building="ngModel" name="building" required
placeholder="House No./ Building No" />
<div class="md-errors-spacer" [hidden]="building.valid || landmark.pristine" class="ion-padding-start">
Building Name is required
</div>
<input [(ngModel)]="addressForm.landmark" name="landmark" #landmark="ngModel" name="landmark" required
</div> -->
<input [(ngModel)]="addressForm.building" name="building" #building="ngModel" name="building"
placeholder="House No./ Building No" [value]="address" (keydown.enter)="$event.preventDefault()"
autocorrect="off" autocapitalize="off" spellcheck="off" type="text" #building />
<!-- <div class=" md-errors-spacer" [hidden]="building.valid || landmark.pristine" class="ion-padding-start">
Building Name is required
</div> -->
<input [(ngModel)]="addressForm.landmark" name="landmark" #landmark="ngModel" name="landmark"
placeholder="Landmark" />
<div class="md-errors-spacer" [hidden]="landmark.valid || landmark.pristine" class="ion-padding-start">
Landmark is required
</div>
<ion-grid>
<ion-row>
<ion-col>
......@@ -74,7 +77,7 @@
Address Type is required
</div>
</ion-grid>
<button class="add_btn" type="submit" [disabled]="!addressForm.form.valid" *ngIf="locationRest()">
<button class="add_btn" type="submit" [disabled]="!addressForm.form.valid">
CHANGE
</button>
</div>
......
......@@ -2,7 +2,7 @@
width: 100%;
height: 100vh;
.map-inner {
height: calc(100% - 348px);
height: calc(100% - 375px);
position: relative;
.map-pin {
position: absolute;
......@@ -11,8 +11,10 @@
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 20px;
height: 40px;
img {
margin-top: -23px;
margin-top: -20px;
display: block;
}
}
}
......@@ -60,6 +62,7 @@
margin: 0px;
padding: 0px;
font-weight: 800;
margin-bottom: 20px;
}
input {
width: 100%;
......@@ -143,7 +146,7 @@
}
}
.map-inner {
height: calc(100% - 235px);
height: calc(100% - 300px);
}
}
}
\ No newline at end of file
......@@ -14,6 +14,7 @@ import { ServiceService } from './../../config/service.service';
import { MyordersService } from './../../config/myorder.service';
import { NgForm } from '@angular/forms';
import * as firebase from 'firebase';
declare var google: any;
@Component({
selector: 'app-changeaddress',
......@@ -38,6 +39,7 @@ export class ChangeaddressPage implements OnInit {
lng: any;
newCenterLat: number;
newCenterLng: number;
@ViewChild('building', { static: false })
public searchElementRef: ElementRef;
constructor(
......@@ -75,6 +77,20 @@ export class ChangeaddressPage implements OnInit {
this.mapsAPILoader.load().then(() => {
this.setCurrentLocation();
this.geoCoder = new google.maps.Geocoder();
const autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.nativeElement, {
types: ['address']
});
autocomplete.addListener('place_changed', () => {
this.ngZone.run(() => {
const place: google.maps.places.PlaceResult = autocomplete.getPlace();
if (place.geometry === undefined || place.geometry === null) {
return;
}
this.latitude = place.geometry.location.lat();
this.longitude = place.geometry.location.lng();
this.zoom = 16;
});
});
});
}
// google maps zoom level
......@@ -93,7 +109,7 @@ export class ChangeaddressPage implements OnInit {
mapReady(map) {
map.addListener('dragend', () => {
console.log(this.newCenterLat, this.newCenterLng);
this.getAddress(this.latitude, this.longitude);
this.getAddress(this.newCenterLat, this.newCenterLng);
});
}
centerChange(e) {
......@@ -159,6 +175,8 @@ export class ChangeaddressPage implements OnInit {
}
onSubmit(data: any) {
console.log();
const buildAddress = this.searchElementRef.nativeElement.value;
this.loader = true;
this.service.get('order').then(val => {
console.log(val);
......@@ -177,12 +195,13 @@ export class ChangeaddressPage implements OnInit {
);
const distanceKM = (distanceNew / 1000).toFixed(2);
if (distanceKM < This.service.distance) {
console.log(buildAddress);
const orderId = val.orderId;
const postData: Address = {
address: This.address,
addressType: data.addressType,
building: data.building,
landmark: data.landmark,
address: '',
building: buildAddress,
landmark: data.landmark !== undefined ? data.landmark : '',
defaultVal: 0,
uid: This.uid,
latLng: new firebase.firestore.GeoPoint(
......
......@@ -34,4 +34,4 @@ const routes: Routes = [
declarations: [HomePage]
})
export class HomePageModule { }
// AIzaSyBn6hOlr6YHcZAmbptlsmbhvH5iQllWflE
\ No newline at end of file
// //AIzaSyBnCzDk6ec1OJFcW5FYgxP3LWVHMNumGDM
\ No newline at end of file
......@@ -135,7 +135,9 @@
</ion-header>
<ion-content class="sort_wrappper">
<div class="location-finder">
<input type="text" placeholder="Search for location">
<input type="text" placeholder="Search for location" (keydown.enter)="$event.preventDefault()" autocorrect="off" autocapitalize="off" spellcheck="off" type="text" #building>
</div>
<agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false" [backgroundColor]="'rgba(29, 27, 130,0.2)'">
<agm-marker [latitude]="lat" [longitude]="lng" [iconUrl]="
......@@ -164,7 +166,8 @@
</div>
<div class="floatLeft">
<p>
{{address.building}}, {{address.landmark}}, {{address.address}}
{{address.building}}, <span *ngIf="address.landmark && address.landmark!==''">{{address.landmark}},</span>
<!-- {{address.address}} -->
</p>
</div>
<div class="clear"></div>
......
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild, ElementRef, NgZone } from '@angular/core';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { MapsAPILoader, MouseEvent } from '@agm/core';
......@@ -35,7 +35,7 @@ import { AuthService } from 'src/config/auth.service';
]
})
export class HomePage implements OnInit {
isShow = false;
isShow = true;
searchShow = false;
public lat = 51.678418;
public lng = 7.809007;
......@@ -47,6 +47,8 @@ export class HomePage implements OnInit {
slideOpts = {
slidesPerView: 1.5
};
@ViewChild('building', { static: false })
public searchElementRef: ElementRef;
constructor(
private router: Router,
......@@ -63,11 +65,12 @@ export class HomePage implements OnInit {
private searchService: SearchService,
private productsService: ProductsService,
private subjectService: SubjectService,
private authService: AuthService
private authService: AuthService,
private ngZone: NgZone,
) {
this.loader = false;
this.address = 'Pick your Location';
this.isShow = false;
const users = this.service.get('user').then(data => {
if (data) {
data = JSON.parse(data);
......@@ -97,6 +100,35 @@ export class HomePage implements OnInit {
this.menuCtrl.enable(true);
}
resetMap() {
console.log('called');
const This = this;
setTimeout(() => {
This.mapsAPILoader.load().then(() => {
This.setCurrentLocation();
This.geoCoder = new google.maps.Geocoder();
const autocomplete = new google.maps.places.Autocomplete(This.searchElementRef.nativeElement, {
types: ['address']
});
autocomplete.addListener('place_changed', () => {
This.ngZone.run(() => {
const place: google.maps.places.PlaceResult = autocomplete.getPlace();
if (place.geometry === undefined || place.geometry === null) {
return;
}
This.lat = place.geometry.location.lat();
This.lng = place.geometry.location.lng();
This.getAddress(This.lat, This.lng);
console.log(This.lat, This.lng, This.service.distance);
This.centerService.getNearBy(This.lat, This.lng, This.service.distance);
This.istoggle();
});
});
});
}, 1000);
}
private setCurrentLocation() {
const This = this;
if ('geolocation' in navigator) {
......@@ -137,6 +169,8 @@ export class HomePage implements OnInit {
.setDefaultAddress(address.addressId, this.custId)
.then(() => {
this.address = address.address;
this.lat = address.latLng.latitude;
this.lng = address.latLng.longitude;
console.log(address.latLng);
this.centerService.getNearBy(
address.latLng.latitude,
......@@ -190,6 +224,9 @@ export class HomePage implements OnInit {
istoggle() {
this.isShow = !this.isShow;
if (this.isShow) {
this.resetMap();
}
console.log(this.isShow, 'Is SHow');
this.subjectService.setTabData(!this.isShow);
}
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { KeywordlistPage } from './keywordlist.page';
const routes: Routes = [
{
path: '',
component: KeywordlistPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [KeywordlistPage]
})
export class KeywordlistPageModule { }
<ion-header>
<div class="nav_header">
<ion-grid class="no-gutter">
<ion-row class="no-gutter">
<ion-col class="no-gutter" size="2">
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png" />
</button>
</ion-col>
<ion-col class="no-gutter" size="8">
<div class="nav_title floatLeft">
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="goToPage('searchmodal')" />
</div>
</ion-col>
<ion-col class="no-gutter" size="2">
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow" (click)="goToPage('searchmodal')"></button>
<button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()"></button>
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-header>
<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">
<div class="load-back">
<img [src]="product.image" onerror="this.src='../assets/[email protected]'" (click)="prodDetails(i)" />
</div>
<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)" [innerHTML]="unEscape(product.prodName)"></h5>
<p (click)="prodDetails(i)">
A$ {{service.formatNumber(product.price)}}<span class="offer" *ngIf="product.discount > 0">-{{product.discount}}%</span>
</p>
</li>
</ul>
</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/[email protected]'"
(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="no-result-wrapper" *ngIf="prodService.product.length === 0">
<img src="../../assets/basket.png" />
<h1>No result found</h1>
<button (click)="goToPage('home')">home</button>
</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>
<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-1" type="radio" value="newest" name="sort" (click)="setValue($event.target.value)" />
<label for="styled-checkbox-1">Newest First</label>
</li>
<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" 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>
</div>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
</ion-content>
\ No newline at end of file
.product_list {
padding-bottom: 50px;
.product_title {
padding: 10px;
padding-bottom: 20px;
padding-top: 20px;
font-size: 24px;
font-weight: bold;
color: rgba(41, 40, 91, 1);
}
.product_taskbar {
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
height: 45px;
width: calc(100% - 20px);
margin: 0 auto;
background-image: url('../../assets/Group109_2.png');
background-position: left;
background-repeat: no-repeat;
background-size: 12px;
.filter {
width: 45px;
height: 45px;
cursor: pointer;
}
.viewset {
width: 45px;
height: 45px;
cursor: pointer;
.grid_view {
width: 50%;
height: 100%;
cursor: pointer;
background-position: center;
background-repeat: no-repeat;
background-size: 15px;
background-image: url('../../assets/Group111_2.png');
}
.line_view {
background-image: url('../../assets/Group110_2.png');
cursor: pointer;
}
}
}
.grid_view {
li {
width: 100%;
transition-timing-function: ease-in-out;
transition: 1s;
transform: translateX(0);
.product_image {
height: 390px;
}
}
}
ul {
padding: 10px;
padding-bottom: 0px;
padding-top: 0px;
margin: 0px;
li {
width: calc(100% - 50%);
display: inline-block;
border: 10px solid #fff;
border-top: none;
border-bottom: none;
margin-bottom: 20px;
transition-timing-function: ease-in-out;
transform: translateX(2%);
transition: 1s;
.product_image {
height: 235px;
position: relative;
.featured_badge {
position: absolute;
top: 20px;
left: 0px;
color: #fff;
background-color: rgba(41, 40, 91, 1);
padding: 2px;
padding-left: 10px;
padding-right: 10px;
font-size: 13px;
}
.fav_icon {
position: absolute;
top: 10px;
right: 10px;
font-size: 27px;
width: 30px;
height: 30px;
background-image: url('../../assets/Group32_2.png');
background-position: center;
background-repeat: no-repeat;
background-size: 24px;
}
.fav_fill {
position: absolute;
top: 10px;
right: 10px;
font-size: 27px;
width: 30px;
height: 30px;
background-image: url('../../assets/fav_fill.png');
background-position: center;
background-repeat: no-repeat;
background-size: 24px;
}
img {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
background-color: #fff;
}
}
h5 {
margin: 0px;
padding: 0px;
color: rgba(59, 57, 77, 1);
padding-top: 5px;
padding-bottom: 5px;
}
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199, 1);
span {
text-decoration: line-through;
margin-left: 10px;
color: rgba(215, 213, 228, 1);
}
.offer {
color: #fff;
background-color: rgba(41, 40, 91, 1);
border-radius: 4px;
text-decoration: none;
padding: 3px;
font-size: 13px;
}
}
}
}
.ellipse {
white-space: nowrap;
width: 150px;
overflow: hidden;
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: 280px;
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: 10px;
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;
}
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);
}
}
}
}
.load-back {
height: 100%;
width: 100%;
background-image: url('../../assets/giphy.gif');
background-position: center;
}
.no-result-wrapper {
text-align: center;
padding-top: 40%;
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;
}
}
@media only screen and (max-width: 350px) {
.product_list {
.ellipse {
width: 135px !important;
}
}
}
\ No newline at end of file
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { KeywordlistPage } from './keywordlist.page';
describe('ProductlistPage', () => {
let component: KeywordlistPage;
let fixture: ComponentFixture<KeywordlistPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [KeywordlistPage],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(KeywordlistPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { Router, ActivatedRoute, NavigationExtras } from '@angular/router';
import { ProductsService } from './../../config/products.service';
import { ServiceService } from './../../config/service.service';
import { SearchService } from './../../config/search.service';
import { ModalController } from '@ionic/angular';
import { SearchmodalPage } from '../searchmodal/searchmodal.page';
import { SubjectService } from './../../config/subject.service';
@Component({
selector: 'app-keywordlist',
templateUrl: './keywordlist.page.html',
styleUrls: ['./keywordlist.page.scss'],
animations: [
trigger('slideInOut', [
transition(':enter', [
style({ transform: 'translateY(100%)' }),
animate('200ms ease-in', style({ transform: 'translateY(0%)' }))
]),
transition(':leave', [
animate('200ms ease-out', style({ transform: 'translateY(100%)' }))
])
])
]
})
export class KeywordlistPage implements OnInit {
onGrid = false;
isShow = false;
data: any;
searchShow = false;
sortValue: string;
loader: boolean;
keyword: any;
custId: any;
shopperId: any;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location,
public prodService: ProductsService,
public service: ServiceService,
public searchService: SearchService,
private modalController: ModalController,
private subjectService: SubjectService
) {
this.loader = true;
const users = this.service.get('userData').then(data => {
if (data) {
data = JSON.parse(data);
this.custId = data.uid;
}
});
}
ngOnInit() { }
ionViewWillEnter() {
console.log('logged');
this.service.get('keywordParams').then(val => {
if (val) {
this.data = val;
this.keyword = this.data.text;
console.log(this.data);
this.prodService.prodList(this.data.text, 'keyword');
setTimeout(() => {
this.loader = false;
}, 2000);
} else {
this.goToPage('home');
}
});
const users = this.service.get('user').then(data => {
console.log(data);
if (data) {
data = JSON.parse(data);
this.custId = data.uid;
this.prodService.getFavlist(data.uid);
}
});
}
goToPage(path, data = null) {
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
istoggle() {
this.isShow = !this.isShow;
}
goBack() {
// this.location.back();
window.history.back();
}
unEscape(text: string) {
const regex = '%uFFFD';
return unescape(text.replace(/%uFFFD/g, ''));
}
gridToggle() {
this.onGrid = !this.onGrid;
}
async clickSearch() {
this.subjectService.setTabData(false);
const modal = await this.modalController.create({
component: SearchmodalPage
});
modal.onDidDismiss().then(dataReturned => {
this.subjectService.setTabData(true);
});
return await modal.present();
}
searchClose() {
this.searchShow = false;
}
prodDetails(index: number) {
this.prodService.setProd(this.prodService.product[index]);
this.router.navigateByUrl('productdetail');
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
changeFav(index) {
const state = this.prodService.fav.findIndex(x => x === index);
console.log(state);
console.log(this.prodService.fav);
if (state > -1) {
this.prodService.fav.splice(state, 1);
this.prodService.changeFav(index, 'yes', this.custId);
} else {
this.prodService.fav.push(index);
this.prodService.changeFav(index, 'no', this.custId);
}
return;
console.log(this.prodService.fav);
}
setValue(value) {
this.sortValue = value;
console.log(this.sortValue);
}
submit() {
console.log(this.sortValue);
this.prodService.filterSearch(this.sortValue, this.shopperId);
}
checkFavStatus(index) {
const state = this.prodService.fav.findIndex(x => x === index);
return state > -1 ? 'fav_fill' : 'fav_icon';
}
searchFun(data: string) {
this.searchService.search(data);
}
viewPage(datas: any) {
console.log(datas);
let data;
let url;
if (datas.type === 'shopper') {
data = datas.data;
this.service.set('shopParams', data);
url = 'productlist';
} else if (datas.type === 'category') {
data = datas.data;
this.service.set('catParams', data);
url = 'catstorelist';
} else {
data = datas.data;
data.size = this.service.splitSep(data.size);
data.tag = this.service.splitSep(data.tag);
(data.color = this.service.splitSep(data.color)), (url = 'productdetail');
this.prodService.setProd(data);
}
this.searchClose();
this.router.navigateByUrl(url, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
}
......@@ -20,7 +20,9 @@
<ion-content>
<div class="nearby_map">
<div class="map-inner">
<agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="8" [backgroundColor]="'rgba(29, 27, 130,0.2)'" (mapReady)="mapReady($event)" (centerChange)="centerChange($event)">
<agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="zoom"
[backgroundColor]="'rgba(29, 27, 130,0.2)'" (mapReady)="mapReady($event)"
(centerChange)="centerChange($event)">
<agm-marker [markerDraggable]="true" (dragEnd)="markerDragEnd($event)" [iconUrl]="
{
url: './assets/pin.svg',
......@@ -31,40 +33,47 @@
</agm-map>
<span class="map-pin"><img src="../../assets/pin.svg" alt=""></span>
</div>
<form (ngSubmit)="onSubmit(addressForm.value); addressForm.reset()" #addressForm="ngForm" method="post" class="form-horizontal">
<form (ngSubmit)="onSubmit(addressForm.value); addressForm.reset()" #addressForm="ngForm" method="post"
class="form-horizontal">
<div class="add_address_wrapper">
<h5>DELIVERY</h5>
<p>{{address}}</p>
<input [(ngModel)]="addressForm.building" name="building" #building="ngModel" name="building" required placeholder="House No./ Building No" />
<div class="md-errors-spacer" [hidden]="building.valid || landmark.pristine" class="ion-padding-start">
<input [(ngModel)]="addressForm.building" name="building" #building="ngModel" name="building"
placeholder="House No./ Building No" [value]="address" (keydown.enter)="$event.preventDefault()"
autocorrect="off" autocapitalize="off" spellcheck="off" type="text" #building />
<!-- <div class=" md-errors-spacer" [hidden]="building.valid || landmark.pristine" class="ion-padding-start">
Building Name is required
</div>
<input [(ngModel)]="addressForm.landmark" name="landmark" #landmark="ngModel" name="landmark" required placeholder="Landmark" />
<div class="md-errors-spacer" [hidden]="landmark.valid || landmark.pristine" class="ion-padding-start">
Landmark is required
</div>
</div> -->
<input [(ngModel)]="addressForm.landmark" name="landmark" #landmark="ngModel" name="landmark"
placeholder="Landmark" />
<ion-grid>
<ion-row>
<ion-col>
<h6>
<input class="styled-checkbox" id="styled-check-1" type="radio" value="Home" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required />
<input class="styled-checkbox" id="styled-check-1" type="radio" value="Home"
[(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel"
required />
<label for="styled-check-1"><span>Home</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input class="styled-checkbox" id="styled-check-2" type="radio" value="Work" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required />
<input class="styled-checkbox" id="styled-check-2" type="radio" value="Work"
[(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel"
required />
<label for="styled-check-2"><span>Office</span></label>
</h6>
</ion-col>
<ion-col>
<h6>
<input class="styled-checkbox" id="styled-check-3" type="radio" value="Other" [(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel" required />
<input class="styled-checkbox" id="styled-check-3" type="radio" value="Other"
[(ngModel)]="addressForm.addressType" name="addressType" #addressType="ngModel"
required />
<label for="styled-check-3"><span>Others</span></label>
</h6>
</ion-col>
</ion-row>
<div class="md-errors-spacer" [hidden]="addressType.valid || addressType.pristine" class="ion-padding-start">
<div class="md-errors-spacer" [hidden]="addressType.valid || addressType.pristine"
class="ion-padding-start">
Address Type is required
</div>
</ion-grid>
......
......@@ -6,7 +6,7 @@
width: 100%;
height: 100%;
.map-inner {
height: calc(100% - 348px);
height: calc(100% - 324px);
position: relative;
.map-pin {
position: absolute;
......@@ -15,8 +15,10 @@
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 20px;
height: 40px;
img {
margin-top: -23px;
margin-top: -20px;
display: block;
}
}
}
......@@ -74,6 +76,7 @@
margin: 0px;
padding: 0px;
font-weight: 800;
margin-bottom: 20px;
}
input {
width: 100%;
......@@ -166,7 +169,7 @@
}
}
.map-inner {
height: calc(100% - 235px);
height: calc(100% - 250px);
}
}
}
\ No newline at end of file
......@@ -33,6 +33,7 @@ export class NearbyPage implements OnInit {
uid: string;
type: any;
loader: boolean;
@ViewChild('building', { static: false })
public searchElementRef: ElementRef;
newCenterLat: number;
......@@ -67,6 +68,20 @@ export class NearbyPage implements OnInit {
this.mapsAPILoader.load().then(() => {
this.setCurrentLocation();
this.geoCoder = new google.maps.Geocoder();
const autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.nativeElement, {
types: ['address']
});
autocomplete.addListener('place_changed', () => {
this.ngZone.run(() => {
const place: google.maps.places.PlaceResult = autocomplete.getPlace();
if (place.geometry === undefined || place.geometry === null) {
return;
}
this.latitude = place.geometry.location.lat();
this.longitude = place.geometry.location.lng();
this.zoom = 16;
});
});
});
}
// google maps zoom level
......@@ -75,14 +90,14 @@ export class NearbyPage implements OnInit {
console.log('map-called');
if ('geolocation' in navigator) {
console.log(navigator);
this.latitude = -33.87276;
this.longitude = 151.20534;
this.zoom = 8;
/* this.latitude = -33.87276;
this.longitude = 151.20534; */
this.zoom = 24;
this.getAddress(this.latitude, this.longitude);
navigator.geolocation.getCurrentPosition(position => {
this.latitude = position.coords.latitude;
this.longitude = position.coords.longitude;
this.zoom = 8;
this.zoom = 24;
this.getAddress(this.latitude, this.longitude);
});
}
......@@ -104,7 +119,7 @@ export class NearbyPage implements OnInit {
console.log(status);
if (status === 'OK') {
if (results[0]) {
this.zoom = 12;
this.zoom = 24;
this.address = results[0].formatted_address;
console.log(this.address);
} else {
......@@ -144,9 +159,9 @@ export class NearbyPage implements OnInit {
console.log(data);
const postData: Address = {
address: this.address,
addressType: data.addressType,
building: data.building,
landmark: data.landmark,
addressType: '',
building: this.searchElementRef.nativeElement.value,
landmark: data.landmark !== undefined ? data.landmark : '',
defaultVal: 0,
uid: this.uid,
latLng: new firebase.firestore.GeoPoint(this.newCenterLat, this.newCenterLng),
......
......@@ -66,38 +66,42 @@
</div>
<div class="nearby_shop_list">
<ul>
<li>
<li *ngFor="let product of data.product; let i = index">
<div class="nearby_image">
<img [src]="data.product[0].image" onerror="this.src='../assets/[email protected]'" />
<img [src]="product.image" onerror="this.src='../assets/[email protected]'" />
</div>
<div class="nearby_detail">
<h5>
<span class="floatLeft">{{data.shopperName}}</span>
<span class="floatRight">{{data.product[0].qty}}
<span class="floatLeft">{{unEscape(product.prodName)}}</span>
<span class="floatRight">0
<img src="../assets/Path61_2.png" />
</span>
<div class="clear"></div>
</h5>
<p class="prodName">{{unEscape(data.product[0].prodName)}}</p>
<p class="prodName"></p>
</div>
<div class="clear"></div>
<div class="product_detail">
<h5 *ngIf="data.orderStatus >= 3 || data.orderStatus < 7 && i == 0">
Delivery time : <span><b>{{deliveryTime}}</b></span>
</h5>
<h6>
<!-- <span *ngIf="product.color !== 'No-Color'">Product: {{unEscape(product.prodName)}},
</span> -->
<span *ngIf="product.color !== 'No-Color'">Color: {{product.color}}, </span>
<span *ngIf="product.size !== 'Any-Size'">Size: {{product.size}}</span>
</h6>
<h5>Quantity : <span>{{product.qty}}</span></h5>
<h5>
Amount : <strong>A$ {{service.formatNumber(product.price)}}</strong>
</h5>
<h5>Order Status : <span>{{getStatus(data.orderStatus)}}</span></h5>
</div>
</li>
</ul>
</div>
<div class="product_detail" *ngFor="let product of data.product">
<h6>
<span *ngIf="product.color !== 'No-Color'">Color: {{product.color}}, </span>
<span *ngIf="product.size !== 'Any-Size'">Size: {{product.size}}</span>
</h6>
<h5>Quantity : <span>{{product.qty}}</span></h5>
<h5>
Amount : <strong>A$ {{service.formatNumber(product.price)}}</strong><span class="afterpay">{{data.paymentMode}}</span>
</h5>
<h5 *ngIf="data.orderStatus >= 3 || data.orderStatus < 7">
Delivery time : <span>{{deliveryTime}}</span>
</h5>
<h5>Order Status : <span>{{getStatus(data.orderStatus)}}</span></h5>
</div>
<div class="product_detail">
......@@ -110,8 +114,10 @@
</div>
<h5 *ngIf="data.deliveryAddress">
{{data.deliveryAddress.addressType}},<br />{{data.deliveryAddress.address}},
<br /> {{data.deliveryAddress.building}}, <br /> {{data.deliveryAddress.landmark}}
{{data.deliveryAddress.addressType}}
<!-- ,<br />{{data.deliveryAddress.address}} -->,
<br /> {{data.deliveryAddress.building}}<span *ngIf="data.deliveryAddress.landmark && data.deliveryAddress.landmark!==''"><br />,
{{data.deliveryAddress.landmark}}</span>
</h5>
<!-- <hr /> -->
</div>
......
......@@ -81,7 +81,8 @@
padding-right: 10px;
li {
list-style: none;
padding-bottom: 10px;
border-bottom: 1px solid #e8e8e8;
margin-bottom: 30px;
.nearby_image {
width: 120px;
height: 120px;
......
......@@ -34,7 +34,7 @@ export class OrderplacedPage implements OnInit {
ionViewWillEnter() {
this.deliveryTime = '00:00:00';
this.service.get('order').then(val => {
console.log(val);
console.log('My Orders value', val);
this.data = val;
const This = this;
console.log(Math.round(Date.now() / 1000) + ' < ' + this.data.bookDate.seconds);
......
......@@ -4,7 +4,8 @@
</div>
<div class="search-sctn">
<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 />
<input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..."
(click)="clickSearch($event.target.value)" (input)="searchFun($event.target.value)" #searchText />
</div>
</div>
<div class="close-sctn">
......
......@@ -43,9 +43,11 @@ export class SearchmodalPage implements OnInit {
this.searchService.search(data);
}
clickSearch() {
clickSearch(text: string) {
this.searchShow = true;
this.searchService.searchList = [];
if (text === '') {
this.searchService.searchList = [];
}
}
viewPage(datas: any) {
......@@ -61,6 +63,10 @@ export class SearchmodalPage implements OnInit {
data = datas.data;
this.service.set('catParams', data);
url = 'catstorelist';
} else if (datas.type === 'keyword') {
data = datas.data;
this.service.set('keywordParams', data);
url = 'keywordlist';
} else {
data = datas.data;
data.size = this.service.splitSep(data.size);
......
......@@ -24,10 +24,10 @@ const routes: Routes = [
IonicModule,
AgmDirectionModule,
AgmCoreModule.forRoot({
apiKey: 'AIzaSyBn6hOlr6YHcZAmbptlsmbhvH5iQllWflE'
apiKey: 'AIzaSyBnCzDk6ec1OJFcW5FYgxP3LWVHMNumGDM'
}),
RouterModule.forChild(routes)
],
declarations: [TrackorderPage]
})
export class TrackorderPageModule {}
export class TrackorderPageModule { }
......@@ -11,12 +11,12 @@
width: 120px;
height: 125px;
float: left;
background-color: #a8a8a8;
background-color: #fff;
border-radius: 8px;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-fit: contain;
object-position: center;
}
}
......
......@@ -76,22 +76,28 @@ export class WishlistPage implements OnInit {
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);
this.router.navigateByUrl('cart', { replaceUrl: true, queryParams: data });
})
.catch(err => {
this.loader = false;
this.service.showToast(
'Something went wrong',
'top',
'my-error',
1000
);
});
console.log(data);
if (data === false) {
this.loader = false;
this.service.showToast('You have items from another Shopping Centre', 'top', 'my-error', 2000);
} else {
this.wishService
.clearWish(this.custId)
.then(datas => {
this.loader = false;
this.service.showToast('Added to cart', 'top', 'my-toast', 2000);
this.router.navigateByUrl('cart', { replaceUrl: true, queryParams: data });
})
.catch(err => {
this.loader = false;
this.service.showToast(
'Something went wrong',
'top',
'my-error',
1000
);
});
}
})
.catch(err => {
this.loader = false;
......
src/assets/model1@3x.png

8.91 KB | W: | H:

src/assets/model1@3x.png

4.64 KB | W: | H:

src/assets/model1@3x.png
src/assets/model1@3x.png
src/assets/model1@3x.png
src/assets/model1@3x.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -21,6 +21,13 @@ export class AddressService {
addressState: number;
constructor(public afs: AngularFirestore, public subject: SubjectService) {
this.addressState = 0;
this.subject.getUserData().subscribe(userData => {
if (userData) {
console.log('address reinitialized');
const userDatas = JSON.parse(userData);
this.addList(userDatas.uid);
}
});
}
public async addList(userId: string) {
......@@ -146,8 +153,11 @@ export class AddressService {
}
public async getNearBy(centerId, userId, distance) {
// latitude, longitude, distance, userId
console.log(centerId, userId, distance);
this.custAddress = undefined;
if (centerId) {
this.afs.collection('centers').doc(centerId).ref.get().then((doc) => {
if (doc.exists) {
......@@ -221,15 +231,23 @@ export class AddressService {
// alert('No Orders Found');
}
if (this.addressList.length > 0 && this.nearestList.length > 0) {
if (this.addressList.length > 0) {
this.addressList.forEach((address) => {
const index = this.nearestList.findIndex(x => x.addressId === address.addressId);
if (index >= 0) {
address.nearest = true;
}
address.nearest = false;
});
if (this.nearestList.length > 0) {
this.addressList.forEach((address) => {
const index = this.nearestList.findIndex(x => x.addressId === address.addressId);
if (index >= 0) {
address.nearest = true;
}
});
}
console.log(this.addressList);
}
console.log(this.addressList);
this.addressList = this.addressList.sort((a: any, b: any) => {
return b.nearest - a.nearest;
......@@ -246,6 +264,7 @@ export class AddressService {
}
setAddress() {
this.custAddress = undefined;
console.log(this.nearestList);
if (this.nearestList.length > 0) {
this.custAddress = this.nearestList.find(
......
......@@ -153,11 +153,11 @@ export class CartsService {
const res = value;
this.cartTotal = 0;
if (res.length > 0) {
if (this.cartCenter === '') {
this.cartCenter = res[0].centerId;
this.addressService.defaultAddress(this.custId);
this.addressService.getNearBy(this.cartCenter, this.custId, this.service.distance);
}
// if (this.cartCenter === '') {
this.cartCenter = res[0].centerId;
// }
this.addressService.defaultAddress(this.custId);
this.addressService.getNearBy(this.cartCenter, this.custId, this.service.distance);
res.forEach(item => {
const cartItem: CartItem = {
cartId: item.cartId,
......
......@@ -56,7 +56,7 @@ export class CenterService {
}
public async getNearBy(latitude, longitude, distance) {
console.log(distance);
console.log(latitude, longitude, distance);
const This = this;
const state = true;
......@@ -103,7 +103,7 @@ export class CenterService {
};
this.nearcenters.push(center);
});
// console.log(this.nearcenters);
console.log(this.nearcenters);
} else {
// alert('No Orders Found');
}
......
......@@ -55,18 +55,30 @@ export class ProductsService {
});
}
public async prodList(shopperId: string) {
public async prodList(shopperId: string, type = null) {
const This = this;
const state = true;
// console.log(shopperId);
const prodRef: AngularFirestoreCollection<any> = this.afs.collection(
`products`,
ref =>
ref
.orderBy('category', 'asc')
.where('shopperId', '==', shopperId)
.where('status', '==', state)
);
let prodRef: AngularFirestoreCollection<any>;
if (type === null) {
prodRef = this.afs.collection(
`products`,
ref =>
ref
.orderBy('category', 'asc')
.where('shopperId', '==', shopperId)
.where('status', '==', state)
);
} else {
prodRef = this.afs.collection(
`products`,
ref =>
ref
.where('keyword', 'array-contains', shopperId)
.where('status', '==', state)
);
}
prodRef.valueChanges().subscribe(value => {
this.product = [];
const res = value;
......
......@@ -76,6 +76,32 @@ export class SearchService {
});
// tslint:disable-next-line:max-line-length
const keywordRef: AngularFirestoreCollection<any> = this.afs.collection(
'keyword',
ref =>
ref
.orderBy('searchName')
.startAt(inputText.toLowerCase())
.endAt(inputText.toLowerCase() + '\uf8ff')
.limit(5)
);
keywordRef.valueChanges().subscribe(values => {
const result = values;
if (result.length > 0) {
result.forEach(item => {
console.log(item);
const prod: Search = {
text: item.text,
data: item,
type: 'keyword'
};
this.searchList.push(prod);
});
console.log(this.searchList);
}
});
// tslint:disable-next-line:max-line-length
const feaRef: AngularFirestoreCollection<any> = this.afs.collection(
'shopcategory',
ref =>
......
......@@ -120,11 +120,13 @@ export class WishService {
}
addToCart(custId, items) {
console.log(items);
const promise = new Promise(resolve => {
items.forEach(item => {
this.cartService.buyNow(item);
this.cartService.buyNow(item).then(res => {
resolve(res);
});
});
resolve(true);
});
return promise;
}
......
......@@ -4,9 +4,9 @@
<head>
<meta charset="utf-8" />
<title>Ionic App</title>
<base href="/" />
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="viewport"
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
......@@ -18,6 +18,8 @@
</head>
<body>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBnCzDk6ec1OJFcW5FYgxP3LWVHMNumGDM&libraries=geometry,places"></script>
<app-root></app-root>
</body>
......
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