Commit 78a3ed33 authored by prumde's avatar prumde

Bug fixing


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174414 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c85f2597
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
} }
.img-back-32 { .img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../assets/images/svg/back_32_32.svg); content: url(../../assets/images/svg/back_32_32.svg);
} }
...@@ -74,6 +73,9 @@ ...@@ -74,6 +73,9 @@
margin-left: -2rem !important; margin-left: -2rem !important;
background: #F2F2F2; background: #F2F2F2;
} }
.fixed-header-back:hover {
box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1);
}
.ecm-section-info { .ecm-section-info {
padding: 8px; padding: 8px;
......
<div class="row sub-heading"> <div class="row sub-heading">
<div class="ecm-section-info" > <div class="ecm-section-info" >
<img class="fixed-header-back img-back-32 mat-raised-button" (click) = "backClicked();" /> <img class="fixed-header-back img-back-32 mat-raised-button" (click) = "backClicked();" src="back_32_32.svg" />
<ul class="ecm-breadcrumbs"> <ul class="ecm-breadcrumbs">
<li *ngFor="let breadcrumb of breadcrumbs; let i = index"> <li *ngFor="let breadcrumb of breadcrumbs; let i = index">
<a *ngIf="!((i+1) == breadcrumbs.length)" [routerLink]="[breadcrumb.url]">{{breadcrumb.label}}</a> <a *ngIf="!((i+1) == breadcrumbs.length)" [routerLink]="[breadcrumb.url]">{{breadcrumb.label}}</a>
......
...@@ -3,6 +3,10 @@ import { Location } from '@angular/common'; ...@@ -3,6 +3,10 @@ import { Location } from '@angular/common';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { EcmStoreModel } from '../ecm-store/ecm-store.model'; import { EcmStoreModel } from '../ecm-store/ecm-store.model';
import { ItemDetail } from '../ecm-model/product-detail-model'; import { ItemDetail } from '../ecm-model/product-detail-model';
import { Category } from '../ecm-model/category-model';
import { SubCategory } from '../ecm-model/subcategory-model';
import { Item } from '../ecm-model/product-model';
import { Observable } from 'rxjs/Observable';
interface IBreadcrumb { interface IBreadcrumb {
label: string; label: string;
...@@ -20,6 +24,10 @@ export class EcmBreadcrumbsComponent implements OnInit { ...@@ -20,6 +24,10 @@ export class EcmBreadcrumbsComponent implements OnInit {
@Input() pageName; @Input() pageName;
breadcrumbs: IBreadcrumb[] = []; breadcrumbs: IBreadcrumb[] = [];
category : Observable<Category>;
subcategory : Observable<SubCategory>;
item : Observable<Item>;
constructor( private _location: Location, private store: Store<EcmStoreModel> ) { } constructor( private _location: Location, private store: Store<EcmStoreModel> ) { }
ngOnInit() { ngOnInit() {
...@@ -39,7 +47,22 @@ export class EcmBreadcrumbsComponent implements OnInit { ...@@ -39,7 +47,22 @@ export class EcmBreadcrumbsComponent implements OnInit {
label: category_shDescr, label: category_shDescr,
url: 'javascript:void(0)' url: 'javascript:void(0)'
}); });
/*
this.category = this.store.select('CATEGORY');
this.category.subscribe( storeCategory => {
let category_shDescr = storeCategory!.shDescr;
console.log('>>>category_shDescr ::' + category_shDescr);
this.breadcrumbs = [];
this.breadcrumbs.push( {
label: 'Home',
url: '/home'
});
this.breadcrumbs.push( {
label: category_shDescr,
url: 'javascript:void(0)'
});
});
*/
} }
if ( this.pageName == 'ITEMS' ) { if ( this.pageName == 'ITEMS' ) {
...@@ -77,6 +100,37 @@ export class EcmBreadcrumbsComponent implements OnInit { ...@@ -77,6 +100,37 @@ export class EcmBreadcrumbsComponent implements OnInit {
label: subcatShDescr, label: subcatShDescr,
url: 'javascript:void(0)' url: 'javascript:void(0)'
}); });
/*
this.category = this.store.select('CATEGORY');
this.category.subscribe( storeCategory => {
let catCode = storeCategory!.catCode;
let category_shDescr = storeCategory!.shDescr;
console.log('>>>catCode ::' + catCode);
console.log('>>>category_shDescr ::' + category_shDescr);
this.breadcrumbs = [];
this.breadcrumbs.push( {
label: 'Home',
url: '/home'
});
this.breadcrumbs.push( {
label: category_shDescr,
url: '/categories/' + catCode
});
this.subcategory = this.store.select('SUBCATEGORY');
this.subcategory.subscribe( storeSubCategory => {
let subcatShDescr = storeSubCategory!.shDescr;
this.breadcrumbs.push( {
label: subcatShDescr,
url: 'javascript:void(0)'
});
});
});
*/
} }
...@@ -112,11 +166,6 @@ export class EcmBreadcrumbsComponent implements OnInit { ...@@ -112,11 +166,6 @@ export class EcmBreadcrumbsComponent implements OnInit {
label: subcatShDescr, label: subcatShDescr,
url: '/products/' + scatCode url: '/products/' + scatCode
}); });
// this.breadcrumbs.push( {
// label: itemShDescr,
// // url: '/details/' + itemCode
// url: 'javascript:void(0)'
// });
} }
if ( this.pageName == 'CART' ) { if ( this.pageName == 'CART' ) {
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
} }
.ecm-card-info { .ecm-card-info {
padding: 6px 0px 8px 8px; padding: 6px 0px 8px 8px;
width: calc(100% - 165px); /*width: calc(100% - 165px);*/
width: calc(100% - 150px);
float: left; float: left;
} }
.ecm-card-info-title { .ecm-card-info-title {
...@@ -36,29 +37,37 @@ ...@@ -36,29 +37,37 @@
overflow: hidden; overflow: hidden;
} }
.ecm-card-info-subhead { .ecm-card-info-subhead {
/* ...
font-size: 12px; font-size: 12px;
color: #888; color: #888;
display: block;
top: 7px; top: 7px;
position: relative; position: relative;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
line-height: 15px; line-height: 15px;
*/
display: block;
font-size: 12px; white-space: nowrap;
color: #888; text-overflow: ellipsis;
display: block;
top: 7px;
position: relative;
overflow: hidden;
line-height: 15px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
} }
/*
@supports (-webkit-line-clamp: 2) {
.ecm-card-info-subhead {
font-size: 12px;
color: #888;
top: 7px;
position: relative;
overflow: hidden;
line-height: 15px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
text-overflow: initial;
}
}
*/
.ecm-card-info-img { .ecm-card-info-img {
float: left; float: left;
/*background-color: mediumvioletred;*/ /*background-color: mediumvioletred;*/
...@@ -121,14 +130,14 @@ p { ...@@ -121,14 +130,14 @@ p {
} }
.ecm-ratings{ .ecm-ratings{
top: 10px !important; /* top: 10px !important; */
font-size: 20px; font-size: 20px;
color: rgb(500, 150, 50); color: rgb(500, 150, 50);
display: block; display: block;
position: relative; position: relative;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
top: 5px; /* top: 5px; */
} }
.ecm-rupee{ .ecm-rupee{
...@@ -142,7 +151,7 @@ p { ...@@ -142,7 +151,7 @@ p {
#ecm-item-info { #ecm-item-info {
padding: 10px; padding: 10px;
width: calc(100%-120px); width: calc(100% - 120px);
} }
#ecm-item-info-title { #ecm-item-info-title {
......
...@@ -47,15 +47,12 @@ ...@@ -47,15 +47,12 @@
} }
.img-user-32 { .img-user-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../assets/images/svg/user_32_32.svg); content: url(../../assets/images/svg/user_32_32.svg);
} }
.img-logo-32 { .img-logo-32 {
/*content: url(../../assets/images/logo_32_32.png);*/
content: url(../../assets/images/svg/logo_32_32.svg); content: url(../../assets/images/svg/logo_32_32.svg);
} }
.img-cart-32 { .img-cart-32 {
/*content: url(../../assets/images/logo_32_32.png);*/
content: url(../../assets/images/svg/cart_32_32.svg); content: url(../../assets/images/svg/cart_32_32.svg);
} }
......
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
<div class="input-container-bg" [@fadeState]="headerFadeState"></div> <div class="input-container-bg" [@fadeState]="headerFadeState"></div>
<div class="input-container"> <div class="input-container">
<img *ngIf="userData" mdTooltip="Click here to Manage Account" [mdTooltipPosition]="'below'" [src]="profileImageLink" onerror="this.src = '/ecm/assets/images/w_user_128_128.png'; " class="user-adj user-image-128" title= "{{userData.name}}" (click)="showSidePanel('USER_OPT');" [@userState]="headerFadeState" /> <img *ngIf="userData" mdTooltip="Click here to Manage Account" [mdTooltipPosition]="'below'" [src]="profileImageLink" onerror="this.src = '/ecm/assets/images/w_user_128_128.png'; " class="user-adj user-image-128" title= "{{userData.name}}" (click)="showSidePanel('USER_OPT');" [@userState]="headerFadeState" />
<img *ngIf="!userData" mdTooltip="Click here for Login" [mdTooltipPosition]="'below'" (click)="showOverlayPanel('USER_OPT');" class="img-user user-adj" [@userState]="headerFadeState" /> <img *ngIf="!userData" mdTooltip="Click here for Login" [mdTooltipPosition]="'below'" (click)="showOverlayPanel('USER_OPT');" class="img-user user-adj" [@userState]="headerFadeState" src="w_user_128_128.png"/>
<div class="row"> <div class="row">
<div class="small-12 medium-10 large-10 medium-centered column"> <div class="small-12 medium-10 large-10 medium-centered column">
<img class="img-logo logo-adj" [@l2dLogoTrans]="headerFadeState" /> <img class="img-logo logo-adj" [@l2dLogoTrans]="headerFadeState" src="logo.png" />
<ecm-search [compFadeState]="headerFadeState" [headerState]="'relative'"></ecm-search> <ecm-search [compFadeState]="headerFadeState" [headerState]="'relative'"></ecm-search>
</div> </div>
</div> </div>
...@@ -49,13 +49,13 @@ ...@@ -49,13 +49,13 @@
<ng-template #fixedHeader> <ng-template #fixedHeader>
<md-toolbar color="primary"> <md-toolbar color="primary">
<img class="fixed-header-logo img-logo-32" /> <img class="fixed-header-logo img-logo-32" src="logo_32_32.svg" />
<span class="siteHeading">{{siteHeading}}</span> <span class="siteHeading">{{siteHeading}}</span>
<ecm-search [compFadeState]="headerFadeState" [headerState]="'fixed'"></ecm-search> <ecm-search [compFadeState]="headerFadeState" [headerState]="'fixed'"></ecm-search>
<span [ngClass]="{'cart-span': sideOption=='CART_OPT'}" (click)="cartAction();" > <span [ngClass]="{'cart-span': sideOption=='CART_OPT'}" (click)="cartAction();" >
<button md-button class="square-button"> <button md-button class="square-button">
<span *ngIf="cartItems > 0" class="fixed-header-badge">{{ cartCounter | async }}</span> <span *ngIf="cartItems > 0" class="fixed-header-badge">{{ cartCounter | async }}</span>
<img mdTooltip="Show Cart" [mdTooltipPosition]="'below'" class="fixed-header-cart img-cart-32" /> <img mdTooltip="Show Cart" [mdTooltipPosition]="'below'" class="fixed-header-cart img-cart-32" src="cart_32_32.svg"/>
<!-- <img *ngIf="cartItems == 0" class="fixed-header-cart img-cart-32 no-badge" /> --> <!-- <img *ngIf="cartItems == 0" class="fixed-header-cart img-cart-32 no-badge" /> -->
<!--<md-icon class="example-icon">shopping_cart</md-icon>--> <!--<md-icon class="example-icon">shopping_cart</md-icon>-->
</button> </button>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<span [ngClass]="{'user-span': userData && sideOption=='USER_OPT'}" (click)="userAction();" > <span [ngClass]="{'user-span': userData && sideOption=='USER_OPT'}" (click)="userAction();" >
<button md-button class="square-button"> <button md-button class="square-button">
<img *ngIf="userData" mdTooltip="Click here to Manage Account" [mdTooltipPosition]="'below'" [src]="profileImageLink" onerror="this.src = '/ecm/assets/images/svg/user_32_32.svg'; this.className = 'fixed-header-no-user'" title="{{userData.name}}" [ngClass]="( userImage.src.indexOf('/ibase/') > 0 ) ? 'fixed-header-user' : 'fixed-header-no-user' " #userImage/> <img *ngIf="userData" mdTooltip="Click here to Manage Account" [mdTooltipPosition]="'below'" [src]="profileImageLink" onerror="this.src = '/ecm/assets/images/svg/user_32_32.svg'; this.className = 'fixed-header-no-user'" title="{{userData.name}}" [ngClass]="( userImage.src.indexOf('/ibase/') > 0 ) ? 'fixed-header-user' : 'fixed-header-no-user' " #userImage/>
<img *ngIf="!userData" mdTooltip="Click here for Login" [mdTooltipPosition]="'below'" class="fixed-header-no-user img-user-32"/> <img *ngIf="!userData" mdTooltip="Click here for Login" [mdTooltipPosition]="'below'" class="fixed-header-no-user img-user-32" src="user_32_32.svg"/>
<!--<md-icon class="example-icon">account_circle</md-icon>--> <!--<md-icon class="example-icon">account_circle</md-icon>-->
</button> </button>
</span> </span>
......
...@@ -121,6 +121,10 @@ export class ECMHeaderComponent implements OnInit, OnDestroy, AfterViewChecked { ...@@ -121,6 +121,10 @@ export class ECMHeaderComponent implements OnInit, OnDestroy, AfterViewChecked {
onWindowScroll() { onWindowScroll() {
let scrollTop: number = this.document.body.scrollTop; let scrollTop: number = this.document.body.scrollTop;
if( scrollTop == 0 )
{
scrollTop = window.scrollY;
}
if ( this.isFixedHeader ) { if ( this.isFixedHeader ) {
if ( scrollTop > 10 && scrollTop < 50 ) { if ( scrollTop > 10 && scrollTop < 50 ) {
...@@ -150,7 +154,7 @@ export class ECMHeaderComponent implements OnInit, OnDestroy, AfterViewChecked { ...@@ -150,7 +154,7 @@ export class ECMHeaderComponent implements OnInit, OnDestroy, AfterViewChecked {
} }
} }
//console.log('headerFadeState[' + this.headerFadeState + ']' + scrollTop ); //console.log('headerFadeState[' + this.headerFadeState + ']' + scrollTop + 'window.scrollY['+ window.scrollY+']');
localStorage.setItem( 'scrollTop', scrollTop + '' ); localStorage.setItem( 'scrollTop', scrollTop + '' );
//this.scrollTop = scrollTop; //this.scrollTop = scrollTop;
//localStorage.setItem('scrollHeight', document.body.scrollHeight + ''); //localStorage.setItem('scrollHeight', document.body.scrollHeight + '');
......
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
.attachedFile { .attachedFile {
border: none !important; border: none !important;
height: auto !important;
} }
.thumbnailView { .thumbnailView {
......
...@@ -93,6 +93,33 @@ export class EcmImageComponent implements OnInit, AfterViewChecked { ...@@ -93,6 +93,33 @@ export class EcmImageComponent implements OnInit, AfterViewChecked {
this.targetDiv.nativeElement.innerHTML = ""; this.targetDiv.nativeElement.innerHTML = "";
} }
} }
/*
initSingleImage(objName:string, refSer:string, refId:string)
{
console.log("initSingleImage check window.getImagePlugin ");
if (! getImagePlugin ){
console.log("window.getImagePlugin is null" );
return;
}
// Get the target element in which you want to add AttachmentsPlugin.
console.log("loadImage after check window.getImagePlugin ");
getImagePlugin({
OBJ_NAME : objName,
REF_SER : refSer,
REF_ID : refId,//ITEM_CODE
// host url can be empty in browser
// for mobile devices it has be specified correctly
HOST_URL : "",
DOC_TYPE : "",
IS_HOSTED_MODE : true || false,
ENABLE_SINGLE_IMAGE : true
}, this, 'imageCallback');
}
imageCallback(data:any) {
console.log("imageCallback data>>" + data);
}
*/
ngAfterViewChecked() ngAfterViewChecked()
{ {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
export class ItemDetail { export class ItemDetail {
public itemCode: string = ''; public itemCode: string = '';
public itemQuantity: number;
public itemCategory: any; // JSON String public itemCategory: any; // JSON String
public itemSubCategory: any; // JSON String public itemSubCategory: any; // JSON String
public itemHeader: any; // JSON String public itemHeader: any; // JSON String
......
...@@ -8,6 +8,7 @@ export class Item { ...@@ -8,6 +8,7 @@ export class Item {
public shDescr: string = ''; public shDescr: string = '';
public costRate: string; public costRate: string;
public rating: number; public rating: number;
public itemQuantity: number ;
public scat_sh_descr: string = ''; public scat_sh_descr: string = '';
public scat_descr: string = ''; public scat_descr: string = '';
public cat_sh_descr: string = ''; public cat_sh_descr: string = '';
......
...@@ -57,26 +57,26 @@ export class EcmProductDetailsComponent implements OnInit { ...@@ -57,26 +57,26 @@ export class EcmProductDetailsComponent implements OnInit {
getItemDetail( itemCode: string ) { getItemDetail( itemCode: string ) {
this.subcategoryService.getItemDetail( itemCode ).subscribe( this.subcategoryService.getItemDetail( itemCode ).subscribe(
itemDetail => { itemDetail => {
console.log( 'comp itemCode[' + itemCode + '] itemDetail[' + itemDetail + '] \n this.itemDetail[' + JSON.stringify( itemDetail ) + ']' ); if( itemDetail ) console.log( 'comp itemCode[' + itemCode + '] itemDetail[' + itemDetail + '] \n this.itemDetail[' + JSON.stringify( itemDetail ) + ']' );
this.itemDetail = itemDetail;
let ecmTemplateName = itemDetail.itemCategory.ecmTemplate;
console.log( "getItemDetail ecmTemplateName: " + ecmTemplateName )
this.ecmTemplate = ECM_TEMPLATES[ecmTemplateName];
this.itemDetail = itemDetail;
if(this.itemDetail) if(this.itemDetail)
{ {
this.storeCatSubcat();
let ecmTemplateName = itemDetail.itemCategory.ecmTemplate;
console.log( "getItemDetail ecmTemplateName: " + ecmTemplateName )
this.ecmTemplate = ECM_TEMPLATES[ecmTemplateName];
this.scatCode = this.itemDetail.itemSubCategory.scatCode; this.scatCode = this.itemDetail.itemSubCategory.scatCode;
console.log("Changed scatCode.."+this.scatCode); console.log("Changed scatCode.."+this.scatCode);
}
if( this.ecmTemplate )
if( this.ecmTemplate ) {
{ this.ecmTemplate.setItemDetail(itemDetail);
this.ecmTemplate.setItemDetail(itemDetail); }
else
} {
else alert( "Sorry, the " + ecmTemplateName + " is not in the system yet!" );
{ }
alert( "Sorry, the " + ecmTemplateName + " is not in the system yet!" );
} }
console.log( 'comp ecmTemplate[' + this.ecmTemplate + ']' ); console.log( 'comp ecmTemplate[' + this.ecmTemplate + ']' );
}, },
...@@ -128,5 +128,18 @@ export class EcmProductDetailsComponent implements OnInit { ...@@ -128,5 +128,18 @@ export class EcmProductDetailsComponent implements OnInit {
showSnackbar(message) { showSnackbar(message) {
this.snackBar.open(message, '', {duration: 2000}); this.snackBar.open(message, '', {duration: 2000});
} }
storeCatSubcat()
{
let category = this.itemDetail.itemCategory;
if( category ) {
this.store.dispatch({type: 'CATEGORY', payload: category});
}
let subCategory = this.itemDetail.itemSubCategory;
if( subCategory ) {
this.store.dispatch({type: 'SUB_CATEGORY', payload: subCategory});
}
}
} }
...@@ -79,6 +79,7 @@ select{ ...@@ -79,6 +79,7 @@ select{
color: mediumvioletred; color: mediumvioletred;
background-color: #fefefe; background-color: #fefefe;
-moz-appearance: none; -moz-appearance: none;
-webkit-appearance: none;
background-image: url(../../../assets/images/down_arrow.png); background-image: url(../../../assets/images/down_arrow.png);
background-position: right .5rem center; background-position: right .5rem center;
background-repeat: no-repeat; background-repeat: no-repeat;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<span class="search-which-border"> <span class="search-which-border">
<div class="locate-me">{{ userLocation ? userLocation.city : 'Locate Me' }}</div> <div class="locate-me">{{ userLocation ? userLocation.city : 'Locate Me' }}</div>
<div class="locate-handle" (click)="loacteMe();" ></div> <div class="locate-handle" (click)="loacteMe();" ></div>
<img class="img-locate" title="Locate Me" /> <img class="img-locate" title="Locate Me" src="locate_20_20.png"/>
</span> </span>
</span> </span>
<button md-raised-button class="search-submit" (click)="search(myInput.value)">Search</button> <button md-raised-button class="search-submit" (click)="search(myInput.value)">Search</button>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<form> <form>
<input #myInput type="text" placeholder="Search Food, Tour, Events and More..." class="search-terms-fixed" value="" name="search" id="search" /> <input #myInput type="text" placeholder="Search Food, Tour, Events and More..." class="search-terms-fixed" value="" name="search" id="search" />
<div md-ripple class="location" (click)="loacteMe();"> <div md-ripple class="location" (click)="loacteMe();">
<img class="location-img-32"/> <img class="location-img-32" src="location_32_32.svg"/>
<span class="location-text">{{ userLocation ? userLocation.address : 'Locate Me' }}</span> <span class="location-text">{{ userLocation ? userLocation.address : 'Locate Me' }}</span>
<i class="material-icons location-arrow">keyboard_arrow_down</i> <i class="material-icons location-arrow">keyboard_arrow_down</i>
</div> </div>
......
<div class="row"> <div class="row">
<div class="small-12 medium-5 large-4 medium-centered column"> <div class="small-12 medium-5 large-4 medium-centered column">
<div class="signin-form-adj" > <div class="signin-form-adj" >
<img class="img-logo logo-adj" /> <img class="img-logo logo-adj" src="logo.png" />
</div> </div>
<div class="signin-form"> <div class="signin-form">
<h4>Login to continue</h4> <h4>Login to continue</h4>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
} }
.itemImage .itemImage
{ {
position: relative;
height: 55px; height: 55px;
width: 55px; width: 55px;
border-radius: 2px; border-radius: 2px;
...@@ -204,7 +205,7 @@ ...@@ -204,7 +205,7 @@
.item-image{ .item-image{
width: 140px; width: 140px;
padding-top: 16px; padding-top: 16px;
position: relative;
} }
.change-color{ .change-color{
padding-top: 16px; padding-top: 16px;
......
<div *ngIf="isMiniCart then miniCart; else fullCart;"></div> <div *ngIf="isMiniCart then miniCart; else fullCart;"></div>
<!-- --<div *ngIf="cartItemsDetail && miniView">------ -->
<ng-template #miniCart>
<div *ngIf="cartItemsDetail">
<div class="cartItemsDetail"
*ngFor="let item of cartItemsDetail | slice:0:show; let i=index">
<table style="border: 2px solid ghostwhite; width: 100%;">
<tr>
<td class="itemImage"><ecm-image [refId]='item.itemCode'
[refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage]="true"></ecm-image></td>
<td class="itemdescription" (click)="viewItem(item.itemCode)">{{item.descr}}</td>
<td style="padding: 10px;">₹ {{item.costRate}}</td>
<td (click)="deleteCartItem(item.itemCode)" style="cursor: pointer;">
<span class="delete-icon">x</span>
</td>
</tr>
</table>
<ng-template #miniCart>
<div *ngIf="cartCount == 0" >
<span> Your cart is empty <i class="material-icons" style="color: mediumvioletred; font-size: 20px;">add_shopping_cart</i> </span>
</div> </div>
<!-- <div class="ViewAll" *ngIf="cartItemsDetail.length > 3 && show == 3" (click)="show = cartItemsDetail.length"> -->
<div *ngIf="cartCount > 0">
<div class="ViewAll" *ngIf="cartItemsDetail.length > 3 && show == 3" <div class="cartItemsDetail" *ngFor="let item of cartItemsDetail | slice:0:displayItem; let i=index">
(click)="showTotalCartItems()"> <table style="border: 2px solid ghostwhite; width: 100%;">
<a md-button class="viewAll-button" [routerLink]="['/cart']" <tr>
(click)="closePanel.emit();"> View All ( <td class="itemImage"><ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage]="true" [isThumbnail]="true"></ecm-image></td>
{{cartItemsDetail.length}} )</a> <td class="itemdescription" (click)="viewItem(item.itemCode)">{{item.descr}}</td>
<td style="padding: 10px;">₹ {{item.costRate}}</td>
<!-- <span class="ecm-View" style="cursor: pointer;position: absolute;">ViewAll ( {{cartItemsDetail.length}} )</span> --> <td (click)="deleteCartItem(item.itemCode)" style="cursor: pointer;"><span class="delete-icon">x</span></td>
</tr>
</table>
</div>
<div class="ViewAll" *ngIf="cartCount > displayItem" (click)="showTotalCartItems()">
<a md-button class="viewAll-button" [routerLink]="['/cart']" (click)="closePanel.emit();"> View All ( {{cartCount}} )</a>
</div>
<!-- <button md-button class="checkout-button" [routerLink]="['/checkout']">Checkout</button> -->
<button md-button class="checkout-button" [routerLink]="['/checkout']">Checkout
<i class="material-icons" style="position: relative; left: 8px;">trending_flat</i>
</button>
</div> </div>
<!-- <button md-raised-button class="button medium-btn-checkout" style="background: mediumvioletred; color:#fff;" >Checkout</button> -->
<button md-button class="checkout-button" [routerLink]="['/checkout']">Checkout</button>
</div>
</ng-template> </ng-template>
<!-- ---------================ MiniCart Ends==============================---------------------------- --> <!-- ---------================ MiniCart Ends==============================---------------------------- -->
...@@ -42,19 +34,17 @@ ...@@ -42,19 +34,17 @@
<div *ngIf="cartItemsDetail"> <div *ngIf="cartItemsDetail">
<ecm-header [isFixedHeader]=false> </ecm-header> <ecm-header [isFixedHeader]=false> </ecm-header>
<ecm-breadcrumbs [pageName]="'CART'"></ecm-breadcrumbs> <ecm-breadcrumbs [pageName]="'CART'"></ecm-breadcrumbs>
<div class="row details-of-Cart"> <div class="row details-of-Cart">
<md-card class="medium-8 columns cartItemsDetails"> <md-card class="medium-8 columns cartItemsDetails">
<div class="ecmdetailsItems"> <div class="ecmdetailsItems">
<div class="ecm-headings"> <div class="ecm-headings">
<span>({{cartItems}}) My Cart</span> <span>({{cartCount}}) My Cart</span>
</div> </div>
<hr> <hr>
<div class="listItems" *ngFor="let item of cartItemsDetail"> <div class="listItems" *ngFor="let item of cartItemsDetail">
<div class="media-object-section item-image"> <div class="media-object-section item-image">
<ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage]="true"></ecm-image> <ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage]="true" [isThumbnail]="true"></ecm-image>
</div> </div>
<div class="media-object-section" style="width: 500px;"> <div class="media-object-section" style="width: 500px;">
...@@ -73,11 +63,11 @@ ...@@ -73,11 +63,11 @@
<div class="media-object-section" style="width: 228px;"> <div class="media-object-section" style="width: 228px;">
<div class="counter"> <div class="counter">
<button md-button [disabled]="disable()" class="counter-button" (click)="decrement()"> <button md-button [disabled]="checkQantity(item)" class="counter-button" (click)="decrement(item)">
<i class="material-icons" style="padding: 0px;">remove</i> <i class="material-icons" style="padding: 0px;">remove</i>
</button> </button>
<span> <input class="ecm-textBox" type="text" [value]="counterValue"></span> <span> <input class="ecm-textBox" type="text" [value]="item.itemQuantity"></span>
<button md-button class="counter-button" (click)="increment()"> <button md-button class="counter-button" (click)="increment(item)">
<i class="material-icons" style="padding: 0px;">add</i> <i class="material-icons" style="padding: 0px;">add</i>
</button> </button>
</div> </div>
...@@ -105,7 +95,7 @@ ...@@ -105,7 +95,7 @@
</div> </div>
<div class="totalProductsInfo"> <div class="totalProductsInfo">
<div class="priceItems"> <div class="priceItems">
<span style="font-size: 15px;">Price ( {{cartItems}} Items )</span> <span style="font-size: 15px;">Price ( {{cartCount}} Items )</span>
<span class="price-info">Rs. {{totalPrice}}</span> <span class="price-info">Rs. {{totalPrice}}</span>
</div> </div>
<br> <br>
...@@ -134,5 +124,6 @@ ...@@ -134,5 +124,6 @@
</md-card> </md-card>
</div> </div>
</div> </div>
<ecm-footer> </ecm-footer>
</div> </div>
</ng-template> </ng-template>
...@@ -2,6 +2,9 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; ...@@ -2,6 +2,9 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Http, Response, Headers, RequestOptions, URLSearchParams } from '@angular/http' import { Http, Response, Headers, RequestOptions, URLSearchParams } from '@angular/http'
import { MdSnackBar } from '@angular/material'; import { MdSnackBar } from '@angular/material';
import { MdDialog, MdDialogRef } from '@angular/material'; import { MdDialog, MdDialogRef } from '@angular/material';
import { ItemDetail } from '../../ecm-model/product-detail-model';
import { EcmCategoryComponent } from '../ecm-category/ecm-category.component';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
...@@ -11,28 +14,29 @@ import { INCREMENT, DECREMENT, RESET } from '../../ecm-store/ecm-store'; ...@@ -11,28 +14,29 @@ import { INCREMENT, DECREMENT, RESET } from '../../ecm-store/ecm-store';
import { Item } from '../../ecm-model/product-model'; import { Item } from '../../ecm-model/product-model';
import { EcmCartService } from './ecm-cart.service'; import { EcmCartService } from './ecm-cart.service';
import { ECMCart } from '../../ecm-model/cart-model'; import { ECMCart } from '../../ecm-model/cart-model';
import { EcmProductDetailService } from '../../ecm-product-details/ecm-product-detail.service';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
@Component( { @Component( {
selector: 'ecm-cart', selector: 'ecm-cart',
templateUrl: './ecm-cart.component.html', templateUrl: './ecm-cart.component.html',
styleUrls: ['./ecm-cart.component.css'] styleUrls: ['./ecm-cart.component.css'],
providers: [EcmProductDetailService]
}) })
export class EcmCartComponent implements OnInit { export class EcmCartComponent implements OnInit {
cartItemsDetail: Item[]; cartItemsDetail: Item[];
cartItems = 0; cartCount = 0;
catCode; catCode;
show = 3; displayItem = 3;
totalPrice: number = 0; totalPrice: number = 0;
counterValue = 1;
itemPrice = 1000;
total = this.totalPrice;
@Input() isMiniCart: boolean = false; @Input() isMiniCart: boolean = false;
@Output() closePanel = new EventEmitter(); @Output() closePanel = new EventEmitter();
@Output() doActivity = new EventEmitter(); @Output() doActivity = new EventEmitter();
selectedOption: string; selectedOption: string;
constructor( private route: ActivatedRoute, public dialog: MdDialog, private router: Router, public cartService: EcmCartService, public snackBar: MdSnackBar, private http: Http, private store: Store<EcmStoreModel> ) { }
constructor( private route: ActivatedRoute, public dialog: MdDialog, private router: Router,public subcategoryService: EcmProductDetailService, public cartService: EcmCartService, public snackBar: MdSnackBar, private http: Http, private store: Store<EcmStoreModel> ) { }
ngOnInit() { ngOnInit() {
this.getCartItem(); this.getCartItem();
...@@ -42,11 +46,18 @@ export class EcmCartComponent implements OnInit { ...@@ -42,11 +46,18 @@ export class EcmCartComponent implements OnInit {
this.cartService.getCartItems().subscribe( this.cartService.getCartItems().subscribe(
cartItemsDetail => { cartItemsDetail => {
this.cartItemsDetail = cartItemsDetail; this.cartItemsDetail = cartItemsDetail;
this.cartItems = this.cartItemsDetail.length; if( this.cartItemsDetail && this.cartItemsDetail.length)
console.log( 'comp cartItemsDetail[' + JSON.stringify( cartItemsDetail ) + '] \n this.cartItemsDetail[' + this.cartItemsDetail.length + ']' ); {
if ( this.cartItemsDetail ) { this.cartCount = this.cartItemsDetail.length ;
this.getTotalPrice(); console.log( 'comp cartItemsDetail[' + this.cartItemsDetail + '] \n this.cartItemsDetail[' + this.cartItemsDetail.length + ']' );
console.log( "the total Price is" + this.totalPrice ); if ( this.cartItemsDetail ) {
this.getTotalPrice();
console.log( "the total Price is" + this.totalPrice );
}
}
else
{
this.cartCount = 0;
} }
}, },
error => { error => {
...@@ -70,18 +81,10 @@ export class EcmCartComponent implements OnInit { ...@@ -70,18 +81,10 @@ export class EcmCartComponent implements OnInit {
let cartData = new ECMCart; let cartData = new ECMCart;
cartData.itemCode = itemCode; cartData.itemCode = itemCode;
this.store.dispatch({ type: DECREMENT, payload: cartData }); this.store.dispatch({ type: DECREMENT, payload: cartData });
this.openSnackBar( "Item in the Cart", "Deleted" ); this.openSnackBar('Item Removed from your Cart' );
}
openSnackBar( message: string, action: string ) {
this.snackBar.open( message, action, {
duration: 1000,
});
} }
showTotalCartItems() { showTotalCartItems() {
this.show = this.cartItemsDetail.length;
this.getTotalPrice(); this.getTotalPrice();
this.router.navigate( ['/cart'] ); this.router.navigate( ['/cart'] );
} }
...@@ -89,6 +92,7 @@ export class EcmCartComponent implements OnInit { ...@@ -89,6 +92,7 @@ export class EcmCartComponent implements OnInit {
getTotalPrice() { getTotalPrice() {
this.cartItemsDetail.forEach(( item, i ) => { this.cartItemsDetail.forEach(( item, i ) => {
this.totalPrice = this.totalPrice + parseFloat( item.costRate ); this.totalPrice = this.totalPrice + parseFloat( item.costRate );
item.itemQuantity = 1;
}); });
} }
...@@ -97,25 +101,42 @@ export class EcmCartComponent implements OnInit { ...@@ -97,25 +101,42 @@ export class EcmCartComponent implements OnInit {
this.totalPrice = this.totalPrice - parseFloat( item.costRate ); this.totalPrice = this.totalPrice - parseFloat( item.costRate );
}); });
} }
increment() { increment(item : Item) {
this.counterValue += 1; item.itemQuantity++;
this.total = this.counterValue * this.total; this.addToCart(item);
}
addToCart(data : Item) {
let cartData = new ECMCart;
cartData.itemCode = data.itemCode;
cartData.quantity = data.itemQuantity;
this.store.dispatch({ type: INCREMENT, payload: cartData });
this.subcategoryService.addToCart(cartData);
this.openSnackBar( data.shDescr + ' Added to your Cart ' );
} }
decrement() { decrement(item) {
this.counterValue -= 1; item.itemQuantity--;
this.total = this.total - this.total;
} }
disable() { checkQantity(item)
console.log( this.counterValue ); {
if ( this.counterValue == 1 ) if (item.itemQuantity == 1)
return true; return true;
else else
return false; return false;
} }
wishList() { wishList() {
alert( "item is added in a wishList" ); this.openSnackBar('Item Added to your Wishlist' );
}
openSnackBar( message: string ) {
this.snackBar.open( message, '', {
duration: 2000,
});
} }
openDialog( itemCode ) { openDialog( itemCode ) {
...@@ -126,11 +147,8 @@ export class EcmCartComponent implements OnInit { ...@@ -126,11 +147,8 @@ export class EcmCartComponent implements OnInit {
}); });
} }
viewItem( itemCode ) { viewItem( itemCode ) {
//this.productDetailComponent.getItemDetail(itemCode);
//this.setItemDetail.next(itemCode);
this.router.navigate( ['/detail', itemCode] ); this.router.navigate( ['/detail', itemCode] );
} }
} }
......
...@@ -188,3 +188,5 @@ ...@@ -188,3 +188,5 @@
</form> </form>
</div> </div>
<ecm-footer> </ecm-footer>
...@@ -72,8 +72,8 @@ ...@@ -72,8 +72,8 @@
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
} }
/*
.img-back-32 { .img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../../assets/images/svg/back_32_32.svg); content: url(../../../assets/images/svg/back_32_32.svg);
} }
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
padding: 0; padding: 0;
height: 20px !important; height: 20px !important;
width: 20px !important; width: 20px !important;
/* box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1); */
cursor: pointer; cursor: pointer;
border-radius: 100%; border-radius: 100%;
margin-left: -2rem !important; margin-left: -2rem !important;
...@@ -90,7 +89,7 @@ ...@@ -90,7 +89,7 @@
.fixed-header-back:hover { .fixed-header-back:hover {
box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1); box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1);
} }
*/
/* loading section */ /* loading section */
.loading { .loading {
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<section class="subcategories-section"> <section class="subcategories-section">
<div class="row row-subcategory"> <div class="row row-subcategory">
<div class="ecm-section-info"> <div class="ecm-section-info">
<span class="ecm-section-info-title">{{subcategory.shDescr}}</span> <span class="ecm-section-info-title">{{subcategory?.shDescr}}</span>
<span class="ecm-section-info-subhead">{{subcategory.descr}}</span> <span class="ecm-section-info-subhead">{{subcategory?.descr}}</span>
</div> </div>
<div class="small-12 medium-6 large-4 column end "*ngFor="let _item of items"> <div class="small-12 medium-6 large-4 column end "*ngFor="let _item of items">
<!--<ecm-item-caption [itemData]="_item"></ecm-item-caption> --> <!--<ecm-item-caption [itemData]="_item"></ecm-item-caption> -->
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
.product-image { .product-image {
width: 110px; width: 110px;
height: 110px; height: 110px;
position: relative;
} }
hr { hr {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="recent-view-items"> <div class="recent-view-items">
<div *ngFor="let item of recentViewItems | slice:0:show; let i=index" class="ecm-recent-view-card" (click)="viewItem(item.itemCode)"> <div *ngFor="let item of recentViewItems | slice:0:show; let i=index" class="ecm-recent-view-card" (click)="viewItem(item.itemCode)">
<div class="media-object-section product-image"> <div class="media-object-section product-image">
<ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true"></ecm-image> <ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" [isThumbnail]="true"></ecm-image>
</div> </div>
<div class="media-object-section"> <div class="media-object-section">
<span class="item-descr">{{item.descr}}</span> <span class="item-descr">{{item.descr}}</span>
......
<div *ngIf="relatedItems"> <div *ngIf="relatedItems && relatedItems.length">
<section class="related-items-section"> <section class="related-items-section">
<div class="row row-category"> <div class="row row-category">
<div class="ecm-section-info"> <div class="ecm-section-info">
......
...@@ -71,9 +71,8 @@ ...@@ -71,9 +71,8 @@
padding-left: 3rem; padding-left: 3rem;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
} }
/*
.img-back-32 { .img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../../assets/images/svg/back_32_32.svg); content: url(../../../assets/images/svg/back_32_32.svg);
} }
...@@ -82,7 +81,6 @@ ...@@ -82,7 +81,6 @@
padding: 0; padding: 0;
height: 20px !important; height: 20px !important;
width: 20px !important; width: 20px !important;
/* box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1); */
cursor: pointer; cursor: pointer;
border-radius: 100%; border-radius: 100%;
margin-left: -2rem !important; margin-left: -2rem !important;
...@@ -90,7 +88,7 @@ ...@@ -90,7 +88,7 @@
.fixed-header-back:hover { .fixed-header-back:hover {
box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1); box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1);
} }
*/
/* loading section */ /* loading section */
.loading { .loading {
min-height: calc(100% - 50px); min-height: calc(100% - 50px);
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<section class="subcategories-section"> <section class="subcategories-section">
<div class="row row-subcategory"> <div class="row row-subcategory">
<div class="ecm-section-info"> <div class="ecm-section-info">
<span *ngIf="category" class="ecm-section-info-title">{{category.shDescr}}</span> <span *ngIf="category" class="ecm-section-info-title">{{category?.shDescr}}</span>
<span *ngIf="category" class="ecm-section-info-subhead">{{category.descr}}</span> <span *ngIf="category" class="ecm-section-info-subhead">{{category?.descr}}</span>
</div> </div>
<div class="small-12 medium-6 large-4 column end " *ngFor="let _subcategory of subcategories"> <div class="small-12 medium-6 large-4 column end " *ngFor="let _subcategory of subcategories">
<ecm-card (storeData)="storeCategory(_subcategory)" [subcategory]="_subcategory"></ecm-card> <ecm-card (storeData)="storeCategory(_subcategory)" [subcategory]="_subcategory"></ecm-card>
......
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