Commit 6cbd7354 by Tobin

Merge branch 'jensa' into 'master'

Jensa See merge request !46
parents 1576e39f 98b712b8
......@@ -379,8 +379,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
......@@ -401,14 +400,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -423,20 +420,17 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -553,8 +547,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
......@@ -566,7 +559,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -581,7 +573,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -595,7 +586,6 @@
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -694,8 +684,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
......@@ -707,7 +696,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -793,8 +781,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -830,7 +817,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -850,7 +836,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -894,14 +879,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
......@@ -1739,6 +1722,11 @@
"bootstrap": "^4.0.0-alpha.6"
}
},
"angularx-social-login": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/angularx-social-login/-/angularx-social-login-1.2.7.tgz",
"integrity": "sha512-ymzYuuYfWeIywVmswKYFMwC9n3oFxeIr3OpjL62afZig7rpVDvVGsxqFR3Kfjc2dThMRCvDVoq/vvGgO33fWKQ=="
},
"ansi-colors": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz",
......@@ -2593,7 +2581,7 @@
},
"camelcase-keys": {
"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=",
"requires": {
"camelcase": "^2.0.0",
......@@ -4965,14 +4953,12 @@
},
"handlebars": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.1.tgz",
"integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==",
"resolved": "",
"dev": true,
"requires": {
"neo-async": "^2.6.0",
"optimist": "^0.6.1",
"source-map": "^0.6.1",
"uglify-js": "^3.1.4"
"source-map": "^0.6.1"
},
"dependencies": {
"source-map": {
......@@ -6398,7 +6384,7 @@
},
"load-json-file": {
"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=",
"requires": {
"graceful-fs": "^4.1.2",
......@@ -6410,7 +6396,7 @@
"dependencies": {
"pify": {
"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="
}
}
......@@ -6748,7 +6734,7 @@
},
"meow": {
"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=",
"requires": {
"camelcase-keys": "^2.0.0",
......@@ -6765,7 +6751,7 @@
"dependencies": {
"minimist": {
"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="
}
}
......@@ -7175,7 +7161,7 @@
"dependencies": {
"semver": {
"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="
}
}
......@@ -7259,7 +7245,7 @@
},
"chalk": {
"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=",
"requires": {
"ansi-styles": "^2.2.1",
......@@ -7276,7 +7262,7 @@
},
"supports-color": {
"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="
}
}
......@@ -7571,7 +7557,7 @@
},
"os-locale": {
"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=",
"requires": {
"lcid": "^1.0.0"
......@@ -8437,7 +8423,7 @@
},
"pify": {
"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="
}
}
......@@ -8861,7 +8847,7 @@
"dependencies": {
"source-map": {
"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=",
"requires": {
"amdefine": ">=0.0.4"
......@@ -10314,33 +10300,6 @@
"integrity": "sha1-tlQ6g8/Iwr77P0yPumiW9bDJvmg=",
"dev": true
},
"uglify-js": {
"version": "3.5.15",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz",
"integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==",
"dev": true,
"optional": true,
"requires": {
"commander": "~2.20.0",
"source-map": "~0.6.1"
},
"dependencies": {
"commander": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
"dev": true,
"optional": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"optional": true
}
}
},
"ultron": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
......
......@@ -26,6 +26,7 @@
"@google/maps": "^0.5.5",
"angular-star-rating": "^4.0.0-beta.3",
"angular-wizard-form": "^0.4.1",
"angularx-social-login": "^1.2.7",
"bootstrap": "^4.3.1",
"core-js": "^2.5.4",
"font-awesome": "^4.7.0",
......
......@@ -8,9 +8,21 @@ import { PurchaseModule } from './purchase/purchase.module';
import { NavbarComponent } from './navbar/navbar.component';
import { FooterComponent } from './footer/footer.component';
import { ReactiveFormsModule } from '@angular/forms';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { MalihuScrollbarModule } from 'ngx-malihu-scrollbar';
import { ForgotComponent } from './forgot/forgot.component';
import { SocialLoginModule, AuthServiceConfig, LoginOpt } from "angularx-social-login";
import { FacebookLoginProvider } from "angularx-social-login";
let config = new AuthServiceConfig([
{
id: FacebookLoginProvider.PROVIDER_ID,
provider: new FacebookLoginProvider("350548065653331")
}
]);
export function provideConfig() {
return config;
}
@NgModule({
declarations: [
......@@ -26,9 +38,16 @@ import { ForgotComponent } from './forgot/forgot.component';
PurchaseModule,
ReactiveFormsModule,
HttpClientModule,
MalihuScrollbarModule.forRoot()
MalihuScrollbarModule.forRoot(),
SocialLoginModule
],
providers: [
{
provide: AuthServiceConfig,
useFactory: provideConfig
}
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
......@@ -269,7 +269,7 @@
<td>
<div class="floatLeft">
<div class="btn-group btn-group-justified">
<button class="btn btn-default btn-sm">{{bookData.status === '1' ? 'Accepted' : 'Pending'}}</button>
<button class="{{bookData.status === '1' ? 'btn btn-success btn-sm' : 'btn btn-primary btn-sm'}}btn btn-primary btn-sm">{{bookData.status === '1' ? 'Accepted' : 'Pending'}}</button>
<button (click)="cnfCancelBook(bookData.booking_id)" class="btn btn-danger btn-sm">Cancel</button>
</div>
</div>
......@@ -298,8 +298,8 @@
<td>{{mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount}}</td>
<td>
<div class="btn-group btn-group-justified">
<button class="btn btn-default btn-sm" *ngIf="bookData.status == '1' && !mechdata.custom_service_quote">Accepted</button>
<button class="btn btn-default btn-sm" *ngIf="mechdata.status == '0'">Waiting for Approval</button>
<button class="btn btn-success btn-sm" *ngIf="bookData.status == '1' && !mechdata.custom_service_quote">Accepted</button>
<button class="btn btn-info btn-sm" *ngIf="mechdata.status == '0'">Waiting for Approval</button>
<button class="btn btn-success btn-sm" [attr.bookAmount]="mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount" *ngIf="mechdata.status == '1' && bookData.status != '1'" (click)="mechanicQuoteAccept($event,bookData.booking_id,mechdata.mechanic_id)">Accept</button>
<button class="btn btn-info btn-sm" (click)="showCustQuote(bookData.booking_id,mechdata.mechanic_id,1)" data-toggle="modal" data-target="#quote" *ngIf="mechdata.status =='1' && mechdata.custom_service_quote">View Quote</button>
</div>
......@@ -523,7 +523,7 @@
<select (change)="get_model($event.target.value)" class="vehicle_input_select" placeholder="Choose Make"
formControlName="maker" [ngClass]="{'input_error': !vehicleDetailsAddForm.controls['maker'].valid && vehicleDetailsFormSubmitClick}">
<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 carBrands; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option>
</select>
</div>
</div>
......@@ -532,7 +532,7 @@
<select class="vehicle_input_select" placeholder="Choose Model" formControlName="modelName"
[ngClass]="{'input_error': !vehicleDetailsAddForm.controls['modelName'].valid && vehicleDetailsFormSubmitClick}">
<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>
</div>
<div class="col-md-6">
......@@ -926,20 +926,29 @@
<div class="col-md-6">
<div class="scheduletiming_listing">
<ul id="scroll_0_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<span *ngFor="let time of mechanic.scheduleTiming">
<li *ngIf="(time > currentTime && ((dateSection[0] | date: 'dd') == currentDate))" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p>
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
<li *ngIf="((dateSection[0] | date: 'dd') != currentDate)" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</span>
</ul>
<ul id="scroll_1_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'1');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p>
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</ul>
......
......@@ -725,7 +725,7 @@
padding: 30px;
padding-top: 50px;
position: relative;
top: 85px;
top: 15px;
.login_modal_inner {
width: 90%;
margin: 0 auto;
......@@ -827,7 +827,7 @@
}
}
.active{
background-color: #f2f2f2;
background-color: #b9b9b9;
padding:8px;
padding-left: 15px;
border-radius: 8px;
......
......@@ -44,7 +44,8 @@ export class DashboardComponent implements OnInit {
successBookDtls: any;
profileEditResp: any;
autocompleteVin: any;
carSearchJsonData: any;
carBrands: any;
selBrand: string = '';
autocompleteDetails: any;
optionalDescription: string;
editProfileSubmitClick: boolean;
......@@ -74,6 +75,8 @@ export class DashboardComponent implements OnInit {
step: number;
today: any = new Date();
currDate: any;
currentDate: any;
currentTime: any;
nextDate: any;
dateStep: number = 0;
dateSection: any[] = new Array();
......@@ -140,8 +143,9 @@ export class DashboardComponent implements OnInit {
}
ngOnInit() {
this.currentTime = this.today.getTime();
this.currentDate = this.today.getDate();
this.tab = 'active';
this.route.queryParams.subscribe(params => {
let payStatus = params['status'];
let activeTab = params['tab'];
......@@ -175,9 +179,7 @@ export class DashboardComponent implements OnInit {
modelName: new FormControl('', [Validators.required])
});
this.webService.get_stored_json('car-list.json').subscribe((response: any) => {
this.carSearchJsonData = response;
});
this.getVehicleBrand();
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
......@@ -224,12 +226,38 @@ export class DashboardComponent implements OnInit {
$('body').attr('style','');
}
getVehicleBrand(){
this.loader = true;
this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){
this.carBrands = response.data;
}
this.loader = false;
});
}
get_model(brand_id) {
this.loader = true;
const thisObj = this;
thisObj.carBrands.forEach(function (brandData,index) {
if(brandData.veh_brand_id == brand_id){
thisObj.selBrand = brandData.maker;
}
});
this.webService.post_data('getVehicleModel',{'vehBrand_id':brand_id}).subscribe(response => {
if(response.status == 'success'){
this.carModel = response.data;
}
this.loader = false;
});
}
getCustBookDetails(){
this.loader = true;
this.webService.post_data('getCustBookDetails', {'customer_id':this.loginDetails.customer_id}).subscribe(response => {
if ( response.status == '1' && response.bookData != 'undefined' && response.bookData != undefined && response.bookData != 'null' && response.bookData != null ) {
let bookings = response.bookData;
console.log(bookings);
let successBooking: any[] = new Array();
let bookingDetails: any[] = new Array();
......@@ -269,10 +297,6 @@ export class DashboardComponent implements OnInit {
});
}
get_model(event) {
this.carModel = this.carSearchJsonData[event].models;
}
setIssueSelected(event){
let issue_id = event.target.attributes.issue_id.value;
let sub_issue_id = event.target.attributes.sub_issue_id.value;
......@@ -418,7 +442,7 @@ export class DashboardComponent implements OnInit {
}
let location;
this.vehicleDetailsFormSubmitClick = false;
vehicleData.car_maker = this.carSearchJsonData[vehicleData['maker']]['brand'];
vehicleData.car_maker = this.selBrand;
this.ngZone.run(() => {
let place: google.maps.places.PlaceResult = this.autocompleteDetails.getPlace();
if (place == undefined || place == null || place === undefined || place === null ||
......@@ -477,7 +501,7 @@ export class DashboardComponent implements OnInit {
this.loader = false;
this.errMessage = {'errMsg':response.message}
    setTimeout (() => {
         this.errMessage = false;
         this.errMessage = false;
      }, 2000);
}
});
......@@ -561,9 +585,9 @@ export class DashboardComponent implements OnInit {
}
});
this.getIssueData();
}
}
getIssueData(){
getIssueData(){
const This = this;
this.loader = true;
this.webService.get_data('getGeneralIssues').subscribe(response => {
......@@ -579,9 +603,9 @@ export class DashboardComponent implements OnInit {
this.loader = 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 ){
this.issuesData = this.defIssuesData;
} else {
......@@ -612,50 +636,48 @@ export class DashboardComponent implements OnInit {
$('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
});
},500);
}
}
// searchIssues(event){
// if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){
// this.issuesData = this.defIssuesData;
// } else {
// const thisObj = this;
// let data: any[] = new Array();
// let serRegExp = new RegExp(event.target.value,"gi");
// thisObj.defIssuesData.forEach(function (issues,index) {
// let issueCat = issues.issue;
// let subIssueCat =issues.sub_categories;
// if(issueCat.search(serRegExp) != -1){
// thisObj.defIssuesData['exception'] = '0';
// data.push(thisObj.defIssuesData[index]);
// }else {
// issues.sub_categories.forEach(function (issues_cat_1,index_1) {
// let subIssueCat = issues_cat_1.issue_category;
// if(subIssueCat.search(serRegExp) != -1){
// thisObj.defIssuesData['exception'] = '1';
// data.push(thisObj.defIssuesData[index]);
// // console.log(thisObj.defIssuesData[index].sub_categories[index_1])
// }
// })
// }
// });
// console.log(thisObj.defIssuesData);
// this.issuesData = (data.length > 0)?data:false;
// }
// setTimeout(()=>{
// this.selectedIssues.forEach(function (issues) {
// $('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
// });
// },500);
// }
jumpToStep3(){
// searchIssues(event){
// if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){
// this.issuesData = this.defIssuesData;
// } else {
// const thisObj = this;
// let data: any[] = new Array();
// let serRegExp = new RegExp(event.target.value,"gi");
// thisObj.defIssuesData.forEach(function (issues,index) {
// let issueCat = issues.issue;
// let subIssueCat =issues.sub_categories;
// if(issueCat.search(serRegExp) != -1){
// thisObj.defIssuesData['exception'] = '0';
// data.push(thisObj.defIssuesData[index]);
// }else {
// issues.sub_categories.forEach(function (issues_cat_1,index_1) {
// let subIssueCat = issues_cat_1.issue_category;
// if(subIssueCat.search(serRegExp) != -1){
// thisObj.defIssuesData['exception'] = '1';
// data.push(thisObj.defIssuesData[index]);
// }
// })
// }
// });
// this.issuesData = (data.length > 0)?data:false;
// }
// setTimeout(()=>{
// this.selectedIssues.forEach(function (issues) {
// $('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
// });
// },500);
// }
jumpToStep3(){
if(this.selectedIssues.length != 0){
this.step3nextRef.nativeElement.click();
}
}
}
getQuote(){
getQuote(){
const thisObj = this;
this.loader = true;
......@@ -667,6 +689,7 @@ export class DashboardComponent implements OnInit {
this.webService.post_data('getNearByMechanics',searchData).subscribe(response => {
if(response.status == '1'){
this.mechanicData = response.mechanic_data;
console.log(this.mechanicData)
this.dateSection.push(new Date(this.today.setDate(this.today.getDate())));
this.dateSection.push(new Date(this.today.setDate(this.today.getDate() + 1)));
......@@ -679,23 +702,23 @@ export class DashboardComponent implements OnInit {
this.loader = false;
return false;
});
}
}
onMouseOver(infoWindow, gm) {
onMouseOver(infoWindow, gm) {
if (gm.lastOpen != null) {
gm.lastOpen.close();
}
gm.lastOpen = infoWindow;
infoWindow.open();
}
}
onMouseOut(gm){
onMouseOut(gm){
if (gm.lastOpen != null) {
gm.lastOpen.close();
}
}
}
next(event) {
next(event) {
if(this.dateStep > 30){
this.showLeftArrow = true;
this.showRightArrow = false;
......@@ -709,9 +732,9 @@ export class DashboardComponent implements OnInit {
this.dateSection[0] = new Date(this.currDate);
this.dateSection[1] = new Date(this.nextDate);
this.dateStep += 1;
}
}
prev(event) {
prev(event) {
if(this.dateStep <= 0){
this.showLeftArrow = false;
this.showRightArrow = true;
......@@ -725,13 +748,13 @@ export class DashboardComponent implements OnInit {
this.dateSection[0] = new Date(this.currDate);
this.dateSection[1] = new Date(this.nextDate);
this.dateStep -= 1;
}
}
getSchedule(time,index){
getSchedule(time,index){
this.wizardData['schedule_date'] = {'date':this.formatDate(this.dateSection[index]),'time':time};
}
}
formatDate(date) {
formatDate(date) {
const d = new Date(date);
let day = '' + d.getDate();
let month = ''+(d.getMonth()+1);
......@@ -739,9 +762,9 @@ export class DashboardComponent implements OnInit {
if (day.length < 2) { day = '0'+day; }
if (month.length < 2) { month = '0'+month; }
return [year,month,day].join('-');
}
}
scheduleNow(mechanic_id,cost){
scheduleNow(mechanic_id,cost){
this.wizardData['mechanic_id'] = mechanic_id+':'+cost;
if(!this.loginDetails){
......@@ -752,9 +775,9 @@ export class DashboardComponent implements OnInit {
this.wizardData['cost'] = cost;
this.wizardData['multiple'] ='0';
this.confirmBooking();
}
}
scheduleMultipleRequest(){
scheduleMultipleRequest(){
if(!this.loginDetails){
this.routeToIndex();
}
......@@ -769,9 +792,9 @@ export class DashboardComponent implements OnInit {
this.wizardData['cost'] = this.estimatedPrice;
this.wizardData['multiple'] ='1';
this.confirmBooking();
}
}
confirmBooking(){
confirmBooking(){
this.wizardData['customer_id'] = this.loginDetails.customer_id;
this.wizardData['selected_issues'] = this.selectedIssues;
this.wizardData['optionalDescription'] = this.optionalDescription;
......@@ -806,9 +829,9 @@ export class DashboardComponent implements OnInit {
this.loader = false;
return false;
});
}
}
resetQuoteWizard(){
resetQuoteWizard(){
this.selectedIssues = [];
this.scheduleMechanic = false;
this.scheduleDateInit = false;
......@@ -819,9 +842,9 @@ export class DashboardComponent implements OnInit {
this.optionalImges[3] = false;
this.optionalImges[4] = false;
this.optionalDescription = '';
}
}
showCustQuote(booking_id,mechanic_id,type){
showCustQuote(booking_id,mechanic_id,type){
if(!booking_id || !mechanic_id){
return false;
}
......@@ -843,9 +866,9 @@ export class DashboardComponent implements OnInit {
}
});
this.loader = false;
}
}
cancelBooking(booking: any){
cancelBooking(booking: any){
let bookingId: number;
if(!booking.bookingId){
return false;
......@@ -859,32 +882,32 @@ export class DashboardComponent implements OnInit {
this.loader = false;
}
});
}
}
mechanicQuoteAccept(event,booking_id,mechanic_id){
mechanicQuoteAccept(event,booking_id,mechanic_id){
if(!booking_id || !mechanic_id){
return false;
}
let amount = event.target.attributes.bookAmount.value;
this.showConfirmPopUp('acceptQuote',{bookingId:booking_id,mechanicId:mechanic_id,amount:amount});
}
}
cnfCancelBook(booking_id){
cnfCancelBook(booking_id){
if(!booking_id){
return false;
}
this.showConfirmPopUp('cancelBooking',{bookingId:booking_id});
}
}
cnfdeleteCustomerCar(customer_id,vehicle_id){
cnfdeleteCustomerCar(customer_id,vehicle_id){
if(!customer_id || !vehicle_id){
return false;
}
this.showConfirmPopUp('deleteCustomerCar',{'customer_id':customer_id,'customer_veh_id':vehicle_id});
}
}
showConfirmPopUp(fn_name: string, param: any){
showConfirmPopUp(fn_name: string, param: any){
if(fn_name === ''){
return false;
}
......@@ -894,9 +917,9 @@ export class DashboardComponent implements OnInit {
this.confirmParam = param;
this.confirmCallBak = fn_name;
this.confirmModalRef.nativeElement.click();
}
}
confirmCallBack(fn_name: string,param: string){
confirmCallBack(fn_name: string,param: string){
if(fn_name === '' || !this[fn_name]){
return false;
}
......@@ -906,21 +929,22 @@ export class DashboardComponent implements OnInit {
} else {
this[fn_name]();
}
}
}
acceptQuote(param: any){
acceptQuote(param: any){
this.loader=true;
this.webService.post_data('acceptMechanicQuote',param).subscribe(response => {
if(response.status == 'success'){
document.location.href = this.serverUrl+'payNow/'+response.data;
// this.getCustBookDetails();
}else{
this.loader = false;
this.failureModelRef.nativeElement.click();
}
})
}
}
checkboxChange(index,mechanic_id,event,estimate){
checkboxChange(index,mechanic_id,event,estimate){
if (event.target.checked) {
this.selMechanics.push({id:index,mechanic_id:mechanic_id,amount:estimate});
} else {
......@@ -929,15 +953,15 @@ export class DashboardComponent implements OnInit {
this.selMechanics.splice(id, 1);
}
}
}
}
scrollToTop(id){
scrollToTop(id){
$('#'+id).stop().animate({scrollTop: 0}, 800);
}
}
scrollToBottom(id){
scrollToBottom(id){
$('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500);
}
}
tab_swap(type) { this.tab = type; }
tab_swap(type) { this.tab = type; }
}
......@@ -265,7 +265,7 @@
<div class="col-md-6">
<select (change)="get_model($event.target.value)" formControlName="maker" [ngClass]="{'input_error': !vehicleDataForm.controls['maker'].valid && vehicleDataFormSubmit}">
<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 carBrands; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option>
</select>
</div>
</div>
......@@ -273,7 +273,7 @@
<div class="col-md-6">
<select formControlName="modelName" [ngClass]="{'input_error': !vehicleDataForm.controls['modelName'].valid && vehicleDataFormSubmit}">
<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>
</div>
<div class="col-md-6">
......@@ -591,20 +591,36 @@
<div class="scheduletiming_listing">
<!-- <ul id="scroll_0_{{mechanic.mechanic_id}}" malihu-scrollbar [scrollbarOptions]="scrollbarOptions"> -->
<ul id="scroll_0_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<!-- <li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p *ngIf="time > currentDate">{{time}}</p>
</label>
</li> -->
<span *ngFor="let time of mechanic.scheduleTiming">
<li *ngIf="(time > currentTime && ((dateSection[0] | date: 'dd') == currentDate))" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
<li *ngIf="((dateSection[0] | date: 'dd') != currentDate)" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p>
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</span>
</ul>
<ul id="scroll_1_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'1');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p>
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</ul>
......
......@@ -395,7 +395,7 @@
padding: 30px;
padding-top: 50px;
position: relative;
top: 85px;
top:15px;
.login_modal_inner {
width: 90%;
margin: 0 auto;
......@@ -498,7 +498,7 @@
}
}
.active{
background-color: #f2f2f2;
background-color: #b9b9b9;
padding:8px;
padding-left: 15px;
border-radius: 8px;
......
......@@ -18,7 +18,6 @@ declare const google: any;
styleUrls: ['./index.component.scss']
})
export class IndexComponent implements OnInit {
public featuredOn: NgxCarousel;
public carouselTile: NgxCarousel;
......@@ -66,6 +65,8 @@ export class IndexComponent implements OnInit {
step: number;
today: any = new Date();
currDate: any;
currentDate: any;
currentTime: any;
nextDate: any;
dateStep: number = 0;
mechanics: string = '';
......@@ -81,8 +82,9 @@ export class IndexComponent implements OnInit {
scheduleMechanic: any;
carModel: any;
carBrands: any;
selBrand: string = '';
modelDates: number[] = new Array();
carSearchJsonData: any;
optionalImges: any = new Array({1:false,2:false,3:false,4:false});
optionalDescription: string;
......@@ -110,6 +112,8 @@ export class IndexComponent implements OnInit {
}
ngOnInit() {
this.currentTime = this.today.getTime();
this.currentDate = this.today.getDate();
this.vehicleDataForm = new FormGroup({
trim: new FormControl(''), milage: new FormControl(''), emgine: new FormControl(''),
last_date: new FormControl(''),
......@@ -119,9 +123,7 @@ export class IndexComponent implements OnInit {
modelName: new FormControl('', [Validators.required])
});
this.webService.get_stored_json('car-list.json').subscribe((response: any) => {
this.carSearchJsonData = response;
});
this.getVehicleBrand();
let currentYear = Number((new Date()).getFullYear());
let startingYear = currentYear - 50;
......@@ -155,8 +157,31 @@ export class IndexComponent implements OnInit {
$('body').attr('style','');
}
get_model(event) {
this.carModel = this.carSearchJsonData[event].models;
getVehicleBrand(){
this.loader=true;
this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){
this.carBrands = response.data;
}
this.loader = false;
});
}
get_model(brand_id) {
this.loader = true;
const thisObj = this;
thisObj.carBrands.forEach(function (brandData,index) {
if(brandData.veh_brand_id == brand_id){
thisObj.selBrand = brandData.maker;
}
});
this.webService.post_data('getVehicleModel',{'vehBrand_id':brand_id}).subscribe(response => {
if(response.status == 'success'){
this.carModel = response.data;
}
this.loader = false;
});
}
getVehicleLoc(lastLoc){
......@@ -196,16 +221,15 @@ export class IndexComponent implements OnInit {
}
this.wizardData['vechile_info'] = {'trim':vehicleData['trim'],
'lastMaintanceDate':(vehicleData['last_date'])?(formatDate(vehicleData['last_date'],'MM/dd/yyyy','en')):'',
'maker':this.carSearchJsonData[vehicleData['maker']]['brand'],
'maker':this.selBrand,
'milage':vehicleData['milage'],'emgine':vehicleData['emgine'],
'modelName':vehicleData['modelName'],'modelYear':vehicleData['modelYear'],
'maintanenceInterval':vehicleData['maintanence_interval']
}
console.log(this.wizardData['vechile_info'])
this.vehicleDataFormSubmit = false;
}
}
getIssueData(){
getIssueData(){
const This = this;
this.loader = true;
this.webService.get_data('getGeneralIssues').subscribe(response => {
......@@ -221,9 +245,9 @@ export class IndexComponent implements OnInit {
this.loader = 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 ){
this.issuesData = this.defIssuesData;
} else {
......@@ -254,8 +278,8 @@ export class IndexComponent implements OnInit {
$('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
});
},500);
}
get_newlocaion(lastLoc){
}
get_newlocaion(lastLoc){
this.cfautocomplete.addListener("place_changed", () => {
this.ngZone.run(() => {
let places: google.maps.places.PlaceResult = this.cfautocomplete.getPlace();
......@@ -365,7 +389,6 @@ export class IndexComponent implements OnInit {
thisObj.selectedIssues.forEach(function (selIssues) {
selSubIssues.push(selIssues.sub_issue_id);
});
console.log(this.wizardData)
let searchData = {'pickup_data':this.wizardData.pickup_data,'sub_issues':selSubIssues}
this.webService.post_data('getNearByMechanics',searchData).subscribe(response => {
if(response.status == '1'){
......
......@@ -24,19 +24,24 @@
HOME
</a>
</li>
<li class="nav-item" *ngIf="loginDetails">
<a class="nav-link" (click)="goToPage('dashboard')">
DASHBOARD
</a>
</li>
<li class="nav-item">
<a class="nav-link" (click)="goToPage('purchaseHome')">
PURCHASE
</a>
</li>
<li class="nav-item">
<a class="nav-link base_arrow dropdown">
<div class="dropdown-toggle" data-toggle="dropdown">
<a class="nav-link base_arrow dropdown" data-toggle="dropdown">
<div class="dropdown-toggle">
CAR OWNERS
</div>
<div class="dropdown-menu">
<a class="dropdown-item">My Dashboard</a>
<a class="dropdown-item">Find parts and accessories</a>
<a class="dropdown-item" *ngIf="loginDetails" (click)="goToPage('dashboard')">My Dashboard</a>
<a class="dropdown-item" (click)="goToPage('purchaseHome')">Find parts and accessories</a>
<a class="dropdown-item">Rewards</a>
<a class="dropdown-item">Messages</a>
<a class="dropdown-item">Request a Service </a>
......@@ -78,8 +83,6 @@
<div class="clear"></div>
</div>
<div class="dropdown-menu">
<a class="dropdown-item" (click)="goToPage('dashboard')">
My Dashboard</a>
<a class="dropdown-item" (click)="logout()">Logout</a>
</div>
</a>
......@@ -110,7 +113,7 @@
</div>
<div class="row">
<div class="col-md-12">
<button class="facebook_btn">
<button class="facebook_btn" (click)="signInWithFB()">
Sign Up with Facebook <img src="assets/images/asset_fb1.png">
</button>
</div>
......@@ -203,7 +206,7 @@
<div class="row">
<div class="col-md-12">
<h6><a (click)="resetForm()" data-dismiss="modal" data-toggle="modal" data-target="#login">Sign In</a> OR <a>Continue as guest</a></h6>
<h6><a (click)="resetForm()" data-dismiss="modal" data-toggle="modal" data-target="#login">Sign In</a> OR <a (click)="cntueGustBtn()">Continue as guest</a></h6>
</div>
</div>
</div>
......@@ -232,7 +235,7 @@
<h3>SIGN IN</h3>
<div class="row">
<div class="col-md-12">
<button class="facebook_btn">
<button class="facebook_btn" (click)="signInWithFB()">
Sign in with Facebook <img src="assets/images/asset_fb1.png">
</button>
</div>
......@@ -287,7 +290,7 @@
</div>
<div class="row">
<div class="col-md-12">
<h6>Do you have an account? <a data-dismiss="modal" data-toggle="modal" data-target="#signup">Sign Up</a> OR <a>Continue as guest</a></h6>
<h6>Do you have an account? <a data-dismiss="modal" data-toggle="modal" data-target="#signup">Sign Up</a> OR <a (click)="cntueGustBtn()">Continue as guest</a></h6>
</div>
</div>
</div>
......@@ -392,6 +395,7 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<input class="" type="email" placeholder="Email" formControlName="email"
......@@ -415,6 +419,14 @@
</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 Mechanic Shop</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'">
<strong>{{spSignupResponse.message}}<br></strong>
</div>
......
......@@ -213,6 +213,27 @@
margin: 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 {
border: 1px solid #1e1e1e;
height: 40px;
......
......@@ -5,6 +5,9 @@ import { ValidationService } from './../provider/validation.service';
import { WebService } from './../provider/web.service';
import { SubjectService } from './../provider/subject.service';
import { ImageStorage } from '../../environments/server.config';
import { AuthService } from "angularx-social-login";
import { FacebookLoginProvider, GoogleLoginProvider } from "angularx-social-login";
import { SocialUser } from "angularx-social-login";
declare var $;
declare const window: any;
......@@ -14,27 +17,32 @@ declare const window: any;
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.scss']
})
export class NavbarComponent implements OnInit {
data : any;
loader : boolean;
imageServer : any;
loginDetails : any;
loginResponse : any;
forgotResponse : any;
signupResponse : any;
spSignupResponse : any;
mechShop : any;
loader : boolean;
loginSubmitClick : boolean;
forgotSubmitClick : boolean;
signupSubmitClick : boolean;
spSignupSubmitClick : boolean;
private user: SocialUser;
private loggedIn: boolean;
constructor (
private router : Router,
private route : ActivatedRoute,
public errorMsg : ValidationService,
public webService : WebService,
public subjectService : SubjectService) {
public subjectService : SubjectService,
private authService : AuthService) {
this.imageServer = ImageStorage;
this.loginDetails = false;
this.loginSubmitClick = false;
......@@ -56,8 +64,12 @@ export class NavbarComponent implements OnInit {
ngOnInit() {
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
if(!this.loginDetails){
this.facebookSignUp();
}
});
this.getMechanicShops();
this.loginForm = new FormGroup({
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)])
......@@ -83,10 +95,66 @@ export class NavbarComponent implements OnInit {
phone: new FormControl('', [Validators.required, Validators.pattern("^[0-9\ ( ) + , - ]+$")]),
password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)]),
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('')
});
}
signInWithFB(): void {
this.authService.signIn(FacebookLoginProvider.PROVIDER_ID);
}
signOut(): void {
this.authService.signOut();
}
facebookSignUp(){
const This = this;
this.authService.authState.subscribe((user) => {
this.user = user;
let data: any = new Array();
data = {'first_name':this.user.firstName,'last_name':this.user.lastName,'email':this.user.email,'image_url':this.user.photoUrl};
if(this.user){
this.webService.post_data('socialLogin', {'data':data}).subscribe(response => {
if ( response.status == '1') {
this.webService.setLocalStorageItem('userData', JSON.stringify(response.data));
this.subjectService.sendLoginData('logged_in');
this.loginModal.nativeElement.click();
this.signupModal.nativeElement.click();
} else {
response.status = 'error';
response.message = (response.message == '')?this.errorMsg.errorList.req_failure:response.message;
this.loginResponse = response;
}
},error => {
this.loginResponse = {'status':'error','message':this.errorMsg.errorList.req_failure};
},() => {
setTimeout( function() {
This.loginResponse = false;
}, 2000)
});
}
});
}
cntueGustBtn(){
this.loginModal.nativeElement.click();
this.signupModal.nativeElement.click();
}
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) {
if(this.loginForm.invalid){
return false;
......@@ -241,10 +309,12 @@ export class NavbarComponent implements OnInit {
}
logout() {
this.signOut();
const userData = this.webService.getLocalStorageItem('userData');
this.webService.removeLocalStorageItem(userData);
this.subjectService.sendLoginData(false);
this.router.navigate(['../index']);
}
}
......@@ -47,13 +47,13 @@ export class AddaddressComponent implements OnInit {
this.address_id = params['address_id'];
});
});
if(this.address_id != ''){
this.getUserAddressById(this.address_id);
}
this.checkUserLogin();
this.checkProductId();
this.buildAddressForm();
if(this.address_id > 0){
this.getUserAddressById(this.address_id);
}
}
buildAddressForm(){
......@@ -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(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
......
......@@ -21,7 +21,10 @@
</div>
</ul>
<ng-template #noAddress>
Address is Not Added!
<div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>Address is Not Added!</p>
</div>
</ng-template>
<div class="row">
<div class="col-md-6">
......
......@@ -42,7 +42,6 @@ export class AddressComponent implements OnInit {
checkProductId(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
console.log(this.prdtData)
if(this.prdtData && this.prdtData['product_id'] > 0){
this.product_id = this.prdtData['product_id'];
}else{
......
......@@ -43,7 +43,11 @@
</li>
</ul>
<ng-template #noCart>
No Data Found
<div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>No Data Found</p>
</div>
</ng-template>
</div>
</div>
......@@ -57,7 +61,7 @@
<div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<h5>{{prdt.product_name}}</h5>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting prevent-click">
<fieldset class="rating">
......
......@@ -236,7 +236,7 @@
padding: 10px;
img{
height: 180px;
width: auto;
max-width: 100%;
}
}
h5{
......
......@@ -4,7 +4,7 @@
</app-searchbar>
<div class="loader_overlay" *ngIf="loader"></div>
<div class="myorder_wrapper">
<ul *ngIf="bookedData" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<ul *ngIf="bookedData;else noOrders" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li *ngFor="let book of bookedData">
<div class="row">
<div class="col-md-6">
......@@ -12,7 +12,7 @@
<img src="{{imageServer + book.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<div class="auto_part_detail">
<h2>{{book.product_name}}</h2>
<h2 class="text_truncate" data-toggle="pill" tooltip="{{book.product_name}}" placement="top" show-delay="500" z-index="99999">{{book.product_name}}</h2>
<h3>{{book.short_description}}</h3>
<div class="others">
<!-- <h4><div>Color</div><span>Black</span></h4> -->
......@@ -45,6 +45,13 @@
</div>
</li>
</ul>
<ng-template #noOrders>
<div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>No Data Found</p>
</div>
</ng-template>
</div>
</div>
<div class="bottom_product_list">
......@@ -53,11 +60,11 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData">
<li (click)="latestPrdtDtls(prdt.product_id)">
<div class="inner_div_product">
<div class="inner_div_product cpoint">
<div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<h5>{{prdt.product_name}}</h5>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating prevent-click">
......
......@@ -191,7 +191,7 @@
padding: 10px;
img{
height: 180px;
width: auto;
max-width: 100%;
}
}
h5{
......
......@@ -18,10 +18,11 @@
</div>
<div class="col-md-8" *ngIf="productDetails">
<div class="product_details">
<h1>{{productDetails.product_name}}</h1>
<h1 class="text_truncate" data-toggle="pill" tooltip="{{productDetails.product_name}}" placement="top" show-delay="500" z-index="99999">{{productDetails.product_name}}</h1>
<h2>{{productDetails.short_description}}</h2>
<h4><div>Brand</div><span>{{productDetails.brand_name}}</span></h4>
<h4><div>Part ID</div><span>PRD152685425</span></h4>
<h2><strong>Brand : </strong>{{productDetails.brand_name}}</h2>
<div *ngIf="productDetails.part_id">
<h2><strong>Part ID : </strong>{{productDetails.part_id}}</h2></div>
<h3>$ {{productDetails.amount}}</h3>
<div class="rating_div" *ngIf="productDetails.rating">
<fieldset class="rating prevent-click">
......@@ -113,7 +114,7 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData" >
<li (click)="latestPrdtDtls(prdt.product_id)">
<div class="inner_div_product">
<div class="inner_div_product cpoint">
<div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
......
......@@ -52,7 +52,6 @@ export class ProductdetailsComponent implements OnInit {
this.route.queryParams.subscribe(params => {
this.product_id = params['product_id'];
});
this.getProductDetails();
});
if(!this.product_id){
......@@ -70,6 +69,7 @@ export class ProductdetailsComponent implements OnInit {
this.designModules();
this.checkUserLogin();
this.trendingProducts();
this.getProductDetails();
}
checkUserLogin(){
......@@ -81,7 +81,11 @@ export class ProductdetailsComponent implements OnInit {
getProductDetails(){
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'){
let image: string = '';
let imageArr: any[] = new Array();
......
......@@ -28,23 +28,24 @@
<h6 href="#ac3" data-toggle="collapse">Vehicle Information</h6>
<ul id="ac3" class="collapse in show">
<h6 class="backgroundNone borderNone">
<select>
<option>
Year
</option>
<select (change)="get_year($event.target.value)">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Year</option>
<option *ngFor="let date of modelDates">{{date}}</option>
</select>
</h6>
<h6 class="backgroundNone borderNone">
<select>
<option>
Model
<select (change)="get_model($event.target.value)">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Maker</option>
<option *ngFor="let brands of carBrands" value="{{brands.veh_brand_id}}">
{{brands.maker}}
</option>
</select>
</h6>
<h6 class="backgroundNone borderNone">
<select>
<option>
Make
<select (change)="getModelResult($event.target.value)" *ngIf="modelShow">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Model</option>
<option *ngFor="let models of carModel" value="{{models.veh_modal_id}}">
{{models.model}}
</option>
</select>
</h6>
......@@ -66,7 +67,7 @@
</div>
</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">
<li *ngFor="let prdt of productArray">
<div class="inner_div_product cpoint" (click)="getSingleProductDetails(prdt.product_id)">
......@@ -76,7 +77,7 @@
<h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<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.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>
......@@ -100,17 +101,6 @@
No Data Found
</ng-template>
<hr>
<!-- <div class="pagination">
<ul>
<li class="prev"><</li>
<li class="select">1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li class="next">></li>
</ul>
</div> -->
</div>
<div class="clear"></div>
</div>
......
......@@ -282,6 +282,7 @@
.rating {
border: none;
float: left;
position: relative;
}
.rating > input { display: none; }
......
......@@ -22,6 +22,10 @@ export class ProductlistComponent implements OnInit {
page: number = 1;
total_page: number = 1;
filterParam: any = new Array();
modelDates: number[] = new Array();
carBrands:any;
carModel:any;
modelShow :boolean;
constructor(
private router : Router,
......@@ -29,6 +33,7 @@ export class ProductlistComponent implements OnInit {
public webService : WebService
){
this.loader = true;
this.modelShow = false;
this.productArray = [];
this.filterParam = {"key":'',"brand_id":Array(),"minPrice":'',"maxPrice":'','page':1};
this.imageServer = ImageStorage;
......@@ -50,6 +55,48 @@ export class ProductlistComponent implements OnInit {
ngOnInit() {
this.getBrand();
this.getYear();
this.getVehBrand();
}
getYear(){
let currentYear = Number((new Date()).getFullYear());
let startingYear = currentYear - 110;
for (let date = currentYear ; date >= startingYear ; date --) {
this.modelDates.push(date);
}
}
getVehBrand(){
this.loader=true;
this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){
this.carBrands = response.data;
}
this.loader = false;
});
}
get_model(brand_id) {
this.page = 1;
this.loader = true;
this.webService.post_data('getVehicleModel',{'vehBrand_id':brand_id}).subscribe(response => {
if(response.status == 'success'){
this.modelShow = true;
this.carModel = response.data;
this.filterParam.page = this.page;
this.filterParam.maker = brand_id;
this.getProductDetails(this.filterParam);
}
this.loader = false;
});
}
getModelResult(modelId){
this.page = 1;
this.filterParam.page = this.page;
this.filterParam.model = modelId;
this.getProductDetails(this.filterParam);
}
goToPage(path,data=null){
......@@ -124,4 +171,11 @@ export class ProductlistComponent implements OnInit {
this.filterParam.maxPrice = top;
this.getProductDetails(this.filterParam);
}
get_year(year){
this.page = 1;
this.filterParam.page = this.page;
this.filterParam.year = year;
this.getProductDetails(this.filterParam);
}
}
......@@ -12,11 +12,11 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="latestProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of latestProductData">
<li (click)="latestPrdtDtls(prdt.product_id)" >
<div class="inner_div_product">
<div class="inner_div_product cpoint">
<div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<h5>{{prdt.product_name}}</h5>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating prevent-click">
......@@ -52,15 +52,15 @@
<div class="loader_overlay" *ngIf="trend_loader"></div>
<ul *ngIf="trendingProductData"
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" >
<div class="inner_div_product">
<li *ngFor="let prdt of trendingProductData" >
<div class="inner_div_product cpoint" (click)="latestPrdtDtls(prdt.product_id)" >
<div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<h5>{{prdt.product_name}}</h5>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<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.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>
......
......@@ -289,6 +289,7 @@
.rating {
border: none;
float: left;
position: relative;
}
.rating > input { display: none; }
......
......@@ -20,6 +20,7 @@ export class PurchaseHomeComponent implements OnInit {
trend_loader:boolean;
latestProductData:any;
trendingProductData:any;
loginDetails:any;
@ViewChild("failureModel") public failureModelRef: ElementRef;
......
......@@ -23,7 +23,7 @@
</ul>
</div>
</div>
<div class="purchase_other">
<div class="purchase_other" *ngIf="loginDetails">
<ul>
<li (click)="goToPage('orders')">
<img src="assets/images/asset_cart.png">
......
......@@ -2,6 +2,7 @@ import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router';
import { WebService } from '../../provider/web.service';
import { ImageStorage } from '../../../environments/server.config';
import { SubjectService } from '../../provider/subject.service';
@Component({
selector: 'app-searchbar',
......@@ -13,17 +14,29 @@ export class SearchbarComponent implements OnInit {
productArray: any;
SingleProductData:any;
imageServer: string;
loginDetails:any;
public scrollbarOptions = { axis: 'y', theme: 'minimal-dark' };
@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.imageServer = ImageStorage;
}
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){
......@@ -38,7 +51,6 @@ export class SearchbarComponent implements OnInit {
}
this.webService.post_data('productSearch',{"key":product}).subscribe(response => {
if(response.status == 'success'){
console.log(response.data)
this.productArray = response.data;
} else {
this.productArray = false;
......
src/assets/images/asset_login_bg.png

508 KB | W: | H:

src/assets/images/asset_login_bg.png

60.8 KB | W: | H:

src/assets/images/asset_login_bg.png
src/assets/images/asset_login_bg.png
src/assets/images/asset_login_bg.png
src/assets/images/asset_login_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/images/order_banner.png

139 KB | W: | H:

src/assets/images/order_banner.png

25.1 KB | W: | H:

src/assets/images/order_banner.png
src/assets/images/order_banner.png
src/assets/images/order_banner.png
src/assets/images/order_banner.png
  • 2-up
  • Swipe
  • Onion skin
let apiConfigUrl,imageStorageUrl;
// // Localhost
// apiConfigUrl = 'http://localhost/dcarfixers/Webservices/';
// imageStorageUrl = 'http://localhost/dcarfixers/';
// Localhost
apiConfigUrl = 'http://localhost/dcarfixers/Webservices/';
imageStorageUrl = 'http://localhost/dcarfixers/';
// // Techlabz
apiConfigUrl = 'https://techlabz.in/dcarfixers/Webservices/';
imageStorageUrl = 'https://techlabz.in/dcarfixers/';
// apiConfigUrl = 'https://techlabz.in/dcarfixers/Webservices/';
// imageStorageUrl = 'https://techlabz.in/dcarfixers/';
// carfixxers.com
// // carfixxers.com
// apiConfigUrl = 'https://carfixxers.com/admin/Webservices/';
// imageStorageUrl = 'https://carfixxers.com/admin/';
......
......@@ -852,3 +852,19 @@ bs-datepicker-container{
padding-bottom: 50px;
}
.cmn_nodata{
text-align: center;
padding-top:10%;
padding-bottom: 10%;
img{
width: 200px;
margin-bottom:50px;
}
p{
text-align: center;
color: #a8a8a8;
font-size: 24px;
font-weight: 300;
}
}
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