Commit 603a00bc authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174349 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 53de4807
......@@ -30,7 +30,6 @@ import { EcmUserOptionComponent } from './ecm-user-option/ecm-user-option.compon
import { EcmInputComponent } from './ecm-input/ecm-input.component';
import { EcmSearchResultComponent } from './ecm-search/ecm-search-result/ecm-search-result.component';
import { SearchService } from './ecm-search/ecm-search-result/search.service';
import { EcmSearchItemComponent } from './ecm-search/ecm-search-result/ecm-search-item/ecm-search-item.component';
import { EcmBreadcrumbsComponent } from './ecm-breadcrumbs/ecm-breadcrumbs.component';
//Changes by Prajyot
......@@ -64,7 +63,6 @@ const appRoutes: Routes = [
EcmUserOptionComponent,
EcmInputComponent,
EcmSearchResultComponent,
EcmSearchItemComponent,
EcmBreadcrumbsComponent
],
imports: [
......
......@@ -15,6 +15,7 @@
<a *ngIf="!card.info_link" class="ecm-card-action top share"></a>
</div>
</div>
<div *ngIf="category" class="ecm-card">
<!-- <img class="ecm-card-img"src="{{category.resourceUrl}}{{category.catCode}}.png"alt="Category image"> -->
<ecm-image [refId]='category.catCode' [refSer]="'ECMCAT'" [object]="'ECM_CATEGORY'" [attachType]="'Image'"></ecm-image>
......@@ -34,6 +35,7 @@
<a *ngIf="!category.catLink" class="ecm-card-action top share" [routerLink]="[ '/share','SUB_CATEGORY',category.catCode]"></a>
</div>
</div>
<div *ngIf="subcategory" class="ecm-card">
<!-- <img class="ecm-card-img"src="{{subcategory.resourceUrl}}{{subcategory.scatCode}}.png"alt="Category image">-->
<ecm-image [refId]="subcategory.scatCode + ':' + subcategory.catCode" [refSer]="'ECMCAT'" [object]="'ECM_CATEGORY'" [attachType]="'Image'"></ecm-image>
......@@ -54,17 +56,17 @@
</div>
</div>
<div *ngIf="itemData" class="ecm-card">
<!-- <img class="ecm-card-img"src="{{subcategory.resourceUrl}}{{subcategory.scatCode}}.png"alt="Category image"> -->
<ecm-image [refId]='itemData.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" ></ecm-image>
<div class="ecm-card-footer">
<!-- <img class="ecm-card-info-img"src="/ecm/assets/images/category/{{catCode}}_icon.png"alt="Item icon" /> -->
<ecm-image [refId]='catCode' [refSer]="'ECMCAT'" [object]="'ECM_CATEGORY'" [attachType]="'Icon'"></ecm-image>
<div class="ecm-card-info">
<span class="ecm-card-info-title">{{itemData.shDescr}}</span>
<span class="ecm-card-info-subhead">{{itemData.descr}}</span>
</div>
<a class="ecm-card-action" (click)='orderItem()'>Place Order</a>
<div *ngIf="itemData" class="ecm-card" id="ecm-item" (click)="openItem()">
<ecm-image [refId]='itemData.itemCode' [refSer]="'M-ITEM'" [object]="'ITEM'" ></ecm-image>
<div class="ecm-card-footer" id="ecm-item-footer">
<div class="ecm-card-info" id="ecm-item-info">
<span id="ecm-item-info-title" class="ecm-card-info-title">{{itemData.descr}}</span>
<span *ngIf="itemData.cat_sh_descr && itemData.scat_sh_descr" class="ecm-card-info-subhead" id="ecm-item-info-subhead">{{itemData.cat_sh_descr}} - {{itemData.scat_sh_descr}}</span>
<span *ngIf="!itemData.cat_sh_descr && !itemData.scat_sh_descr" class="ecm-card-info-subhead" id="ecm-item-info-subhead">{{extraParam.catShDesc}} - {{extraParam.scatDesc}}</span>
<span class="ecm-ratings">
<span *ngFor="let a of createRatings(itemData.rating);">&#x2605;</span>
</span>
</div>
<div class="ecm-card-price"><span class="ecm-rupee"></span>{{itemData.costRate}}</div>
</div>
</div>
......@@ -11,15 +11,24 @@ export class ECMCardComponent implements OnInit {
@Input() card: ECMCard;
@Input() category: Category;
@Input() subcategory: SubCategory;
@Input() itemData: Item;
@Input() catCode: any;
@Input() itemData: Item;
@Input() extraParam: any;
constructor() { }
ngOnInit() {
}
orderItem()
openItem()
{
alert(this.itemData.itemCode);
}
createRatings(ratings){
var rating: number[] = [];
for(var i = 1; i <= ratings; i++){
rating.push(i);
}
return rating;
}
}
......@@ -3,11 +3,10 @@ h4{
}
.categories-section {
padding: 0;
margin: 0;
padding-top: 100px;
padding-top: 70px;
background-color: #FFF;
padding-top: 70px !important;
padding: 0;
margin: 0;
background-color: #FFF;
}
.ecm-pagination-section {
padding-top: 10px;
......@@ -108,70 +107,6 @@ option{
font-size: 15px
}
/* BreadCrumbs */
.ecm-breadcrumbs {
/* font-size: .85em; */
color: #000;
line-height: 1.5;
/* margin: 20px; */
padding-left: 0;
margin: 0;
list-style-type: none;
}
.ecm-breadcrumbs li {
display: inline;
list-style-type: none;
margin-left: 0;
}
.ecm-breadcrumbs li:before {
content: "/";
padding-left: 5px;
padding-right: 5px;
color: mediumvioletred;
}
.ecm-breadcrumbs li:first-child:before {
content: "";
padding-right: 5px;
}
.ecm-breadcrumbs li a {
background-color: transparent;
color: mediumvioletred;
text-decoration: none;
cursor: pointer;
}
.ecm-breadcrumbs li a:hover {
color: rgba(199, 21, 133, 0.45);
}
.row.sub-heading {
top: 60px;
position: relative;
background: #ffffff;
max-width: 100rem;
padding-left: 3rem;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
}
.img-back-32 {
/*content: url(../../assets/images/w_user_32_32.png);*/
content: url(../../../assets/images/svg/back_32_32.svg);
}
.fixed-header-back {
position: absolute;
padding: 0;
height: 20px !important;
width: 20px !important;
box-shadow: 0 0 0 3px rgba(0 ,0 ,0, 0.1), inset 0 0 0px 20px rgba(0 ,0, 0, 0.1);
cursor: pointer;
border-radius: 100%;
margin-left: -2rem !important;
}
.ecm-section-info {
padding: 10px;
}
\ No newline at end of file
<ecm-header [isFixedHeader]=false> </ecm-header>
<div class="row sub-heading">
<div class="ecm-section-info" >
<img class="fixed-header-back img-back-32" (click) = "backClicked();" />
<ul class="ecm-breadcrumbs">
<li *ngFor="let breadcrumb of breadcrumbs">
<a [routerLink]="[breadcrumb.url]">{{breadcrumb.label}}</a>
</li>
</ul>
</div>
</div>
<app-ecm-breadcrumbs [pageName]="'SEARCH'"> </app-ecm-breadcrumbs>
<div *ngIf="items">
<section class="categories-section">
......@@ -30,8 +21,8 @@
</span>
</div>
<div class="small-12 medium-6 large-4 column end "*ngFor="let item of items?.response?.docs">
<app-ecm-search-item [item]="item"></app-ecm-search-item>
<div class="small-12 medium-6 large-4 column end "*ngFor="let item of items">
<ecm-card [itemData]="item"> </ecm-card>
</div>
<span *ngIf="resultFound" >
......
......@@ -2,8 +2,7 @@ import { Component, OnInit, ViewChild,EventEmitter } from '@angular/core';
import { SearchService } from './search.service';
import {Http, Response, Headers} from '@angular/http';
import { ActivatedRoute } from '@angular/router';
import { IBreadcrumb } from '../../ecm-category/category-model';
import { Item } from '../../ecm-category/category-model';
import 'rxjs/add/operator/map';
@Component({
......@@ -13,7 +12,8 @@ import 'rxjs/add/operator/map';
})
export class EcmSearchResultComponent implements OnInit {
items;
searchResponse: any;
items:Item[];
value;
start=0;
numFound;
......@@ -23,23 +23,12 @@ export class EcmSearchResultComponent implements OnInit {
resultFound:boolean;
sortType="rating desc";
solrUrl= '/ecm/service/solr/local2do/';
breadcrumbs:IBreadcrumb[] = [];
@ViewChild('page') page;
constructor(private search_service: SearchService, private http:Http, private route:ActivatedRoute) {}
ngOnInit() {
this.breadcrumbs = [];
this.breadcrumbs.push( {
label: 'Home',
url: '/home'
} );
this.breadcrumbs.push( {
label: 'Search',
url: 'javascript:void(0)'
} );
this.myCity = localStorage.getItem('mycity');
......@@ -56,17 +45,23 @@ export class EcmSearchResultComponent implements OnInit {
}
fetchItems(){
var solrUrl= this.solrUrl+this.value+'/json/'+this.start+'/'+this.sortType;
var solrUrl= this.solrUrl+this.value+'/json/'+this.start+'/'+this.sortType;
this.http.get(solrUrl)
.map(res => res.json())
.subscribe(data => this.items = data,
() => console.log("Completed"));
.subscribe(data => {
this.searchResponse = data;
this.items = data.response.docs;
});
}
ngAfterContentChecked(){
if(this.items)
if(this.searchResponse)
{
this.numFound=this.items.response.numFound;
if(this.searchResponse.response)
{
this.numFound=this.searchResponse.response.numFound;
}
if(this.numFound==0)
{
this.resultFound = false;
......@@ -184,9 +179,9 @@ export class EcmSearchResultComponent implements OnInit {
if(value=='Rating')
this.sortType='rating desc';
if(value=='Price: High to Low')
this.sortType='cost_rate desc';
this.sortType='costRate desc';
if(value=='Price: Low to High')
this.sortType='cost_rate asc';
this.sortType='costRate asc';
this.fetchItems();
}
......
......@@ -157,14 +157,14 @@
}
*/
.sb-icon-search, .sb-search-reset {
width: 38px;
height: 38px;
width: 35px;
height: 30px;
display: block;
position: absolute;
right: 0;
top: 15px;
padding: 0;
margin: -7px;
margin: -8px;
line-height: 32px;
text-align: center;
cursor: pointer;
......@@ -186,9 +186,9 @@
z-index: 90;
/*background-image: url(../../assets/images/w_search_38_38.png);*/
background-image: url(../../assets/images/svg/w_search_38_38.svg);
background-position: 0px 0px;
background-position: 3px 3px;
background-repeat: no-repeat;
background-size: 30px 30px;
background-size: 25px 25px;
border: none;
outline: none;
}
......@@ -216,11 +216,7 @@
z-index: 16;
top: 12px;
}
.sb-search
{
padding:9px;
padding-left: 0px;
}
.sb-search.sb-search-open .sb-search-reset {
z-index: 90;
}
......
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