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 @@
}
.img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../assets/images/svg/back_32_32.svg);
}
......@@ -74,6 +73,9 @@
margin-left: -2rem !important;
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 {
padding: 8px;
......
<div class="row sub-heading">
<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">
<li *ngFor="let breadcrumb of breadcrumbs; let i = index">
<a *ngIf="!((i+1) == breadcrumbs.length)" [routerLink]="[breadcrumb.url]">{{breadcrumb.label}}</a>
......
......@@ -3,6 +3,10 @@ import { Location } from '@angular/common';
import { Store } from '@ngrx/store';
import { EcmStoreModel } from '../ecm-store/ecm-store.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 {
label: string;
......@@ -20,6 +24,10 @@ export class EcmBreadcrumbsComponent implements OnInit {
@Input() pageName;
breadcrumbs: IBreadcrumb[] = [];
category : Observable<Category>;
subcategory : Observable<SubCategory>;
item : Observable<Item>;
constructor( private _location: Location, private store: Store<EcmStoreModel> ) { }
ngOnInit() {
......@@ -39,7 +47,22 @@ export class EcmBreadcrumbsComponent implements OnInit {
label: category_shDescr,
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' ) {
......@@ -77,6 +100,37 @@ export class EcmBreadcrumbsComponent implements OnInit {
label: subcatShDescr,
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 {
label: subcatShDescr,
url: '/products/' + scatCode
});
// this.breadcrumbs.push( {
// label: itemShDescr,
// // url: '/details/' + itemCode
// url: 'javascript:void(0)'
// });
}
if ( this.pageName == 'CART' ) {
......
......@@ -22,7 +22,8 @@
}
.ecm-card-info {
padding: 6px 0px 8px 8px;
width: calc(100% - 165px);
/*width: calc(100% - 165px);*/
width: calc(100% - 150px);
float: left;
}
.ecm-card-info-title {
......@@ -36,29 +37,37 @@
overflow: hidden;
}
.ecm-card-info-subhead {
/* ...
font-size: 12px;
color: #888;
display: block;
top: 7px;
position: relative;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
line-height: 15px;
*/
display: block;
white-space: nowrap;
text-overflow: ellipsis;
}
/*
@supports (-webkit-line-clamp: 2) {
.ecm-card-info-subhead {
font-size: 12px;
color: #888;
display: block;
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 {
float: left;
/*background-color: mediumvioletred;*/
......@@ -121,14 +130,14 @@ p {
}
.ecm-ratings{
top: 10px !important;
/* top: 10px !important; */
font-size: 20px;
color: rgb(500, 150, 50);
display: block;
position: relative;
text-overflow: ellipsis;
overflow: hidden;
top: 5px;
/* top: 5px; */
}
.ecm-rupee{
......@@ -142,7 +151,7 @@ p {
#ecm-item-info {
padding: 10px;
width: calc(100%-120px);
width: calc(100% - 120px);
}
#ecm-item-info-title {
......
......@@ -47,15 +47,12 @@
}
.img-user-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../assets/images/svg/user_32_32.svg);
}
.img-logo-32 {
/*content: url(../../assets/images/logo_32_32.png);*/
content: url(../../assets/images/svg/logo_32_32.svg);
}
.img-cart-32 {
/*content: url(../../assets/images/logo_32_32.png);*/
content: url(../../assets/images/svg/cart_32_32.svg);
}
......
......@@ -32,10 +32,10 @@
<div class="input-container-bg" [@fadeState]="headerFadeState"></div>
<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 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="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>
</div>
</div>
......@@ -49,13 +49,13 @@
<ng-template #fixedHeader>
<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>
<ecm-search [compFadeState]="headerFadeState" [headerState]="'fixed'"></ecm-search>
<span [ngClass]="{'cart-span': sideOption=='CART_OPT'}" (click)="cartAction();" >
<button md-button class="square-button">
<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" /> -->
<!--<md-icon class="example-icon">shopping_cart</md-icon>-->
</button>
......@@ -63,7 +63,7 @@
<span [ngClass]="{'user-span': userData && sideOption=='USER_OPT'}" (click)="userAction();" >
<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 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>-->
</button>
</span>
......
......@@ -121,6 +121,10 @@ export class ECMHeaderComponent implements OnInit, OnDestroy, AfterViewChecked {
onWindowScroll() {
let scrollTop: number = this.document.body.scrollTop;
if( scrollTop == 0 )
{
scrollTop = window.scrollY;
}
if ( this.isFixedHeader ) {
if ( scrollTop > 10 && scrollTop < 50 ) {
......@@ -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 + '' );
//this.scrollTop = scrollTop;
//localStorage.setItem('scrollHeight', document.body.scrollHeight + '');
......
......@@ -110,6 +110,7 @@
.attachedFile {
border: none !important;
height: auto !important;
}
.thumbnailView {
......
......@@ -93,6 +93,33 @@ export class EcmImageComponent implements OnInit, AfterViewChecked {
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()
{
......
......@@ -5,6 +5,7 @@
export class ItemDetail {
public itemCode: string = '';
public itemQuantity: number;
public itemCategory: any; // JSON String
public itemSubCategory: any; // JSON String
public itemHeader: any; // JSON String
......
......@@ -8,6 +8,7 @@ export class Item {
public shDescr: string = '';
public costRate: string;
public rating: number;
public itemQuantity: number ;
public scat_sh_descr: string = '';
public scat_descr: string = '';
public cat_sh_descr: string = '';
......
......@@ -57,27 +57,27 @@ export class EcmProductDetailsComponent implements OnInit {
getItemDetail( itemCode: string ) {
this.subcategoryService.getItemDetail( itemCode ).subscribe(
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;
if(this.itemDetail)
{
this.storeCatSubcat();
let ecmTemplateName = itemDetail.itemCategory.ecmTemplate;
console.log( "getItemDetail ecmTemplateName: " + ecmTemplateName )
this.ecmTemplate = ECM_TEMPLATES[ecmTemplateName];
if(this.itemDetail)
{
this.scatCode = this.itemDetail.itemSubCategory.scatCode;
console.log("Changed scatCode.."+this.scatCode);
}
if( this.ecmTemplate )
{
this.ecmTemplate.setItemDetail(itemDetail);
}
else
{
alert( "Sorry, the " + ecmTemplateName + " is not in the system yet!" );
}
}
console.log( 'comp ecmTemplate[' + this.ecmTemplate + ']' );
},
);
......@@ -129,4 +129,17 @@ export class EcmProductDetailsComponent implements OnInit {
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{
color: mediumvioletred;
background-color: #fefefe;
-moz-appearance: none;
-webkit-appearance: none;
background-image: url(../../../assets/images/down_arrow.png);
background-position: right .5rem center;
background-repeat: no-repeat;
......
......@@ -4,7 +4,7 @@
<span class="search-which-border">
<div class="locate-me">{{ userLocation ? userLocation.city : 'Locate Me' }}</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>
<button md-raised-button class="search-submit" (click)="search(myInput.value)">Search</button>
......@@ -13,7 +13,7 @@
<form>
<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();">
<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>
<i class="material-icons location-arrow">keyboard_arrow_down</i>
</div>
......
<div class="row">
<div class="small-12 medium-5 large-4 medium-centered column">
<div class="signin-form-adj" >
<img class="img-logo logo-adj" />
<img class="img-logo logo-adj" src="logo.png" />
</div>
<div class="signin-form">
<h4>Login to continue</h4>
......
......@@ -6,6 +6,7 @@
}
.itemImage
{
position: relative;
height: 55px;
width: 55px;
border-radius: 2px;
......@@ -204,7 +205,7 @@
.item-image{
width: 140px;
padding-top: 16px;
position: relative;
}
.change-color{
padding-top: 16px;
......
<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">
<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 *ngIf="cartCount > 0">
<div class="cartItemsDetail" *ngFor="let item of cartItemsDetail | slice:0:displayItem; 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="itemImage"><ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage]="true" [isThumbnail]="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>
<td (click)="deleteCartItem(item.itemCode)" style="cursor: pointer;"><span class="delete-icon">x</span></td>
</tr>
</table>
</div>
<!-- <div class="ViewAll" *ngIf="cartItemsDetail.length > 3 && show == 3" (click)="show = cartItemsDetail.length"> -->
<div class="ViewAll" *ngIf="cartItemsDetail.length > 3 && show == 3"
(click)="showTotalCartItems()">
<a md-button class="viewAll-button" [routerLink]="['/cart']"
(click)="closePanel.emit();"> View All (
{{cartItemsDetail.length}} )</a>
<!-- <span class="ecm-View" style="cursor: pointer;position: absolute;">ViewAll ( {{cartItemsDetail.length}} )</span> -->
<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>
<!-- <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>
<!-- ---------================ MiniCart Ends==============================---------------------------- -->
......@@ -42,19 +34,17 @@
<div *ngIf="cartItemsDetail">
<ecm-header [isFixedHeader]=false> </ecm-header>
<ecm-breadcrumbs [pageName]="'CART'"></ecm-breadcrumbs>
<div class="row details-of-Cart">
<md-card class="medium-8 columns cartItemsDetails">
<div class="ecmdetailsItems">
<div class="ecm-headings">
<span>({{cartItems}}) My Cart</span>
<span>({{cartCount}}) My Cart</span>
</div>
<hr>
<div class="listItems" *ngFor="let item of cartItemsDetail">
<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 class="media-object-section" style="width: 500px;">
......@@ -73,11 +63,11 @@
<div class="media-object-section" style="width: 228px;">
<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>
</button>
<span> <input class="ecm-textBox" type="text" [value]="counterValue"></span>
<button md-button class="counter-button" (click)="increment()">
<span> <input class="ecm-textBox" type="text" [value]="item.itemQuantity"></span>
<button md-button class="counter-button" (click)="increment(item)">
<i class="material-icons" style="padding: 0px;">add</i>
</button>
</div>
......@@ -105,7 +95,7 @@
</div>
<div class="totalProductsInfo">
<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>
</div>
<br>
......@@ -134,5 +124,6 @@
</md-card>
</div>
</div>
<ecm-footer> </ecm-footer>
</div>
</ng-template>
......@@ -2,6 +2,9 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Http, Response, Headers, RequestOptions, URLSearchParams } from '@angular/http'
import { MdSnackBar } 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';
......@@ -11,28 +14,29 @@ import { INCREMENT, DECREMENT, RESET } from '../../ecm-store/ecm-store';
import { Item } from '../../ecm-model/product-model';
import { EcmCartService } from './ecm-cart.service';
import { ECMCart } from '../../ecm-model/cart-model';
import { EcmProductDetailService } from '../../ecm-product-details/ecm-product-detail.service';
import { Router, ActivatedRoute } from '@angular/router';
@Component( {
selector: 'ecm-cart',
templateUrl: './ecm-cart.component.html',
styleUrls: ['./ecm-cart.component.css']
styleUrls: ['./ecm-cart.component.css'],
providers: [EcmProductDetailService]
})
export class EcmCartComponent implements OnInit {
cartItemsDetail: Item[];
cartItems = 0;
cartCount = 0;
catCode;
show = 3;
displayItem = 3;
totalPrice: number = 0;
counterValue = 1;
itemPrice = 1000;
total = this.totalPrice;
@Input() isMiniCart: boolean = false;
@Output() closePanel = new EventEmitter();
@Output() doActivity = new EventEmitter();
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() {
this.getCartItem();
......@@ -42,12 +46,19 @@ export class EcmCartComponent implements OnInit {
this.cartService.getCartItems().subscribe(
cartItemsDetail => {
this.cartItemsDetail = cartItemsDetail;
this.cartItems = this.cartItemsDetail.length;
console.log( 'comp cartItemsDetail[' + JSON.stringify( cartItemsDetail ) + '] \n this.cartItemsDetail[' + this.cartItemsDetail.length + ']' );
if( this.cartItemsDetail && this.cartItemsDetail.length)
{
this.cartCount = this.cartItemsDetail.length ;
console.log( 'comp cartItemsDetail[' + this.cartItemsDetail + '] \n this.cartItemsDetail[' + this.cartItemsDetail.length + ']' );
if ( this.cartItemsDetail ) {
this.getTotalPrice();
console.log( "the total Price is" + this.totalPrice );
}
}
else
{
this.cartCount = 0;
}
},
error => {
let errorMessage = <any>error;
......@@ -70,18 +81,10 @@ export class EcmCartComponent implements OnInit {
let cartData = new ECMCart;
cartData.itemCode = itemCode;
this.store.dispatch({ type: DECREMENT, payload: cartData });
this.openSnackBar( "Item in the Cart", "Deleted" );
}
openSnackBar( message: string, action: string ) {
this.snackBar.open( message, action, {
duration: 1000,
});
this.openSnackBar('Item Removed from your Cart' );
}
showTotalCartItems() {
this.show = this.cartItemsDetail.length;
this.getTotalPrice();
this.router.navigate( ['/cart'] );
}
......@@ -89,6 +92,7 @@ export class EcmCartComponent implements OnInit {
getTotalPrice() {
this.cartItemsDetail.forEach(( item, i ) => {
this.totalPrice = this.totalPrice + parseFloat( item.costRate );
item.itemQuantity = 1;
});
}
......@@ -97,25 +101,42 @@ export class EcmCartComponent implements OnInit {
this.totalPrice = this.totalPrice - parseFloat( item.costRate );
});
}
increment() {
this.counterValue += 1;
this.total = this.counterValue * this.total;
increment(item : Item) {
item.itemQuantity++;
this.addToCart(item);
}
decrement() {
this.counterValue -= 1;
this.total = this.total - this.total;
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 ' );
}
disable() {
console.log( this.counterValue );
if ( this.counterValue == 1 )
decrement(item) {
item.itemQuantity--;
}
checkQantity(item)
{
if (item.itemQuantity == 1)
return true;
else
return false;
}
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 ) {
......@@ -126,11 +147,8 @@ export class EcmCartComponent implements OnInit {
});
}
viewItem( itemCode ) {
//this.productDetailComponent.getItemDetail(itemCode);
//this.setItemDetail.next(itemCode);
this.router.navigate( ['/detail', itemCode] );
}
}
......
......@@ -72,8 +72,8 @@
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
}
/*
.img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../../assets/images/svg/back_32_32.svg);
}
......@@ -82,7 +82,6 @@
padding: 0;
height: 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;
border-radius: 100%;
margin-left: -2rem !important;
......@@ -90,7 +89,7 @@
.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);
}
*/
/* loading section */
.loading {
......
......@@ -21,8 +21,8 @@
<section class="subcategories-section">
<div class="row row-subcategory">
<div class="ecm-section-info">
<span class="ecm-section-info-title">{{subcategory.shDescr}}</span>
<span class="ecm-section-info-subhead">{{subcategory.descr}}</span>
<span class="ecm-section-info-title">{{subcategory?.shDescr}}</span>
<span class="ecm-section-info-subhead">{{subcategory?.descr}}</span>
</div>
<div class="small-12 medium-6 large-4 column end "*ngFor="let _item of items">
<!--<ecm-item-caption [itemData]="_item"></ecm-item-caption> -->
......
......@@ -9,6 +9,7 @@
.product-image {
width: 110px;
height: 110px;
position: relative;
}
hr {
......
......@@ -5,7 +5,7 @@
<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 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 class="media-object-section">
<span class="item-descr">{{item.descr}}</span>
......
<div *ngIf="relatedItems">
<div *ngIf="relatedItems && relatedItems.length">
<section class="related-items-section">
<div class="row row-category">
<div class="ecm-section-info">
......
......@@ -71,9 +71,8 @@
padding-left: 3rem;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
}
/*
.img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../../assets/images/svg/back_32_32.svg);
}
......@@ -82,7 +81,6 @@
padding: 0;
height: 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;
border-radius: 100%;
margin-left: -2rem !important;
......@@ -90,7 +88,7 @@
.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);
}
*/
/* loading section */
.loading {
min-height: calc(100% - 50px);
......
......@@ -21,8 +21,8 @@
<section class="subcategories-section">
<div class="row row-subcategory">
<div class="ecm-section-info">
<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-title">{{category?.shDescr}}</span>
<span *ngIf="category" class="ecm-section-info-subhead">{{category?.descr}}</span>
</div>
<div class="small-12 medium-6 large-4 column end " *ngFor="let _subcategory of subcategories">
<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