Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcarfixers_angular
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
16
Issues
16
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobin
dcarfixers_angular
Commits
0e2d189c
Commit
0e2d189c
authored
Jan 18, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
23d4475a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
231 additions
and
25 deletions
+231
-25
dashboard.component.html
src/app/home/dashboard/dashboard.component.html
+0
-0
dashboard.component.scss
src/app/home/dashboard/dashboard.component.scss
+4
-0
dashboard.component.ts
src/app/home/dashboard/dashboard.component.ts
+118
-14
index.component.html
src/app/home/index/index.component.html
+0
-0
index.component.ts
src/app/home/index/index.component.ts
+93
-11
styles.scss
src/styles.scss
+16
-0
No files found.
src/app/home/dashboard/dashboard.component.html
View file @
0e2d189c
This diff is collapsed.
Click to expand it.
src/app/home/dashboard/dashboard.component.scss
View file @
0e2d189c
...
...
@@ -111,6 +111,10 @@
}
}
}
.service-align-center
{
padding-left
:
0px
!
important
;
text-align
:
center
;
}
.container-fluid
{
width
:
calc
(
100%
-
15%
);
.tab-content
{
...
...
src/app/home/dashboard/dashboard.component.ts
View file @
0e2d189c
This diff is collapsed.
Click to expand it.
src/app/home/index/index.component.html
View file @
0e2d189c
This diff is collapsed.
Click to expand it.
src/app/home/index/index.component.ts
View file @
0e2d189c
...
...
@@ -51,6 +51,7 @@ export class IndexComponent implements OnInit {
//Service Details: TAB 3
loader
:
boolean
;
issuesData
:
any
;
defIssuesData
:
any
[]
=
new
Array
();
selectedIssues
:
any
[]
=
new
Array
();
//Quote Page
...
...
@@ -63,12 +64,17 @@ export class IndexComponent implements OnInit {
imageServer
:
string
;
mechanicData
:
any
;
autoSchedule
:
boolean
;
showLeftArrow
:
boolean
;
showRightArrow
:
boolean
;
estimatedPrice
:
number
;
scheduleDateInit
:
boolean
;
scheduleMechanic
:
any
;
carModel
:
any
;
modelDates
:
number
[]
=
new
Array
();
carSearchJsonData
:
any
;
optionalImges
:
any
=
new
Array
({
1
:
false
,
2
:
false
,
3
:
false
,
4
:
false
});
optionalDescription
:
string
;
constructor
(
private
router
:
Router
,
...
...
@@ -77,13 +83,18 @@ export class IndexComponent implements OnInit {
public
mapsAPILoader
:
MapsAPILoader
,
public
subjectService
:
SubjectService
)
{
this
.
step
=
0
;
this
.
issuesData
=
false
;
this
.
autoSchedule
=
false
;
this
.
imageServer
=
ImageStorage
;
this
.
currDate
=
new
Date
();
this
.
nextDate
=
new
Date
();
this
.
loginDetails
=
false
;
this
.
searchLocError
=
false
;
this
.
showLeftArrow
=
false
;
this
.
showRightArrow
=
true
;
this
.
scheduleDateInit
=
false
;
this
.
scheduleMechanic
=
false
;
this
.
optionalDescription
=
''
;
this
.
vehicleDataFormSubmit
=
false
;
}
...
...
@@ -176,17 +187,43 @@ export class IndexComponent implements OnInit {
this
.
webService
.
get_data
(
'getGeneralIssues'
).
subscribe
(
response
=>
{
if
(
response
.
status
==
'1'
){
this
.
issuesData
=
response
.
issue_data
;
this
.
defIssuesData
=
this
.
issuesData
;
this
.
loader
=
false
;
}
else
{
this
.
loader
=
false
;
return
false
;
}
this
.
loader
=
false
;
},
error
=>
{
this
.
loader
=
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
){
let
issue_id
=
event
.
target
.
attributes
.
issue_id
.
value
;
let
sub_issue_id
=
event
.
target
.
attributes
.
sub_issue_id
.
value
;
...
...
@@ -239,11 +276,19 @@ export class IndexComponent implements OnInit {
resetQuoteWizard
(){
this
.
jumpToStep0
();
this
.
vehicleDataForm
.
reset
();
this
.
searchElementRef
.
nativeElement
.
value
=
''
;
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
(){
...
...
@@ -257,17 +302,19 @@ export class IndexComponent implements OnInit {
let
searchData
=
{
'pickup_data'
:
this
.
wizardData
.
pickup_data
,
'sub_issues'
:
selSubIssues
}
this
.
webService
.
post_data
(
'getNearByMechanics'
,
searchData
).
subscribe
(
response
=>
{
this
.
loader
=
false
;
if
(
response
.
status
==
'1'
){
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
()
+
1
)));
this
.
loader
=
false
;
}
else
{
this
.
loader
=
false
;
return
false
;
}
},
error
=>
{
this
.
loader
=
false
;
return
false
;
});
}
...
...
@@ -288,8 +335,12 @@ export class IndexComponent implements OnInit {
next
(
event
)
{
if
(
this
.
dateStep
>
30
){
this
.
showLeftArrow
=
true
;
this
.
showRightArrow
=
false
;
return
false
;
}
this
.
showLeftArrow
=
true
;
this
.
showRightArrow
=
true
;
this
.
dateSection
=
new
Array
();
this
.
nextDate
.
setDate
(
this
.
nextDate
.
getDate
()
+
1
);
this
.
currDate
.
setDate
(
this
.
currDate
.
getDate
()
+
1
);
...
...
@@ -300,8 +351,12 @@ export class IndexComponent implements OnInit {
prev
(
event
)
{
if
(
this
.
dateStep
<=
0
){
this
.
showLeftArrow
=
false
;
this
.
showRightArrow
=
true
;
return
false
;
}
this
.
showLeftArrow
=
true
;
this
.
showRightArrow
=
true
;
this
.
dateSection
=
new
Array
();
this
.
nextDate
.
setDate
(
this
.
nextDate
.
getDate
()
-
1
);
this
.
currDate
.
setDate
(
this
.
currDate
.
getDate
()
-
1
);
...
...
@@ -311,7 +366,6 @@ export class IndexComponent implements OnInit {
}
getSchedule
(
time
,
index
){
this
.
scheduleDateInit
=
true
;
this
.
wizardData
[
'schedule_date'
]
=
{
'date'
:
this
.
formatDate
(
this
.
dateSection
[
index
]),
'time'
:
time
};
}
...
...
@@ -325,7 +379,7 @@ export class IndexComponent implements OnInit {
return
[
year
,
month
,
day
].
join
(
'-'
);
}
scheduleNow
(
mechanic_id
){
scheduleNow
(
mechanic_id
,
cost
){
this
.
wizardData
[
'mechanic_id'
]
=
mechanic_id
;
if
(
!
this
.
loginDetails
){
...
...
@@ -334,6 +388,8 @@ export class IndexComponent implements OnInit {
return
false
;
}
this
.
loader
=
true
;
this
.
wizardData
[
'cost'
]
=
cost
;
this
.
confirmBooking
();
}
...
...
@@ -342,12 +398,13 @@ export class IndexComponent implements OnInit {
this
.
wizardData
[
'selected_issues'
]
=
this
.
selectedIssues
;
this
.
webService
.
post_data
(
'scheduleNow'
,
this
.
wizardData
).
subscribe
(
response
=>
{
this
.
loader
=
false
;
if
(
response
.
status
==
'1'
){
this
.
closeWizardRef
.
nativeElement
.
click
();
this
.
closeQuoteWizardRef
.
nativeElement
.
click
();
this
.
router
.
navigate
([
'../dashboard'
]);
this
.
router
.
navigate
([
'../dashboard'
],{
queryParams
:
{
tab
:
'service'
}});
this
.
loader
=
false
;
}
else
{
this
.
loader
=
false
;
return
false
;
}
},
error
=>
{
...
...
@@ -357,22 +414,47 @@ export class IndexComponent implements OnInit {
}
jumpToStep0
(){
this
.
goTostepRef
.
nativeElement
.
click
();
this
.
goTostep
0
Ref
.
nativeElement
.
click
();
}
jumpToStep1
(){
if
(
!
this
.
vehicleDataForm
.
invalid
){
this
.
goTostepRef
.
nativeElement
.
click
();
this
.
goTostep
1
Ref
.
nativeElement
.
click
();
}
}
jumpToStep2
(){
if
(
this
.
selectedIssues
.
length
>
0
){
this
.
goTostepRef
.
nativeElement
.
click
();
this
.
goTostep
2
Ref
.
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
''
;
}
carouselTileLoad
(){
return
''
;
}
...
...
src/styles.scss
View file @
0e2d189c
...
...
@@ -465,3 +465,18 @@ section.module.parallax {
.error
{
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment