Commit 02813e62 by Arjun

android

parent a49fe93e
......@@ -28,8 +28,7 @@
<div class="sub_menu">
<ul *ngIf="categoryService.activecategories">
<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 }}
</li>
</ion-menu-toggle>
......
......@@ -3,6 +3,7 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Platform, Events } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import {
AngularFirestore,
AngularFirestoreDocument,
......@@ -16,7 +17,7 @@ import { ServiceService } from './../config/service.service';
import { SubjectService } from './../config/subject.service';
import { CategoriesService } from './../config/category.service';
import { SearchmodalPage } from './searchmodal/searchmodal.page';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { NavigationBar } from '@ionic-native/navigation-bar/ngx';
@Component({
......@@ -67,11 +68,14 @@ export class AppComponent {
public categoryService: CategoriesService,
public subjectService: SubjectService,
private route: ActivatedRoute,
private navigationBar: NavigationBar
private navigationBar: NavigationBar,
private location: Location,
private events: Events
) {
console.log(this.router.url);
setInterval(() => {
console.log(window.location.href);
}, 1000);
this.state = true;
this.initializeApp();
this.subjectService.getLoginData().subscribe(loginData => {
this.state = loginData;
......@@ -96,9 +100,7 @@ export class AppComponent {
});
}
ionViewWillEnter() {
alert('enter');
}
ionViewDidEnter() {}
initializeApp() {
this.platform.ready().then(() => {
......@@ -144,6 +146,7 @@ export class AppComponent {
'review'
];
const currentUrl = this.router.url.split('/');
console.log(currentUrl);
const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
// console.log(currentUrl[1], index, this.state);
if (index > -1 || this.tabData === false) {
......
......@@ -59,8 +59,8 @@
<p class="textLeft">Total Price:</p>
</ion-col>
<ion-col>
<p class="textRight">A$
{{service.formatNumber(cartService.cartTotal.toFixed(2))}}</p>
<p class="textRight">A$ {{service.formatNumber(cartService.cartTotal.toFixed(2))}}
</p>
</ion-col>
</ion-row>
</div>
......@@ -104,8 +104,7 @@
<ion-row>
<ion-col class="p0">
<h6>
{{addressService.custAddress.building}},<br />
{{addressService.custAddress.landmark}},
{{addressService.custAddress.building}},<br /> {{addressService.custAddress.landmark}},
<br /> {{addressService.custAddress.address}}
</h6>
</ion-col>
......@@ -125,8 +124,7 @@
</label>
</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()" checked="true" />
<label for="paypal">
<p>PayPal</p>
</label>
......@@ -135,8 +133,7 @@
<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>
......@@ -146,8 +143,7 @@
<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>
......@@ -173,8 +169,7 @@
<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>
......@@ -247,13 +242,10 @@
</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>
<!-- <div class="footer_btn" [hidden]="currentIndex != 2" (click)="finishpop()">
FINISH
</div> -->
</ion-footer>
<div class="loader" *ngIf="loader">
<div class="lds-ripple">
......@@ -273,8 +265,7 @@
<div class="clear"></div>
</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"></agm-marker>
</agm-map>
<div class="add_address_wrapper">
......@@ -287,9 +278,7 @@
<li *ngFor="let address of addressService.nearestList; let i = index">
<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 [checked]="address.defaultVal == 1" />
<label for="styled-checkbox-{{i}}"> {{address.addressType}} </label>
</div>
<div class="floatLeft">
......@@ -300,8 +289,7 @@
<div class="clear"></div>
</li>
</ul>
<div class="textCenter" *ngIf="addressService.nearestList && addressService.nearestList.length === 0">No
Address Found in the nearest center</div>
<div class="textCenter" *ngIf="addressService.nearestList && addressService.nearestList.length === 0">No Address Found in the nearest center</div>
</div>
<!-- <div class="loader" *ngIf="loader">
......
.cart_wrapper {
width: 100%;
height: 100%;
.cart_head {
width: 100%;
height: 220px;
......@@ -456,7 +457,7 @@
text-align: center;
color: #fff;
font-size: 18px;
padding: 15px;
padding: 10px;
font-weight: 300;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
......@@ -474,7 +475,7 @@
border-top-left-radius: 15px;
text-align: center;
font-size: 18px;
padding: 15px;
padding: 10px;
font-weight: 300;
float: left;
border-top: 1px solid #d7d5e4;
......@@ -488,7 +489,7 @@
text-align: center;
color: #fff;
font-size: 18px;
padding: 15px;
padding: 10px;
font-weight: 300;
float: right;
}
......
......@@ -10,6 +10,7 @@ import { ServiceService } from './../../config/service.service';
import { AddressService } from './../../config/address.service';
import { AddressList } from './../../config/services/address';
import { trigger, transition, animate, style } from '@angular/animations';
import { Events } from '@ionic/angular';
import { zip } from 'rxjs';
@Component({
......@@ -60,7 +61,8 @@ export class CartPage implements OnInit {
public orderService: OrdersService,
public modalController: ModalController,
public service: ServiceService,
public addressService: AddressService
public addressService: AddressService,
private event: Events
) {
console.log('cart loaded');
this.bookDate = this.formatDate();
......@@ -95,7 +97,6 @@ export class CartPage implements OnInit {
setTimeout(() => {
this.setAddress();
}, 1000); */
}
ionViewWillEnter() {
......@@ -159,6 +160,7 @@ export class CartPage implements OnInit {
}
goBack() {
this.event.publish('home');
this.location.back();
}
......@@ -192,11 +194,15 @@ export class CartPage implements OnInit {
paymentMethod: this.paymentMethod
};
const state = this.orderService
.checkOut(this.cartService.carts, otherCharges, this.addressService.centerLoc)
.checkOut(
this.cartService.carts,
otherCharges,
this.addressService.centerLoc
)
.then(data => {
this.cartService.cartCenter = '';
const cartCount = this.orderService.cartCount;
const timer = ((cartCount - 1) * 20) + 60;
const timer = (cartCount - 1) * 20 + 60;
const totalTime = this.add_minutes(timer);
console.log('ready for slide');
this.timeinterval = setInterval(() => {
......@@ -232,7 +238,7 @@ export class CartPage implements OnInit {
getTimeRemaining(endtime, currDate) {
const t = Date.parse(endtime) - Date.parse(currDate);
const hours = Math.floor((((t / 1000) / 60) / 60) % 60);
const hours = Math.floor((t / 1000 / 60 / 60) % 60);
const seconds = Math.floor((t / 1000) % 60);
const minutes = Math.floor((t / 1000 / 60) % 60);
return {
......@@ -290,7 +296,9 @@ export class CartPage implements OnInit {
if (value[0].type === 1) {
const rate = value[0].amount;
const upto = value[0].amount;
const percentage = Math.round((this.cartService.cartTotal * rate) / 100).toFixed(2);
const percentage = Math.round(
(this.cartService.cartTotal * rate) / 100
).toFixed(2);
this.discount = percentage > upto ? upto : percentage;
} else {
this.discount = value[0].amount;
......
......@@ -141,7 +141,7 @@
}
.ellipse {
white-space: nowrap;
width: 180px;
width: 150px;
overflow: hidden;
text-overflow: ellipsis;
}
......
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