Commit 4f2945c8 authored by prumde's avatar prumde

Updated


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