diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 00ca5f1..24de202 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -97,7 +97,9 @@ const routes: Routes = [ loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule' }, { path: 'noresult', loadChildren: './noresult/noresult.module#NoresultPageModule' }, { 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({ diff --git a/src/app/cart/cart.page.html b/src/app/cart/cart.page.html index d14227e..dd39103 100644 --- a/src/app/cart/cart.page.html +++ b/src/app/cart/cart.page.html @@ -9,7 +9,7 @@ <h4>CART</h4> </div> <button class="nav_btn floatRight"> - + </button> <div class="clear"></div> </div> @@ -27,6 +27,11 @@ </ul> </div> <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-slide> <div class="cart_list" *ngIf="cartService.carts"> @@ -63,9 +68,10 @@ <div class="checkout_list"> <h5> <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> - </h5> + </h5> <ion-grid class="p0" *ngIf="cartService.carts && cartService.carts.length > 0"> <ion-row *ngFor="let carts of cartService.carts"> <ion-col size="6" class="p0"> @@ -89,7 +95,7 @@ <ion-row> <ion-col class="p0"> <h6> - {{custAddress.building}},<br/> {{custAddress.landmark}},<br/> {{custAddress.address}} + {{custAddress.building}},<br /> {{custAddress.landmark}},<br /> {{custAddress.address}} </h6> </ion-col> </ion-row> @@ -149,25 +155,29 @@ <hr> <div class="coupon_code"> <input class="" placeholder="COUPON CODE" #promo><button class="add_btn" (click)="promoApply(promo.value)">ADD</button> - <br/> <h6>GET50</h6> + <br /> + <h6>GET50</h6> <span *ngIf="discountApplied" style="color: red">Promocode applied successfully </span> </div> - <br/> + <br /> <h6> <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> </h6> <h6> <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> </h6> <h6> <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> </h6> <h6 *ngIf="discountApplied"> @@ -182,7 +192,8 @@ <p class="textLeft">Total Price:</p> </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-row> </div> @@ -200,6 +211,7 @@ </div> </ion-slide> </ion-slides> + </div> </div> </div> @@ -262,5 +274,4 @@ </div> </ion-content> -</div> - +</div> \ No newline at end of file diff --git a/src/app/cart/cart.page.scss b/src/app/cart/cart.page.scss index 41b030a..7532a9f 100644 --- a/src/app/cart/cart.page.scss +++ b/src/app/cart/cart.page.scss @@ -403,6 +403,30 @@ 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; + } + } } } } diff --git a/src/app/failed/failed.module.ts b/src/app/failed/failed.module.ts new file mode 100644 index 0000000..7c72513 --- /dev/null +++ b/src/app/failed/failed.module.ts @@ -0,0 +1,26 @@ +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 {} diff --git a/src/app/failed/failed.page.html b/src/app/failed/failed.page.html new file mode 100644 index 0000000..eb1686c --- /dev/null +++ b/src/app/failed/failed.page.html @@ -0,0 +1,15 @@ +<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 diff --git a/src/app/failed/failed.page.scss b/src/app/failed/failed.page.scss new file mode 100644 index 0000000..ff912d3 --- /dev/null +++ b/src/app/failed/failed.page.scss @@ -0,0 +1,51 @@ +.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 diff --git a/src/app/failed/failed.page.spec.ts b/src/app/failed/failed.page.spec.ts new file mode 100644 index 0000000..e0f94bc --- /dev/null +++ b/src/app/failed/failed.page.spec.ts @@ -0,0 +1,27 @@ +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(); + }); +}); diff --git a/src/app/failed/failed.page.ts b/src/app/failed/failed.page.ts new file mode 100644 index 0000000..2fd7024 --- /dev/null +++ b/src/app/failed/failed.page.ts @@ -0,0 +1,15 @@ +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() { + } + +} diff --git a/src/app/productlist/productlist.page.html b/src/app/productlist/productlist.page.html index a9dbffb..8eec863 100644 --- a/src/app/productlist/productlist.page.html +++ b/src/app/productlist/productlist.page.html @@ -1,64 +1,56 @@ <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" /> </button> - <div class="nav_title floatLeft"> - <input - class="search_bar" - placeholder="Search here.. eg:shirts, retailers etc..." - (click)="clickSearch()" - /> - </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 class="nav_title floatLeft"> + <input class="search_bar" placeholder="Search here.. eg:shirts, retailers etc..." (click)="clickSearch()" /> + </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> <ion-content> - <div class="product_list"> - <div class="product_taskbar"> - <div class="filter floatLeft" (click)="istoggle()"></div> - <div class="viewset floatRight"> - <div - class="grid_view grid_act floatRight" - (click)="gridToggle()" - [class.line_view]="onGrid" - ></div> - <div class="clear"></div> - </div> - <div class="clear"></div> - </div> - <div class="product_title" *ngIf="data"> - {{data.shopName}} - </div> - <ul - [class.grid_view]="onGrid" - *ngIf="prodService.product && prodService.product.length > 0" - > - <li *ngFor="let product of prodService.product; let i = index"> - <div class="product_image"> - <img - [src]="product.image" - onerror="this.src='../assets/model1@3x.png'" - (click)="prodDetails(i)" - /> - <div - [ngClass]="checkFavStatus(product.prodId)" - (click)="changeFav(product.prodId)" - ></div> - <div class="featured_badge" *ngIf="product.featured">Featured</div> + + <div class="product_list"> + <div class="product_taskbar"> + <div class="filter floatLeft" (click)="istoggle()"> + + </div> + <div class="viewset floatRight"> + <div class="grid_view grid_act floatRight" (click)="gridToggle()" [class.line_view]="onGrid"> + </div> + <div class="clear"></div> + </div> + <div class="clear"></div> + </div> + <div class="product_title" *ngIf="data"> + {{data.shopName}} </div> - <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 + <ul [class.grid_view]="onGrid" *ngIf="prodService.product && prodService.product.length > 0"> + <li *ngFor="let product of prodService.product; let i = index"> + <div class="product_image"> + <div class="load-back"> + <img [src]="product.image" onerror="this.src='../assets/model1@3x.png'" (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/model1@3x.png'" (click)="prodDetails(i)" /> + <div [ngClass]="checkFavStatus(product.prodId)" (click)="changeFav(product.prodId)"></div> + <div class="featured_badge" *ngIf="product.featured">Featured</div> + </div> + <h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5> + <p (click)="prodDetails(i)"> + A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0">-{{product.discount}}%</span > </p> </li> @@ -114,12 +106,7 @@ </div> </ion-content> <div class="search_item_list" *ngIf="searchShow" [@slideInOut]> - <ul *ngIf="searchService.searchList"> - <li - *ngFor="let search of searchService.searchList" - (click)="viewPage(search)" - > - {{search.text}} - </li> - </ul> -</div> + <ul *ngIf="searchService.searchList"> + <li *ngFor="let search of searchService.searchList" (click)="viewPage(search)">{{search.text}}</li> + </ul> +</div> \ No newline at end of file diff --git a/src/app/productlist/productlist.page.scss b/src/app/productlist/productlist.page.scss index b8db934..064cf9d 100644 --- a/src/app/productlist/productlist.page.scss +++ b/src/app/productlist/productlist.page.scss @@ -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 diff --git a/src/app/profile/profile.page.html b/src/app/profile/profile.page.html index 0cc4c3d..6045011 100644 --- a/src/app/profile/profile.page.html +++ b/src/app/profile/profile.page.html @@ -1,146 +1,132 @@ <div class="nav_header"> - <ion-menu-toggle> - <button class="nav_btn nav_menu floatLeft"></button> - </ion-menu-toggle> - <div class="nav_title floatLeft"> - <img src="../../assets/Group 11@3x.png" /> - </div> - <div class="clear"></div> + <ion-menu-toggle> + <button class="nav_btn nav_menu floatLeft"></button> + </ion-menu-toggle> + <div class="nav_title floatLeft"> + <img src="../../assets/Group 11@3x.png" /> + </div> + <div class="clear"></div> </div> + + <ion-content> - <div class="profile_wrapper" *ngIf="loggedUser"> - <div class="profile_banner"> - <!-- <div class="profile_circle"> + <div class="profile_wrapper" *ngIf="loggedUser"> + <div class="profile_banner"> + <!-- <div class="profile_circle"> <div class="edit"></div> </div> --> - <div class="profile_circle"> - <img - [src]="loggedUser.profilePhoto" - onerror="this.src='./../../assets/profile_banner.png'" - /> - <div class="edit"></div> - <input type="file" accept="image/*" (change)="fileChange($event)" /> - </div> + <div class="profile_circle"> + <img [src]="loggedUser.profilePhoto" onerror="this.src='./../../assets/profile_banner.png'" /> + <div class="edit"></div> + <input type="file" accept="image/*" (change)="fileChange($event)" /> + </div> - <h5>{{loggedUser.name}}</h5> - <p (click)="istoggle()">LOGOUT</p> - </div> - <div class="account_wrapper"> - <div class="account_header"> - <h5 class="floatLeft">ACCOUNT INFORMATION</h5> - <span - class="floatRight" - (click)="goToPage('changedetails', user && user)" - ><img src="../../assets/edit.png" - /></span> - <div class="clear"></div> - </div> - <div class="row"> - <ion-row> - <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> - </ion-col> - </ion-row> - </div> - <div class="row"> - <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 - > - </p> - </ion-col> - <ion-col class="textRight p0"> - <h6>{{loggedUser.emailId}}</h6> - </ion-col> - </ion-row> - </div> - <hr /> - <ion-row> - <ion-col class="textLeft p0"> - <p>Wishlist</p> - </ion-col> - <ion-col class="textRight p0" (click)="goToPage('wishlist')"> - <h6>(3)</h6> - </ion-col> - </ion-row> - <hr /> - <ion-row> - <ion-col class="textLeft p0"> - <p>Address</p> - </ion-col> - <ion-col class="textRight p0" (click)="goToPage('address')"> - <h6 *ngIf="addressService.addList"> - ({{addressService.addressList.length}}) - </h6> - </ion-col> - </ion-row> - <hr /> - <!-- <ion-row> - <ion-col class="textLeft p0"> - <p>My Cards</p> - </ion-col> - <ion-col class="textRight p0" (click)="goToPage('addcard')"> - <h6> - <ion-icon name="arrow-forward"></ion-icon> - </h6> - </ion-col> - </ion-row> - <hr /> --> - <ion-row> - <ion-col class="textLeft p0"> - <p>My Order</p> - </ion-col> - <ion-col class="textRight p0" (click)="goToPage('myorder')"> - <h6> - <ion-icon name="arrow-forward"></ion-icon> - </h6> - </ion-col> - </ion-row> - <hr /> - <ion-row> - <ion-col class="textLeft p0"> - <p>Currency</p> - </ion-col> - <ion-col class="textRight p0"> - <h6> - <span>AUD</span> - </h6> - </ion-col> - </ion-row> - </div> - </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> + <h5>{{loggedUser.name}}</h5> + <p (click)="istoggle()">LOGOUT</p> + </div> + <div class="account_wrapper"> + <div class="account_header"> + <h5 class="floatLeft">ACCOUNT INFORMATION</h5> + <span class="floatRight" (click)="goToPage('changedetails', user && user)"><img + src="../../assets/edit.png" /></span> + <div class="clear"></div> + </div> + <div class="row"> + <ion-row> + <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> + </ion-col> + </ion-row> + </div> + <div class="row"> + <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> + </p> + </ion-col> + <ion-col class="textRight p0"> + <h6>{{loggedUser.emailId}}</h6> + </ion-col> + </ion-row> + </div> + <hr /> + <ion-row> + <ion-col class="textLeft p0"> + <p>Wishlist</p> + </ion-col> + <ion-col class="textRight p0"> + <h6>(3)</h6> + </ion-col> + </ion-row> + <hr /> + <ion-row> + <ion-col class="textLeft p0"> + <p>Address</p> + </ion-col> + <ion-col class="textRight p0"> + <h6>(1)</h6> + </ion-col> + </ion-row> + <hr /> + <ion-row> + <ion-col class="textLeft p0"> + <p>My Cards</p> + </ion-col> + <ion-col class="textRight p0"> + <h6> + <ion-icon name="arrow-forward"></ion-icon> + </h6> + </ion-col> + </ion-row> + <hr /> + <ion-row> + <ion-col class="textLeft p0"> + <p>My Order</p> + </ion-col> + <ion-col class="textRight p0" (click)="goToPage('myorder')"> + <h6> + <ion-icon name="arrow-forward"></ion-icon> + </h6> + </ion-col> + </ion-row> + <hr /> + <ion-row> + <ion-col class="textLeft p0"> + <p>Currency</p> + </ion-col> + <ion-col class="textRight p0"> + <h6> + <span>AUD</span> + </h6> + </ion-col> + </ion-row> + </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> + <div class="clear"></div> + </div> + </div> + </div> + </div> </div> - </div> -</ion-content> +</ion-content> \ No newline at end of file diff --git a/src/app/profile/profile.page.scss b/src/app/profile/profile.page.scss index 7e01108..0230ad1 100644 --- a/src/app/profile/profile.page.scss +++ b/src/app/profile/profile.page.scss @@ -1,176 +1,176 @@ - .profile_wrapper { - .profile_banner { +.profile_wrapper { + .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; - 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; - } - } - .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); - } - } - .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; - } + height: 100%; + object-fit: cover; + object-position: center; + border-radius: 50%; } - .logout-pop-wrapper { - height: 100vh; - width: 100%; - position: fixed; + input { + width: 80px; + height: 100%; + opacity: 0; + cursor: pointer; + position: absolute; 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; + } + .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; + } + } + .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); + } + } + .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; + } + .btn-cancel { + border: 1px solid #29285B; + background-color: #29285B; + } + .btn-logout { 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; - } - } + border: 1px solid rgba(0, 0, 0, 0.16); + color: #000; } } - } \ No newline at end of file + } + } +} \ No newline at end of file diff --git a/src/app/success/success.module.ts b/src/app/success/success.module.ts new file mode 100644 index 0000000..292b585 --- /dev/null +++ b/src/app/success/success.module.ts @@ -0,0 +1,26 @@ +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 {} diff --git a/src/app/success/success.page.html b/src/app/success/success.page.html new file mode 100644 index 0000000..ef9bbf4 --- /dev/null +++ b/src/app/success/success.page.html @@ -0,0 +1,31 @@ +<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 diff --git a/src/app/success/success.page.scss b/src/app/success/success.page.scss new file mode 100644 index 0000000..bd98f76 --- /dev/null +++ b/src/app/success/success.page.scss @@ -0,0 +1,128 @@ +.success_wrapper { + width: 100%; + .cart_head { + width: 100%; + height: auto; + background-image: url("../../assets/Group63@3x.png"); + 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 diff --git a/src/app/success/success.page.spec.ts b/src/app/success/success.page.spec.ts new file mode 100644 index 0000000..34bdc18 --- /dev/null +++ b/src/app/success/success.page.spec.ts @@ -0,0 +1,27 @@ +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(); + }); +}); diff --git a/src/app/success/success.page.ts b/src/app/success/success.page.ts new file mode 100644 index 0000000..aca47e8 --- /dev/null +++ b/src/app/success/success.page.ts @@ -0,0 +1,15 @@ +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() { + } + +} diff --git a/src/assets/failed.png b/src/assets/failed.png new file mode 100644 index 0000000..2846241 Binary files /dev/null and b/src/assets/failed.png differ diff --git a/src/assets/giphy.gif b/src/assets/giphy.gif new file mode 100644 index 0000000..7a880b3 Binary files /dev/null and b/src/assets/giphy.gif differ diff --git a/src/config/auth.service.ts b/src/config/auth.service.ts index 1a6a864..5d3c968 100644 --- a/src/config/auth.service.ts +++ b/src/config/auth.service.ts @@ -1,21 +1,21 @@ -import { Injectable } from '@angular/core'; -import { User, Signup, Address } from './services/user'; -import { auth } from 'firebase/app'; -import { Router, ActivatedRoute } from '@angular/router'; -import { AngularFireAuth } from '@angular/fire/auth'; +import { Injectable } from "@angular/core"; +import { User, Signup, Address } from "./services/user"; +import { auth } from "firebase/app"; +import { Router, ActivatedRoute } from "@angular/router"; +import { AngularFireAuth } from "@angular/fire/auth"; import { AngularFirestore, AngularFirestoreDocument, AngularFirestoreCollection -} from '@angular/fire/firestore'; -import { ServiceService } from './../config/service.service'; -import { SubjectService } from './../config/subject.service'; -import { GooglePlus } from '@ionic-native/google-plus/ngx'; -import { take } from 'rxjs/operators'; -import { from } from 'rxjs'; +} from "@angular/fire/firestore"; +import { ServiceService } from "./../config/service.service"; +import { SubjectService } from "./../config/subject.service"; +import { GooglePlus } from "@ionic-native/google-plus/ngx"; +import { take } from "rxjs/operators"; +import { from } from "rxjs"; @Injectable({ - providedIn: 'root' + providedIn: "root" }) export class AuthService { constructor( @@ -32,24 +32,24 @@ export class AuthService { this.subjectService.sendLoginData(false); this.userData = user; console.log(this.userData); - this.service.set('user', JSON.stringify(this.userData)); + this.service.set("user", JSON.stringify(this.userData)); this.SetUserData(user); if (this.type === 1) { - this.router.navigateByUrl('home'); + this.router.navigateByUrl("home"); } else { - this.router.navigateByUrl('verification'); + this.router.navigateByUrl("verification"); } } else { this.subjectService.sendLoginData(true); - this.service.set('user', null); - JSON.parse(localStorage.getItem('user')); - this.router.navigateByUrl('login'); + this.service.set("user", null); + JSON.parse(localStorage.getItem("user")); + this.router.navigateByUrl("login"); } }); } 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; } userData: any; @@ -62,7 +62,7 @@ export class AuthService { return this.afAuth.auth .signInWithEmailAndPassword(email, password) .then(result => { - console.log('success'); + console.log("success"); document.body.scrollTop = document.documentElement.scrollTop = 0; this.SetUserData(result.user); }) @@ -76,8 +76,8 @@ export class AuthService { // tslint:disable-next-line:radix // const otpnew = parseInt(otp); const custRef: AngularFirestoreCollection<any> = this.afs.collection( - 'customers', - ref => ref.where('otp', '==', otp).where('uid', '==', this.userData.uid) + "customers", + ref => ref.where("otp", "==", otp).where("uid", "==", this.userData.uid) ); custRef .valueChanges() @@ -85,20 +85,20 @@ export class AuthService { .subscribe((value: User[]) => { if (value.length > 0) { this.afs - .collection('customers') + .collection("customers") .doc(this.userData.uid) - .update({ otp: '', phoneVerified: true }); - this.service.set('type', 1); - this.router.navigateByUrl('nearby'); + .update({ otp: "", phoneVerified: true }); + this.service.set("type", 1); + this.router.navigateByUrl("nearby"); } else { - window.alert('Please input valid OTP'); + window.alert("Please input valid OTP"); } }); } profilePic(pic) { this.afs - .collection('customers') + .collection("customers") .doc(this.userData.uid) .update({ profilePhoto: pic }); } @@ -109,7 +109,7 @@ export class AuthService { this.afAuth.auth .signInWithPopup(new auth.GoogleAuthProvider()) .then(result => { - console.log('success'); + console.log("success"); console.log(result.additionalUserInfo.isNewUser); if ( result.additionalUserInfo && @@ -125,7 +125,7 @@ export class AuthService { this.afAuth.auth .signInWithPopup(new auth.FacebookAuthProvider()) .then(result => { - console.log('success'); + console.log("success"); console.log(result); }); } @@ -149,7 +149,7 @@ export class AuthService { loginType: value.loginType }; 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)); console.log(this.loggedUser); }); @@ -158,8 +158,8 @@ export class AuthService { public async SignOut() { return this.afAuth.auth.signOut().then(() => { this.subjectService.sendLoginData(true); - this.service.remove('user'); - console.log('logout'); + this.service.remove("user"); + console.log("logout"); }); } @@ -167,9 +167,9 @@ export class AuthService { this.type = 2; console.log(userData.user); const currencyData = { - currId: '123', - currName: 'Australian dollar', - symbol: 'A$' + currId: "123", + currName: "Australian dollar", + symbol: "A$" }; const otp = Math.floor(1000 + Math.random() * 9000); userData = userData.user; @@ -189,11 +189,11 @@ export class AuthService { this.userPostData = postData; console.log(postData); this.afs - .collection('customers') + .collection("customers") .doc(userData.uid) .set(postData) .then(() => { - console.log('successs'); + console.log("successs"); }); } @@ -207,15 +207,15 @@ export class AuthService { console.log(result.user); this.afAuth.auth.currentUser.sendEmailVerification(); const currencyData = { - currId: '123', - currName: 'Australian dollar', - symbol: 'A$' + currId: "123", + currName: "Australian dollar", + symbol: "A$" }; const custData = result.user; const postData: User = { uid: custData.uid, status: true, - profilePhoto: '', + profilePhoto: "", phoneVerified: false, phone: userData.phone, name: userData.name, @@ -228,11 +228,11 @@ export class AuthService { this.userPostData = postData; console.log(postData); this.afs - .collection('customers') + .collection("customers") .doc(custData.uid) .set(postData) .then(() => { - console.log('successs'); + console.log("successs"); }); }) .catch(error => { @@ -245,7 +245,7 @@ export class AuthService { console.log(this.userData.uid); this.afs - .collection('address') + .collection("address") .add({ uid: this.userData.uid }) @@ -269,13 +269,13 @@ export class AuthService { const neworderId = docRef.id; console.log(addrData); this.afs - .collection('address') + .collection("address") .doc(neworderId) .set(addrData) .then(() => { - console.log('Address add Successfully'); - this.service.set('user', JSON.stringify(this.userData)); - this.router.navigateByUrl('home'); + console.log("Address add Successfully"); + this.service.set("user", JSON.stringify(this.userData)); + this.router.navigateByUrl("home"); document.body.scrollTop = document.documentElement.scrollTop = 0; }); }); diff --git a/src/global.scss b/src/global.scss index 9251658..2671464 100644 --- a/src/global.scss +++ b/src/global.scss @@ -416,6 +416,10 @@ app-deliverypop { padding: 0px !important; } +app-success { + padding: 0px !important; +} + .nav_header { position: fixed; top: 0px;