From 13570ae9cbd2ab7dbdf7827115578eb9bae8233a Mon Sep 17 00:00:00 2001 From: Gopal Date: Fri, 28 Dec 2018 01:09:34 +0530 Subject: [PATCH 1/3] added shadow plugin --- app/_app-common.scss | 9 +- .../login-register.component.html | 4 +- .../add-address/add-address.component.html | 5 +- app/checkout/address/address.module.ts | 2 +- .../delivery-address.component.html | 44 +++---- .../delivery-address.component.scss | 4 +- app/checkout/cart/cart.component.html | 44 +++---- app/checkout/cart/cart.component.scss | 22 ++-- app/checkout/cart/cart.component.ts | 5 + app/checkout/cart/cart.module.ts | 4 +- .../line-item-list.component.html | 44 ++++--- .../line-item-list.component.scss | 41 ++----- .../line-item-list.component.ts | 4 + .../order-response.component.html | 70 ++++------- .../order-response.component.scss | 4 +- .../order-success/order-response.component.ts | 2 +- .../order-success/order-response.module.ts | 30 ++--- .../cash-on-delivery.component.html | 4 +- .../cash-on-delivery.component.scss | 4 +- .../payment-modes.component.html | 81 +++++++------ .../payment-modes.component.scss | 2 - .../payment-modes/payment-modes.component.ts | 1 + .../payubiz-hosted.component.html | 4 +- .../payubiz-hosted.component.scss | 4 +- app/checkout/payment/payment.module.ts | 4 +- .../category-menu.component.html | 4 +- .../category-menu.component.scss | 4 +- app/home/home.component.html | 21 ++-- app/home/home.component.scss | 111 +----------------- app/home/home.module.ts | 4 +- .../component/header/actionbar-component.html | 26 ++-- .../component/header/actionbar-component.ts | 1 + 32 files changed, 241 insertions(+), 372 deletions(-) diff --git a/app/_app-common.scss b/app/_app-common.scss index 0f39e29..08ac9be 100644 --- a/app/_app-common.scss +++ b/app/_app-common.scss @@ -1,6 +1,3 @@ -// Place any CSS rules you want to apply on both iOS and Android here. -// This is where the vast majority of your CSS code goes. -// Font icon class @import './app-variables'; .fa { @@ -8,12 +5,12 @@ } .page-container{ - background-color: #dfdfdf; + background-color: #efefef; } .action-btn { background-color: $action-color; - border-radius: 5; + // border-radius: 5; color: $white; font-size: 16; font-weight: 600; @@ -24,7 +21,7 @@ background-color: $action-color; border-radius: 5; color: $white; - height: 45; + height: 35; width: 50%; font-size: 14; } diff --git a/app/auth/component/login-register/login-register.component.html b/app/auth/component/login-register/login-register.component.html index ec67097..00a45e6 100644 --- a/app/auth/component/login-register/login-register.component.html +++ b/app/auth/component/login-register/login-register.component.html @@ -1,4 +1,5 @@ - + + @@ -25,6 +26,7 @@ + diff --git a/app/checkout/address/add-address/add-address.component.html b/app/checkout/address/add-address/add-address.component.html index 58aeb23..30f4444 100644 --- a/app/checkout/address/add-address/add-address.component.html +++ b/app/checkout/address/add-address/add-address.component.html @@ -64,14 +64,16 @@ + - + + @@ -80,6 +82,7 @@ + diff --git a/app/checkout/address/address.module.ts b/app/checkout/address/address.module.ts index 7fdb5f7..c069a4e 100644 --- a/app/checkout/address/address.module.ts +++ b/app/checkout/address/address.module.ts @@ -3,13 +3,13 @@ import { ReactiveFormsModule } from "@angular/forms"; import { NativeScriptCommonModule } from "nativescript-angular/common"; import { NativeScriptFormsModule } from "nativescript-angular/forms"; import { ModalDialogService } from "nativescript-angular/modal-dialog"; +import { NgShadowModule } from "nativescript-ngx-shadow"; import { AddressService } from "~/core/services/address.service"; import { SharedModule } from "~/shared/shared.module"; import { AddAddressComponent } from "./add-address/add-address.component"; import { StatesModalComponent } from "./add-address/states-modal/states-modal.component"; import { AddressComponent } from "./address.component"; import { DeliveryAddressComponent } from "./delivery-address/delivery-address.component"; -import { NgShadowModule } from 'nativescript-ngx-shadow'; @NgModule({ imports: [ NativeScriptCommonModule, diff --git a/app/checkout/address/delivery-address/delivery-address.component.html b/app/checkout/address/delivery-address/delivery-address.component.html index 4bcd808..4ea9c43 100644 --- a/app/checkout/address/delivery-address/delivery-address.component.html +++ b/app/checkout/address/delivery-address/delivery-address.component.html @@ -1,26 +1,23 @@ - + - - - - - - - - - - - - + + + + + + + + + + - + - - + + - @@ -47,18 +44,13 @@ - + - - - - - - - + + diff --git a/app/checkout/address/delivery-address/delivery-address.component.scss b/app/checkout/address/delivery-address/delivery-address.component.scss index cf31cc4..20dc9d1 100644 --- a/app/checkout/address/delivery-address/delivery-address.component.scss +++ b/app/checkout/address/delivery-address/delivery-address.component.scss @@ -5,14 +5,12 @@ background-color: $white; padding: 2px 10px; width: 100%; - // border-width: 1 0 0 1; - // border-color: $accent-dark; } .address-content { background-color: white; padding-top: 10; - padding-bottom: 10; + border-radius: 5; .address-field { font-size: 14em; padding-left: 15; diff --git a/app/checkout/cart/cart.component.html b/app/checkout/cart/cart.component.html index 6f59567..bb862f5 100644 --- a/app/checkout/cart/cart.component.html +++ b/app/checkout/cart/cart.component.html @@ -1,27 +1,31 @@ - - - - + + + + + + + + + - - - - + + + + - - - - - + + + + - - - - - - - + + + + + + + diff --git a/app/checkout/cart/cart.component.scss b/app/checkout/cart/cart.component.scss index 8b3e19e..93f3872 100644 --- a/app/checkout/cart/cart.component.scss +++ b/app/checkout/cart/cart.component.scss @@ -1,12 +1,5 @@ @import '../../app-variables'; -.button-container { - text-align: center; - background-color: $white; - padding: 2px 10px; - width: 100%; -} - .total { padding: 10; background-color:$white; @@ -33,3 +26,18 @@ font-weight: bold; margin-top: 50; } + +.freeshipping { + text-align: center; + margin-top: 10; + font-size: 14; + color: green; +} + +.delivery-text { + text-align: center; + margin-top: 10; + font-size: 14; +} + + diff --git a/app/checkout/cart/cart.component.ts b/app/checkout/cart/cart.component.ts index 1df4eaa..78145d6 100644 --- a/app/checkout/cart/cart.component.ts +++ b/app/checkout/cart/cart.component.ts @@ -24,6 +24,7 @@ export class CartComponent implements OnInit, OnDestroy { shipTotal$: Observable; itemTotal: number; currency = environment.config.currencySymbol; + freeShippingAmount = environment.config.freeShippingAmount; isAuthenticated: boolean; orderState: string; subscriptionList$: Array = []; @@ -82,6 +83,10 @@ export class CartComponent implements OnInit, OnDestroy { this.router.navigate(["/"]); } + get differance() { + return this.freeShippingAmount - this.itemTotal; + } + ngOnDestroy() { this.subscriptionList$.map((sub$) => sub$.unsubscribe()); } diff --git a/app/checkout/cart/cart.module.ts b/app/checkout/cart/cart.module.ts index ce5629d..1f3fb9e 100644 --- a/app/checkout/cart/cart.module.ts +++ b/app/checkout/cart/cart.module.ts @@ -1,5 +1,6 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; import { NativeScriptCommonModule } from "nativescript-angular/common"; +import { NgShadowModule } from "nativescript-ngx-shadow"; import { NativeScriptUIListViewModule } from "nativescript-ui-listview/angular"; import { SharedModule } from "~/shared/shared.module"; import { CartRoutingModule } from "./cart-routing.module"; @@ -10,7 +11,8 @@ import { LineItemListComponent } from "./line-item-list/line-item-list.component NativeScriptCommonModule, CartRoutingModule, NativeScriptUIListViewModule, - SharedModule + SharedModule, + NgShadowModule ], declarations: [ CartComponent, diff --git a/app/checkout/cart/line-item-list/line-item-list.component.html b/app/checkout/cart/line-item-list/line-item-list.component.html index 011e4da..c490172 100644 --- a/app/checkout/cart/line-item-list/line-item-list.component.html +++ b/app/checkout/cart/line-item-list/line-item-list.component.html @@ -1,30 +1,28 @@ - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + - + diff --git a/app/checkout/cart/line-item-list/line-item-list.component.scss b/app/checkout/cart/line-item-list/line-item-list.component.scss index 8f52118..63b62ea 100644 --- a/app/checkout/cart/line-item-list/line-item-list.component.scss +++ b/app/checkout/cart/line-item-list/line-item-list.component.scss @@ -1,30 +1,4 @@ @import '../../../app-variables'; -.lineitem { - height: 100%; - height: 10vh; - .savetoday { - padding: 7dpi 20dpi; - background-color: $white; - .discount { - background-color: $action-color; - padding: 5dpi 15dpi 5dpi; - text-align: center; - border-radius: 5dpi; - font-size: 18em; - color: $background-light; - font-weight: bold; - margin: 6dpi 10dpi 10dpi 0; - } - .autoship { - margin-top: 5dpi; - font-weight: bold; - color: $secondary; - white-space: normal; - word-wrap: break-word; - } - } -} - .btn-primary { background-color: $action-color; border-radius: 7px; @@ -41,7 +15,7 @@ } .actionbtn { - border-radius: 10; + border-radius: 5; background-color: $action-color; width: 15%; height: 15%; @@ -63,8 +37,8 @@ text-align: center; } -.quantity{ - padding: 10; +.quantity { + padding: 10; font-size: 14rm; } @@ -86,5 +60,12 @@ .remove { padding: 10; text-align: right; - font-size: 15rm; + font-size: 18; +} + +.line-items-card { + margin-right: 5; + margin-left: 5; + margin-bottom: 15; + border-radius: 5; } diff --git a/app/checkout/cart/line-item-list/line-item-list.component.ts b/app/checkout/cart/line-item-list/line-item-list.component.ts index 8894cda..c19b0f9 100644 --- a/app/checkout/cart/line-item-list/line-item-list.component.ts +++ b/app/checkout/cart/line-item-list/line-item-list.component.ts @@ -5,6 +5,7 @@ import { IappState } from "~/app.reducers"; import { CheckoutActions } from "~/checkout/actions/checkout.actions"; import { LineItem } from "~/core/models/line_item"; import { SharedService } from "~/core/services/shared.service"; +import { environment } from "~/environments/environment"; @Component({ moduleId: module.id, @@ -19,6 +20,9 @@ export class LineItemListComponent implements OnInit { quantityCount: number; subscriptionList$: Array = []; lineItem: LineItem; + currency = environment.config.currencySymbol; + freeShippingAmount = environment.config.freeShippingAmount; + isDeleting: boolean; constructor( private store: Store, diff --git a/app/checkout/order-success/order-response.component.html b/app/checkout/order-success/order-response.component.html index f47d32c..d353f44 100644 --- a/app/checkout/order-success/order-response.component.html +++ b/app/checkout/order-success/order-response.component.html @@ -1,24 +1,22 @@ - - + + - - - - - - - + + + + + - + - - - + + + @@ -37,45 +35,28 @@ - + - - - + + + - - - - - - - - - - - - - - - - - - - - + + + + - + - - - + + + - + @@ -89,9 +70,8 @@ - + - diff --git a/app/checkout/order-success/order-response.component.scss b/app/checkout/order-success/order-response.component.scss index 8d95202..15f2f42 100644 --- a/app/checkout/order-success/order-response.component.scss +++ b/app/checkout/order-success/order-response.component.scss @@ -2,13 +2,13 @@ .address-content { background-color: white; padding-top: 10; - padding-bottom: 10; .address-field { font-size: 14em; + padding: 3 5 3 10; } .address-bold { font-size: 14em; - padding: 5 5 5 15; + padding: 3 5 3 10; font-weight: 600; } .heading { diff --git a/app/checkout/order-success/order-response.component.ts b/app/checkout/order-success/order-response.component.ts index 2b6e728..16d5139 100644 --- a/app/checkout/order-success/order-response.component.ts +++ b/app/checkout/order-success/order-response.component.ts @@ -47,8 +47,8 @@ export class OrderResponseComponent implements OnInit, OnDestroy { this.isProcessing = true; this.subscriptionList$.push( this.checkoutService.getOrderDetail(this.orderReferance).subscribe((data) => { - this.isProcessing = false; this.orderDetails = data; + this.isProcessing = false; }) ); } diff --git a/app/checkout/order-success/order-response.module.ts b/app/checkout/order-success/order-response.module.ts index 7dc284b..28887eb 100644 --- a/app/checkout/order-success/order-response.module.ts +++ b/app/checkout/order-success/order-response.module.ts @@ -1,25 +1,27 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; import { NativeScriptCommonModule } from "nativescript-angular/common"; import { NativeScriptFormsModule } from "nativescript-angular/forms"; +import { NgShadowModule } from "nativescript-ngx-shadow"; import { SharedModule } from "~/shared/shared.module"; import { OrderResponseComponent } from "./order-response.component"; @NgModule({ - imports: [ - NativeScriptCommonModule, - NativeScriptFormsModule, - SharedModule - ], - declarations: [ - OrderResponseComponent - ], + imports: [ + NativeScriptCommonModule, + NativeScriptFormsModule, + SharedModule, + NgShadowModule + ], + declarations: [ + OrderResponseComponent + ], - providers: [ + providers: [ - ] - , - schemas: [ - NO_ERRORS_SCHEMA - ] + ] + , + schemas: [ + NO_ERRORS_SCHEMA + ] }) export class OrderModule { } diff --git a/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.html b/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.html index f659ac9..0824552 100644 --- a/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.html +++ b/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.html @@ -5,8 +5,8 @@ - - + + diff --git a/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.scss b/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.scss index 4d94833..705d206 100644 --- a/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.scss +++ b/app/checkout/payment/payment-modes/cash-on-delivery/cash-on-delivery.component.scss @@ -10,7 +10,7 @@ white-space: normal; text-transform: uppercase; font-size: 14rem; - padding-top: 10; + margin-top: 15; padding-bottom: 10; padding-left: 15; font-weight: 600; @@ -20,7 +20,7 @@ color: $gray-900; font-size: 13rem; padding-left: 15; - padding-top: 10; + margin-top: 15; border-bottom: 1; padding-right: 15; border-color: whitesmoke; diff --git a/app/checkout/payment/payment-modes/payment-modes.component.html b/app/checkout/payment/payment-modes/payment-modes.component.html index 0ce5820..669481c 100644 --- a/app/checkout/payment/payment-modes/payment-modes.component.html +++ b/app/checkout/payment/payment-modes/payment-modes.component.html @@ -1,52 +1,55 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + + - - - - - - - - - + + - - + + diff --git a/app/checkout/payment/payment-modes/payment-modes.component.scss b/app/checkout/payment/payment-modes/payment-modes.component.scss index d73bb58..ad82926 100644 --- a/app/checkout/payment/payment-modes/payment-modes.component.scss +++ b/app/checkout/payment/payment-modes/payment-modes.component.scss @@ -5,8 +5,6 @@ text-align: center; font-weight: 500; font-size: 16rem; - border-width: 0 0 1 0; - border-color: $accent-dark; } .address-content { diff --git a/app/checkout/payment/payment-modes/payment-modes.component.ts b/app/checkout/payment/payment-modes/payment-modes.component.ts index f1d4989..bf2993a 100644 --- a/app/checkout/payment/payment-modes/payment-modes.component.ts +++ b/app/checkout/payment/payment-modes/payment-modes.component.ts @@ -86,6 +86,7 @@ export class PaymentModesComponent implements OnInit, OnDestroy { } else { this.sharedService.infoMessage("Error occured try again!"); this.router.navigate(["/"]); + this.isProcessing = false; } } diff --git a/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.html b/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.html index 88d1335..553be9b 100644 --- a/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.html +++ b/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.html @@ -5,8 +5,8 @@ - - + + diff --git a/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.scss b/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.scss index 4d94833..705d206 100644 --- a/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.scss +++ b/app/checkout/payment/payment-modes/payubiz-hosted/payubiz-hosted.component.scss @@ -10,7 +10,7 @@ white-space: normal; text-transform: uppercase; font-size: 14rem; - padding-top: 10; + margin-top: 15; padding-bottom: 10; padding-left: 15; font-weight: 600; @@ -20,7 +20,7 @@ color: $gray-900; font-size: 13rem; padding-left: 15; - padding-top: 10; + margin-top: 15; border-bottom: 1; padding-right: 15; border-color: whitesmoke; diff --git a/app/checkout/payment/payment.module.ts b/app/checkout/payment/payment.module.ts index 0621873..288be8f 100644 --- a/app/checkout/payment/payment.module.ts +++ b/app/checkout/payment/payment.module.ts @@ -1,6 +1,7 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; import { NativeScriptCommonModule } from "nativescript-angular/common"; import { NativeScriptFormsModule } from "nativescript-angular/forms"; +import { NgShadowModule } from "nativescript-ngx-shadow"; import { SharedModule } from "~/shared/shared.module"; import { CashOnDeliveryComponent } from "./payment-modes/cash-on-delivery/cash-on-delivery.component"; import { PaymentModesComponent } from "./payment-modes/payment-modes.component"; @@ -10,7 +11,8 @@ import { PayubizHostedComponent } from "./payment-modes/payubiz-hosted/payubiz-h imports: [ NativeScriptCommonModule, SharedModule, - NativeScriptFormsModule + NativeScriptFormsModule, + NgShadowModule ], declarations: [PaymentModesComponent, CashOnDeliveryComponent, PayubizHostedComponent], diff --git a/app/home/components/category-menu/category-menu.component.html b/app/home/components/category-menu/category-menu.component.html index 51ef478..a4b5daa 100644 --- a/app/home/components/category-menu/category-menu.component.html +++ b/app/home/components/category-menu/category-menu.component.html @@ -1,5 +1,5 @@ - + @@ -8,7 +8,7 @@ - diff --git a/app/home/components/category-menu/category-menu.component.scss b/app/home/components/category-menu/category-menu.component.scss index d3d7a0b..ebe5259 100644 --- a/app/home/components/category-menu/category-menu.component.scss +++ b/app/home/components/category-menu/category-menu.component.scss @@ -1,7 +1,7 @@ .box { font-weight: bold; font-size: 14em; - margin: 3dpi; + margin: 5dpi; position: left top; border-radius: 5; color: white; @@ -10,6 +10,6 @@ background-position: right bottom; padding-left: 5%; - padding-bottom: 130%; + padding-bottom: 120%; padding-top: 5%; } diff --git a/app/home/home.component.html b/app/home/home.component.html index 8d2acbe..63bb3f6 100644 --- a/app/home/home.component.html +++ b/app/home/home.component.html @@ -1,5 +1,5 @@ - + @@ -7,19 +7,24 @@ - + - + + - - + + - + + diff --git a/app/home/home.component.scss b/app/home/home.component.scss index 793a50d..dfe6e63 100644 --- a/app/home/home.component.scss +++ b/app/home/home.component.scss @@ -1,120 +1,11 @@ @import '../_app-variables.scss'; -.img-logo { - width: 130px -} - -.container { - padding: 0 10dpi; - background-color: $white - 10; - .typeofproduct { - color: orange; - margin-top: 2dpi; - font-size: 28em; - } - .savetoday { - padding: 7dpi 20dpi; - .discount { - background-color: $action-color; - padding: 5dpi 15dpi 5dpi; - text-align: center; - border-radius: 5dpi; - font-size: 18em; - color: $background-light; - font-weight: bold; - margin: 6dpi 10dpi 10dpi 0; - } - .autoship { - margin-top: 5dpi; - font-weight: bold; - color: $secondary; - white-space: normal; - word-wrap: break-word; - } - } - .shopby { - padding: 7dpi 10dpi; - font-size: 18em; - color: $secondary; - .icon { - margin-top: 2dpi; - font-size: 28em; - color: $accent-dark; - } - } - -} - -.box { - font-weight: bold; - font-size: 15em; - background-color: lightgray; - margin: 5 0 0 5; - height: 180; - position: left top; - border-radius: 5; - color: white; - background-repeat: no-repeat; - background-size: 75% 90%; - background-position: right bottom; - padding-left: 10; - padding-bottom: 120%; - padding-top: 10; -} - -.free-delivery{ - font-weight: bold; - font-size: 15em; - color: "red"; - background-color: yellow; - -} - - -.promoimg { - padding: 20dpi 4dpi; -} - -.product-base { - width: 180dpi; - border-radius: 5dpi; - border-color: $gray-10; - background-color: $white; - margin: 3dpi; - height: auto; - .product-img { - text-align: center - } - .product-name { - font-size: 15em; - color: $secondary; - .name { - white-space: normal; - word-wrap: break-word; - height: 160px; - margin: 15 0; - } - } - .product-price { - font-size: 20dpi; - color: $action-price-color - } - .add-to { - border-color: $gray-10; - padding: 10; - text-align: center; - color: $action-color; - } -} .login-label { - horizontal-align: center; vertical-align: center; color: $accent-dark; font-size: 14; text-align: center; text-transform: uppercase; + font-weight: 500; } -.searchbox-back { - background-color: $accent-dark; -} diff --git a/app/home/home.module.ts b/app/home/home.module.ts index 64e62a6..acbbbf6 100644 --- a/app/home/home.module.ts +++ b/app/home/home.module.ts @@ -3,6 +3,7 @@ import { EffectsModule } from "@ngrx/effects"; import { NativeScriptCommonModule } from "nativescript-angular/common"; import { NativeScriptFormsModule } from "nativescript-angular/forms"; import { NativeScriptRouterModule } from "nativescript-angular/router"; +import { NgShadowModule } from "nativescript-ngx-shadow"; import { NativeScriptUIListViewModule } from "nativescript-ui-listview/angular"; import { ProductActions } from "~/product/actions/product-actions"; import { ProductEffects } from "~/product/effects/product.effects"; @@ -22,7 +23,8 @@ import { HomeComponent } from "./home.component"; NativeScriptFormsModule, NativeScriptRouterModule, EffectsModule.forRoot([ProductEffects, SearchEffects]), - SharedModule + SharedModule, + NgShadowModule ], declarations: [ HomeComponent, diff --git a/app/shared/component/header/actionbar-component.html b/app/shared/component/header/actionbar-component.html index 5bd87e6..f20d515 100644 --- a/app/shared/component/header/actionbar-component.html +++ b/app/shared/component/header/actionbar-component.html @@ -1,13 +1,13 @@ - - + + - + @@ -15,20 +15,10 @@ - - + + - - + diff --git a/app/shared/component/header/actionbar-component.ts b/app/shared/component/header/actionbar-component.ts index b3b3780..6391920 100644 --- a/app/shared/component/header/actionbar-component.ts +++ b/app/shared/component/header/actionbar-component.ts @@ -39,6 +39,7 @@ export class ActionBarComponent implements OnInit, OnDestroy { } navigateToCart() { + // this.router.navigate(["/checkout/order/22"]); this.router.navigate(["/checkout/cart"]); } From 685cf895235dcdcf03aafa001abd3d40bc61d15f Mon Sep 17 00:00:00 2001 From: Gopal Date: Fri, 28 Dec 2018 16:02:08 +0530 Subject: [PATCH 2/3] fixed shadow & ui for android --- app/_app-common.scss | 4 +- app/app.module.ts | 4 +- .../login-register.component.html | 4 +- app/checkout/actions/checkout.actions.ts | 16 ++++++++ .../add-address/add-address.component.html | 8 ++-- .../add-address/add-address.component.ts | 6 +-- .../states-modal/states-modal.component.html | 19 +++++++--- .../states-modal/states-modal.component.ts | 38 +++++++++++++------ app/checkout/address/address.component.ts | 3 ++ .../delivery-address.component.html | 7 ++-- .../delivery-address.component.ts | 4 +- app/checkout/cart/cart.component.html | 9 +++-- .../line-item-list.component.html | 2 +- .../line-item-list.component.ts | 14 +++++-- app/checkout/effects/checkout.effects.ts | 11 +++++- .../payment-modes.component.html | 7 ++-- .../payment-modes/payment-modes.component.ts | 18 ++++----- app/checkout/payment/payment.module.ts | 23 ++++++----- app/checkout/reducers/checkout.reducer.ts | 7 +++- app/checkout/reducers/checkout.state.ts | 9 +++-- app/checkout/reducers/selectors.ts | 6 +++ app/core/services/address.service.ts | 11 +----- app/core/services/checkout.service.ts | 15 ++++++-- .../category-menu.component.html | 4 +- .../products-list.component.html | 2 +- .../products-list/products-list.component.ts | 4 ++ package.json | 1 - 27 files changed, 162 insertions(+), 94 deletions(-) diff --git a/app/_app-common.scss b/app/_app-common.scss index 08ac9be..761f00d 100644 --- a/app/_app-common.scss +++ b/app/_app-common.scss @@ -10,7 +10,7 @@ .action-btn { background-color: $action-color; - // border-radius: 5; + border-radius: 1; color: $white; font-size: 16; font-weight: 600; @@ -21,7 +21,7 @@ background-color: $action-color; border-radius: 5; color: $white; - height: 35; + height: 40; width: 50%; font-size: 14; } diff --git a/app/app.module.ts b/app/app.module.ts index 535e8b3..3d90c5e 100644 --- a/app/app.module.ts +++ b/app/app.module.ts @@ -8,7 +8,6 @@ import { NativeScriptFormsModule } from "nativescript-angular/forms"; import { NativeScriptHttpClientModule } from "nativescript-angular/http-client"; import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { NativeScriptRouterModule } from "nativescript-angular/router"; -import { NgShadowModule } from "nativescript-ngx-shadow"; import { NativeScriptUIListViewModule } from "nativescript-ui-listview/angular"; import { NativeScriptUISideDrawerModule } from "nativescript-ui-sidedrawer/angular/side-drawer-directives"; import { AppRoutingModule } from "~/app-routing.module"; @@ -49,8 +48,7 @@ import { SharedModule } from "./shared/shared.module"; exports: [ ], - providers: [ - ] + providers: [] }) export class AppModule { } diff --git a/app/auth/component/login-register/login-register.component.html b/app/auth/component/login-register/login-register.component.html index 00a45e6..f9ac10f 100644 --- a/app/auth/component/login-register/login-register.component.html +++ b/app/auth/component/login-register/login-register.component.html @@ -20,7 +20,7 @@ - + @@ -54,7 +54,7 @@ - + diff --git a/app/checkout/actions/checkout.actions.ts b/app/checkout/actions/checkout.actions.ts index f3106e4..c21f42d 100644 --- a/app/checkout/actions/checkout.actions.ts +++ b/app/checkout/actions/checkout.actions.ts @@ -1,3 +1,4 @@ +import { CState } from "~/core/models/state"; import { LineItem } from "./../../core/models/line_item"; import { Order } from "./../../core/models/order"; @@ -16,6 +17,8 @@ export class CheckoutActions { static ORDER_COMPLETE_SUCCESS = "ORDER_COMPLETE_SUCCESS"; static GET_ORDER_DETAILS = "GET_ORDER_DETAILS"; static GET_ORDER_DETAILS_SUCCESS = "GET_ORDER_DETAILS_SUCCESS"; + static GET_STATES_LIST = "GET_STATES_LIST"; + static GET_STATES_LIST_SUCCESS = "GET_STATES_LIST_SUCCESS"; fetchCurrentOrderSuccess(order: Order) { return { @@ -102,4 +105,17 @@ export class CheckoutActions { payload: order }; } + + getStatesLists() { + return { + type: CheckoutActions.GET_STATES_LIST + }; + } + + getStatesListSuccess(states: Array) { + return { + type: CheckoutActions.GET_STATES_LIST_SUCCESS, + payload: states + }; + } } diff --git a/app/checkout/address/add-address/add-address.component.html b/app/checkout/address/add-address/add-address.component.html index 30f4444..4c7127a 100644 --- a/app/checkout/address/add-address/add-address.component.html +++ b/app/checkout/address/add-address/add-address.component.html @@ -83,10 +83,10 @@ - + - + - + diff --git a/app/checkout/address/add-address/add-address.component.ts b/app/checkout/address/add-address/add-address.component.ts index 74cf9fe..c4056cb 100644 --- a/app/checkout/address/add-address/add-address.component.ts +++ b/app/checkout/address/add-address/add-address.component.ts @@ -6,7 +6,7 @@ import { RouterExtensions } from "nativescript-angular/router"; import { Subscription } from "rxjs"; import { Page } from "tns-core-modules/ui/page/page"; import { IappState } from "~/app.reducers"; -import { getOrderNumber, getOrderState, getShipAddress } from "~/checkout/reducers/selectors"; +import { getOrderNumber, getOrderState, getShipAddress, getStatesList } from "~/checkout/reducers/selectors"; import { Address } from "~/core/models/address"; import { CState } from "~/core/models/state"; import { AddressService } from "~/core/services/address.service"; @@ -53,7 +53,7 @@ export class AddAddressComponent implements OnInit, OnDestroy { }); this.subscriptionList$.push( - this.addrService.getAllStates().subscribe((states) => this.states = states), + this.store.select(getStatesList).subscribe((states) => this.states = states), this.store.select(getOrderState).subscribe((oState) => this.orderState = oState), this.store.select(getShipAddress).subscribe((ship) => this.shipAddress = ship), this.store.select(getOrderNumber).subscribe((oNumber) => this.orderNumber = oNumber) @@ -129,7 +129,7 @@ export class AddAddressComponent implements OnInit, OnDestroy { const options: ModalDialogOptions = { viewContainerRef: this._vcRef, context: "", - fullscreen: false + fullscreen: true }; this._modalService.showModal(StatesModalComponent, options).then((state: CState) => { diff --git a/app/checkout/address/add-address/states-modal/states-modal.component.html b/app/checkout/address/add-address/states-modal/states-modal.component.html index 650205f..daa545c 100644 --- a/app/checkout/address/add-address/states-modal/states-modal.component.html +++ b/app/checkout/address/add-address/states-modal/states-modal.component.html @@ -1,7 +1,14 @@ - - - - + + + + - - + + + + + + + + + diff --git a/app/checkout/address/add-address/states-modal/states-modal.component.ts b/app/checkout/address/add-address/states-modal/states-modal.component.ts index 2610488..406cb37 100644 --- a/app/checkout/address/add-address/states-modal/states-modal.component.ts +++ b/app/checkout/address/add-address/states-modal/states-modal.component.ts @@ -1,8 +1,11 @@ -import { Component, OnInit } from "@angular/core"; +import { Component, OnDestroy, OnInit } from "@angular/core"; +import { Store } from "@ngrx/store"; +import { ModalDialogParams } from "nativescript-angular/modal-dialog"; +import { Subscription } from "rxjs"; +import { Page } from "tns-core-modules/ui/page/page"; +import { IappState } from "~/app.reducers"; +import { getStatesList } from "~/checkout/reducers/selectors"; import { CState } from "~/core/models/state"; -import { AddressService } from "~/core/services/address.service"; -import { ModalDialogService, ModalDialogParams } from 'nativescript-angular/modal-dialog'; -import { topmost } from "ui/frame"; @Component({ moduleId: module.id, @@ -11,22 +14,33 @@ import { topmost } from "ui/frame"; styleUrls: ["./states-modal.component.css"] }) -export class StatesModalComponent implements OnInit { +export class StatesModalComponent implements OnInit, OnDestroy { + states: Array = []; + subscriptionList$: Array = []; constructor( - private addrService: AddressService, - private params: ModalDialogParams - ) { // - } + private params: ModalDialogParams, + private store: Store, + private page: Page + ) { } + + ngOnInit() { - ngOnInit() { // - this.addrService.getAllStates().subscribe((states) => { - this.states = states; + this.page.on("navigatingFrom", (data) => { + this.ngOnDestroy(); }); + + this.subscriptionList$.push( + this.store.select(getStatesList).subscribe((states) => this.states = states) + ); } selectedState(state: CState) { this.params.closeCallback(state); } + + ngOnDestroy() { + this.subscriptionList$.map((sub$) => sub$.unsubscribe()); + } } diff --git a/app/checkout/address/address.component.ts b/app/checkout/address/address.component.ts index 2a6c30a..7bfbf28 100644 --- a/app/checkout/address/address.component.ts +++ b/app/checkout/address/address.component.ts @@ -6,6 +6,7 @@ import { Observable, Subscription } from "rxjs"; import { tap } from "rxjs/operators"; import { Page } from "tns-core-modules/ui/page/page"; import { IappState } from "~/app.reducers"; +import { CheckoutActions } from "../actions/checkout.actions"; import { Address } from "./../../core/models/address"; import { CheckoutService } from "./../../core/services/checkout.service"; import { getOrderNumber, getOrderState, getShipAddress } from "./../reducers/selectors"; @@ -30,6 +31,7 @@ export class AddressComponent implements OnInit, OnDestroy { constructor( private store: Store, private checkoutService: CheckoutService, + private checkoutAction: CheckoutActions, private router: Router, private page: Page) { } @@ -38,6 +40,7 @@ export class AddressComponent implements OnInit, OnDestroy { this.ngOnDestroy(); }); + this.store.dispatch(this.checkoutAction.getStatesLists()); this.orderNumber$ = this.store.select(getOrderNumber); this.subscriptionList$.push( diff --git a/app/checkout/address/delivery-address/delivery-address.component.html b/app/checkout/address/delivery-address/delivery-address.component.html index 4ea9c43..618b0ac 100644 --- a/app/checkout/address/delivery-address/delivery-address.component.html +++ b/app/checkout/address/delivery-address/delivery-address.component.html @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ - + @@ -50,7 +50,6 @@ - + diff --git a/app/checkout/address/delivery-address/delivery-address.component.ts b/app/checkout/address/delivery-address/delivery-address.component.ts index fe7b9f6..e253ff6 100644 --- a/app/checkout/address/delivery-address/delivery-address.component.ts +++ b/app/checkout/address/delivery-address/delivery-address.component.ts @@ -1,7 +1,7 @@ -import { Component, Input, OnDestroy, OnInit, EventEmitter, Output } from "@angular/core"; +import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from "@angular/core"; import { Router } from "@angular/router"; import { Store } from "@ngrx/store"; -import { Observable, Subscription } from "rxjs"; +import { Subscription } from "rxjs"; import { tap } from "rxjs/operators"; import { Page } from "tns-core-modules/ui/page/page"; import { IappState } from "~/app.reducers"; diff --git a/app/checkout/cart/cart.component.html b/app/checkout/cart/cart.component.html index bb862f5..7062383 100644 --- a/app/checkout/cart/cart.component.html +++ b/app/checkout/cart/cart.component.html @@ -1,6 +1,6 @@ - + @@ -16,8 +16,9 @@ - - + + + @@ -25,7 +26,7 @@ - + diff --git a/app/checkout/cart/line-item-list/line-item-list.component.html b/app/checkout/cart/line-item-list/line-item-list.component.html index c490172..0329ac8 100644 --- a/app/checkout/cart/line-item-list/line-item-list.component.html +++ b/app/checkout/cart/line-item-list/line-item-list.component.html @@ -4,7 +4,7 @@ - + diff --git a/app/checkout/cart/line-item-list/line-item-list.component.ts b/app/checkout/cart/line-item-list/line-item-list.component.ts index c19b0f9..e65c7f2 100644 --- a/app/checkout/cart/line-item-list/line-item-list.component.ts +++ b/app/checkout/cart/line-item-list/line-item-list.component.ts @@ -1,6 +1,7 @@ -import { Component, Input, OnInit } from "@angular/core"; +import { Component, Input, OnDestroy, OnInit } from "@angular/core"; import { Store } from "@ngrx/store"; import { Subscription } from "rxjs"; +import { Page } from "tns-core-modules/ui/page/page"; import { IappState } from "~/app.reducers"; import { CheckoutActions } from "~/checkout/actions/checkout.actions"; import { LineItem } from "~/core/models/line_item"; @@ -14,7 +15,7 @@ import { environment } from "~/environments/environment"; styleUrls: ["./line-item-list.component.scss"] }) -export class LineItemListComponent implements OnInit { +export class LineItemListComponent implements OnInit, OnDestroy { @Input() lineItems: Array; @Input() itemTotal: number; quantityCount: number; @@ -26,11 +27,14 @@ export class LineItemListComponent implements OnInit { constructor( private store: Store, + private page: Page, private checkoutActions: CheckoutActions, private sharedService: SharedService) { } ngOnInit() { - // + this.page.on("navigatingFrom", (data) => { + this.ngOnDestroy(); + }); } removeLineItem(index: number) { @@ -60,4 +64,8 @@ export class LineItemListComponent implements OnInit { return index; } + ngOnDestroy() { + this.subscriptionList$.map((sub$) => sub$.unsubscribe()); + } + } diff --git a/app/checkout/effects/checkout.effects.ts b/app/checkout/effects/checkout.effects.ts index b190bb0..a4d0956 100644 --- a/app/checkout/effects/checkout.effects.ts +++ b/app/checkout/effects/checkout.effects.ts @@ -2,7 +2,7 @@ import { Injectable } from "@angular/core"; import { Actions, Effect } from "@ngrx/effects"; import { Action } from "@ngrx/store"; import { map, switchMap } from "rxjs/operators"; -import { Order } from "~/core/models/order"; +import { CState } from "~/core/models/state"; import { SharedService } from "~/core/services/shared.service"; import { CheckoutService } from "../../core/services/checkout.service"; import { LineItem } from "./../../core/models/line_item"; @@ -39,6 +39,15 @@ export class CheckoutEffects { }) ); + @Effect() + statesList$ = this.actions$.ofType(CheckoutActions.GET_STATES_LIST).pipe( + switchMap>((_) => { + + return this.checkoutService.getAllStates(); + }), + map((states) => this.actions.getStatesListSuccess(states)) + ); + constructor( private actions$: Actions, private checkoutService: CheckoutService, diff --git a/app/checkout/payment/payment-modes/payment-modes.component.html b/app/checkout/payment/payment-modes/payment-modes.component.html index 669481c..3ca91c4 100644 --- a/app/checkout/payment/payment-modes/payment-modes.component.html +++ b/app/checkout/payment/payment-modes/payment-modes.component.html @@ -7,7 +7,7 @@ - + @@ -36,8 +36,9 @@ - - + + diff --git a/app/checkout/payment/payment-modes/payment-modes.component.ts b/app/checkout/payment/payment-modes/payment-modes.component.ts index bf2993a..1c85d78 100644 --- a/app/checkout/payment/payment-modes/payment-modes.component.ts +++ b/app/checkout/payment/payment-modes/payment-modes.component.ts @@ -1,19 +1,16 @@ -import { Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from "@angular/core"; -import { Router } from "@angular/router"; +import { Component, OnDestroy, OnInit } from "@angular/core"; import { Store } from "@ngrx/store"; import { RouterExtensions } from "nativescript-angular/router"; -import { Observable, Subscription } from "rxjs"; -import { concatMap, map, switchMap } from "rxjs/operators"; +import { Subscription } from "rxjs"; +import { concatMap, map } from "rxjs/operators"; import { Page } from "tns-core-modules/ui/page/page"; import { IappState } from "~/app.reducers"; import { getAuthStatus } from "~/auth/reducers/selectors"; import { CheckoutActions } from "~/checkout/actions/checkout.actions"; import { - getAdjustmentTotal, getItemTotal, - getOrderNumber, getOrderState, getShipAddress, + getAdjustmentTotal, getItemTotal, getOrderState, getShipTotal, getTotalCartItems, getTotalCartValue } from "~/checkout/reducers/selectors"; -import { Address } from "~/core/models/address"; import { CheckoutService } from "~/core/services/checkout.service"; import { SharedService } from "~/core/services/shared.service"; import { environment } from "~/environments/environment"; @@ -29,15 +26,12 @@ export class PaymentModesComponent implements OnInit, OnDestroy { subscriptionList$: Array = []; orderAmount: number; - orderNumber: number; isAuthenticated: boolean; totalCartItems: number; - orderNumber$: Observable; shipTotal: number; itemTotal: number; adjustmentTotal: number; currency = environment.config.currencySymbol; - orderSub$: Subscription; freeShippingAmount = environment.config.freeShippingAmount; isProcessing: boolean; orderState: string; @@ -52,6 +46,8 @@ export class PaymentModesComponent implements OnInit, OnDestroy { } ngOnInit() { + this.isProcessing = true; + this.page.on("navigatingFrom", (data) => { this.ngOnDestroy(); }); @@ -67,7 +63,7 @@ export class PaymentModesComponent implements OnInit, OnDestroy { this.store.select(getAdjustmentTotal).subscribe((adjustmentTotal) => this.adjustmentTotal = adjustmentTotal) ); - this.orderNumber$ = this.store.select(getOrderNumber); + this.isProcessing = false; } makeCodPayment() { diff --git a/app/checkout/payment/payment.module.ts b/app/checkout/payment/payment.module.ts index 288be8f..e1310f4 100644 --- a/app/checkout/payment/payment.module.ts +++ b/app/checkout/payment/payment.module.ts @@ -8,18 +8,17 @@ import { PaymentModesComponent } from "./payment-modes/payment-modes.component"; import { PayubizHostedComponent } from "./payment-modes/payubiz-hosted/payubiz-hosted.component"; @NgModule({ - imports: [ - NativeScriptCommonModule, - SharedModule, - NativeScriptFormsModule, - NgShadowModule - ], - declarations: [PaymentModesComponent, CashOnDeliveryComponent, PayubizHostedComponent], + imports: [ + NativeScriptCommonModule, + SharedModule, + NativeScriptFormsModule, + NgShadowModule + ], + declarations: [PaymentModesComponent, CashOnDeliveryComponent, PayubizHostedComponent], - providers: [] - , - schemas: [ - NO_ERRORS_SCHEMA - ] + providers: [], + schemas: [ + NO_ERRORS_SCHEMA + ] }) export class PaymentModule { } diff --git a/app/checkout/reducers/checkout.reducer.ts b/app/checkout/reducers/checkout.reducer.ts index bfefecb..2e2efa9 100644 --- a/app/checkout/reducers/checkout.reducer.ts +++ b/app/checkout/reducers/checkout.reducer.ts @@ -147,12 +147,17 @@ export function reducer(state = initialState, { type, payload }: any): CheckoutS itemTotal: _itemTotal, adjustmentTotal: _adjustmentTotal, lineItemIds: _lineItemIds, - lineItemEntities: _lineItemEntities, + lineItemEntities: _lineItemEntities }) as CheckoutState; case CheckoutActions.ORDER_COMPLETE_SUCCESS: return initialState; + case CheckoutActions.GET_STATES_LIST_SUCCESS: + return state.merge({ + stateList: payload + }) as CheckoutState; + default: return state; } diff --git a/app/checkout/reducers/checkout.state.ts b/app/checkout/reducers/checkout.state.ts index aebf755..4d70630 100644 --- a/app/checkout/reducers/checkout.state.ts +++ b/app/checkout/reducers/checkout.state.ts @@ -1,5 +1,6 @@ -import { LineItem } from './../../core/models/line_item'; -import { Map, Record, List, fromJS } from 'immutable'; +import { List, Map, Record } from "immutable"; +import { LineItem } from "./../../core/models/line_item"; + export interface CheckoutState extends Map { orderNumber: number; orderState: string; @@ -12,6 +13,7 @@ export interface CheckoutState extends Map { shipTotal: number; itemTotal: number; adjustmentTotal: number; + stateList: List; } export const CheckoutStateRecord = Record({ @@ -25,5 +27,6 @@ export const CheckoutStateRecord = Record({ shipAddress: Map({}), shipTotal: 0, itemTotal: 0, - adjustmentTotal: 0 + adjustmentTotal: 0, + stateList: List([]) }); diff --git a/app/checkout/reducers/selectors.ts b/app/checkout/reducers/selectors.ts index 19cfc39..57d4acc 100644 --- a/app/checkout/reducers/selectors.ts +++ b/app/checkout/reducers/selectors.ts @@ -49,6 +49,11 @@ export function fetchItemTotal(state: CheckoutState) { export function fetchAdjustmentTotal(state: CheckoutState) { return state.adjustmentTotal; } + +export function fetchStatesList(state: CheckoutState) { + return state.stateList.toJS(); +} + // *************************** PUBLIC API's **************************** export const getLineItems = createSelector(getCheckoutState, fetchLineItems); export const getOrderNumber = createSelector(getCheckoutState, fetchOrderNumber); @@ -60,3 +65,4 @@ export const getOrderState = createSelector(getCheckoutState, fetchOrderState); export const getShipTotal = createSelector(getCheckoutState, fetchShipTotal); export const getItemTotal = createSelector(getCheckoutState, fetchItemTotal); export const getAdjustmentTotal = createSelector(getCheckoutState, fetchAdjustmentTotal); +export const getStatesList = createSelector(getCheckoutState, fetchStatesList); diff --git a/app/core/services/address.service.ts b/app/core/services/address.service.ts index ac39305..96165fc 100644 --- a/app/core/services/address.service.ts +++ b/app/core/services/address.service.ts @@ -1,9 +1,7 @@ import { HttpClient } from "@angular/common/http"; import { Injectable } from "@angular/core"; import { FormBuilder, FormControl, Validators } from "@angular/forms"; -import { Observable } from "rxjs"; -import { map, tap } from "rxjs/operators"; -import { CState } from "../models/state"; +import { tap } from "rxjs/operators"; import { SharedService } from "./shared.service"; @Injectable() @@ -46,13 +44,6 @@ export class AddressService { return isValid ? null : { whitespace: true }; } - // Country ID: 105 is for INDIA. - getAllStates(): Observable> { - return this.http - .get<{ states: Array }>(`api/v1/countries/105/states`) - .pipe(map((res) => res.states)); - } - updateAddress(updatedAddress, addressId, orderNumber) { const url = `api/v1/orders/${orderNumber}/addresses/${addressId}`; diff --git a/app/core/services/checkout.service.ts b/app/core/services/checkout.service.ts index 4b9c790..0bf32da 100644 --- a/app/core/services/checkout.service.ts +++ b/app/core/services/checkout.service.ts @@ -1,10 +1,11 @@ import { HttpClient } from "@angular/common/http"; -import { Inject, Injectable, PLATFORM_ID } from "@angular/core"; +import { Injectable } from "@angular/core"; import { Store } from "@ngrx/store"; -import { Observable, of, throwError } from "rxjs"; +import { Observable, of } from "rxjs"; import { catchError, map, switchMap, tap } from "rxjs/operators"; import { IappState } from "~/app.reducers"; import { Order } from "../models/order"; +import { CState } from "../models/state"; import { CheckoutActions } from "./../../checkout/actions/checkout.actions"; import { LineItem } from "./../models/line_item"; import { SharedService } from "./shared.service"; @@ -42,7 +43,7 @@ export class CheckoutService { ); } - // This API not works with Admin user + // This API do not works with Admin user createNewOrder(orderParams): Observable { const newOrderUrl = `api/v1/orders`; @@ -182,4 +183,12 @@ export class CheckoutService { getOrderDetail(orderNumber: string): Observable { return this.http.get(`api/v1/orders/${orderNumber}`); } + + // Country ID: 105 is for INDIA. + getAllStates(): Observable> { + return this.http + .get<{ states: Array }>(`api/v1/countries/105/states`) + .pipe(map((res) => res.states)); + } + } diff --git a/app/home/components/category-menu/category-menu.component.html b/app/home/components/category-menu/category-menu.component.html index a4b5daa..d017a32 100644 --- a/app/home/components/category-menu/category-menu.component.html +++ b/app/home/components/category-menu/category-menu.component.html @@ -4,11 +4,11 @@ - + - diff --git a/app/shared/component/products-list/products-list.component.html b/app/shared/component/products-list/products-list.component.html index 6303f49..aeac05f 100644 --- a/app/shared/component/products-list/products-list.component.html +++ b/app/shared/component/products-list/products-list.component.html @@ -5,7 +5,7 @@ - + diff --git a/app/shared/component/products-list/products-list.component.ts b/app/shared/component/products-list/products-list.component.ts index f4b7c19..9f381bf 100644 --- a/app/shared/component/products-list/products-list.component.ts +++ b/app/shared/component/products-list/products-list.component.ts @@ -24,6 +24,10 @@ export class ProductsListComponent implements OnInit { // } + trackByFn(index) { + return index; + } + productDetail(productSlug: string) { this.router.navigate(["/", productSlug]); } diff --git a/package.json b/package.json index 90b6f0e..0fc12f6 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "immutable": "^3.8.2", "jsonapi-deserializer": "^0.1.1", "nativescript-angular": "~6.0.6", - "nativescript-cardview": "^3.1.1", "nativescript-feedback": "^1.3.1", "nativescript-localstorage": "^2.0.0", "nativescript-ngx-shadow": "^6.4.0", From d7e527a6aebfafc4413e05181f37cac4e70e5e8b Mon Sep 17 00:00:00 2001 From: Gopal Date: Fri, 28 Dec 2018 16:24:06 +0530 Subject: [PATCH 3/3] minor changes --- .../Android/src/main/AndroidManifest.xml | 2 +- app/app.component.ts | 3 - app/core/services/json-api-parser.service.ts | 6 +- .../product-details.component.scss | 116 +----------------- 4 files changed, 4 insertions(+), 123 deletions(-) diff --git a/app/App_Resources/Android/src/main/AndroidManifest.xml b/app/App_Resources/Android/src/main/AndroidManifest.xml index a8287df..017331b 100644 --- a/app/App_Resources/Android/src/main/AndroidManifest.xml +++ b/app/App_Resources/Android/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ CardView); @Component({ selector: "ns-app", diff --git a/app/core/services/json-api-parser.service.ts b/app/core/services/json-api-parser.service.ts index 2f1747b..c2ccf1a 100644 --- a/app/core/services/json-api-parser.service.ts +++ b/app/core/services/json-api-parser.service.ts @@ -6,13 +6,11 @@ import { CJsonApi } from "../models/jsonapi"; }) export class JsonApiParserService { - constructor() { } - - parseSingleObj(data): Object { + parseSingleObj(data): object { return Object.assign(new CJsonApi(), data).toModel(); } - parseArrayofObject(array): Array { + parseArrayofObject(array): Array { return array.map( (obj) => Object.assign(new CJsonApi(), obj).toModel() ); diff --git a/app/product/component/product-details/product-details.component.scss b/app/product/component/product-details/product-details.component.scss index 56e13cc..0f663a8 100644 --- a/app/product/component/product-details/product-details.component.scss +++ b/app/product/component/product-details/product-details.component.scss @@ -1,119 +1,5 @@ @import '../../../app-variables'; -// .result-count { -// padding: 10dpi 5dpi; -// text-align: left; -// background-color: $gray-200; -// border-radius: 3dpi; -// } -// .list { -// padding-top: 40dpi; -// .product-base { -// border-bottom-width: 1px; -// border-bottom-color: $gray-10; -// background-color: $white; -// padding: 10dpi; -// height: auto; -// background-color: $background-light; -// border-radius: 5dpi; -// .imgcontainer { -// text-align: center; -// .more { -// white-space: normal; -// word-wrap: break-word; -// text-align: center; -// } -// } -// .product-name { -// font-size: 15em; -// color: $secondary; -// white-space: normal; -// word-wrap: break-word; -// } -// .product-price { -// white-space: normal; -// word-wrap: break-word; -// margin-top: 0.4em; -// text-align: left; -// font-size: 20em; -// color: $action-price-color; -// } -// .off { -// background-color: $success-dark; -// padding: 2dpi; -// border-radius: 5dpi; -// width: 300px; -// text-align: center; -// font-size: 10em; -// } -// .free-ship { -// display: block; -// padding: 5dpi 0; -// border-bottom-width: 1px; -// border-bottom-color: $gray-10; -// border-top-width: 1px; -// border-top-color: $gray-10; -// font-size: 10em; -// .free { -// font-weight: bold; -// margin-right: 2dpi; -// } -// } -// } -// } -// .product-base { -// width: 450px; -// border-radius: 7px; -// border-color: $gray-10; -// margin: 6dpi; -// height: auto; -// .product-img { -// text-align: center -// } -// } -// .product-price { -// font-size: 20dpi; -// color: $action-price-color -// } -// .add-to { -// border-color: $gray-10; -// padding: 10; -// text-align: center; -// color: $action-color; -// } -// } -// .product-json { -// text-overflow: normal; -// white-space: normal -// } -// .product-detail { -// .price { -// font-size: 20dpi; -// color: $action-price-color; -// text-emphasis: none; -// white-space: normal; -// } -// .btn-primary { -// border-radius: 10px; -// width: 96%; -// margin: 10px; -// border-color: $accent-dark; -// color: $white; -// border-width: 5,5,5,5; -// } -// .btn-outofstock { -// background-color: gray; -// border-radius: 10px; -// width: 96%; -// margin: 10px; -// border-color: gray; -// color: $white; -// border-width: 5,5,5,5; -// } -// .line-through { -// color: black; -// text-decoration: line-through; -// } -// } + .product-name { font-size: 15em; color: $secondary;