Commit 07fb827d authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174392 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 92992fa7
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<span class="ecm-card-info-title">{{category.shDescr}}</span> <span class="ecm-card-info-title">{{category.shDescr}}</span>
<span class="ecm-card-info-subhead">{{category.descr}}</span> <span class="ecm-card-info-subhead">{{category.descr}}</span>
</div> </div>
<a md-raised-button *ngIf="!category.catLink" class="ecm-card-action" (click)="storeCategory()">View</a> <a md-raised-button *ngIf="!category.catLink" class="ecm-card-action" (click)="viewCategories()">View</a>
<a *ngIf="!category.catLink" class="ecm-card-action top share" [routerLink]="[ '/share',category.catCode]"></a> <a *ngIf="!category.catLink" class="ecm-card-action top share" [routerLink]="[ '/share',category.catCode]"></a>
</div> </div>
</div> </div>
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
<span class="ecm-card-info-title">{{subcategory.shDescr}}</span> <span class="ecm-card-info-title">{{subcategory.shDescr}}</span>
<span class="ecm-card-info-subhead">{{subcategory.descr}}</span> <span class="ecm-card-info-subhead">{{subcategory.descr}}</span>
</div> </div>
<a md-raised-button *ngIf="!subcategory.catLink" class="ecm-card-action" (click)="storeSubCategory()">View</a> <a md-raised-button *ngIf="!subcategory.catLink" class="ecm-card-action" (click)="viewProducts()">View</a>
<a *ngIf="!subcategory.catLink" class="ecm-card-action top share" [routerLink]="[ '/share',subcategory.scatCode]"></a> <a *ngIf="!subcategory.catLink" class="ecm-card-action top share" [routerLink]="[ '/share',subcategory.scatCode]"></a>
</div> </div>
</div> </div>
<div *ngIf="itemData" class="ecm-card" id="ecm-item" (click)="storeItem()"> <div *ngIf="itemData" class="ecm-card" id="ecm-item" (click)="viewItem()">
<ecm-image [refId]='itemData.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image> <ecm-image [refId]='itemData.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image>
<div class="ecm-card-footer" id="ecm-item-footer"> <div class="ecm-card-footer" id="ecm-item-footer">
<div class="ecm-card-info" id="ecm-item-info"> <div class="ecm-card-info" id="ecm-item-info">
......
...@@ -32,7 +32,7 @@ export class ECMCardComponent implements OnInit { ...@@ -32,7 +32,7 @@ export class ECMCardComponent implements OnInit {
ngOnInit() { ngOnInit() {
} }
storeItem(){ viewItem(){
// this.recentviewService.storeRecentViewItem(this.itemData.itemCode); // this.recentviewService.storeRecentViewItem(this.itemData.itemCode);
this.storeData.emit(this.itemData); this.storeData.emit(this.itemData);
this.router.navigate(['/detail',this.itemData.itemCode]); this.router.navigate(['/detail',this.itemData.itemCode]);
...@@ -46,27 +46,56 @@ export class ECMCardComponent implements OnInit { ...@@ -46,27 +46,56 @@ export class ECMCardComponent implements OnInit {
return rating; return rating;
} }
storeCategory(){ viewCategories(){
this.storeData.emit(this.category); this.storeData.emit(this.category);
this.router.navigate([ '/categories', this.category.catCode]); this.router.navigate([ '/categories', this.category.catCode]);
} }
storeSubCategory(){ viewProducts(){
this.storeData.emit(this.subcategory); this.storeData.emit(this.subcategory);
this.router.navigate([ '/products', this.subcategory.scatCode]); this.router.navigate([ '/products', this.subcategory.scatCode]);
} }
updateLikes(item_code) { updateLikes(item_code) {
let likesData ="{\"userId\":\""+this.reviewsData.userId+"\",\"productUsfulCnt\":\""+(this.reviewsData.productUsfulCnt+1)+"\",\"productNotUsfulCnt\":\""+this.reviewsData.productNotUsfulCnt+"\"}"; if(this.isAuthUser())
console.log("Likes Data-->"); {
console.log(likesData); let likesData ="{\"userId\":\""+this.reviewsData.userId+"\",\"productUsfulCnt\":\""+(this.reviewsData.productUsfulCnt+1)+"\",\"productNotUsfulCnt\":\""+this.reviewsData.productNotUsfulCnt+"\"}";
this.productReviewService.updateLikes(item_code, likesData); console.log("Likes Data-->");
console.log(likesData);
this.productReviewService.updateLikes(item_code, likesData);
}
else
{
alert("Please Login First.");
}
}
updateDislikes(item_code) {
if(this.isAuthUser())
{
let likesData ="{\"userId\":\""+this.reviewsData.userId+"\",\"productUsfulCnt\":\""+this.reviewsData.productUsfulCnt+"\",\"productNotUsfulCnt\":\""+(this.reviewsData.productNotUsfulCnt-1)+"\"}";
console.log("Likes Data-->");
console.log(likesData);
this.productReviewService.updateLikes(item_code, likesData);
}
else
{
alert("Please Login First.");
}
} }
updateDislikes(item_code) { isAuthUser(){
let likesData ="{\"userId\":\""+this.reviewsData.userId+"\",\"productUsfulCnt\":\""+this.reviewsData.productUsfulCnt+"\",\"productNotUsfulCnt\":\""+(this.reviewsData.productNotUsfulCnt-1)+"\"}"; var isAuthUser;
console.log("Likes Data-->"); var userInfo = localStorage.getItem( 'userInfo' );
console.log(likesData); console.log( 'EcmUserOptionComponent getUserInfo ::' + userInfo );
this.productReviewService.updateLikes(item_code, likesData); if ( userInfo !== 'undefined' && userInfo !== null && userInfo !== 'null' )
{
isAuthUser = true;
}
else
{
isAuthUser = false;
}
return isAuthUser;
} }
} }
<ecm-header [isFixedHeader]=false> </ecm-header> <ecm-header [isFixedHeader]=false> </ecm-header>
<ecm-breadcrumbs *ngIf="itemDetail" [pageName]="'DETAIL'" [itemDetail]='itemDetail'></ecm-breadcrumbs> <ecm-breadcrumbs *ngIf="itemDetail" [pageName]="'DETAIL'" [itemDetail]='itemDetail'></ecm-breadcrumbs>
<ecm-template *ngIf="ecmTemplate" [ecmTemplate] = "ecmTemplate" (scrollToReviews) = "scrollToReviews();" (doActivity) = "doActivity($event);" > <div class="row">
</ecm-template> <ecm-template #ecmTemplateComp *ngIf="ecmTemplate" [ecmTemplate] = "ecmTemplate" (scrollToReviews) = "scrollToReviews();" (doActivity) = "doActivity($event);" >
</ecm-template>
</div>
<div *ngIf="itemCode" #reviewsAndRating> <div class="row" *ngIf="itemDetail" #reviewsAndRating>
<ecm-product-review [itemCode] = "itemCode"></ecm-product-review> <ecm-product-review [itemDetail] = "itemDetail"></ecm-product-review>
</div> </div>
<ecm-recent-view #recentView></ecm-recent-view> <ecm-related-items *ngIf="itemDetail" [scatCode]="itemDetail.itemSubCategory.scatCode"> </ecm-related-items>
\ No newline at end of file
...@@ -10,12 +10,11 @@ import { EcmProductDetailService } from './ecm-product-detail.service'; ...@@ -10,12 +10,11 @@ import { EcmProductDetailService } from './ecm-product-detail.service';
import { ScrollService } from '../scroll.service'; import { ScrollService } from '../scroll.service';
import { ItemDetail } from '../ecm-model/product-detail-model'; import { ItemDetail } from '../ecm-model/product-detail-model';
import { EcmTemplateItem } from './ecm-template/ecm-template.component'; import { EcmTemplateItem,EcmTemplateComponent } from './ecm-template/ecm-template.component';
import { EcmOutingComponent } from './ecm-template/ecm-outing.component'; import { EcmOutingComponent } from './ecm-template/ecm-outing.component';
import { EcmFoodComponent } from './ecm-template/ecm-food.component'; import { EcmFoodComponent } from './ecm-template/ecm-food.component';
import { EcmCelebrationComponent } from './ecm-template/ecm-celebration.component'; import { EcmCelebrationComponent } from './ecm-template/ecm-celebration.component';
import { EcmHandicraftComponent } from './ecm-template/ecm-handicraft.component'; import { EcmHandicraftComponent } from './ecm-template/ecm-handicraft.component';
import { EcmRecentViewComponent } from '../ecm-view/ecm-recent-view/ecm-recent-view.component';
export const ECM_TEMPLATES: any = { export const ECM_TEMPLATES: any = {
'ecm-outing' : new EcmTemplateItem(EcmOutingComponent), 'ecm-outing' : new EcmTemplateItem(EcmOutingComponent),
...@@ -30,11 +29,11 @@ export const ECM_TEMPLATES: any = { ...@@ -30,11 +29,11 @@ export const ECM_TEMPLATES: any = {
styleUrls: ['./ecm-product-details.component.css'], styleUrls: ['./ecm-product-details.component.css'],
providers: [EcmProductDetailService] providers: [EcmProductDetailService]
}) })
export class EcmProductDetailsComponent implements OnInit, OnDestroy { export class EcmProductDetailsComponent implements OnInit {
@ViewChild('reviewsAndRating') reviewsAndRating: ElementRef; @ViewChild('reviewsAndRating') reviewsAndRating: ElementRef;
@ViewChild('recentView') recentView: EcmRecentViewComponent; @ViewChild('ecmTemplateComp') ecmTemplateComp: EcmTemplateComponent;
itemCode:string; itemCode:string;
ecmTemplate : EcmTemplateItem; ecmTemplate : EcmTemplateItem;
itemDetail: ItemDetail; itemDetail: ItemDetail;
...@@ -51,21 +50,6 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy { ...@@ -51,21 +50,6 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy {
this.getItemDetail(this.itemCode); this.getItemDetail(this.itemCode);
}); });
} }
ngAfterViewInit() {
console.log('Product Detail ngAfterViewInit' + this.recentView );
if( this.recentView ) {
this.recentView.ngOnInit();
console.log('item-detail-2 ' + document.getElementById('item-detail-2'));
if( document.getElementById('item-detail-2') ) {
console.log('item-detail-2 TOP' + document.getElementById('item-detail-2').offsetTop);
}
console.log('recentViewCard ' + document.getElementById('recentViewCard'));
if( document.getElementById('recentViewCard') ) {
console.log('recentViewCard TOP' + document.getElementById('recentViewCard').style.position);
}
}
}
getItemDetail( itemCode: string ) { getItemDetail( itemCode: string ) {
this.subcategoryService.getItemDetail( itemCode ).subscribe( this.subcategoryService.getItemDetail( itemCode ).subscribe(
...@@ -78,6 +62,10 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy { ...@@ -78,6 +62,10 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy {
if( this.ecmTemplate ) if( this.ecmTemplate )
{ {
this.ecmTemplate.setItemDetail(itemDetail); this.ecmTemplate.setItemDetail(itemDetail);
if(this.ecmTemplateComp)
{
this.ecmTemplateComp.loadComponent();
}
} }
else else
{ {
...@@ -87,10 +75,6 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy { ...@@ -87,10 +75,6 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy {
}, },
); );
} }
ngOnDestroy() {
if( this.recentView )
this.recentView.doDestroy(this.itemCode);
}
scrollToReviews() { scrollToReviews() {
let offsetTop = this.reviewsAndRating.nativeElement.offsetTop; let offsetTop = this.reviewsAndRating.nativeElement.offsetTop;
...@@ -98,7 +82,6 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy { ...@@ -98,7 +82,6 @@ export class EcmProductDetailsComponent implements OnInit, OnDestroy {
window.scrollTo(0, offsetTop - 80); window.scrollTo(0, offsetTop - 80);
} }
doActivity($event) { doActivity($event) {
this.performActivity($event.activity, $event.data); this.performActivity($event.activity, $event.data);
} }
......
...@@ -206,10 +206,10 @@ ...@@ -206,10 +206,10 @@
} }
.ecm-review-card { .ecm-review-card {
position: absolute; /* position: absolute; */
width: calc(100% - 380px); /* width: calc(100% - 380px); */
margin: 30px 0px 30px 30px margin-top: 25px;
top: 70px;
} }
.write-review-text { .write-review-text {
......
<div class="row">
<div class="medium-8 large-8 columns">
<md-card class="ecm-review-card"> <md-card class="ecm-review-card">
<div class="ecm-review-header"> <div class="ecm-review-header">
<div> <div>
...@@ -6,9 +8,9 @@ ...@@ -6,9 +8,9 @@
<hr> <hr>
<div class="row header-content"> <div class="row header-content">
<div class="medium-5 medium-4 columns ecm-total-reviews"> <div class="medium-5 medium-4 columns ecm-total-reviews">
<span class="ecm-avg-rating"> 3.4 </span> <span class="ecm-avg-rating"> {{itemAvgRating}} </span>
<span class="ecm-ratings">&#x2605; &#x2605; &#x2605; &#x2605; &#x2605;</span> <span class="ecm-ratings">&#x2605; &#x2605; &#x2605; &#x2605; &#x2605;</span>
<span class="ecm-total-ratings"> 20,344 Ratings </span> <span class="ecm-total-ratings"> {{itemAvgRating}} Ratings </span>
</div> </div>
<div class="medium-5 medium-4 columns ecm-write-review"> <div class="medium-5 medium-4 columns ecm-write-review">
...@@ -24,7 +26,7 @@ ...@@ -24,7 +26,7 @@
<md-tab-group class="ecm-tab medium-12 col-sm-9" (selectChange)="onSelectChange($event)" > <md-tab-group class="ecm-tab medium-12 col-sm-9" (selectChange)="onSelectChange($event)" >
<md-tab label="Most Recent"> <md-tab label="Most Recent">
<md-select class="ecm-select" placeholder="Sort By" [(ngModel)]="sortBy" (change)="sort()" name="sort"> <md-select class="ecm-select" placeholder="Filter By" [(ngModel)]="sortBy" (change)="sort()" name="sort">
<md-option class="ecm-options" *ngFor="let type of sortTypes" [value]="type.value"> <md-option class="ecm-options" *ngFor="let type of sortTypes" [value]="type.value">
{{type.viewValue}} {{type.viewValue}}
</md-option> </md-option>
...@@ -81,3 +83,5 @@ ...@@ -81,3 +83,5 @@
</md-tab-group> </md-tab-group>
</md-card> </md-card>
</div>
</div>
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { Reviews } from '../ecm-model/product-review.model'; import { Reviews } from '../ecm-model/product-review.model';
import { EcmProductReviewService } from './ecm-product-review.service'; import { EcmProductReviewService } from './ecm-product-review.service';
import { ItemDetail } from '../ecm-model/product-detail-model';
@Component( { @Component( {
selector: 'ecm-product-review', selector: 'ecm-product-review',
...@@ -9,7 +10,7 @@ import { EcmProductReviewService } from './ecm-product-review.service'; ...@@ -9,7 +10,7 @@ import { EcmProductReviewService } from './ecm-product-review.service';
}) })
export class EcmProductReviewComponent implements OnInit { export class EcmProductReviewComponent implements OnInit {
@Input() itemCode; @Input() itemDetail: ItemDetail;
solrUrl = '/ecm/service/solr/local2do/'; solrUrl = '/ecm/service/solr/local2do/';
reviews: Reviews[]; reviews: Reviews[];
tabSort: string = "reviewDate desc"; tabSort: string = "reviewDate desc";
...@@ -20,7 +21,9 @@ export class EcmProductReviewComponent implements OnInit { ...@@ -20,7 +21,9 @@ export class EcmProductReviewComponent implements OnInit {
start = 0; start = 0;
searchResponse; searchResponse;
numFound; numFound;
itemAvgRating;
itemCode;
sortTypes = [ sortTypes = [
{ value: 'productRating:[5 TO 5]', viewValue: '5 Stars' }, { value: 'productRating:[5 TO 5]', viewValue: '5 Stars' },
{ value: 'productRating:[4 TO 4]', viewValue: '4 Stars' }, { value: 'productRating:[4 TO 4]', viewValue: '4 Stars' },
...@@ -32,6 +35,8 @@ export class EcmProductReviewComponent implements OnInit { ...@@ -32,6 +35,8 @@ export class EcmProductReviewComponent implements OnInit {
constructor( private productreviewService: EcmProductReviewService ) { } constructor( private productreviewService: EcmProductReviewService ) { }
ngOnInit() { ngOnInit() {
this.itemCode = this.itemDetail.itemCode;
this.itemAvgRating = this.itemDetail.itemAvgRating;
this.fetchReviews(); this.fetchReviews();
} }
...@@ -46,7 +51,7 @@ export class EcmProductReviewComponent implements OnInit { ...@@ -46,7 +51,7 @@ export class EcmProductReviewComponent implements OnInit {
} }
else if ( data.response ) { else if ( data.response ) {
this.reviews = data.response.docs; this.reviews = data.response.docs;
this.numFound = data.response.numFound; this.numFound = data.response.numFound;
this.pageCount = Math.ceil(( this.numFound / 10 ) ); this.pageCount = Math.ceil(( this.numFound / 10 ) );
} }
console.log( this.searchResponse ); console.log( this.searchResponse );
...@@ -98,24 +103,26 @@ export class EcmProductReviewComponent implements OnInit { ...@@ -98,24 +103,26 @@ export class EcmProductReviewComponent implements OnInit {
} }
onLastPage() { onLastPage() {
if ( this.currentPage == this.pageCount ) if ( this.currentPage == this.pageCount ) {
return true; return true;
else }
else {
return false; return false;
}
} }
onSelectChange($event) { onSelectChange( $event ) {
console.log('index => ', $event.index); console.log( 'index => ', $event.index );
if($event.index == 0) if ( $event.index == 0 )\
{
this.tabSort = 'reviewDate desc';
this.fetchReviews();
}
else if ( $event.index == 1 )
{ {
this.tabSort = 'reviewDate desc'; this.tabSort = 'productUsfulCnt desc';
this.fetchReviews(); this.fetchReviews();
} }
else if($event.index == 1)
{
this.tabSort = 'productUsfulCnt desc';
this.fetchReviews();
}
} }
} }
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<md-card style="margin-top: 15px;"> <md-card style="margin-top: 15px;">
<div class="row"> <div class="row">
<!-- ------------------------ITEM-IMAGE START HERE-------------------------------- --> <!-- ------------------------ITEM-IMAGE START HERE-------------------------------- -->
<span class="medium-6 columns medium-5 columns image"> <span class="small-12 medium-6 large-6 columns image">
<ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image> <ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image>
</span> </span>
<!-- -----------------------ITEM-IMAGE ENDS HERE-------------------------------- -----> <!-- -----------------------ITEM-IMAGE ENDS HERE-------------------------------- ----->
<!-- ----------------------ITEM-DETAILS START HERE-------------------------------- --> <!-- ----------------------ITEM-DETAILS START HERE-------------------------------- -->
<div class="medium-6 medium-5 columns head"> <div class="small-12 medium-6 large-6 columns head">
<span class="ecm-itemCategory">{{itemDetail.itemDetailData.itemCategory}} <span class="ecm-itemCategory">{{itemDetail.itemDetailData.itemCategory}}
<div class="ecm-share"> <div class="ecm-share">
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<div class="row ecm-card"> <div class="row ecm-card">
<!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > --> <!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > -->
<div class="small-9 columns ecm-itemsDetailsInfo"> <div class="medium-8 large-8 columns ecm-itemsDetailsInfo">
<md-card> <md-card>
<div> <div>
<span class="ecm-itemDeatils">Items Details</span> <span class="ecm-itemDeatils">Items Details</span>
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
</md-card> </md-card>
</div> </div>
<div class="small-3 columns ecm-recent-view"> <div class="medium-4 large-4 columns ecm-recent-view">
<ecm-recent-view #recentView> </ecm-recent-view> <ecm-recent-view #recentView> </ecm-recent-view>
</div> </div>
</div> </div>
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<md-card style="margin-top: 15px;"> <md-card style="margin-top: 15px;">
<div class="row"> <div class="row">
<!-- ------------------------ITEM-IMAGE START HERE-------------------------------- --> <!-- ------------------------ITEM-IMAGE START HERE-------------------------------- -->
<span class="medium-6 medium-5 columns image"> <span class="small-12 medium-6 large-6 columns image">
<ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image> <ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image>
</span> </span>
<!-- -----------------------ITEM-IMAGE ENDS HERE-------------------------------- -----> <!-- -----------------------ITEM-IMAGE ENDS HERE-------------------------------- ----->
<!-- ----------------------ITEM-DETAILS START HERE-------------------------------- --> <!-- ----------------------ITEM-DETAILS START HERE-------------------------------- -->
<div class="medium-6 medium-5 columns head"> <div class="small-12 medium-6 large-6 columns head">
<span class="ecm-itemCategory">{{itemDetail.itemDetailData.itemCategory}} <span class="ecm-itemCategory">{{itemDetail.itemDetailData.itemCategory}}
<div class="ecm-share"> <div class="ecm-share">
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<div class="row ecm-card"> <div class="row ecm-card">
<!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > --> <!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > -->
<div class="small-9 columns ecm-itemsDetailsInfo"> <div class="medium-8 large-8 columns ecm-itemsDetailsInfo">
<md-card> <md-card>
<div> <div>
<span class="ecm-itemDeatils">Items Details</span> <span class="ecm-itemDeatils">Items Details</span>
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
</md-card> </md-card>
</div> </div>
<div class="small-3 columns ecm-recent-view"> <div class="medium-4 large-4 columns ecm-recent-view">
<ecm-recent-view #recentView> </ecm-recent-view> <ecm-recent-view #recentView> </ecm-recent-view>
</div> </div>
</div> </div>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="row"> <div class="row">
<!-- ------------------------HANDICRAFT-IMAGE START HERE-------------------------------- --> <!-- ------------------------HANDICRAFT-IMAGE START HERE-------------------------------- -->
<div class="medium-6 columns medium-5 columns image"> <div class="small-12 medium-6 large-6 columns image">
<div class="md-card-image"> <div class="md-card-image">
<ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image> <ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image>
</div> </div>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<!-- ------------------------HANDICRAFT-IMAGE ENDS HERE-------------------------------- --> <!-- ------------------------HANDICRAFT-IMAGE ENDS HERE-------------------------------- -->
<!-- ----------------------HANDICRAFT-DETAILS START HERE-------------------------------- --> <!-- ----------------------HANDICRAFT-DETAILS START HERE-------------------------------- -->
<div class="medium-6 medium-5 columns head"> <div class="small-12 medium-6 large-6 columns head">
<!-- <md-card> --> <!-- <md-card> -->
<md-card-content> <md-card-content>
<div> <div>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<div class="row ecm-card"> <div class="row ecm-card">
<!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > --> <!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > -->
<div class="small-9 columns ecm-product-details"> <div class="medium-8 large-8 columns ecm-product-details">
<md-card> <md-card>
<div> <div>
<span class="ecm-itemDeatils">Items Details</span> <span class="ecm-itemDeatils">Items Details</span>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</md-card> </md-card>
</div> </div>
<div class="small-3 columns ecm-recent-view"> <div class="medium-4 large-4 columns ecm-recent-view">
<ecm-recent-view #recentView> </ecm-recent-view> <ecm-recent-view #recentView> </ecm-recent-view>
</div> </div>
</div> </div>
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<md-card style="margin-top: 15px;"> <md-card style="margin-top: 15px;">
<div class="row"> <div class="row">
<!-- ------------------------ITEM-IMAGE START HERE-------------------------------- --> <!-- ------------------------ITEM-IMAGE START HERE-------------------------------- -->
<span class="medium-6 medium-5 columns image"> <span class="small-12 medium-6 large-6 columns image">
<ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image> <ecm-image [refId]='itemDetail.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "true" ></ecm-image>
</span> </span>
<!-- -----------------------ITEM-IMAGE ENDS HERE-------------------------------- -----> <!-- -----------------------ITEM-IMAGE ENDS HERE-------------------------------- ----->
<!-- ----------------------ITEM-DETAILS START HERE-------------------------------- --> <!-- ----------------------ITEM-DETAILS START HERE-------------------------------- -->
<div class="medium-6 medium-5 columns head"> <div class="small-12 medium-6 large-6 columns head">
<span class="ecm-itemCategory">{{itemDetail.itemDetailData.itemCategory}} <span class="ecm-itemCategory">{{itemDetail.itemDetailData.itemCategory}}
<div class="ecm-share"> <div class="ecm-share">
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<div class="row ecm-card"> <div class="row ecm-card">
<!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > --> <!-- <div class="medium-12 col-sm-9 ecm-itemsDetailsInfo" > -->
<div class="small-9 columns ecm-itemsDetailsInfo" id="item-detail-2"> <div class="medium-8 large-8 columns ecm-itemsDetailsInfo" id="item-detail-2">
<md-card> <md-card>
<div> <div>
<span class="ecm-itemDeatils">Items Details</span> <span class="ecm-itemDeatils">Items Details</span>
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
</md-card> </md-card>
</div> </div>
<div class="small-3 columns ecm-recent-view"> <div class="medium-4 large-4 columns ecm-recent-view">
<ecm-recent-view #recentView> </ecm-recent-view> <ecm-recent-view #recentView> </ecm-recent-view>
</div> </div>
</div> </div>
......
...@@ -40,12 +40,16 @@ export class EcmTemplateComponent implements AfterViewInit { ...@@ -40,12 +40,16 @@ export class EcmTemplateComponent implements AfterViewInit {
constructor(private componentFactoryResolver: ComponentFactoryResolver) { } constructor(private componentFactoryResolver: ComponentFactoryResolver) { }
ngAfterViewInit() { ngAfterViewInit() {
console.log("AfterViewNit of Ecm-Template Called");
this.loadComponent(); this.loadComponent();
} }
loadComponent(){ loadComponent(){
console.log("Ecm-Template Loader Called");
let ecmTemplateItem = this.ecmTemplate; let ecmTemplateItem = this.ecmTemplate;
console.log("ecmTemplateItem" + ecmTemplateItem.component);
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(ecmTemplateItem.component); let componentFactory = this.componentFactoryResolver.resolveComponentFactory(ecmTemplateItem.component);
let viewContainerRef = this.ecmTemplateDir.viewContainerRef; let viewContainerRef = this.ecmTemplateDir.viewContainerRef;
......
...@@ -52,21 +52,7 @@ export class ECMSigninService { ...@@ -52,21 +52,7 @@ export class ECMSigninService {
.map(this.extractData) .map(this.extractData)
.catch(this.handleError); .catch(this.handleError);
} }
updateUserData(_username: string) {
let userdataUrl = '/ecm/service/sys/updatedata'; // URL to Web Service
let _urlParams = new URLSearchParams();
_urlParams.append('username', _username);
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
userdataUrl = userdataUrl + '?' + _urlParams.toString();
console.log( "update user data...." + userdataUrl);
return this.http.get( userdataUrl, options )
.map(this.extractData)
.catch(this.handleError);
}
private extractData(res: Response) { private extractData(res: Response) {
let body = res.json(); let body = res.json();
console.log('extractData[' + JSON.stringify(body) + ']'); console.log('extractData[' + JSON.stringify(body) + ']');
......
...@@ -16,18 +16,17 @@ hr { ...@@ -16,18 +16,17 @@ hr {
} }
.recent-view-title { .recent-view-title {
margin-left: 30px;
margin-right: 30px;
text-align: center; text-align: center;
display: block; display: block;
height: 40px; height: 40px;
width: 160px; /* width: 160px; */
line-height: 40px; line-height: 40px;
border-bottom: thin solid mediumvioletred; border-bottom: thin solid mediumvioletred;
} }
.ecm-recent-view-card { .ecm-recent-view-card {
padding-bottom: 30px; padding-bottom: 30px;
cursor: pointer;
} }
.item-descr { .item-descr {
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<span class="recent-view-title"> Recently Viewed </span> <span class="recent-view-title"> Recently Viewed </span>
</div> </div>
<hr> <hr>
<div *ngFor="let item of recentViewItems | slice:0:show; let i=index" class="ecm-recent-view-card"> <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'" ></ecm-image> <ecm-image [refId]='item.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" [isSingleImage] = "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>
...@@ -15,5 +15,4 @@ ...@@ -15,5 +15,4 @@
<div class="view-all-section" *ngIf="recentViewItems.length > 3 && show == 3" (click)="show = recentViewItems.length"> <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> <span class="view-all-button">View All {{recentViewItems.length}} Items </span>
</div> </div>
</md-card> </md-card>
\ No newline at end of file
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { Router } from '@angular/router';
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';
...@@ -13,10 +14,9 @@ import { ItemDetail } from '../../ecm-model/product-detail-model'; ...@@ -13,10 +14,9 @@ import { ItemDetail } from '../../ecm-model/product-detail-model';
export class EcmRecentViewComponent implements OnInit { export class EcmRecentViewComponent implements OnInit {
recentViewItems: Item[]; recentViewItems: Item[];
errorMessage: string; errorMessage: string;
show = 3; show = 3;
constructor( public recentviewService: EcmRecentViewService ) { } constructor( public recentviewService: EcmRecentViewService, private router: Router ) { }
ngOnInit() { ngOnInit() {
this.getRecentViewItems(); this.getRecentViewItems();
...@@ -26,7 +26,7 @@ export class EcmRecentViewComponent implements OnInit { ...@@ -26,7 +26,7 @@ export class EcmRecentViewComponent implements OnInit {
this.recentviewService.getRecentViewItems().subscribe( this.recentviewService.getRecentViewItems().subscribe(
recentViewItems => { recentViewItems => {
console.log('recentViewItems.length >> ' + recentViewItems.length); console.log('recentViewItems.length >> ' + recentViewItems.length);
this.recentViewItems = recentViewItems; this.recentViewItems = recentViewItems.reverse();
console.log( 'comp recentItems[' + JSON.stringify( recentViewItems ) + '] \n this.trendingItems[' + JSON.stringify( this.recentViewItems ) + ']' ); console.log( 'comp recentItems[' + JSON.stringify( recentViewItems ) + '] \n this.trendingItems[' + JSON.stringify( this.recentViewItems ) + ']' );
}, },
error => { error => {
...@@ -34,7 +34,13 @@ export class EcmRecentViewComponent implements OnInit { ...@@ -34,7 +34,13 @@ export class EcmRecentViewComponent implements OnInit {
console.log( 'comp errorMessage[' + this.errorMessage + ']' ); console.log( 'comp errorMessage[' + this.errorMessage + ']' );
}); });
} }
viewItem(itemCode){
//this.productDetailComponent.getItemDetail(itemCode);
//this.setItemDetail.next(itemCode);
this.router.navigate(['/detail',itemCode]);
}
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