Commit 2cbe65ee by Adarsh K

Merge branch 'adarsh' into 'master'

Adarsh See merge request !106
parents 5b3e5c67 d1b4b96b
...@@ -71,7 +71,7 @@ export class AddaddresssPage implements OnInit { ...@@ -71,7 +71,7 @@ export class AddaddresssPage implements OnInit {
this.geoAccuracy = pos.coords.accuracy; this.geoAccuracy = pos.coords.accuracy;
this.getGeoencoder(this.geoLatitude, this.geoLongitude); this.getGeoencoder(this.geoLatitude, this.geoLongitude);
}).catch(err => { }).catch(err => {
alert('Error getting location' + JSON.stringify(err)); console.log('Error getting location' + JSON.stringify(err));
}); });
} }
...@@ -84,7 +84,7 @@ export class AddaddresssPage implements OnInit { ...@@ -84,7 +84,7 @@ export class AddaddresssPage implements OnInit {
console.log(this.geoAddress); console.log(this.geoAddress);
}) })
.catch((error: any) => { .catch((error: any) => {
alert('Error getting location' + JSON.stringify(error)); console.log('Error getting location' + JSON.stringify(error));
}); });
} }
...@@ -102,9 +102,9 @@ export class AddaddresssPage implements OnInit { ...@@ -102,9 +102,9 @@ export class AddaddresssPage implements OnInit {
} }
} }
return address.slice(0, -2); return address.slice(0, -2);
} }
onAddrss(form: NgForm) { onAddrss(form: NgForm) {
this.submitted = true; this.submitted = true;
console.log(form.value); console.log(form.value);
if (form.valid) { if (form.valid) {
...@@ -113,6 +113,6 @@ onAddrss(form: NgForm) { ...@@ -113,6 +113,6 @@ onAddrss(form: NgForm) {
} else { } else {
console.log(form.errors); console.log(form.errors);
} }
} }
} }
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
<div class="sub_menu"> <div class="sub_menu">
<ul *ngIf="categoryService.activecategories"> <ul *ngIf="categoryService.activecategories">
<ion-menu-toggle> <ion-menu-toggle>
<li *ngFor="let category of categoryService.activecategories" (click)="goToPage('catstorelist', category)"> <li *ngFor="let category of categoryService.activecategories"
(click)="goToPage('catstorelist', category)">
{{ category.catName }} {{ category.catName }}
</li> </li>
</ion-menu-toggle> </ion-menu-toggle>
...@@ -87,8 +88,8 @@ ...@@ -87,8 +88,8 @@
<img src="../assets/basket.png" alt="Product"> <img src="../assets/basket.png" alt="Product">
</div> </div>
<div class="content"> <div class="content">
<h1>Order Placed Successfully</h1> <h1>{{service.popupSub}}</h1>
<p *ngIf="orderId">Order ID {{orderId}} , New Order has been successfully Placed. </p> <p *ngIf="orderId">Order ID {{orderId}}, {{service.popupMsg}}</p>
</div> </div>
<span (click)="istoggle();"><img src="../assets/close.png" alt="Close"></span> <span (click)="istoggle();"><img src="../assets/close.png" alt="Close"></span>
......
...@@ -86,14 +86,10 @@ ...@@ -86,14 +86,10 @@
<h5> <h5>
<span class="floatLeft">ITEMS</span> <span class="floatLeft">ITEMS</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$ <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{service.formatNumber(cartService.cartTotal.toFixed(2))}}</span {{service.formatNumber(cartService.cartTotal.toFixed(2))}}</span>
>
<div class="clear"></div> <div class="clear"></div>
</h5> </h5>
<ion-grid <ion-grid class="p0" *ngIf="cartService.carts && cartService.carts.length > 0">
class="p0"
*ngIf="cartService.carts && cartService.carts.length > 0"
>
<ion-row *ngFor="let carts of cartService.carts"> <ion-row *ngFor="let carts of cartService.carts">
<ion-col size="6" class="p0"> <ion-col size="6" class="p0">
<h6 class="textLeft">{{unEscape(carts.prodName)}}</h6> <h6 class="textLeft">{{unEscape(carts.prodName)}}</h6>
...@@ -118,10 +114,11 @@ ...@@ -118,10 +114,11 @@
<ion-row> <ion-row>
<ion-col class="p0"> <ion-col class="p0">
<h6> <h6>
{{addressService.custAddress.building}},<span *ngIf="addressService.custAddress.landmark && addressService.custAddress.landmark!==''">{{addressService.custAddress.landmark}},</span {{addressService.custAddress.building}}<span
> *ngIf="addressService.custAddress.landmark && addressService.custAddress.landmark!==''">,
<br /> {{addressService.custAddress.landmark}}</span>
{{addressService.custAddress.address}} <!-- <br />
{{addressService.custAddress.address}} -->
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
...@@ -133,13 +130,15 @@ ...@@ -133,13 +130,15 @@
<div class="clear"></div> <div class="clear"></div>
</h5> </h5>
<div class="payment_method"> <div class="payment_method">
<input type="radio" name="payments" id="cod" name="radio-group" checked="true" (click)="getwaycod()" /> <input type="radio" name="payments" id="cod" name="radio-group" checked="true"
(click)="getwaycod()" />
<label for="cod"> <label for="cod">
<p>Credit Card</p> <p>Credit Card</p>
</label> </label>
</div> </div>
<div class="payment_method"> <div class="payment_method">
<input type="radio" name="payments" id="paypal" name="radio-group" (click)="getwaypaypal()" /> <input type="radio" name="payments" id="paypal" name="radio-group"
(click)="getwaypaypal()" />
<label for="paypal"> <label for="paypal">
<p>PayPal</p> <p>PayPal</p>
</label> </label>
...@@ -148,7 +147,8 @@ ...@@ -148,7 +147,8 @@
<input class="card_no borderNone widthFull" placeholder="PayPal ID" /> <input class="card_no borderNone widthFull" placeholder="PayPal ID" />
</div> --> </div> -->
<div class="payment_method"> <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"> <label for="afterpay">
<p>AfterPay</p> <p>AfterPay</p>
</label> </label>
...@@ -158,7 +158,8 @@ ...@@ -158,7 +158,8 @@
<input class="cv_number" placeholder="CVV" /> <input class="cv_number" placeholder="CVV" />
</div> --> </div> -->
<div class="payment_method"> <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"> <label for="payk">
<p>PayK</p> <p>PayK</p>
</label> </label>
...@@ -184,14 +185,14 @@ ...@@ -184,14 +185,14 @@
<hr /> <hr />
<div class="coupon_code"> <div class="coupon_code">
<div class="promo-row"> <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 APPLY
</button> </button>
</div> </div>
<span *ngIf="discountApplied == 1" class="promo-success">Promocode applied successfully <span *ngIf="discountApplied == 1" class="promo-success">Promocode applied successfully
</span> </span>
<span *ngIf="discountApplied == 2" class="promo-error">Invalid Promocode</span <span *ngIf="discountApplied == 2" class="promo-error">Invalid Promocode</span>
>
</div> </div>
<br /> <br />
...@@ -199,29 +200,25 @@ ...@@ -199,29 +200,25 @@
<h6> <h6>
<span class="floatLeft">PRODUCT COST</span> <span class="floatLeft">PRODUCT COST</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$ <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{service.formatNumber(cartService.cartTotal.toFixed(2))}}</span {{service.formatNumber(cartService.cartTotal.toFixed(2))}}</span>
>
<div class="clear"></div> <div class="clear"></div>
</h6> </h6>
<h6> <h6>
<span class="floatLeft">DELIVERY CHARGE</span> <span class="floatLeft">DELIVERY CHARGE</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$ <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{service.formatNumber(getDeliveryCharge(cartService.cartTotal))}}</span {{service.formatNumber(getDeliveryCharge(cartService.cartTotal))}}</span>
>
<div class="clear"></div> <div class="clear"></div>
</h6> </h6>
<h6> <h6>
<span class="floatLeft">GST/TAX</span> <span class="floatLeft">GST/TAX</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$ <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{service.formatNumber(getTax(cartService.cartTotal))}}</span {{service.formatNumber(getTax(cartService.cartTotal))}}</span>
>
<div class="clear"></div> <div class="clear"></div>
</h6> </h6>
<h6 *ngIf="discountApplied"> <h6 *ngIf="discountApplied">
<span class="floatLeft">DISCOUNT</span> <span class="floatLeft">DISCOUNT</span>
<span class="floatRight">(-) A$ {{service.formatNumber(discount)}}</span <span class="floatRight">(-) A$ {{service.formatNumber(discount)}}</span>
>
<div class="clear"></div> <div class="clear"></div>
</h6> </h6>
<hr /> <hr />
...@@ -248,8 +245,7 @@ ...@@ -248,8 +245,7 @@
<h3>Your order is due for delivery in</h3> <h3>Your order is due for delivery in</h3>
<h1>{{deliveryTime}}</h1> <h1>{{deliveryTime}}</h1>
<button class="view_order" (click)="goToPage('myorder')"> <button class="view_order" (click)="goToPage('myorder')">
VIEW ORDERS</button VIEW ORDERS</button><br />
><br />
<button class="home_btn" (click)="goToPage('home')">HOME</button> <button class="home_btn" (click)="goToPage('home')">HOME</button>
</div> </div>
</ion-slide> </ion-slide>
...@@ -259,22 +255,14 @@ ...@@ -259,22 +255,14 @@
</div> </div>
</ion-content> </ion-content>
<ion-footer class="hide-on-keyboard-open"> <ion-footer class="hide-on-keyboard-open">
<div <div class="footer_btnbay" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 0">
class="footer_btnbay"
*ngIf="cartService.carts && cartService.carts.length > 0"
[hidden]="currentIndex != 0"
>
<div class="continue" (click)="goToPage('productlist')"> <div class="continue" (click)="goToPage('productlist')">
CONTINUE SHOPPING CONTINUE SHOPPING
</div> </div>
<div class="checkout" (click)="next(1)">CHECKOUT</div> <div class="checkout" (click)="next(1)">CHECKOUT</div>
</div> </div>
<div <div class="footer_btn" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 1"
class="footer_btn" (click)="next(2);">
*ngIf="cartService.carts && cartService.carts.length > 0"
[hidden]="currentIndex != 1"
(click)="next(2);"
>
PAY PAY
</div> </div>
</ion-footer> </ion-footer>
...@@ -304,71 +292,44 @@ ...@@ -304,71 +292,44 @@
</ion-grid> </ion-grid>
</div> </div>
<ion-content class="sort_wrappper"> <ion-content class="sort_wrappper">
<agm-map <agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false"
[zoom]="20" [backgroundColor]="'rgba(29, 27, 130,0.2)'">
[latitude]="lat" <agm-marker [latitude]="lat" [longitude]="lng" [iconUrl]="
[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', url: './assets/pin-2.svg',
scaledSize: { scaledSize: {
width: 28, width: 28,
height: 40 height: 40
}}" }}"></agm-marker>
></agm-marker>
</agm-map> </agm-map>
<div class="add_address_wrapper"> <div class="add_address_wrapper">
<h5> <h5>
<span class="floatLeft">SELECT ADDRESS</span> <span class="floatLeft">SELECT ADDRESS</span>
<span class="floatRight" (click)="istoggle(); goToPage('nearby')">ADD NEW</span <span class="floatRight" (click)="istoggle(); goToPage('nearby')">ADD NEW</span>
>
<div class="clear"></div> <div class="clear"></div>
</h5> </h5>
<ul <ul *ngIf="addressService.addressList && addressService.addressList.length > 0">
*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 === true">DELIVERS TO</h4>
<h4 *ngIf="address.nearest === false">DOES NOT DELIVER TO</h4> <h4 *ngIf="address.nearest === false">DOES NOT DELIVER TO</h4>
<div> <div>
{{address.default}} {{address.default}}
<input <input class="styled-checkbox" name="addressId" id="styled-checkbox-{{i}}" type="radio"
class="styled-checkbox" (click)="setDefault(address.addressId, i)" [value]="address.addressId" #addressType />
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> <label for="styled-checkbox-{{i}}"> {{address.addressType}} </label>
</div> </div>
<div> <div>
<p> <p>
{{address.building}}, {{address.building}},
<span *ngIf="address.landmark && address.landmark!==''" <span *ngIf="address.landmark && address.landmark!==''">{{address.landmark}},</span>
>{{address.landmark}},</span
>
<!-- {{address.address}} --> <!-- {{address.address}} -->
</p> </p>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</li> </li>
</ul> </ul>
<div <div class="textCenter" *ngIf="addressService.addressList && addressService.addressList.length === 0">
class="textCenter"
*ngIf="addressService.addressList && addressService.addressList.length === 0"
>
No Address Found No Address Found
</div> </div>
</div> </div>
......
...@@ -210,6 +210,8 @@ export class CartPage implements OnInit { ...@@ -210,6 +210,8 @@ export class CartPage implements OnInit {
custAddress: this.addressService.custAddress, custAddress: this.addressService.custAddress,
paymentMethod: this.paymentMethod paymentMethod: this.paymentMethod
}; };
this.service.popupMsg = 'New Order has been successfully Placed!';
this.service.popupSub = 'Order Placed Successfully';
const state = this.orderService const state = this.orderService
.checkOut( .checkOut(
this.cartService.carts, this.cartService.carts,
......
...@@ -211,6 +211,8 @@ export class ChangeaddressPage implements OnInit { ...@@ -211,6 +211,8 @@ export class ChangeaddressPage implements OnInit {
status: true status: true
}; };
console.log(postData, orderId); console.log(postData, orderId);
this.service.popupMsg = 'Order address has been changed successfully!';
this.service.popupSub = 'Order Address changed';
This.addressService.changeAddress(postData, orderId); This.addressService.changeAddress(postData, orderId);
val.deliveryAddress = postData; val.deliveryAddress = postData;
This.service.set('order', val); This.service.set('order', val);
......
...@@ -92,12 +92,12 @@ export class NearbyPage implements OnInit { ...@@ -92,12 +92,12 @@ export class NearbyPage implements OnInit {
console.log(navigator); console.log(navigator);
/* this.latitude = -33.87276; /* this.latitude = -33.87276;
this.longitude = 151.20534; */ this.longitude = 151.20534; */
this.zoom = 24; this.zoom = 16;
this.getAddress(this.latitude, this.longitude); this.getAddress(this.latitude, this.longitude);
navigator.geolocation.getCurrentPosition(position => { navigator.geolocation.getCurrentPosition(position => {
this.latitude = position.coords.latitude; this.latitude = position.coords.latitude;
this.longitude = position.coords.longitude; this.longitude = position.coords.longitude;
this.zoom = 24; this.zoom = 16;
this.getAddress(this.latitude, this.longitude); this.getAddress(this.latitude, this.longitude);
}); });
} }
...@@ -119,7 +119,7 @@ export class NearbyPage implements OnInit { ...@@ -119,7 +119,7 @@ export class NearbyPage implements OnInit {
console.log(status); console.log(status);
if (status === 'OK') { if (status === 'OK') {
if (results[0]) { if (results[0]) {
this.zoom = 24; this.zoom = 16;
this.address = results[0].formatted_address; this.address = results[0].formatted_address;
console.log(this.address); console.log(this.address);
} else { } else {
...@@ -158,8 +158,8 @@ export class NearbyPage implements OnInit { ...@@ -158,8 +158,8 @@ export class NearbyPage implements OnInit {
this.loader = true; this.loader = true;
console.log(data); console.log(data);
const postData: Address = { const postData: Address = {
address: this.address, address: '',
addressType: '', addressType: data.addressType,
building: this.searchElementRef.nativeElement.value, building: this.searchElementRef.nativeElement.value,
landmark: data.landmark !== undefined ? data.landmark : '', landmark: data.landmark !== undefined ? data.landmark : '',
defaultVal: 0, defaultVal: 0,
......
...@@ -9,10 +9,14 @@ import * as firebase from 'firebase'; ...@@ -9,10 +9,14 @@ import * as firebase from 'firebase';
export class ServiceService { export class ServiceService {
state: boolean; state: boolean;
distance: any; distance: any;
popupMsg: any;
popupSub: any;
constructor( constructor(
public storage: Storage, public storage: Storage,
public toastController: ToastController public toastController: ToastController
) { ) {
this.popupMsg = '';
this.popupSub = '';
this.state = true; this.state = true;
this.distance = 10; this.distance = 10;
this.storage.ready().then(() => { this.storage.ready().then(() => {
......
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