Commit 54e31d19 by Jansa Jose

index page and design issues

parent 7247e745
...@@ -379,8 +379,7 @@ ...@@ -379,8 +379,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -401,14 +400,12 @@ ...@@ -401,14 +400,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
...@@ -423,20 +420,17 @@ ...@@ -423,20 +420,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
...@@ -553,8 +547,7 @@ ...@@ -553,8 +547,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
...@@ -566,7 +559,6 @@ ...@@ -566,7 +559,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
...@@ -581,7 +573,6 @@ ...@@ -581,7 +573,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
...@@ -595,7 +586,6 @@ ...@@ -595,7 +586,6 @@
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -694,8 +684,7 @@ ...@@ -694,8 +684,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
...@@ -707,7 +696,6 @@ ...@@ -707,7 +696,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -793,8 +781,7 @@ ...@@ -793,8 +781,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -830,7 +817,6 @@ ...@@ -830,7 +817,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -850,7 +836,6 @@ ...@@ -850,7 +836,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -894,14 +879,12 @@ ...@@ -894,14 +879,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
...@@ -2593,7 +2576,7 @@ ...@@ -2593,7 +2576,7 @@
}, },
"camelcase-keys": { "camelcase-keys": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
"requires": { "requires": {
"camelcase": "^2.0.0", "camelcase": "^2.0.0",
...@@ -6398,7 +6381,7 @@ ...@@ -6398,7 +6381,7 @@
}, },
"load-json-file": { "load-json-file": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": { "requires": {
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",
...@@ -6410,7 +6393,7 @@ ...@@ -6410,7 +6393,7 @@
"dependencies": { "dependencies": {
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
} }
} }
...@@ -6748,7 +6731,7 @@ ...@@ -6748,7 +6731,7 @@
}, },
"meow": { "meow": {
"version": "3.7.0", "version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"requires": { "requires": {
"camelcase-keys": "^2.0.0", "camelcase-keys": "^2.0.0",
...@@ -6765,7 +6748,7 @@ ...@@ -6765,7 +6748,7 @@
"dependencies": { "dependencies": {
"minimist": { "minimist": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
} }
} }
...@@ -7175,7 +7158,7 @@ ...@@ -7175,7 +7158,7 @@
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "5.3.0", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
} }
} }
...@@ -7259,7 +7242,7 @@ ...@@ -7259,7 +7242,7 @@
}, },
"chalk": { "chalk": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": { "requires": {
"ansi-styles": "^2.2.1", "ansi-styles": "^2.2.1",
...@@ -7276,7 +7259,7 @@ ...@@ -7276,7 +7259,7 @@
}, },
"supports-color": { "supports-color": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
} }
} }
...@@ -7571,7 +7554,7 @@ ...@@ -7571,7 +7554,7 @@
}, },
"os-locale": { "os-locale": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"requires": { "requires": {
"lcid": "^1.0.0" "lcid": "^1.0.0"
...@@ -8437,7 +8420,7 @@ ...@@ -8437,7 +8420,7 @@
}, },
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
} }
} }
...@@ -8861,7 +8844,7 @@ ...@@ -8861,7 +8844,7 @@
"dependencies": { "dependencies": {
"source-map": { "source-map": {
"version": "0.4.4", "version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"requires": { "requires": {
"amdefine": ">=0.0.4" "amdefine": ">=0.0.4"
...@@ -10315,9 +10298,9 @@ ...@@ -10315,9 +10298,9 @@
"dev": true "dev": true
}, },
"uglify-js": { "uglify-js": {
"version": "3.5.15", "version": "3.6.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
"integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==", "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
......
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
<div class="col-md-6"> <div class="col-md-6">
<select (change)="get_model($event.target.value)" formControlName="maker" [ngClass]="{'input_error': !vehicleDataForm.controls['maker'].valid && vehicleDataFormSubmit}"> <select (change)="get_model($event.target.value)" formControlName="maker" [ngClass]="{'input_error': !vehicleDataForm.controls['maker'].valid && vehicleDataFormSubmit}">
<option value="" class="hide">MAKE</option> <option value="" class="hide">MAKE</option>
<option *ngFor="let car_date of carSearchJsonData; let key = index" value="{{key}}">{{car_date.brand}}</option> <option *ngFor="let car_date of carSearchJsonData; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option>
</select> </select>
</div> </div>
</div> </div>
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
<div class="col-md-6"> <div class="col-md-6">
<select formControlName="modelName" [ngClass]="{'input_error': !vehicleDataForm.controls['modelName'].valid && vehicleDataFormSubmit}"> <select formControlName="modelName" [ngClass]="{'input_error': !vehicleDataForm.controls['modelName'].valid && vehicleDataFormSubmit}">
<option value="" class="hide">MODEL</option> <option value="" class="hide">MODEL</option>
<option *ngFor="let car_models of carModel">{{car_models}}</option> <option *ngFor="let car_models of carModel">{{car_models.model}}</option>
</select> </select>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
......
...@@ -18,7 +18,6 @@ declare const google: any; ...@@ -18,7 +18,6 @@ declare const google: any;
styleUrls: ['./index.component.scss'] styleUrls: ['./index.component.scss']
}) })
export class IndexComponent implements OnInit { export class IndexComponent implements OnInit {
public featuredOn: NgxCarousel; public featuredOn: NgxCarousel;
public carouselTile: NgxCarousel; public carouselTile: NgxCarousel;
...@@ -119,9 +118,10 @@ export class IndexComponent implements OnInit { ...@@ -119,9 +118,10 @@ export class IndexComponent implements OnInit {
modelName: new FormControl('', [Validators.required]) modelName: new FormControl('', [Validators.required])
}); });
this.webService.get_stored_json('car-list.json').subscribe((response: any) => { // this.webService.get_stored_json('car-list.json').subscribe((response: any) => {
this.carSearchJsonData = response; // this.carSearchJsonData = response;
}); // });
this.getVehicleBrand();
let currentYear = Number((new Date()).getFullYear()); let currentYear = Number((new Date()).getFullYear());
let startingYear = currentYear - 50; let startingYear = currentYear - 50;
...@@ -155,8 +155,21 @@ export class IndexComponent implements OnInit { ...@@ -155,8 +155,21 @@ export class IndexComponent implements OnInit {
$('body').attr('style',''); $('body').attr('style','');
} }
getVehicleBrand(){
this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){
this.carSearchJsonData = response.data;
}
});
}
get_model(event) { get_model(event) {
this.carModel = this.carSearchJsonData[event].models; this.webService.post_data('getVehicleModel',{'vehBrand_id':event}).subscribe(response => {
if(response.status == 'success'){
this.carModel = response.data;
}
});
// this.carModel = this.carSearchJsonData[event].models;
} }
getVehicleLoc(lastLoc){ getVehicleLoc(lastLoc){
...@@ -201,11 +214,11 @@ export class IndexComponent implements OnInit { ...@@ -201,11 +214,11 @@ export class IndexComponent implements OnInit {
'modelName':vehicleData['modelName'],'modelYear':vehicleData['modelYear'], 'modelName':vehicleData['modelName'],'modelYear':vehicleData['modelYear'],
'maintanenceInterval':vehicleData['maintanence_interval'] 'maintanenceInterval':vehicleData['maintanence_interval']
} }
console.log(this.wizardData['vechile_info']) //console.log(this.wizardData['vechile_info'])
this.vehicleDataFormSubmit = false; this.vehicleDataFormSubmit = false;
} }
getIssueData(){ getIssueData(){
const This = this; const This = this;
this.loader = true; this.loader = true;
this.webService.get_data('getGeneralIssues').subscribe(response => { this.webService.get_data('getGeneralIssues').subscribe(response => {
...@@ -221,9 +234,9 @@ export class IndexComponent implements OnInit { ...@@ -221,9 +234,9 @@ export class IndexComponent implements OnInit {
this.loader = false; this.loader = false;
return false; return false;
}); });
} }
searchIssues(event){ searchIssues(event){
if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){ if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){
this.issuesData = this.defIssuesData; this.issuesData = this.defIssuesData;
} else { } else {
...@@ -254,8 +267,8 @@ export class IndexComponent implements OnInit { ...@@ -254,8 +267,8 @@ export class IndexComponent implements OnInit {
$('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true); $('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
}); });
},500); },500);
} }
get_newlocaion(lastLoc){ get_newlocaion(lastLoc){
this.cfautocomplete.addListener("place_changed", () => { this.cfautocomplete.addListener("place_changed", () => {
this.ngZone.run(() => { this.ngZone.run(() => {
let places: google.maps.places.PlaceResult = this.cfautocomplete.getPlace(); let places: google.maps.places.PlaceResult = this.cfautocomplete.getPlace();
...@@ -365,7 +378,7 @@ export class IndexComponent implements OnInit { ...@@ -365,7 +378,7 @@ export class IndexComponent implements OnInit {
thisObj.selectedIssues.forEach(function (selIssues) { thisObj.selectedIssues.forEach(function (selIssues) {
selSubIssues.push(selIssues.sub_issue_id); selSubIssues.push(selIssues.sub_issue_id);
}); });
console.log(this.wizardData) //console.log(this.wizardData)
let searchData = {'pickup_data':this.wizardData.pickup_data,'sub_issues':selSubIssues} let searchData = {'pickup_data':this.wizardData.pickup_data,'sub_issues':selSubIssues}
this.webService.post_data('getNearByMechanics',searchData).subscribe(response => { this.webService.post_data('getNearByMechanics',searchData).subscribe(response => {
if(response.status == '1'){ if(response.status == '1'){
......
...@@ -24,14 +24,19 @@ ...@@ -24,14 +24,19 @@
HOME HOME
</a> </a>
</li> </li>
<li class="nav-item" *ngIf="loginDetails">
<a class="nav-link" (click)="goToPage('dashboard')">
DASHBOARD
</a>
</li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" (click)="goToPage('purchaseHome')"> <a class="nav-link" (click)="goToPage('purchaseHome')">
PURCHASE PURCHASE
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link base_arrow dropdown"> <a class="nav-link base_arrow dropdown" data-toggle="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown"> <div class="dropdown-toggle">
CAR OWNERS CAR OWNERS
</div> </div>
<div class="dropdown-menu"> <div class="dropdown-menu">
...@@ -73,8 +78,6 @@ ...@@ -73,8 +78,6 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" (click)="goToPage('dashboard')">
My Dashboard</a>
<a class="dropdown-item" (click)="logout()">Logout</a> <a class="dropdown-item" (click)="logout()">Logout</a>
</div> </div>
</a> </a>
...@@ -387,6 +390,7 @@ ...@@ -387,6 +390,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<input class="" type="email" placeholder="Email" formControlName="email" <input class="" type="email" placeholder="Email" formControlName="email"
...@@ -410,6 +414,14 @@ ...@@ -410,6 +414,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12">
<select formControlName="shop_id">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select</option>
<option *ngFor="let shop of mechShop" [attr.value]="shop.shop_id">{{shop.shop_name}}</option>
</select>
</div>
</div>
<div *ngIf="spSignupResponse" class="s_alert" [ngClass]="(spSignupResponse.status == 'success') ? 'alert-success' : 'alert-danger'"> <div *ngIf="spSignupResponse" class="s_alert" [ngClass]="(spSignupResponse.status == 'success') ? 'alert-success' : 'alert-danger'">
<strong>{{spSignupResponse.message}}<br></strong> <strong>{{spSignupResponse.message}}<br></strong>
</div> </div>
......
...@@ -213,6 +213,27 @@ ...@@ -213,6 +213,27 @@
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
select{
border: 1px solid #1e1e1e;
height: 40px;
width: 100%;
border-radius: 10px;
font-size: 16px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius:10px;
-o-border-radius: 10px;
text-align: center;
option{
text-align: center;
}
&::placeholder {
color: #bbbbbb;
}
&:focus {
outline: none;
}
}
input { input {
border: 1px solid #1e1e1e; border: 1px solid #1e1e1e;
height: 40px; height: 40px;
......
...@@ -17,13 +17,14 @@ declare const window: any; ...@@ -17,13 +17,14 @@ declare const window: any;
export class NavbarComponent implements OnInit { export class NavbarComponent implements OnInit {
data : any; data : any;
loader : boolean;
imageServer : any; imageServer : any;
loginDetails : any; loginDetails : any;
loginResponse : any; loginResponse : any;
forgotResponse : any; forgotResponse : any;
signupResponse : any; signupResponse : any;
spSignupResponse : any; spSignupResponse : any;
mechShop : any;
loader : boolean;
loginSubmitClick : boolean; loginSubmitClick : boolean;
forgotSubmitClick : boolean; forgotSubmitClick : boolean;
signupSubmitClick : boolean; signupSubmitClick : boolean;
...@@ -58,6 +59,7 @@ export class NavbarComponent implements OnInit { ...@@ -58,6 +59,7 @@ export class NavbarComponent implements OnInit {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData')); this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
}); });
this.getMechanicShops();
this.loginForm = new FormGroup({ this.loginForm = new FormGroup({
email: new FormControl('', [Validators.required, Validators.maxLength(50), Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')]), email: new FormControl('', [Validators.required, Validators.maxLength(50), Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')]),
password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)]) password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)])
...@@ -83,10 +85,24 @@ export class NavbarComponent implements OnInit { ...@@ -83,10 +85,24 @@ export class NavbarComponent implements OnInit {
phone: new FormControl('', [Validators.required, Validators.pattern("^[0-9\ ( ) + , - ]+$")]), phone: new FormControl('', [Validators.required, Validators.pattern("^[0-9\ ( ) + , - ]+$")]),
password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)]), password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)]),
last_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]), last_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]),
first_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]) first_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]),
shop_id: new FormControl('')
}); });
} }
getMechanicShops(){
this.loader = true;
this.webService.get_data('getMechanicShops').subscribe(response => {
if(response.status == 'success'){
this.mechShop = response.data;
}else{
this.mechShop = false;
}
this.loader = false;
})
}
loginSubmit(data) { loginSubmit(data) {
if(this.loginForm.invalid){ if(this.loginForm.invalid){
return false; return false;
......
...@@ -47,13 +47,13 @@ export class AddaddressComponent implements OnInit { ...@@ -47,13 +47,13 @@ export class AddaddressComponent implements OnInit {
this.address_id = params['address_id']; this.address_id = params['address_id'];
}); });
}); });
if(this.address_id != ''){
this.getUserAddressById(this.address_id);
}
this.checkUserLogin(); this.checkUserLogin();
this.checkProductId(); this.checkProductId();
this.buildAddressForm(); this.buildAddressForm();
if(this.address_id > 0){
this.getUserAddressById(this.address_id);
}
} }
buildAddressForm(){ buildAddressForm(){
...@@ -69,14 +69,6 @@ export class AddaddressComponent implements OnInit { ...@@ -69,14 +69,6 @@ export class AddaddressComponent implements OnInit {
}); });
} }
// checkProductId(product_id){
// if(product_id > 0){
// this.product_id = product_id;
// }else{
// this.goToPage('purchaseHome','');
// }
// }
checkProductId(){ checkProductId(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails')); this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData"> <ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData"> <ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData">
<li (click)="latestPrdtDtls(prdt.product_id)"> <li (click)="latestPrdtDtls(prdt.product_id)">
<div class="inner_div_product"> <div class="inner_div_product cpoint">
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<div class="product_details"> <div class="product_details">
<h1>{{productDetails.product_name}}</h1> <h1>{{productDetails.product_name}}</h1>
<h2>{{productDetails.short_description}}</h2> <h2>{{productDetails.short_description}}</h2>
<h4><div>Brand</div><span>{{productDetails.brand_name}}</span></h4> <h2>Brand : </h2><h4>{{productDetails.brand_name}}</h4>
<h4><div>Part ID</div><span>PRD152685425</span></h4> <div *ngIf="productDetails.part_id"><h2>Part ID : </h2><h4>{{productDetails.part_id}}</h4></div>
<h3>$ {{productDetails.amount}}</h3> <h3>$ {{productDetails.amount}}</h3>
<div class="rating_div" *ngIf="productDetails.rating"> <div class="rating_div" *ngIf="productDetails.rating">
<fieldset class="rating prevent-click"> <fieldset class="rating prevent-click">
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData"> <ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData" > <ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData" >
<li (click)="latestPrdtDtls(prdt.product_id)"> <li (click)="latestPrdtDtls(prdt.product_id)">
<div class="inner_div_product"> <div class="inner_div_product cpoint">
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
......
...@@ -52,7 +52,6 @@ export class ProductdetailsComponent implements OnInit { ...@@ -52,7 +52,6 @@ export class ProductdetailsComponent implements OnInit {
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.product_id = params['product_id']; this.product_id = params['product_id'];
}); });
this.getProductDetails();
}); });
if(!this.product_id){ if(!this.product_id){
...@@ -70,6 +69,7 @@ export class ProductdetailsComponent implements OnInit { ...@@ -70,6 +69,7 @@ export class ProductdetailsComponent implements OnInit {
this.designModules(); this.designModules();
this.checkUserLogin(); this.checkUserLogin();
this.trendingProducts(); this.trendingProducts();
this.getProductDetails();
} }
checkUserLogin(){ checkUserLogin(){
...@@ -81,7 +81,11 @@ export class ProductdetailsComponent implements OnInit { ...@@ -81,7 +81,11 @@ export class ProductdetailsComponent implements OnInit {
getProductDetails(){ getProductDetails(){
this.loader = true; this.loader = true;
this.webService.post_data('SingleProductSearch',{"product_id":this.product_id,'page':this.page}).subscribe(response => { let user_id: number = 0;
if(this.loginDetails && this.loginDetails.customer_id){
user_id = this.loginDetails.customer_id;
}
this.webService.post_data('SingleProductSearch',{"product_id":this.product_id,'page':this.page,'user_id':user_id}).subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
let image: string = ''; let image: string = '';
let imageArr: any[] = new Array(); let imageArr: any[] = new Array();
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
<ul id="ac3" class="collapse in show"> <ul id="ac3" class="collapse in show">
<h6 class="backgroundNone borderNone"> <h6 class="backgroundNone borderNone">
<select> <select>
<option> <option *ngFor="let date of modelDates">{{date}}</option>
Year
</option>
</select> </select>
</h6> </h6>
<h6 class="backgroundNone borderNone"> <h6 class="backgroundNone borderNone">
...@@ -66,7 +64,7 @@ ...@@ -66,7 +64,7 @@
</div> </div>
</div> </div>
<div class="loader_overlay" *ngIf="loader"></div> <div class="loader_overlay" *ngIf="loader"></div>
<div class="search_listing_content" *ngIf="productArray && productArray.length > 0;else noProductData"> <div class="search_listing_content cpoint" *ngIf="productArray && productArray.length > 0;else noProductData">
<ul infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll"> <ul infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li *ngFor="let prdt of productArray"> <li *ngFor="let prdt of productArray">
<div class="inner_div_product cpoint" (click)="getSingleProductDetails(prdt.product_id)"> <div class="inner_div_product cpoint" (click)="getSingleProductDetails(prdt.product_id)">
...@@ -76,7 +74,7 @@ ...@@ -76,7 +74,7 @@
<h5>{{prdt.product_name}}</h5> <h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p> <p>{{prdt.short_description}}</p>
<div class="star_ratting"> <div class="star_ratting">
<fieldset class="rating prevent-click hide"> <fieldset class="rating prevent-click">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label> <input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label> <input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label> <input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label>
......
...@@ -282,6 +282,7 @@ ...@@ -282,6 +282,7 @@
.rating { .rating {
border: none; border: none;
float: left; float: left;
position: relative;
} }
.rating > input { display: none; } .rating > input { display: none; }
......
...@@ -22,6 +22,7 @@ export class ProductlistComponent implements OnInit { ...@@ -22,6 +22,7 @@ export class ProductlistComponent implements OnInit {
page: number = 1; page: number = 1;
total_page: number = 1; total_page: number = 1;
filterParam: any = new Array(); filterParam: any = new Array();
modelDates: number[] = new Array();
constructor( constructor(
private router : Router, private router : Router,
...@@ -50,6 +51,16 @@ export class ProductlistComponent implements OnInit { ...@@ -50,6 +51,16 @@ export class ProductlistComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.getBrand(); this.getBrand();
this.getYear();
}
getYear(){
let currentYear = Number((new Date()).getFullYear());
let startingYear = currentYear - 110;
for (let date = currentYear ; date >= startingYear ; date --) {
this.modelDates.push(date);
}
console.log(this.modelDates);
} }
goToPage(path,data=null){ goToPage(path,data=null){
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="latestProductData"> <ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="latestProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of latestProductData"> <ngx-tile NgxCarouselItem *ngFor="let prdt of latestProductData">
<li (click)="latestPrdtDtls(prdt.product_id)" > <li (click)="latestPrdtDtls(prdt.product_id)" >
<div class="inner_div_product"> <div class="inner_div_product cpoint">
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
...@@ -52,15 +52,15 @@ ...@@ -52,15 +52,15 @@
<div class="loader_overlay" *ngIf="trend_loader"></div> <div class="loader_overlay" *ngIf="trend_loader"></div>
<ul *ngIf="trendingProductData" <ul *ngIf="trendingProductData"
infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll"> infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li (click)="latestPrdtDtls(prdt.product_id)" *ngFor="let prdt of trendingProductData" > <li *ngFor="let prdt of trendingProductData" >
<div class="inner_div_product"> <div class="inner_div_product cpoint" (click)="latestPrdtDtls(prdt.product_id)" >
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
<h5>{{prdt.product_name}}</h5> <h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p> <p>{{prdt.short_description}}</p>
<div class="star_ratting"> <div class="star_ratting">
<fieldset class="rating prevent-click hide"> <fieldset class="rating prevent-click">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label> <input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label> <input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label> <input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label>
......
...@@ -289,6 +289,7 @@ ...@@ -289,6 +289,7 @@
.rating { .rating {
border: none; border: none;
float: left; float: left;
position: relative;
} }
.rating > input { display: none; } .rating > input { display: none; }
......
...@@ -20,6 +20,7 @@ export class PurchaseHomeComponent implements OnInit { ...@@ -20,6 +20,7 @@ export class PurchaseHomeComponent implements OnInit {
trend_loader:boolean; trend_loader:boolean;
latestProductData:any; latestProductData:any;
trendingProductData:any; trendingProductData:any;
loginDetails:any;
@ViewChild("failureModel") public failureModelRef: ElementRef; @ViewChild("failureModel") public failureModelRef: ElementRef;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="purchase_other"> <div class="purchase_other" *ngIf="loginDetails">
<ul> <ul>
<li (click)="goToPage('orders')"> <li (click)="goToPage('orders')">
<img src="assets/images/asset_cart.png"> <img src="assets/images/asset_cart.png">
......
...@@ -2,6 +2,7 @@ import { Component, OnInit, ElementRef, ViewChild } from '@angular/core'; ...@@ -2,6 +2,7 @@ import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router'; import { Router,ActivatedRoute } from '@angular/router';
import { WebService } from '../../provider/web.service'; import { WebService } from '../../provider/web.service';
import { ImageStorage } from '../../../environments/server.config'; import { ImageStorage } from '../../../environments/server.config';
import { SubjectService } from '../../provider/subject.service';
@Component({ @Component({
selector: 'app-searchbar', selector: 'app-searchbar',
...@@ -13,17 +14,29 @@ export class SearchbarComponent implements OnInit { ...@@ -13,17 +14,29 @@ export class SearchbarComponent implements OnInit {
productArray: any; productArray: any;
SingleProductData:any; SingleProductData:any;
imageServer: string; imageServer: string;
loginDetails:any;
public scrollbarOptions = { axis: 'y', theme: 'minimal-dark' }; public scrollbarOptions = { axis: 'y', theme: 'minimal-dark' };
@ViewChild("productSearch") public productSearchRef: ElementRef; @ViewChild("productSearch") public productSearchRef: ElementRef;
constructor(private router : Router, private route: ActivatedRoute, public webService: WebService) { constructor(private router : Router,
private route: ActivatedRoute,
public webService: WebService,
public subjectService : SubjectService) {
this.productArray = true; this.productArray = true;
this.imageServer = ImageStorage; this.imageServer = ImageStorage;
} }
ngOnInit() { ngOnInit() {
this.checkUserLogin();
}
checkUserLogin(){
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
});
} }
goToPage(path,data=null){ goToPage(path,data=null){
......
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