Commit 232ac99f authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174444 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6009b472
......@@ -101,11 +101,11 @@ export class EcmProductDetailsComponent implements OnInit {
}
doActivity($event) {
this.performActivity($event.activity, $event.data);
this.performActivity($event.activity, $event.data, $event);
}
performActivity(activity: string, data: any) {
console.log( 'doActivity > > ' , activity, data );
performActivity(activity: string, data: any, $event) {
console.log( 'doActivity > > ' , activity, data, $event.caller, $event.callBack );
if( activity == 'ADD_CART' ) {
if( data.isAddToCart ) { //GO TO CART
this.router.navigate(['/cart']);
......@@ -116,9 +116,11 @@ export class EcmProductDetailsComponent implements OnInit {
}
}
else if( activity == 'ADD_WISHLIST' ) {
if(this.checkUser() !== 'undefined' && this.checkUser() !== null && this.checkUser() !== 'null')
{
this.addToWishlist(data.itemCode);
$event.caller[$event.callBack]();
this.showSnackbar('Item Added to your Wishlist');
}
else
......@@ -126,6 +128,10 @@ export class EcmProductDetailsComponent implements OnInit {
this.showSignInPanel();
}
}
else if( activity == 'REMOVE_WISHLIST' ) {
this.removeFromWishlist(data.itemCode);
this.showSnackbar('Item Removed from your Wishlist');
}
else if( activity == 'BOOK_NOW' ) {
this.showSnackbar('Book Now - Redirect to Checkout');
}
......@@ -189,7 +195,11 @@ export class EcmProductDetailsComponent implements OnInit {
addToWishlist(itemCode) {
// this.store.dispatch({ type: INCREMENT, payload: cartData });
this.productDetailService.addToWishlist(itemCode);
}
}
removeFromWishlist(itemCode){
}
showSnackbar(message) {
this.snackBar.open(message, '', {duration: 2000});
......@@ -211,7 +221,7 @@ export class EcmProductDetailsComponent implements OnInit {
showSignInPanel()
{
console.log('showSignin');
this.header.userAction();
this.header.showOverlayPanel('USER_OPT');
}
checkUser(){
......
......@@ -537,14 +537,14 @@ li::BEFORE {
color: black;
padding-right: 5px;
padding-left: 5px;
line-height: 24px;
line-height: 20px;
}
.ecm-itemNumOfReviews {
padding-left: 5px;
color: black;
border-left: 1px solid #f3f3f3;
line-height: 24px;
line-height: 20px;
}
md-card {
......
......@@ -7,7 +7,7 @@
<div>
<md-button-toggle class="wishButton">
<md-icon style="color: mediumvioletred;" *ngIf="!inWishlist" (click)="addToWishlist();">favorite_border</md-icon>
<md-icon style="color: mediumvioletred;" *ngIf="inWishlist">favorite</md-icon>
<md-icon style="color: mediumvioletred;" *ngIf="inWishlist" (click)="removeFromWishlist();" >favorite</md-icon>
</md-button-toggle>
</div>
<div class="md-card-image">
......@@ -40,7 +40,7 @@
</span>
<span (click)="scrollToReviews.emit();" *ngIf="itemDetail.itemRatings.AVG_RATING > 0 || itemDetail.itemRatings.NO_OF_REVIEWS > 0 " style="display: inline-flex; cursor: pointer;" >
<rating [rate]="itemDetail.itemRatings.AVG_RATING"></rating>
<rating [rate]="itemDetail.itemRatings.AVG_RATING" [isSmallRatings]=true></rating>
<span class="ecm-itemAvgRating">{{itemDetail.itemRatings.AVG_RATING}} Ratings</span>
<span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS != 0" class="ecm-itemNumOfReviews">{{itemDetail.itemRatings.NO_OF_REVIEWS}} Reviews</span>
<span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS == 0" class="ecm-itemNumOfReviews" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {'firstReview': true} });">Be the first to Review this product</span>
......@@ -136,6 +136,7 @@
</div>
</div>
</md-card-content>
<div [ngClass]="{'buy-cart-button': ( clientWidth > 640 ) , 'mobi-buy-cart-button': ( clientWidth < 639 ) }" >
<button md-button class="button medium-btn Add_to_cart"
(click)="doActivity.emit({activity:'ADD_CART', data: {'itemCode' : itemDetail.itemCode, 'isAddToCart' : isAddToCart}}); isAddToCart= true;">{{ isAddToCart ? 'Go to Cart' : 'Add to Cart' }}</button>
......
......@@ -24,9 +24,10 @@ export class EcmHandicraftComponent implements OnInit, EcmTemplateInterface {
@ViewChild( 'recentView' ) recentView: EcmRecentViewComponent;
@ViewChild('itemDetails') itemDetails: ElementRef;
@Input() isAddToCart: boolean = false;
@Input() inWishlist: boolean = false;
clientWidth: any;
itemCode;
inWishlist;
//isCartItem = false;
//@Input() itemData: Item;
......@@ -75,7 +76,7 @@ export class EcmHandicraftComponent implements OnInit, EcmTemplateInterface {
if ( this.recentView )
this.recentView.doDestroy( this.itemDetail.itemCode );
}
createRatings( ratings ) {
var rating: number[] = [];
for ( var i = 1; i <= ratings; i++ ) {
......@@ -95,7 +96,16 @@ export class EcmHandicraftComponent implements OnInit, EcmTemplateInterface {
}
addToWishlist() {
this.doActivity.emit({activity:'ADD_WISHLIST', data: {'itemCode' : this.itemDetail.itemCode} , 'caller' : this , 'callBack' : 'changeStatus' });
}
removeFromWishlist(){
this.inWishlist = false;
this.doActivity.emit({activity:'REMOVE_WISHLIST', data: {'itemCode' : this.itemDetail.itemCode} });
}
changeStatus(){
this.inWishlist = true;
this.doActivity.emit({activity:'ADD_WISHLIST', data: {'itemCode' : this.itemDetail.itemCode} });
}
alert('Change Status >>'+this.inWishlist );
}
}
\ No newline at end of file
......@@ -7,9 +7,14 @@
}
.product-image {
width: 110px;
height: 110px;
width: 100px;
height: 100px;
position: relative;
display: inline-block;
}
.product-data {
display: inline-block;
}
hr {
......@@ -23,20 +28,20 @@ hr {
}
.ecm-recent-view-card {
padding-bottom: 30px;
cursor: pointer;
}
.item-descr {
display: block;
display: block;
color: #444;
font-size: 14px;
padding-top: 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 180px;
/*width: 180px;*/
word-wrap: break-word;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.item-cost {
......
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