Commit 96ae6741 authored by prumde's avatar prumde

Changes as per new layout


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174384 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 45b94635
/*
.recentView-section { .recentView-section {
margin-top: 50px; margin-top: 70px;
height: 600px; height: 600px;
background-color: #F2F2F2; background-color: #F2F2F2;
} }
...@@ -27,4 +28,61 @@ ...@@ -27,4 +28,61 @@
padding-top: 15px; padding-top: 15px;
padding-bottom: 50px; padding-bottom: 50px;
} }
*/
.ecm-recent-view {
width: 300px;
position: absolute;
left: calc(100% - 345px);
margin: 30px 15px 30px 15px;
}
.product-image {
width: 110px;
height: 110px;
}
hr {
margin: 0px 0px 50px 0px;
}
.recent-view-title {
margin-left: 50px;
margin-right: 50px;
text-align: center;
display: block;
height: 40px;
width: 160px;
line-height: 40px;
border-bottom: thin solid mediumvioletred;
}
.ecm-recent-view-card {
padding-bottom: 30px;
}
.item-descr {
display: block;
color: #444;
font-size: 15px;
}
.item-cost {
display: block;
padding-top: 10px;
font-size: 15px;
font-weight: bold;
}
.view-all-section {
text-align: center;
padding-top: 30px;
}
.view-all-button {
color: mediumvioletred;
font-size: 14px;
font-weight: bold;
cursor: pointer;
}
<div *ngIf="recentViewItems">
<section class="recentView-section"> <md-card *ngIf="recentViewItems && recentViewItems.length " class="media-object stack-for-small ecm-recent-view" id='recentViewCard'>
<div class="row row-category"> <div>
<div class="ecm-section-info"> <span class="recent-view-title"> Recently Viewed </span>
<span class="ecm-section-info-title">Recently Viewed</span>
</div> </div>
<ecm-carousel [cardItems]="recentViewItems" ></ecm-carousel> <hr>
<div *ngFor="let item of recentViewItems | slice:0:show; let i=index" class="ecm-recent-view-card">
<div class="media-object-section product-image">
<ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" ></ecm-image>
</div> </div>
</section> <div class="media-object-section">
</div> <span class="item-descr">{{item.descr}}</span>
\ No newline at end of file <span class="item-cost"> ₹ {{item.costRate}}</span>
</div>
</div>
<div class="view-all-section" *ngIf="recentViewItems.length > 3 && show == 3" (click)="show = recentViewItems.length">
<span class="view-all-button">View All {{recentViewItems.length}} Items </span>
</div>
</md-card>
\ No newline at end of file
...@@ -2,9 +2,7 @@ import { Component, OnInit } from '@angular/core'; ...@@ -2,9 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { EcmRecentViewService } from './ecm-recent-view.service'; import { EcmRecentViewService } from './ecm-recent-view.service';
import { Item } from '../../ecm-model/product-model'; import { Item } from '../../ecm-model/product-model';
import { ItemDetail } from '../../ecm-model/product-detail-model';
declare var reinitFlickity: any;
@Component( { @Component( {
selector: 'ecm-recent-view', selector: 'ecm-recent-view',
...@@ -16,6 +14,8 @@ export class EcmRecentViewComponent implements OnInit { ...@@ -16,6 +14,8 @@ export class EcmRecentViewComponent implements OnInit {
recentViewItems: Item[]; recentViewItems: Item[];
errorMessage: string; errorMessage: string;
show = 3;
constructor( public recentviewService: EcmRecentViewService ) { } constructor( public recentviewService: EcmRecentViewService ) { }
ngOnInit() { ngOnInit() {
...@@ -24,10 +24,10 @@ export class EcmRecentViewComponent implements OnInit { ...@@ -24,10 +24,10 @@ export class EcmRecentViewComponent implements OnInit {
getRecentViewItems() { getRecentViewItems() {
this.recentviewService.getRecentViewItems().subscribe( this.recentviewService.getRecentViewItems().subscribe(
reviewItems => { recentViewItems => {
this.recentViewItems = reviewItems; console.log('recentViewItems.length >> ' + recentViewItems.length);
reinitFlickity(); this.recentViewItems = recentViewItems;
console.log( 'comp trendingItems[' + JSON.stringify( reviewItems ) + '] \n this.trendingItems[' + JSON.stringify( this.recentViewItems ) + ']' ); console.log( 'comp recentItems[' + JSON.stringify( recentViewItems ) + '] \n this.trendingItems[' + JSON.stringify( this.recentViewItems ) + ']' );
}, },
error => { error => {
this.errorMessage = <any>error; this.errorMessage = <any>error;
...@@ -35,7 +35,7 @@ export class EcmRecentViewComponent implements OnInit { ...@@ -35,7 +35,7 @@ export class EcmRecentViewComponent implements OnInit {
}); });
} }
public doDestroy(itemCode: string) { public doDestroy( itemCode: string ) {
this.recentviewService.storeRecentViewItem(itemCode); this.recentviewService.storeRecentViewItem( itemCode );
} }
} }
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