Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on the search product page Ui #161

Merged
merged 3 commits into from
Jun 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<p> Product Name : {{ product.name }} </p>
<p> Product Price : {{ product.price }} </p>
<img [src]="getProductImageUrl(product.master.images[0]?.product_url)">
</div>
</div>
53 changes: 29 additions & 24 deletions src/app/home/content/product-list/product-list.component.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
<div class="container ">

<div class="row results-base">
<div class="col-12 col-md-3 col-sm-3 col-lg-3 product-base" *ngFor="let product of products.products | filter : selectedTaxonIds; trackBy: trackByFn"
[style.margin]="getMargin()" itemscope itemtype="https://schema.org/Product">
<div class="product-thumbShim"></div>
<a itemprop="url" [routerLink]="['/', product.slug]">
<img itemprop="image" class="product-thumb" alt="{{product.name}}" [src]="getProductImageUrl(product.master.images[0]?.product_url)">
<div class="product-productMetaInfo">
<div class="morechoices">
More Choices Available
</div>
<div itemprop="name" class="product-brand">{{ product.name }}</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="product-price">
<span>
<span itemprop="price" class="product-discountedPrice">&#8377; {{ product.price }}</span>
<div class="container "><div class="row results-base">
<div class="col-12 col-md-3 col-sm-3 col-lg-3 product-base" *ngFor="let product of products.products | filter : selectedTaxonIds; trackBy: trackByFn"
[style.margin]="getMargin()" itemscope itemtype="https://schema.org/Product">

<div class="product-thumbShim"></div>
<a itemprop="url" [routerLink]="['/', product.slug]">
<img itemprop="image" class="product-thumb" alt="{{product.name}}" [src]="getProductImageUrl(product.master.images[0]?.product_url)">
<div class="product-productMetaInfo">
<div class="morechoices">
More Choices Available
</div>
<div itemprop="name" class="product-brand">{{ product.name }}</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="product-price">
<span>
<span itemprop="price" class="product-discountedPrice">&#8377; {{ product.price }}</span>
<span *ngIf="product.master.cost_price">
<span itemprop="price" class="disableprize">&#8377; {{product.master.cost_price}}</span>
</span>
</div>
<p class="shipping">
FREE 1-2 day shipping on this item
</p>
</span>
</div>
<p class="shipping">
FREE 1-2 day shipping on this item
</p>
<div class="ngrating">
<ngx-input-star-rating value="{{product.avg_rating }}" disable="true" required></ngx-input-star-rating>
</div>
</a>
</div>

</div>
<!-- <div class="product-product" innerHTML="{{ product.description }}"></div> -->
</div>
</a>
</div>
</div>
<!-- <div class="product-product" innerHTML="{{ product.description }}"></div> -->
29 changes: 20 additions & 9 deletions src/app/home/content/product-list/product-list.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
left: 0;
width: 101%;
height: 100%;
background-color: #282c3f;
background-color: $gray-900;
-webkit-transition: visibility 0s, opacity .5s linear;
transition: visibility 0s, opacity .5s linear;
visibility: hidden;
Expand All @@ -29,14 +29,14 @@
display: inline-block;
transition: all 500ms;
border: 1px solid $gray-600; // margin: 0 30px 20px 0;
box-shadow: 0px 0px 1px #ccc;
box-shadow: 0px 0px 1px $gray-10;
&:hover {
box-shadow: 0px 0px 3px #ccc;
box-shadow: 0px 0px 3px $gray-10;
}
a {
text-decoration: none;
background-color: transparent;
color: #282c3f;
color: $gray-900;
.product-thumb {
height: 240px;
display: block;
Expand All @@ -48,13 +48,16 @@
.product-productMetaInfo {
position: relative;
z-index: 2;
background: #fff;
background: $white;
height: 100%;
padding: 0 5px;
.ngrating {
position: relative;
left: -10px;
}
.product-brand,
.product-product {
overflow: hidden;
// text-overflow: ellipsis;
overflow: hidden; // text-overflow: ellipsis;
// white-space: nowrap;
font-size: 1em;
font-weight: 500;
Expand All @@ -65,9 +68,9 @@
height: 4.6vw;
}
.product-price {
font-size: 1.7em;
font-size: 1.3em;
line-height: 1.2em;
color: $theme-action-sub-color2;
color: $theme-action-sub-color2 - 50;
margin: 10px 0 0;
white-space: nowrap;
font-weight: 500;
Expand All @@ -92,4 +95,12 @@
margin-top: 15px;
color: $black;
margin-bottom: 0px;
}

.disableprize {
font-size: 1rem;
line-height: 1;
color: $gray-700;
text-decoration: line-through;
margin-left: 10px;
}
4 changes: 3 additions & 1 deletion src/app/home/content/product-list/product-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Router, ActivatedRoute } from '@angular/router';
})
export class ProductListComponent implements OnInit {
@Input() products;
// tslint:disable-next-line:no-input-rename
@Input('taxonIds') selectedTaxonIds;
@Input() toggleLayout;
page: number;
Expand All @@ -30,7 +31,8 @@ export class ProductListComponent implements OnInit {
});
}

ngOnInit() { }
ngOnInit() {
}

getProductImageUrl(url) {
return environment.apiEndpoint + url;
Expand Down
2 changes: 2 additions & 0 deletions src/app/home/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { SharedModule } from './../shared/index';
import { CarouselModule } from 'ngx-bootstrap/carousel';
import { ModalModule } from 'ngx-bootstrap';
import { AccordionModule } from 'ngx-bootstrap';
import { NgxInputStarRatingModule } from '@ngx-lite/input-star-rating';
// Components
import { HomeComponent } from './home.component';
// Breadcrumb components
Expand Down Expand Up @@ -83,6 +84,7 @@ import { reducers } from './reducers/index';
PaginationModule.forRoot(),
ModalModule.forRoot(),
AccordionModule.forRoot(),
NgxInputStarRatingModule,

/**
* StoreModule.forFeature is used for composing state
Expand Down