Commit 0e2d189c by Tobin

dc

parent 23d4475a
...@@ -111,6 +111,10 @@ ...@@ -111,6 +111,10 @@
} }
} }
} }
.service-align-center{
padding-left: 0px !important;
text-align: center;
}
.container-fluid { .container-fluid {
width: calc(100% - 15%); width: calc(100% - 15%);
.tab-content { .tab-content {
......
...@@ -51,6 +51,7 @@ export class IndexComponent implements OnInit { ...@@ -51,6 +51,7 @@ export class IndexComponent implements OnInit {
//Service Details: TAB 3 //Service Details: TAB 3
loader: boolean; loader: boolean;
issuesData: any; issuesData: any;
defIssuesData: any[] = new Array();
selectedIssues: any[] = new Array(); selectedIssues: any[] = new Array();
//Quote Page //Quote Page
...@@ -63,12 +64,17 @@ export class IndexComponent implements OnInit { ...@@ -63,12 +64,17 @@ export class IndexComponent implements OnInit {
imageServer: string; imageServer: string;
mechanicData: any; mechanicData: any;
autoSchedule: boolean; autoSchedule: boolean;
showLeftArrow: boolean;
showRightArrow: boolean;
estimatedPrice: number; estimatedPrice: number;
scheduleDateInit: boolean; scheduleDateInit: boolean;
scheduleMechanic: any;
carModel: any; carModel: any;
modelDates: number[] = new Array(); modelDates: number[] = new Array();
carSearchJsonData: any; carSearchJsonData: any;
optionalImges: any = new Array({1:false,2:false,3:false,4:false});
optionalDescription: string;
constructor( constructor(
private router : Router, private router : Router,
...@@ -77,13 +83,18 @@ export class IndexComponent implements OnInit { ...@@ -77,13 +83,18 @@ export class IndexComponent implements OnInit {
public mapsAPILoader : MapsAPILoader, public mapsAPILoader : MapsAPILoader,
public subjectService : SubjectService) { public subjectService : SubjectService) {
this.step = 0; this.step = 0;
this.issuesData = false;
this.autoSchedule = false; this.autoSchedule = false;
this.imageServer = ImageStorage; this.imageServer = ImageStorage;
this.currDate = new Date(); this.currDate = new Date();
this.nextDate = new Date(); this.nextDate = new Date();
this.loginDetails = false; this.loginDetails = false;
this.searchLocError = false; this.searchLocError = false;
this.showLeftArrow = false;
this.showRightArrow = true;
this.scheduleDateInit = false; this.scheduleDateInit = false;
this.scheduleMechanic = false;
this.optionalDescription = '';
this.vehicleDataFormSubmit = false; this.vehicleDataFormSubmit = false;
} }
...@@ -176,16 +187,42 @@ export class IndexComponent implements OnInit { ...@@ -176,16 +187,42 @@ export class IndexComponent implements OnInit {
this.webService.get_data('getGeneralIssues').subscribe(response => { this.webService.get_data('getGeneralIssues').subscribe(response => {
if(response.status == '1'){ if(response.status == '1'){
this.issuesData = response.issue_data; this.issuesData = response.issue_data;
this.defIssuesData = this.issuesData;
this.loader = false; this.loader = false;
} else { } else {
this.loader = false;
return false; return false;
} }
this.loader = false;
},error => { },error => {
this.loader = false; this.loader = false;
return false; return false;
}); });
} }
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;
if(issueCat.search(serRegExp) != -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);
}
setIssueSelected(event){ setIssueSelected(event){
let issue_id = event.target.attributes.issue_id.value; let issue_id = event.target.attributes.issue_id.value;
...@@ -239,11 +276,19 @@ export class IndexComponent implements OnInit { ...@@ -239,11 +276,19 @@ export class IndexComponent implements OnInit {
resetQuoteWizard(){ resetQuoteWizard(){
this.jumpToStep0(); this.jumpToStep0();
this.vehicleDataForm.reset();
this.searchElementRef.nativeElement.value = ''; this.searchElementRef.nativeElement.value = '';
this.selectedIssues = []; this.selectedIssues = [];
this.scheduleDateInit = false;
this.vehicleDataForm.reset({
trim: '', milage: '', emgine: '', maker: '', modelYear: '', modelName: ''
});
this.optionalImges[1] = false;
this.optionalImges[2] = false;
this.optionalImges[3] = false;
this.optionalImges[4] = false;
this.optionalDescription = '';
} }
getQuote(){ getQuote(){
...@@ -257,17 +302,19 @@ export class IndexComponent implements OnInit { ...@@ -257,17 +302,19 @@ export class IndexComponent implements OnInit {
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 => {
this.loader = false;
if(response.status == '1'){ if(response.status == '1'){
this.mechanicData = response.mechanic_data; this.mechanicData = response.mechanic_data;
this.dateSection.push(new Date(this.today.setDate(this.today.getDate()))); this.dateSection.push(new Date(this.today.setDate(this.today.getDate())));
this.dateSection.push(new Date(this.today.setDate(this.today.getDate() + 1))); this.dateSection.push(new Date(this.today.setDate(this.today.getDate() + 1)));
this.loader = false;
} else { } else {
this.loader = false;
return false; return false;
} }
},error => { },error => {
this.loader = false;
return false; return false;
}); });
} }
...@@ -288,8 +335,12 @@ export class IndexComponent implements OnInit { ...@@ -288,8 +335,12 @@ export class IndexComponent implements OnInit {
next(event) { next(event) {
if(this.dateStep > 30){ if(this.dateStep > 30){
this.showLeftArrow = true;
this.showRightArrow = false;
return false; return false;
} }
this.showLeftArrow = true;
this.showRightArrow = true;
this.dateSection = new Array(); this.dateSection = new Array();
this.nextDate.setDate(this.nextDate.getDate() + 1); this.nextDate.setDate(this.nextDate.getDate() + 1);
this.currDate.setDate(this.currDate.getDate() + 1); this.currDate.setDate(this.currDate.getDate() + 1);
...@@ -300,8 +351,12 @@ export class IndexComponent implements OnInit { ...@@ -300,8 +351,12 @@ export class IndexComponent implements OnInit {
prev(event) { prev(event) {
if(this.dateStep <= 0){ if(this.dateStep <= 0){
this.showLeftArrow = false;
this.showRightArrow = true;
return false; return false;
} }
this.showLeftArrow = true;
this.showRightArrow = true;
this.dateSection = new Array(); this.dateSection = new Array();
this.nextDate.setDate(this.nextDate.getDate() - 1); this.nextDate.setDate(this.nextDate.getDate() - 1);
this.currDate.setDate(this.currDate.getDate() - 1); this.currDate.setDate(this.currDate.getDate() - 1);
...@@ -311,7 +366,6 @@ export class IndexComponent implements OnInit { ...@@ -311,7 +366,6 @@ export class IndexComponent implements OnInit {
} }
getSchedule(time,index){ getSchedule(time,index){
this.scheduleDateInit = true;
this.wizardData['schedule_date'] = {'date':this.formatDate(this.dateSection[index]),'time':time}; this.wizardData['schedule_date'] = {'date':this.formatDate(this.dateSection[index]),'time':time};
} }
...@@ -325,7 +379,7 @@ export class IndexComponent implements OnInit { ...@@ -325,7 +379,7 @@ export class IndexComponent implements OnInit {
return [year,month,day].join('-'); return [year,month,day].join('-');
} }
scheduleNow(mechanic_id){ scheduleNow(mechanic_id,cost){
this.wizardData['mechanic_id'] = mechanic_id; this.wizardData['mechanic_id'] = mechanic_id;
if(!this.loginDetails){ if(!this.loginDetails){
...@@ -334,6 +388,8 @@ export class IndexComponent implements OnInit { ...@@ -334,6 +388,8 @@ export class IndexComponent implements OnInit {
return false; return false;
} }
this.loader = true; this.loader = true;
this.wizardData['cost'] = cost;
this.confirmBooking(); this.confirmBooking();
} }
...@@ -342,12 +398,13 @@ export class IndexComponent implements OnInit { ...@@ -342,12 +398,13 @@ export class IndexComponent implements OnInit {
this.wizardData['selected_issues'] = this.selectedIssues; this.wizardData['selected_issues'] = this.selectedIssues;
this.webService.post_data('scheduleNow',this.wizardData).subscribe(response => { this.webService.post_data('scheduleNow',this.wizardData).subscribe(response => {
this.loader = false;
if(response.status == '1'){ if(response.status == '1'){
this.closeWizardRef.nativeElement.click(); this.closeWizardRef.nativeElement.click();
this.closeQuoteWizardRef.nativeElement.click(); this.closeQuoteWizardRef.nativeElement.click();
this.router.navigate(['../dashboard']); this.router.navigate(['../dashboard'],{queryParams: {tab: 'service'}});
this.loader = false;
} else { } else {
this.loader = false;
return false; return false;
} }
},error => { },error => {
...@@ -357,22 +414,47 @@ export class IndexComponent implements OnInit { ...@@ -357,22 +414,47 @@ export class IndexComponent implements OnInit {
} }
jumpToStep0(){ jumpToStep0(){
this.goTostepRef.nativeElement.click(); this.goTostep0Ref.nativeElement.click();
} }
jumpToStep1(){ jumpToStep1(){
if(!this.vehicleDataForm.invalid){ if(!this.vehicleDataForm.invalid){
this.goTostepRef.nativeElement.click(); this.goTostep1Ref.nativeElement.click();
} }
} }
jumpToStep2(){ jumpToStep2(){
if(this.selectedIssues.length > 0){ if(this.selectedIssues.length > 0){
this.goTostepRef.nativeElement.click(); this.goTostep2Ref.nativeElement.click();
} }
} }
optImgUpload(image_id,event){
let reader = new FileReader();
let optionalImg: any = event.target.files[0];
reader.onloadend = () => {
switch (image_id){
case 1:
this.optionalImges[1] = {'file':event.target.files[0],'file_url':reader.result};
break;
case 2:
this.optionalImges[2] = {'file':event.target.files[0],'file_url':reader.result};
break;
case 3:
this.optionalImges[3] = {'file':event.target.files[0],'file_url':reader.result};
break;
case 4:
this.optionalImges[4] = {'file':event.target.files[0],'file_url':reader.result};
break;
}
}
reader.readAsDataURL(optionalImg);
}
scrollToBottom(id){
$('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500);
}
featuredOnLoad() {return ''; } featuredOnLoad() {return ''; }
carouselTileLoad(){ return ''; } carouselTileLoad(){ return ''; }
......
...@@ -465,3 +465,18 @@ section.module.parallax { ...@@ -465,3 +465,18 @@ section.module.parallax {
.error{ .error{
border:2px solid red !important; border:2px solid red !important;
} }
.prevent-click {
pointer-events: none;
cursor: default;
text-decoration: none;
color: black;
}
.hide {
display:none !important;
}
.invisible{
opacity: 0 !important;
}
\ No newline at end of file
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