Commit 7219db02 by Adarsh K

Merge branch 'arjunlatest' into 'master'

Arjunlatest See merge request !49
parents e46929e7 cf1983f6
...@@ -97,7 +97,9 @@ const routes: Routes = [ ...@@ -97,7 +97,9 @@ const routes: Routes = [
loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule' loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule'
}, { path: 'noresult', loadChildren: './noresult/noresult.module#NoresultPageModule' }, }, { path: 'noresult', loadChildren: './noresult/noresult.module#NoresultPageModule' },
{ path: 'feedback', loadChildren: './feedback/feedback.module#FeedbackPageModule' }, { path: 'feedback', loadChildren: './feedback/feedback.module#FeedbackPageModule' },
{ path: 'address', loadChildren: './address/address.module#AddressPageModule' } { path: 'address', loadChildren: './address/address.module#AddressPageModule' },
{ path: 'success', loadChildren: './success/success.module#SuccessPageModule' },
{ path: 'failed', loadChildren: './failed/failed.module#FailedPageModule' }
]; ];
@NgModule({ @NgModule({
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<h4>CART</h4> <h4>CART</h4>
</div> </div>
<button class="nav_btn floatRight"> <button class="nav_btn floatRight">
</button> </button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
</ul> </ul>
</div> </div>
<div class="cart_content"> <div class="cart_content">
<div class="no-items-wrapper">
<img src="../../assets/noitem.png">
<h1>There is no products added</h1>
<button>Shop Now</button>
</div>
<ion-slides pager="false" [options]="cartwizard" (ionSlideDidChange)="slideChanged()"> <ion-slides pager="false" [options]="cartwizard" (ionSlideDidChange)="slideChanged()">
<ion-slide> <ion-slide>
<div class="cart_list" *ngIf="cartService.carts"> <div class="cart_list" *ngIf="cartService.carts">
...@@ -63,9 +68,10 @@ ...@@ -63,9 +68,10 @@
<div class="checkout_list"> <div class="checkout_list">
<h5> <h5>
<span class="floatLeft">ITEMS</span> <span class="floatLeft">ITEMS</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$ {{cartService.cartTotal}}</span> <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{cartService.cartTotal}}</span>
<div class="clear"></div> <div class="clear"></div>
</h5> </h5>
<ion-grid class="p0" *ngIf="cartService.carts && cartService.carts.length > 0"> <ion-grid 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">
...@@ -89,7 +95,7 @@ ...@@ -89,7 +95,7 @@
<ion-row> <ion-row>
<ion-col class="p0"> <ion-col class="p0">
<h6> <h6>
{{custAddress.building}},<br/> {{custAddress.landmark}},<br/> {{custAddress.address}} {{custAddress.building}},<br /> {{custAddress.landmark}},<br /> {{custAddress.address}}
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
...@@ -149,25 +155,29 @@ ...@@ -149,25 +155,29 @@
<hr> <hr>
<div class="coupon_code"> <div class="coupon_code">
<input class="" placeholder="COUPON CODE" #promo><button class="add_btn" (click)="promoApply(promo.value)">ADD</button> <input class="" placeholder="COUPON CODE" #promo><button class="add_btn" (click)="promoApply(promo.value)">ADD</button>
<br/>&nbsp;<h6>GET50</h6> <br />&nbsp;
<h6>GET50</h6>
<span *ngIf="discountApplied" style="color: red">Promocode applied successfully </span> <span *ngIf="discountApplied" style="color: red">Promocode applied successfully </span>
</div> </div>
<br/> <br />
<h6> <h6>
<span class="floatLeft">PRODUCT COST</span> <span class="floatLeft">PRODUCT COST</span>
<span class="floatRight" *ngIf="cartService.cartTotal">A$ {{cartService.cartTotal}}</span> <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{cartService.cartTotal}}</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$ {{getDeliveryCharge(cartService.cartTotal)}}</span> <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{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$ {{getTax(cartService.cartTotal)}}</span> <span class="floatRight" *ngIf="cartService.cartTotal">A$
{{getTax(cartService.cartTotal)}}</span>
<div class="clear"></div> <div class="clear"></div>
</h6> </h6>
<h6 *ngIf="discountApplied"> <h6 *ngIf="discountApplied">
...@@ -182,7 +192,8 @@ ...@@ -182,7 +192,8 @@
<p class="textLeft">Total Price:</p> <p class="textLeft">Total Price:</p>
</ion-col> </ion-col>
<ion-col> <ion-col>
<p class="textRight" *ngIf="cartService.cartTotal">A$ {{getTotal(cartService.cartTotal)}}</p> <p class="textRight" *ngIf="cartService.cartTotal">A$ {{getTotal(cartService.cartTotal)}}
</p>
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
...@@ -200,6 +211,7 @@ ...@@ -200,6 +211,7 @@
</div> </div>
</ion-slide> </ion-slide>
</ion-slides> </ion-slides>
</div> </div>
</div> </div>
</div> </div>
...@@ -262,5 +274,4 @@ ...@@ -262,5 +274,4 @@
</div> </div>
</ion-content> </ion-content>
</div> </div>
\ No newline at end of file
...@@ -403,6 +403,30 @@ ...@@ -403,6 +403,30 @@
font-weight: 900; font-weight: 900;
} }
} }
.no-items-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;
}
}
} }
} }
} }
......
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 { FailedPage } from './failed.page';
const routes: Routes = [
{
path: '',
component: FailedPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [FailedPage]
})
export class FailedPageModule {}
<ion-content>
<div class="orderfailed-wrapper">
<div class="head">
<img src="../../assets/failed.png">
<h1>Order Failed</h1>
</div>
<div class="content">
<h1>Something went wrong</h1>
<h2>Please check your network or details you <br> provided and try again</h2>
</div>
<button>View Orders</button>
<h3>home</h3>
</div>
</ion-content>
\ No newline at end of file
.orderfailed-wrapper {
padding: 20px;
text-align: center;
.head {
img {
width: 60px;
}
h1 {
font-size: 18px;
text-transform: uppercase;
color: #29285B;
font-weight: bolder;
margin-top: 15px;
}
}
.content {
margin-top: 30px;
h1 {
color: #B0AEC7;
font-weight: bolder;
margin: 0;
font-size: 16px;
}
h2 {
color: #B0AEC7;
margin-top: 5px;
font-size: 16px;
}
}
button {
background-color: #29285b;
border-radius: 8px;
height: 50px;
width: 48%;
color: #fff;
font-size: 18px;
font-weight: lighter;
text-transform: uppercase;
margin-top: 25px;
margin-bottom: 50px;
}
h3 {
color: #29285b;
background: none;
font-size: 20px;
font-weight: bolder;
text-transform: uppercase;
margin-top: 50px;
margin-bottom: 50px;
}
}
\ No newline at end of file
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FailedPage } from './failed.page';
describe('FailedPage', () => {
let component: FailedPage;
let fixture: ComponentFixture<FailedPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FailedPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FailedPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-failed',
templateUrl: './failed.page.html',
styleUrls: ['./failed.page.scss'],
})
export class FailedPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
<div class="nav_header"> <div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()"> <button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png" /> <img src="../assets/Group17_2.png" />
</button> </button>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<input <input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" />
class="search_bar" </div>
placeholder="Search here.. eg:shirts, retailers etc..." <button class="nav_btn nav_search floatRight" *ngIf="!searchShow" (click)="clickSearch()"></button>
(click)="clickSearch()" <button class="nav_btn nav_close floatRight" *ngIf="searchShow" (click)="searchClose()"></button>
/> <div class="clear"></div>
</div>
<button
class="nav_btn nav_search floatRight"
*ngIf="!searchShow"
(click)="clickSearch()"
></button>
<button
class="nav_btn nav_close floatRight"
*ngIf="searchShow"
(click)="searchClose()"
></button>
<div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="product_list">
<div class="product_taskbar"> <div class="product_list">
<div class="filter floatLeft" (click)="istoggle()"></div> <div class="product_taskbar">
<div class="viewset floatRight"> <div class="filter floatLeft" (click)="istoggle()">
<div
class="grid_view grid_act floatRight" </div>
(click)="gridToggle()" <div class="viewset floatRight">
[class.line_view]="onGrid" <div class="grid_view grid_act floatRight" (click)="gridToggle()" [class.line_view]="onGrid">
></div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="product_title" *ngIf="data"> <div class="product_title" *ngIf="data">
{{data.shopName}} {{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">
<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> </div>
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5> <ul [class.grid_view]="onGrid" *ngIf="prodService.product && prodService.product.length > 0">
<p (click)="prodDetails(i)"> <li *ngFor="let product of prodService.product; let i = index">
A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0" <div class="product_image">
>-{{product.discount}}%</span <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)">{{product.prodName}}</h5>
<p (click)="prodDetails(i)">A$ {{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> </p>
</li> </li>
...@@ -114,12 +106,7 @@ ...@@ -114,12 +106,7 @@
</div> </div>
</ion-content> </ion-content>
<div class="search_item_list" *ngIf="searchShow" [@slideInOut]> <div class="search_item_list" *ngIf="searchShow" [@slideInOut]>
<ul *ngIf="searchService.searchList"> <ul *ngIf="searchService.searchList">
<li <li *ngFor="let search of searchService.searchList" (click)="viewPage(search)">{{search.text}}</li>
*ngFor="let search of searchService.searchList" </ul>
(click)="viewPage(search)" </div>
> \ No newline at end of file
{{search.text}}
</li>
</ul>
</div>
...@@ -256,4 +256,11 @@ ...@@ -256,4 +256,11 @@
} }
} }
} }
}
.load-back {
height: 100%;
width: 100%;
background-image: url("../../assets/giphy.gif");
background-position: center;
} }
\ No newline at end of file
<div class="nav_header"> <div class="nav_header">
<ion-menu-toggle> <ion-menu-toggle>
<button class="nav_btn nav_menu floatLeft"></button> <button class="nav_btn nav_menu floatLeft"></button>
</ion-menu-toggle> </ion-menu-toggle>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<img src="../../assets/Group [email protected]" /> <img src="../../assets/Group [email protected]" />
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="profile_wrapper" *ngIf="loggedUser"> <div class="profile_wrapper" *ngIf="loggedUser">
<div class="profile_banner"> <div class="profile_banner">
<!-- <div class="profile_circle"> <!-- <div class="profile_circle">
<div class="edit"></div> <div class="edit"></div>
</div> --> </div> -->
<div class="profile_circle"> <div class="profile_circle">
<img <img [src]="loggedUser.profilePhoto" onerror="this.src='./../../assets/profile_banner.png'" />
[src]="loggedUser.profilePhoto" <div class="edit"></div>
onerror="this.src='./../../assets/profile_banner.png'" <input type="file" accept="image/*" (change)="fileChange($event)" />
/> </div>
<div class="edit"></div>
<input type="file" accept="image/*" (change)="fileChange($event)" />
</div>
<h5>{{loggedUser.name}}</h5> <h5>{{loggedUser.name}}</h5>
<p (click)="istoggle()">LOGOUT</p> <p (click)="istoggle()">LOGOUT</p>
</div> </div>
<div class="account_wrapper"> <div class="account_wrapper">
<div class="account_header"> <div class="account_header">
<h5 class="floatLeft">ACCOUNT INFORMATION</h5> <h5 class="floatLeft">ACCOUNT INFORMATION</h5>
<span <span class="floatRight" (click)="goToPage('changedetails', user && user)"><img
class="floatRight" src="../../assets/edit.png" /></span>
(click)="goToPage('changedetails', user && user)" <div class="clear"></div>
><img src="../../assets/edit.png" </div>
/></span> <div class="row">
<div class="clear"></div> <ion-row>
</div> <ion-col class="textLeft p0">
<div class="row"> <p>
<ion-row> Phone
<ion-col class="textLeft p0"> <span *ngIf="loggedUser.phoneVerified == true">Verified</span>
<p> <span *ngIf="loggedUser.phoneVerified == false">Not Verified yet</span>
Phone </p>
<span *ngIf="loggedUser.phoneVerified == true">Verified</span> </ion-col>
<span *ngIf="loggedUser.phoneVerified == false" <ion-col class="textRight p0">
>Not Verified yet</span <h6>{{loggedUser.phone}}</h6>
> </ion-col>
</p> </ion-row>
</ion-col> </div>
<ion-col class="textRight p0"> <div class="row">
<h6>{{loggedUser.phone}}</h6> <ion-row>
</ion-col> <ion-col class="textLeft p0">
</ion-row> <p>
</div> Email<span *ngIf="userData && userData.emailVerified == true">Verified</span>
<div class="row"> <span *ngIf="loggedUser.emailVerified == false">Not Verified yet</span>
<ion-row> </p>
<ion-col class="textLeft p0"> </ion-col>
<p> <ion-col class="textRight p0">
Email<span *ngIf="userData && userData.emailVerified == true" <h6>{{loggedUser.emailId}}</h6>
>Verified</span </ion-col>
> </ion-row>
<span *ngIf="loggedUser.emailVerified == false" </div>
>Not Verified yet</span <hr />
> <ion-row>
</p> <ion-col class="textLeft p0">
</ion-col> <p>Wishlist</p>
<ion-col class="textRight p0"> </ion-col>
<h6>{{loggedUser.emailId}}</h6> <ion-col class="textRight p0">
</ion-col> <h6>(3)</h6>
</ion-row> </ion-col>
</div> </ion-row>
<hr /> <hr />
<ion-row> <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>Wishlist</p> <p>Address</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('wishlist')"> <ion-col class="textRight p0">
<h6>(3)</h6> <h6>(1)</h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> <hr />
<ion-row> <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>Address</p> <p>My Cards</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('address')"> <ion-col class="textRight p0">
<h6 *ngIf="addressService.addList"> <h6>
({{addressService.addressList.length}}) <ion-icon name="arrow-forward"></ion-icon>
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> <hr />
<!-- <ion-row> <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>My Cards</p> <p>My Order</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('addcard')"> <ion-col class="textRight p0" (click)="goToPage('myorder')">
<h6> <h6>
<ion-icon name="arrow-forward"></ion-icon> <ion-icon name="arrow-forward"></ion-icon>
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> --> <hr />
<ion-row> <ion-row>
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>My Order</p> <p>Currency</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('myorder')"> <ion-col class="textRight p0">
<h6> <h6>
<ion-icon name="arrow-forward"></ion-icon> <span>AUD</span>
</h6> </h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> </div>
<ion-row> <div class="logout-pop-wrapper" *ngIf="isShow" [@slideInOut]>
<ion-col class="textLeft p0"> <div class="logout_inner">
<p>Currency</p> <h4>Logout</h4>
</ion-col> <p>Are you sure to Logout ?</p>
<ion-col class="textRight p0"> <div class="logout_footer">
<h6> <button class="btn-cancel floatLeft" (click)="istoggle();">
<span>AUD</span> Cancel
</h6> </button>
</ion-col> <button class="btn-logout floatRight" (click)="authService.SignOut(); istoggle()">
</ion-row> Logout
</div> </button>
</div>
<div class="logout-pop-wrapper" *ngIf="isShow" [@slideInOut]>
<div class="logout_inner">
<h4>Logout</h4>
<p>Are you sure to Logout ?</p>
<div class="logout_footer">
<button class="btn-cancel floatLeft" (click)="istoggle();">
Cancel
</button>
<button
class="btn-logout floatRight"
(click)="authService.SignOut(); istoggle()"
>
Logout
</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div>
</div>
</div>
</div> </div>
</div> </ion-content>
</ion-content> \ No newline at end of file
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 { SuccessPage } from './success.page';
const routes: Routes = [
{
path: '',
component: SuccessPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [SuccessPage]
})
export class SuccessPageModule {}
<ion-content>
<div class="success_wrapper">
<div class="cart_head">
<div class="cart_menu_header">
<ul>
<li class="textCenter active">CART</li>
<li class="textCenter">
<hr>
</li>
<li class="textCenter">CHECKOUT</li>
<li class="textCenter">
<hr>
</li>
<li class="textCenter">FINISH</li>
</ul>
</div>
<div class="success-set">
<img src="../../assets/white_tick.png">
<h1>Order is placed</h1>
<h2>June 26th 2019, 03:00 PM</h2>
</div>
</div>
<div class="product-countdown">
<h1>The product will be delivered in</h1>
<h2>00:59<span>30</span></h2>
<button>View Orders</button>
<h3>home</h3>
</div>
</div>
</ion-content>
\ No newline at end of file
.success_wrapper {
width: 100%;
.cart_head {
width: 100%;
height: auto;
background-image: url("../../assets/[email protected]");
background-position: center bottom;
background-repeat: no-repeat;
background-size: cover;
padding-bottom: 35px;
.nav_header {
position: static;
background-color: transparent;
.nav_title {
h4 {
color: #FFF;
}
}
}
.cart_menu_header {
padding: 50px 20px 20px 20px;
ul {
margin: 0px;
padding: 10px;
background-color: rgba(273, 273, 273, 0.1);
border-radius: 10px;
li {
list-style: none;
color: #FFF;
width: 20%;
display: inline-block;
font-weight: 700;
font-size: 13px;
hr {
height: 0px;
border-top: none;
width: 90%;
margin-top: 0px;
margin-bottom: 0px;
position: relative;
margin: 0 auto;
border-bottom: 2px dashed rgba(176, 174, 199, 1);
bottom: 4px;
}
}
}
}
.success-set {
text-align: center;
margin-top: 50px;
img {
width: 75px;
}
h1 {
color: #fff;
font-size: 18px;
font-weight: bolder;
margin-top: 5px;
margin-bottom: 0;
text-transform: uppercase;
}
h2 {
color: #fff;
font-size: 12px;
font-weight: lighter;
margin-top: 2px;
}
}
}
.product-countdown {
padding: 20px;
text-align: center;
margin-top: 25px;
h1 {
color: #B0AEC7;
font-size: 16px;
margin-top: 10px;
}
h2 {
color: #3B394D;
font-size: 40px;
font-weight: bolder;
margin-top: 15px;
span {
font-size: 16px;
font-weight: lighter;
}
}
button {
background-color: #29285b;
border-radius: 8px;
height: 50px;
width: 48%;
color: #fff;
font-size: 18px;
font-weight: lighter;
text-transform: uppercase;
margin-top: 25px;
margin-bottom: 50px;
}
h3 {
color: #29285b;
background: none;
font-size: 20px;
font-weight: bolder;
text-transform: uppercase;
margin-top: 20px;
margin-bottom: 50px;
}
}
}
@media only screen and (max-width: 350px) {
.cart_head {
padding-bottom: 15px !important;
.cart_menu_header {
padding: 20px !important;
ul {
li {
font-size: 12px !important;
}
}
}
.success-set {
margin-top: 0 !important;
}
}
}
\ No newline at end of file
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SuccessPage } from './success.page';
describe('SuccessPage', () => {
let component: SuccessPage;
let fixture: ComponentFixture<SuccessPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SuccessPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SuccessPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-success',
templateUrl: './success.page.html',
styleUrls: ['./success.page.scss'],
})
export class SuccessPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { User, Signup, Address } from './services/user'; import { User, Signup, Address } from "./services/user";
import { auth } from 'firebase/app'; import { auth } from "firebase/app";
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from "@angular/router";
import { AngularFireAuth } from '@angular/fire/auth'; import { AngularFireAuth } from "@angular/fire/auth";
import { import {
AngularFirestore, AngularFirestore,
AngularFirestoreDocument, AngularFirestoreDocument,
AngularFirestoreCollection AngularFirestoreCollection
} from '@angular/fire/firestore'; } from "@angular/fire/firestore";
import { ServiceService } from './../config/service.service'; import { ServiceService } from "./../config/service.service";
import { SubjectService } from './../config/subject.service'; import { SubjectService } from "./../config/subject.service";
import { GooglePlus } from '@ionic-native/google-plus/ngx'; import { GooglePlus } from "@ionic-native/google-plus/ngx";
import { take } from 'rxjs/operators'; import { take } from "rxjs/operators";
import { from } from 'rxjs'; import { from } from "rxjs";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class AuthService { export class AuthService {
constructor( constructor(
...@@ -32,24 +32,24 @@ export class AuthService { ...@@ -32,24 +32,24 @@ export class AuthService {
this.subjectService.sendLoginData(false); this.subjectService.sendLoginData(false);
this.userData = user; this.userData = user;
console.log(this.userData); console.log(this.userData);
this.service.set('user', JSON.stringify(this.userData)); this.service.set("user", JSON.stringify(this.userData));
this.SetUserData(user); this.SetUserData(user);
if (this.type === 1) { if (this.type === 1) {
this.router.navigateByUrl('home'); this.router.navigateByUrl("home");
} else { } else {
this.router.navigateByUrl('verification'); this.router.navigateByUrl("verification");
} }
} else { } else {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.service.set('user', null); this.service.set("user", null);
JSON.parse(localStorage.getItem('user')); JSON.parse(localStorage.getItem("user"));
this.router.navigateByUrl('login'); this.router.navigateByUrl("login");
} }
}); });
} }
get isLoggedIn(): boolean { get isLoggedIn(): boolean {
const user = JSON.parse(localStorage.getItem('user')); const user = JSON.parse(localStorage.getItem("user"));
return user !== null && user.emailVerified !== false ? true : false; return user !== null && user.emailVerified !== false ? true : false;
} }
userData: any; userData: any;
...@@ -62,7 +62,7 @@ export class AuthService { ...@@ -62,7 +62,7 @@ export class AuthService {
return this.afAuth.auth return this.afAuth.auth
.signInWithEmailAndPassword(email, password) .signInWithEmailAndPassword(email, password)
.then(result => { .then(result => {
console.log('success'); console.log("success");
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
this.SetUserData(result.user); this.SetUserData(result.user);
}) })
...@@ -76,8 +76,8 @@ export class AuthService { ...@@ -76,8 +76,8 @@ export class AuthService {
// tslint:disable-next-line:radix // tslint:disable-next-line:radix
// const otpnew = parseInt(otp); // const otpnew = parseInt(otp);
const custRef: AngularFirestoreCollection<any> = this.afs.collection( const custRef: AngularFirestoreCollection<any> = this.afs.collection(
'customers', "customers",
ref => ref.where('otp', '==', otp).where('uid', '==', this.userData.uid) ref => ref.where("otp", "==", otp).where("uid", "==", this.userData.uid)
); );
custRef custRef
.valueChanges() .valueChanges()
...@@ -85,20 +85,20 @@ export class AuthService { ...@@ -85,20 +85,20 @@ export class AuthService {
.subscribe((value: User[]) => { .subscribe((value: User[]) => {
if (value.length > 0) { if (value.length > 0) {
this.afs this.afs
.collection('customers') .collection("customers")
.doc(this.userData.uid) .doc(this.userData.uid)
.update({ otp: '', phoneVerified: true }); .update({ otp: "", phoneVerified: true });
this.service.set('type', 1); this.service.set("type", 1);
this.router.navigateByUrl('nearby'); this.router.navigateByUrl("nearby");
} else { } else {
window.alert('Please input valid OTP'); window.alert("Please input valid OTP");
} }
}); });
} }
profilePic(pic) { profilePic(pic) {
this.afs this.afs
.collection('customers') .collection("customers")
.doc(this.userData.uid) .doc(this.userData.uid)
.update({ profilePhoto: pic }); .update({ profilePhoto: pic });
} }
...@@ -109,7 +109,7 @@ export class AuthService { ...@@ -109,7 +109,7 @@ export class AuthService {
this.afAuth.auth this.afAuth.auth
.signInWithPopup(new auth.GoogleAuthProvider()) .signInWithPopup(new auth.GoogleAuthProvider())
.then(result => { .then(result => {
console.log('success'); console.log("success");
console.log(result.additionalUserInfo.isNewUser); console.log(result.additionalUserInfo.isNewUser);
if ( if (
result.additionalUserInfo && result.additionalUserInfo &&
...@@ -125,7 +125,7 @@ export class AuthService { ...@@ -125,7 +125,7 @@ export class AuthService {
this.afAuth.auth this.afAuth.auth
.signInWithPopup(new auth.FacebookAuthProvider()) .signInWithPopup(new auth.FacebookAuthProvider())
.then(result => { .then(result => {
console.log('success'); console.log("success");
console.log(result); console.log(result);
}); });
} }
...@@ -149,7 +149,7 @@ export class AuthService { ...@@ -149,7 +149,7 @@ export class AuthService {
loginType: value.loginType loginType: value.loginType
}; };
this.loggedUser = userData; this.loggedUser = userData;
this.service.set('userData', JSON.stringify(this.loggedUser)); this.service.set("userData", JSON.stringify(this.loggedUser));
this.subjectService.sendUserData(JSON.stringify(this.loggedUser)); this.subjectService.sendUserData(JSON.stringify(this.loggedUser));
console.log(this.loggedUser); console.log(this.loggedUser);
}); });
...@@ -158,8 +158,8 @@ export class AuthService { ...@@ -158,8 +158,8 @@ export class AuthService {
public async SignOut() { public async SignOut() {
return this.afAuth.auth.signOut().then(() => { return this.afAuth.auth.signOut().then(() => {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.service.remove('user'); this.service.remove("user");
console.log('logout'); console.log("logout");
}); });
} }
...@@ -167,9 +167,9 @@ export class AuthService { ...@@ -167,9 +167,9 @@ export class AuthService {
this.type = 2; this.type = 2;
console.log(userData.user); console.log(userData.user);
const currencyData = { const currencyData = {
currId: '123', currId: "123",
currName: 'Australian dollar', currName: "Australian dollar",
symbol: 'A$' symbol: "A$"
}; };
const otp = Math.floor(1000 + Math.random() * 9000); const otp = Math.floor(1000 + Math.random() * 9000);
userData = userData.user; userData = userData.user;
...@@ -189,11 +189,11 @@ export class AuthService { ...@@ -189,11 +189,11 @@ export class AuthService {
this.userPostData = postData; this.userPostData = postData;
console.log(postData); console.log(postData);
this.afs this.afs
.collection('customers') .collection("customers")
.doc(userData.uid) .doc(userData.uid)
.set(postData) .set(postData)
.then(() => { .then(() => {
console.log('successs'); console.log("successs");
}); });
} }
...@@ -207,15 +207,15 @@ export class AuthService { ...@@ -207,15 +207,15 @@ export class AuthService {
console.log(result.user); console.log(result.user);
this.afAuth.auth.currentUser.sendEmailVerification(); this.afAuth.auth.currentUser.sendEmailVerification();
const currencyData = { const currencyData = {
currId: '123', currId: "123",
currName: 'Australian dollar', currName: "Australian dollar",
symbol: 'A$' symbol: "A$"
}; };
const custData = result.user; const custData = result.user;
const postData: User = { const postData: User = {
uid: custData.uid, uid: custData.uid,
status: true, status: true,
profilePhoto: '', profilePhoto: "",
phoneVerified: false, phoneVerified: false,
phone: userData.phone, phone: userData.phone,
name: userData.name, name: userData.name,
...@@ -228,11 +228,11 @@ export class AuthService { ...@@ -228,11 +228,11 @@ export class AuthService {
this.userPostData = postData; this.userPostData = postData;
console.log(postData); console.log(postData);
this.afs this.afs
.collection('customers') .collection("customers")
.doc(custData.uid) .doc(custData.uid)
.set(postData) .set(postData)
.then(() => { .then(() => {
console.log('successs'); console.log("successs");
}); });
}) })
.catch(error => { .catch(error => {
...@@ -245,7 +245,7 @@ export class AuthService { ...@@ -245,7 +245,7 @@ export class AuthService {
console.log(this.userData.uid); console.log(this.userData.uid);
this.afs this.afs
.collection('address') .collection("address")
.add({ .add({
uid: this.userData.uid uid: this.userData.uid
}) })
...@@ -269,13 +269,13 @@ export class AuthService { ...@@ -269,13 +269,13 @@ export class AuthService {
const neworderId = docRef.id; const neworderId = docRef.id;
console.log(addrData); console.log(addrData);
this.afs this.afs
.collection('address') .collection("address")
.doc(neworderId) .doc(neworderId)
.set(addrData) .set(addrData)
.then(() => { .then(() => {
console.log('Address add Successfully'); console.log("Address add Successfully");
this.service.set('user', JSON.stringify(this.userData)); this.service.set("user", JSON.stringify(this.userData));
this.router.navigateByUrl('home'); this.router.navigateByUrl("home");
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
}); });
}); });
......
...@@ -416,6 +416,10 @@ app-deliverypop { ...@@ -416,6 +416,10 @@ app-deliverypop {
padding: 0px !important; padding: 0px !important;
} }
app-success {
padding: 0px !important;
}
.nav_header { .nav_header {
position: fixed; position: fixed;
top: 0px; top: 0px;
......
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