Commit 9e070769 by Adarsh K

latest push

parents 28c6ade0 e34368fe
......@@ -87,9 +87,13 @@
(click)="setActive3()"
></div>
</li>
<!-- <li (click)="goToPage('cart')">
<div class="icon_sec m4_icon" [class.m4_icon_act]="sec_active4" (click)="setActive4()"></div>
</li> -->
<li (click)="goToPage('cart')">
<div
class="icon_sec m4_icon"
[class.m4_icon_act]="sec_active4"
(click)="setActive4()"
></div>
</li>
<li (click)="goToPage('myorder')">
<div
class="icon_sec m5_icon"
......
@import url('https://fonts.googleapis.com/css?family=Abel&display=swap');
@import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
* {
font-family: 'Abel', sans-serif;
-webkit-font-smoothing: antialiased;
font-family: 'Abel', sans-serif;
-webkit-font-smoothing: antialiased;
}
.side_menu_wrapper {
background: rgba(41, 40, 91, 1);
width: 100%;
height: 100vh;
padding-left: 20px;
padding-top: 20px;
padding-right: 10px;
.top_banner {
.top_image {
width: 60px;
height: 60px;
float: left;
border-radius: 50%;
background-color: #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
}
.top_detail {
width: calc(100% - 60px);
float: left;
padding: 7px;
padding-left: 15px;
h4 {
margin: 0px;
padding: 0px;
color: #fff;
}
p {
margin: 0px;
padding: 0px;
color: #fff;
color: rgba(176, 174, 199, 1);
}
background: rgba(41, 40, 91, 1);
width: 100%;
height: 100vh;
padding-left: 20px;
padding-top: 20px;
padding-right: 10px;
.top_banner {
.top_image {
width: 60px;
height: 60px;
float: left;
border-radius: 50%;
background-color: #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
}
.top_detail {
width: calc(100% - 60px);
float: left;
padding: 7px;
padding-left: 15px;
h4 {
margin: 0px;
padding: 0px;
color: #fff;
}
p {
margin: 0px;
padding: 0px;
color: #fff;
color: rgba(176, 174, 199, 1);
}
}
}
}
}
.sidemenu_list {
padding-top: 30px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: #fff;
font-weight: 200;
font-size: 15px;
padding: 10px;
font-size: 16px;
&:focus {
background-color: rgba(40, 36, 88, 1);
}
&:hover {
background-color: rgba(40, 36, 88, 1);
}
.version {
color: rgba(176, 174, 199, 1);
font-size: 14px;
}
}
.sub_menu {
padding-left: 25px;
margin-bottom: 40px;
padding-top: 10px;
ul {
padding-top: 30px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: rgba(176, 174, 199, 1);
list-style: none;
color: #fff;
font-weight: 200;
font-size: 15px;
padding: 10px;
font-size: 16px;
&:focus {
background-color: rgba(40, 36, 88, 1);
}
&:hover {
background-color: rgba(40, 36, 88, 1);
}
.version {
color: rgba(176, 174, 199, 1);
font-size: 14px;
}
}
.sub_menu {
padding-left: 25px;
margin-bottom: 40px;
padding-top: 10px;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
color: rgba(176, 174, 199, 1);
}
}
}
}
}
}
}
.common_tab {
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
width: 100%;
height: 50px;
background-color: #fff;
-webkit-box-shadow: 0px 0px 5px 7px rgba(215, 213, 228, 0.5);
-moz-box-shadow: 0px 0px 5px 7px rgba(215, 213, 228, 0.5);
box-shadow: 0px 0px 5px 7px rgba(215, 213, 228, 0.5);
ul {
margin: 0px;
padding: 0px;
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
width: 100%;
height: 100%;
li {
list-style: none;
display: inline-block;
width: 20%;
height: 100%;
text-align: center;
background-repeat: no-repeat;
background-position: center;
background-size: 25px;
}
.icon_sec {
width: 50px;
height: 50px;
background-image: url('../assets/icon_sprite.png');
margin: 0 auto;
background-repeat: no-repeat;
background-size: 450px;
}
.m1_icon {
background-position: top -6px left -249px;
}
.m1_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -249px;
}
.m2_icon {
background-position: top -3px left -88px;
}
.m2_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -3px left -88px;
}
.m3_icon {
background-position: top -6px left -167px;
}
.m3_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -167px;
}
.m4_icon {
background-position: top -6px left -5px;
}
.m4_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -5px;
}
.m5_icon {
background-position: top -6px left -325px;
}
.m5_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -325px;
}
.m6_icon {
background-position: top -6px left -398px;
}
.m6_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -398px;
height: 50px;
background-color: #fff;
-webkit-box-shadow: 0px 0px 5px 7px rgba(215, 213, 228, 0.5);
-moz-box-shadow: 0px 0px 5px 7px rgba(215, 213, 228, 0.5);
box-shadow: 0px 0px 5px 7px rgba(215, 213, 228, 0.5);
ul {
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
li {
list-style: none;
display: inline-block;
height: 100%;
text-align: center;
background-repeat: no-repeat;
background-position: center;
background-size: 25px;
}
.icon_sec {
width: 50px;
height: 50px;
background-image: url('../assets/icon_sprite.png');
margin: 0 auto;
background-repeat: no-repeat;
background-size: 450px;
}
.m1_icon {
background-position: top -6px left -249px;
}
.m1_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -249px;
}
.m2_icon {
background-position: top -3px left -88px;
}
.m2_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -3px left -88px;
}
.m3_icon {
background-position: top -6px left -167px;
}
.m3_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -167px;
}
.m4_icon {
background-position: top -6px left -5px;
}
.m4_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -5px;
}
.m5_icon {
background-position: top -6px left -325px;
}
.m5_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -325px;
}
.m6_icon {
background-position: top -6px left -398px;
}
.m6_icon_act {
background-image: url('../assets/icon_sprite_active.png') !important;
background-position: top -6px left -398px;
}
}
}
}
}
\ No newline at end of file
......@@ -89,10 +89,6 @@ export class AppComponent {
});
}
hideTab() {
alert('asdasdas');
}
async finishpop(data: any) {
const modal = await this.modalController.create({
component: DeliverypopPage,
......
......@@ -48,6 +48,7 @@ export class CartPage implements OnInit {
discount: number;
totalAmt: number;
bookDate: any;
timeinterval: any;
constructor(
private router: Router,
......@@ -59,6 +60,7 @@ export class CartPage implements OnInit {
public service: ServiceService,
public addressService: AddressService
) {
console.log('cart loaded');
this.bookDate = this.formatDate();
this.currentIndex = 0;
this.count = 1;
......@@ -67,7 +69,7 @@ export class CartPage implements OnInit {
this.taxAmount = 0;
this.discountApplied = false;
this.discount = 0;
this.cartService.cartList();
// this.cartService.cartList();
this.loader = true;
const users = this.service.get('user').then(data => {
if (data) {
......@@ -86,6 +88,15 @@ export class CartPage implements OnInit {
this.setAddress();
}
ionViewWillEnter() {
const users = this.service.get('user').then(data => {
if (data) {
data = JSON.parse(data);
this.cartService.cartList();
}
});
}
setAddress() {
if (this.addressService.addressList.length > 0) {
let address = this.addressService.addressList.find(
......@@ -171,6 +182,10 @@ export class CartPage implements OnInit {
.checkOut(this.cartService.carts, otherCharges)
.then(data => {
console.log('ready for slide');
const timeStamp = Math.floor(Date.now() / 1000);
this.timeinterval = setInterval(() => {
this.getDeliveryTime(timeStamp);
}, 1000);
this.slides.slideNext();
});
} else {
......@@ -181,6 +196,31 @@ export class CartPage implements OnInit {
}
}
getDeliveryTime(timeStamp) {
console.log(timeStamp);
const endDate = new Date(timeStamp * 1000);
console.log(endDate);
endDate.setHours(endDate.getHours() + 1);
const t = this.getTimeRemaining(endDate, new Date());
const minutes = t.minutes < 10 ? '0' + t.minutes : t.minutes;
const seconds = t.seconds < 10 ? '0' + t.seconds : t.seconds;
this.deliveryTime = minutes + ' : ' + seconds;
if (t.t <= 0) {
clearInterval(this.timeinterval);
}
}
getTimeRemaining(endtime, currDate) {
const t = Date.parse(endtime) - Date.parse(currDate);
const seconds = Math.floor((t / 1000) % 60);
const minutes = Math.floor((t / 1000 / 60) % 60);
return {
t,
minutes,
seconds
};
}
prev() {
this.slides.slidePrev();
}
......
.nearby_map {
width: 100%;
height: 100vh;
.overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(29, 27, 130, 0.2);
}
agm-map {
width: 100%;
height: 100vh;
.overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(29, 27, 130, 0.2);
}
agm-map {
width: 100%;
height: 100%;
position: relative;
height: 100%;
position: relative;
}
.click_marker {
min-width: 200px;
padding: 10px;
h5 {
margin: 0px;
padding: 0px;
}
.click_marker {
min-width: 200px;
padding: 10px;
h5 {
margin: 0px;
padding: 0px;
}
p {
margin: 0px;
padding: 0px;
}
p {
margin: 0px;
padding: 0px;
}
}
}
.add_address_wrapper {
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
padding: 20px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
background: #fff;
-webkit-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
h5 {
color: rgba(41, 40, 91, 1);
margin: 0px;
padding: 0px;
font-weight: 800;
}
p {}
input {
width: 100%;
height: 45px;
border: 1px solid #E1E0EB;
border-radius: 4px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 20px;
}
.add_btn {
width: 100%;
height: 45px;
background-color: #29285B;
color: #fff;
border-radius: 4px;
}
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
padding: 20px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
background: #fff;
-webkit-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
h5 {
color: rgba(41, 40, 91, 1);
margin: 0px;
padding: 0px;
font-weight: 800;
}
p {
}
input {
width: 100%;
height: 45px;
border: 1px solid #e1e0eb;
border-radius: 4px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 20px;
}
.add_btn {
width: 100%;
height: 45px;
background-color: #29285b;
color: #fff;
border-radius: 4px;
}
}
.styled-checkbox {
position: absolute; // take it out of document flow
opacity: 0; // hide it
&+label {
position: relative;
cursor: pointer;
padding: 0;
}
// Box.
&+label:before {
content: '';
margin-right: 10px;
display: inline-block;
vertical-align: text-top;
width: 20px;
height: 20px;
border-radius: 10px;
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
// Box hover
// Box checked
&: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: 11px;
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);
}
}
\ No newline at end of file
position: absolute; // take it out of document flow
opacity: 0; // hide it
& + label {
position: relative;
cursor: pointer;
padding: 0;
}
// Box.
& + label:before {
content: '';
margin-right: 10px;
display: inline-block;
vertical-align: text-top;
width: 20px;
height: 20px;
border-radius: 10px;
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
// Box hover
// Box checked
&: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: 11px;
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);
}
}
<ion-content>
<div class="cart_wrapper">
<div class="cart_head">
<div class="nav_header">
<button class="nav_btn nav_back_white floatLeft" (click)="goBack()">
<img src="../assets/arrow_white.png">
<div class="cart_wrapper" *ngIf="data">
<div class="cart_head">
<div class="nav_header">
<button
class="nav_btn nav_back_white floatLeft"
(click)="goToPage('myorder')"
>
<img src="../assets/arrow_white.png" />
</button>
<div class="nav_title floatLeft">
<h4></h4>
</div>
<button class="nav_btn floatRight">
</button>
<div class="clear"></div>
</div>
<img [src]="data.product[0].image" onerror="this.src='../assets/[email protected]'">
<h4>ORDER CANCELLED</h4>
<p>June 26th 2019, 03:00 PM</p>
</div>
<div class="nearby_shop_list">
<ul>
<li (click)="goToPage('productlist')">
<div class="nearby_image">
<img src="../assets/[email protected]">
</div>
<div class="nearby_detail">
<h5>
<span class="floatLeft">Carnival Life</span>
<span class="floatRight">4
<img src="../assets/Path61_2.png">
</span>
<div class="clear"></div>
</h5>
<p>Men's & Women's Fashion</p>
</div>
<div class="clear"></div>
</li>
</ul>
</div>
<div class="product_detail">
<h6>Green, Small</h6>
<h5>Quantity : <span>3</span></h5>
<h5>Amount : <strong>AU$99.00</strong></h5>
<h5>Delivery time : <span>Delivery in 1 hour</span></h5>
<h4>DELIVERY</h4>
<h5>
Shamjith KS<br> +00 0000 888 888<br> Carnival Infopark Infopark Kochi<br> 682030, Kerala, India
</h5>
<button class="cancel_btn" (click)="goToPage('productdetail')">BUY NOW</button>
<hr>
<div class="nav_title floatLeft">
<h4></h4>
</div>
<div class="related_product_slider">
<button class="nav_btn floatRight"></button>
<div class="clear"></div>
</div>
<img onerror="this.src='../assets/[email protected]'" />
<h4>ORDER CANCELLED</h4>
<p>{{orderCancelled | date:'MMMM dd, y'}}</p>
</div>
<div class="nearby_shop_list">
<ul>
<li (click)="goToPage('productlist')">
<div class="nearby_image">
<img
[src]="data.product[0].image"
onerror="this.src='../assets/[email protected]'"
/>
</div>
<div class="nearby_detail">
<h5>
<span class="floatLeft">Related Products</span><span class="floatRight">MORE</span>
<div class="clear"></div>
<span class="floatLeft">{{data.shopperName}}</span>
<span class="floatRight"
>4
<img src="../assets/Path61_2.png" />
</span>
<div class="clear"></div>
</h5>
<ul>
<ion-slides pager="false" [options]="relatedProd">
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img src="../assets/[email protected]">
<div class="fav_icon">
</div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00</p>
</li>
</ion-slide>
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img src="../assets/Recommended-Ball-Gown-Floor-Length-V-Neck-Lace-Organza-Prom-Dress-OD850662@3x.png">
<div class="fav_icon">
</div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00</p>
</li>
</ion-slide>
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img src="../assets/[email protected]">
<div class="fav_icon">
</div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00 <span class="offer">-8%</span></p>
</li>
</ion-slide>
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img src="../assets/[email protected]">
<div class="fav_icon">
</div>
<div class="featured_badge">Featured</div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00<span>AU$110.00</span></p>
</li>
</ion-slide>
</ion-slides>
</ul>
</div>
<p>Men's & Women's Fashion</p>
</div>
<div class="clear"></div>
</li>
</ul>
</div>
</ion-content>
\ No newline at end of file
<div class="product_detail" *ngFor="let product of data.product">
<h6>
<span *ngIf="product.color !== 'No-Color'">{{product.color}}, </span>
<span *ngIf="product.size !== 'Any-Size'">{{product.size}}</span>
</h6>
<h5>Quantity : <span>{{product.qty}}</span></h5>
<h5>Amount : <strong>A$ {{product.price}}</strong></h5>
<h5>Delivery time : <span> 1 hour</span></h5>
<h4>DELIVERY</h4>
<h5 *ngIf="data.deliveryAddress">
{{data.deliveryAddress.addressType}},<br />{{data.deliveryAddress.address}},
<br />
{{data.deliveryAddress.building}}, <br />
{{data.deliveryAddress.landmark}}
</h5>
<!-- <button
class="cancel_btn"
(click)="goToPage('ordercancelled')"
>
BUY NOW
</button> -->
<!-- <hr /> -->
</div>
<!-- <div class="related_product_slider">
<h5>
<span class="floatLeft">Related Products</span
><span class="floatRight">MORE</span>
<div class="clear"></div>
</h5>
<ul>
<ion-slides pager="false" [options]="relatedProd">
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img src="../assets/[email protected]" />
<div class="fav_icon"></div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00</p>
</li>
</ion-slide>
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img
src="../assets/Recommended-Ball-Gown-Floor-Length-V-Neck-Lace-Organza-Prom-Dress-OD850662@3x.png"
/>
<div class="fav_icon"></div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00</p>
</li>
</ion-slide>
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img src="../assets/[email protected]" />
<div class="fav_icon"></div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00 <span class="offer">-8%</span></p>
</li>
</ion-slide>
<ion-slide>
<li (click)="goToPage('productdetail')">
<div class="product_image">
<img src="../assets/[email protected]" />
<div class="fav_icon"></div>
<div class="featured_badge">Featured</div>
</div>
<h5>European Style V Neck</h5>
<p>AU$99.00<span>AU$110.00</span></p>
</li>
</ion-slide>
</ion-slides>
</ul>
</div> -->
</div>
</ion-content>
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { Router, ActivatedRoute } from '@angular/router';
import { ServiceService } from './../../config/service.service';
@Component({
selector: 'app-ordercancelled',
templateUrl: './ordercancelled.page.html',
styleUrls: ['./ordercancelled.page.scss'],
styleUrls: ['./ordercancelled.page.scss']
})
export class OrdercancelledPage implements OnInit {
data: any;
orderCancelled = new Date();
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
ngOnInit() {
private location: Location,
private service: ServiceService
) {
this.service.get('order').then(val => {
this.data = val;
});
}
ngOnInit() {}
relatedProd = {
slidesPerView: 2
}
};
goToPage(path, data = null) {
this.router.navigateByUrl(path, { queryParams: data });
......@@ -29,6 +35,5 @@ export class OrdercancelledPage implements OnInit {
goBack() {
this.location.back();
}
}
}
......@@ -89,7 +89,10 @@
Amount : <strong>A$ {{product.price}}</strong
><span class="afterpay">COD</span>
</h5>
<h5>Delivery time : <span>{{deliveryTime}}</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>
<h4>DELIVERY</h4>
<h5 *ngIf="data.deliveryAddress">
{{data.deliveryAddress.addressType}},<br />{{data.deliveryAddress.address}},
......@@ -97,10 +100,14 @@
{{data.deliveryAddress.building}}, <br />
{{data.deliveryAddress.landmark}}
</h5>
<button class="cancel_btn" (click)="goToPage('ordercancelled')">
<button
class="cancel_btn"
(click)="cancellOrder(data.orderId)"
*ngIf="cancelDelivery > 0 && data.orderStatus != 0 && data.orderStatus != 8"
>
CANCEL THIS ORDER
</button>
<hr />
<!-- <hr /> -->
</div>
<!-- <div class="related_product_slider">
......
......@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { Router, ActivatedRoute } from '@angular/router';
import { ServiceService } from './../../config/service.service';
import { MyordersService } from './../../config/myorder.service';
@Component({
selector: 'app-orderplaced',
......@@ -10,12 +11,14 @@ import { ServiceService } from './../../config/service.service';
})
export class OrderplacedPage implements OnInit {
deliveryTime: any;
cancelDelivery: any;
timeinterval: any;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location,
private service: ServiceService
private service: ServiceService,
private myOrder: MyordersService
) {
this.deliveryTime = '';
this.service.get('order').then(val => {
......@@ -47,6 +50,7 @@ export class OrderplacedPage implements OnInit {
getTimeRemaining(endtime, currDate) {
const t = Date.parse(endtime) - Date.parse(currDate);
this.cancelDelivery = t;
const seconds = Math.floor((t / 1000) % 60);
const minutes = Math.floor((t / 1000 / 60) % 60);
return {
......@@ -66,4 +70,55 @@ export class OrderplacedPage implements OnInit {
goBack() {
this.location.back();
}
cancellOrder(orderId) {
console.log(orderId);
this.myOrder.cancelOrder(orderId).then(() => {
this.service.showToast('Order cancelled!', 'top', 'my-toast', 1000);
const This = this;
setTimeout(() => {
This.goToPage('ordercancelled');
}, 1100);
});
}
getStatus(status: number) {
switch (status) {
case 1:
return 'Booked';
break;
case 2:
return 'Shop Accepted';
break;
case 3:
return 'Rider Assigned';
break;
case 4:
return 'Reached Shop';
break;
case 5:
return 'Picked Up';
break;
case 6:
return 'Reached Location';
break;
case 7:
return 'Delivered';
break;
case 9:
return 'Completed';
break;
case 8:
return 'Rejected';
break;
case 10:
return 'Not Received';
break;
case 0:
return 'Cancelled';
break;
default:
return 'Finished';
}
}
}
......@@ -134,7 +134,7 @@ export class ProductdetailPage implements OnInit {
if (type === 1) {
this.router.navigateByUrl('cart');
} else {
// alert('Product added to cart');
this.service.showToast('Added into cart', 'top', 'my-toast', 2000);
}
this.cartService.cartList();
});
......
......@@ -42,14 +42,16 @@
<ion-col class="textLeft p0">
<p>
Phone
<span *ngIf="loggedUser.phoneVerified == true">Verified</span>
<span *ngIf="loggedUser.phoneVerified == false"
>Not Verified yet</span
>
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.phone}}</h6>
<span class="ar-span" *ngIf="loggedUser.phoneVerified == true"
>Verified</span
>
<span class="ar-span" *ngIf="loggedUser.phoneVerified == false"
>Not Verified yet</span
>
</ion-col>
</ion-row>
</div>
......@@ -57,16 +59,17 @@
<ion-row>
<ion-col class="textLeft p0">
<p>
Email<span *ngIf="userData && userData.emailVerified == true"
>Verified</span
>
<span *ngIf="loggedUser.emailVerified == false"
>Not Verified yet</span
>
Email
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.emailId}}</h6>
<span class="ar-span" *ngIf="loggedUser.emailVerified == true"
>Verified</span
>
<span class="ar-span" *ngIf="loggedUser.emailVerified == false"
>Not Verified yet</span
>
</ion-col>
</ion-row>
</div>
......
.profile_wrapper {
.profile_banner {
.profile_banner {
width: 100%;
background-image: url('../../assets/profile_banner.png');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
text-align: center;
padding-top: 40px;
.profile_circle {
width: 100px;
height: 100px;
background-color: #fff;
border-radius: 50%;
position: relative;
margin: 0 auto;
img {
width: 100%;
background-image: url('../../assets/profile_banner.png');
background-position: center;
background-repeat: no-repeat;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
input {
width: 80px;
height: 100%;
opacity: 0;
cursor: pointer;
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
}
.edit {
width: 30px;
height: 30px;
border-radius: 50%;
object-fit: cover;
object-position: center;
background-color: #000;
background-image: url('../../assets/edit_icon.png');
background-size: cover;
text-align: center;
padding-top: 40px;
.profile_circle {
width: 100px;
height: 100px;
background-color: #fff;
border-radius: 50%;
position: relative;
margin: 0 auto;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
input {
width: 80px;
height: 100%;
opacity: 0;
cursor: pointer;
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
}
.edit {
width: 30px;
height: 30px;
border-radius: 50%;
object-fit: cover;
object-position: center;
background-color: #000;
background-image: url('../../assets/edit_icon.png');
background-size: cover;
cursor: pointer;
position: absolute;
top: 0px;
right: 0px;
}
}
h5 {
text-align: center;
color: #fff;
margin: 0px;
padding-top: 15px;
font-weight: 600;
padding-bottom: 5px;
}
p {
color: rgba(206, 153, 76, 1);
text-align: center;
margin: 0px;
padding-bottom: 20px;
font-weight: 700;
}
cursor: pointer;
position: absolute;
top: 0px;
right: 0px;
}
}
.account_wrapper {
width: calc(100% - 40px);
margin: 0 auto;
padding-top: 20px;
padding-bottom: 100px;
.account_header {
padding-bottom: 15px;
h5 {
margin: 0px;
padding: 0px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
}
span {
color: rgba(59, 57, 77, 1);
img {
width: 20px;
}
}
}
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199, 1);
font-size: 18px;
span {
color: rgba(206, 153, 76, 1);
margin-left: 10px;
}
}
h6 {
margin: 0px;
padding: 0px;
color: rgba(59, 57, 77, 1);
font-size: 18px;
ion-icon {
color: rgba(176, 174, 199, 1);
}
h5 {
text-align: center;
color: #fff;
margin: 0px;
padding-top: 15px;
font-weight: 600;
padding-bottom: 5px;
}
p {
color: rgba(206, 153, 76, 1);
text-align: center;
margin: 0px;
padding-bottom: 20px;
font-weight: 700;
}
}
.account_wrapper {
width: calc(100% - 40px);
margin: 0 auto;
padding-top: 20px;
padding-bottom: 100px;
.account_header {
padding-bottom: 15px;
h5 {
margin: 0px;
padding: 0px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
}
span {
color: rgba(59, 57, 77, 1);
img {
width: 20px;
}
.row {
padding-bottom: 20px;
}
}
.ar-span {
color: rgba(206, 153, 76, 1);
margin-left: 10px;
}
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199, 1);
font-size: 18px;
}
h6 {
margin: 0px;
padding: 0px;
color: rgba(59, 57, 77, 1);
font-size: 18px;
ion-icon {
color: rgba(176, 174, 199, 1);
}
}
.row {
padding-bottom: 20px;
}
hr {
border-bottom: 1px solid rgba(176, 174, 199, 0.5);
height: 0px;
border-top: none;
margin-top: 15px;
margin-bottom: 15px;
}
}
.logout-pop-wrapper {
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
.logout_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: 50%;
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;
}
p {
text-align: center;
}
.logout_footer {
padding-top: 10px;
button {
border-radius: 8px;
height: 40px;
width: 48%;
color: #fff;
font-size: 15px;
font-weight: lighter;
text-transform: uppercase;
}
hr {
border-bottom: 1px solid rgba(176, 174, 199, 0.5);
height: 0px;
border-top: none;
margin-top: 15px;
margin-bottom: 15px;
.btn-cancel {
border: 1px solid #29285b;
background-color: #29285b;
}
}
.logout-pop-wrapper {
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
.logout_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: 50%;
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;
}
p {
text-align: center;
}
.logout_footer {
padding-top: 10px;
button {
border-radius: 8px;
height: 40px;
width: 48%;
color: #fff;
font-size: 15px;
font-weight: lighter;
text-transform: uppercase;
}
.btn-cancel {
border: 1px solid #29285B;
background-color: #29285B;
}
.btn-logout {
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.16);
color: #000;
}
}
.btn-logout {
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.16);
color: #000;
}
}
}
}
\ No newline at end of file
}
}
......@@ -121,6 +121,7 @@ export class CartsService {
}
public async cartList() {
console.log('called');
const cartRef: AngularFirestoreCollection<any> = this.afs.collection(
'carts',
ref => ref.where('custId', '==', this.custId)
......
......@@ -79,6 +79,20 @@ export class MyordersService {
});
}*/
public async cancelOrder(orderId) {
const promise = new Promise(resolve => {
this.afs
.collection('orders')
.doc(orderId)
.update({
orderStatus: 0,
cancelTime: firebase.firestore.FieldValue.serverTimestamp()
});
resolve(true);
});
return promise;
}
public async orderList(custId) {
// console.log('called');
// console.log(custId);
......@@ -86,7 +100,7 @@ export class MyordersService {
this.orders = [];
const orderRef: AngularFirestoreCollection<any> = this.afs.collection(
'orders',
ref => ref.where('custId', '==', custId).orderBy('bookDate', 'desc')
ref => ref.where('custId', '==', custId).orderBy('orderDate', 'desc')
);
orderRef.stateChanges().subscribe(value => {
// console.log(value);
......@@ -100,6 +114,7 @@ export class MyordersService {
const order: Myorder = {
amount: item.amount,
status: item.status,
orderDate: item.orderDate,
orderStatus: item.orderStatus,
bookDate: item.bookDate,
deliveryLocation: item.deliveryLocation,
......@@ -122,6 +137,7 @@ export class MyordersService {
}
}
});
this.orders.sort((a, b) => Number(b.orderDate) - Number(a.orderDate));
// console.log(this.orders);
}
});
......
......@@ -170,6 +170,7 @@ export class OrdersService {
deliveryCharge: 'A$ ' + otherCharge.deliveryCharge,
deliveryLocation: delivery,
bookDate: firebase.firestore.FieldValue.serverTimestamp(),
orderDate: Math.floor(Date.now() / 1000),
orderCode: this.orderCode(),
orderId: neworderId,
orderStatus: 1,
......
export interface Myorder {
amount: string;
bookDate: any;
pickupLocation: any;
deliveryLocation: any;
deliveryAddress: any;
status: number;
orderStatus: number;
riderName: string;
orderId: string;
time: string;
product: any;
orderCode: string;
amount: string;
bookDate: any;
orderDate: any;
pickupLocation: any;
deliveryLocation: any;
deliveryAddress: any;
status: number;
orderStatus: number;
riderName: string;
orderId: string;
time: string;
product: any;
orderCode: string;
}
......@@ -29,45 +29,43 @@
}*/
export interface CartProd {
prodName: any;
prodId: string;
image: string;
size: string;
color: string;
qty: number;
discount: string;
price: string;
productDoc: any;
prodName: any;
prodId: string;
image: string;
size: string;
color: string;
qty: number;
discount: string;
price: string;
productDoc: any;
}
export interface Order {
amount: string;
customer: any;
custName: string;
deliveryAddress: string;
deliveryCharge: string;
deliveryLocation: object;
orderCode: string;
orderId: string;
orderStatus: number;
pickupAddress: string;
pickupLocation: object;
bookDate: any;
custId: string;
promoId: any;
rider: any;
riderName: string;
riderId: string;
shopper: any;
shopperName: string;
shopperId: string;
status: number;
shopperState: number;
product: any;
tax: string;
discount: string;
promoApplied: boolean;
amount: string;
customer: any;
custName: string;
deliveryAddress: string;
deliveryCharge: string;
deliveryLocation: object;
orderCode: string;
orderId: string;
orderStatus: number;
pickupAddress: string;
pickupLocation: object;
bookDate: any;
orderDate: any;
custId: string;
promoId: any;
rider: any;
riderName: string;
riderId: string;
shopper: any;
shopperName: string;
shopperId: string;
status: number;
shopperState: number;
product: any;
tax: string;
discount: string;
promoApplied: boolean;
}
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