Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
allCampaign
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
allCampaign
Commits
a53903df
Commit
a53903df
authored
May 21, 2019
by
Chao Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收入页下一步
parent
6a8794fa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
10 deletions
+79
-10
questionnaire/src/app/family/family.component.ts
+1
-0
questionnaire/src/app/income/income.component.html
+6
-4
questionnaire/src/app/income/income.component.ts
+53
-1
questionnaire/src/app/job/job.component.html
+1
-1
questionnaire/src/app/transit1/transit1.component.html
+1
-1
questionnaire/src/app/transit1/transit1.component.ts
+17
-3
No files found.
questionnaire/src/app/family/family.component.ts
View file @
a53903df
...
@@ -42,6 +42,7 @@ export class FamilyComponent implements OnInit {
...
@@ -42,6 +42,7 @@ export class FamilyComponent implements OnInit {
}],
}],
};
};
this
.
commonService
.
addAnswer
(
this
.
pageAnswers
);
this
.
commonService
.
addAnswer
(
this
.
pageAnswers
);
console
.
log
(
this
.
pageAnswers
)
}
}
// 下一步
// 下一步
...
...
questionnaire/src/app/income/income.component.html
View file @
a53903df
...
@@ -7,9 +7,10 @@
...
@@ -7,9 +7,10 @@
</div>
</div>
<ul
class=
"income"
>
<ul
class=
"income"
>
<li
<li
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
[
ngClass
]="{
selected:
selectedOptionId =
=
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData?.questions[0].options"
*
ngFor=
"let options of this.curPageData?.questions[0].options"
>
(
click
)="
selectedIncome
(
this
.
curPageData
?.
questions
[
0
],
options
)"
>
{{ options.optionName }}
{{ options.optionName }}
</li>
</li>
</ul>
</ul>
...
@@ -18,8 +19,9 @@
...
@@ -18,8 +19,9 @@
</div>
</div>
<ul
class=
"income"
*
ngIf=
"hasMate"
>
<ul
class=
"income"
*
ngIf=
"hasMate"
>
<li
<li
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
[
ngClass
]="{
selected:
selectedOptionId =
=
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData?.questions[1]['options']"
*
ngFor=
"let options of this.curPageData?.questions[1]['options']"
(
click
)="
selectedIncome
(
this
.
curPageData
?.
questions
[
1
],
options
)"
>
>
{{ options.optionName }}
{{ options.optionName }}
</li>
</li>
...
@@ -28,7 +30,7 @@
...
@@ -28,7 +30,7 @@
</div>
</div>
<div
class=
"content_footer"
>
<div
class=
"content_footer"
>
<div
style=
"color: #8a8a8a;"
>
<
</div>
<div
style=
"color: #8a8a8a;"
>
<
</div>
<div
[
ngStyle
]="{
color:
nextBtn =
=
false
?
'#
8a8a8a
'
:
'#
ec2d37
'
}"
>
下一步
</div>
<div
[
ngStyle
]="{
color:
nextBtn =
=
false
?
'#
8a8a8a
'
:
'#
ec2d37
'
}"
(
click
)="
next
()"
>
下一步
</div>
</div>
</div>
</div>
</div>
</div>
</div>
questionnaire/src/app/income/income.component.ts
View file @
a53903df
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
CommonService
}
from
'../common.service'
;
import
{
CommonService
}
from
'../common.service'
;
import
{
ActivatedRoute
,
Router
}
from
"@angular/router"
;
@
Component
({
@
Component
({
selector
:
'app-income'
,
selector
:
'app-income'
,
...
@@ -9,19 +10,70 @@ import {CommonService} from '../common.service';
...
@@ -9,19 +10,70 @@ import {CommonService} from '../common.service';
export
class
IncomeComponent
implements
OnInit
{
export
class
IncomeComponent
implements
OnInit
{
hasMate
:
boolean
;
hasMate
:
boolean
;
curPageData
:
Array
<
any
>
;
curPageData
:
Array
<
any
>
;
constructor
(
private
commonService
:
CommonService
)
{
}
pageAnswers
:
any
;
// 家庭结构
type
:
any
;
selectedOptionId
:
any
;
constructor
(
private
commonService
:
CommonService
,
private
router
:
Router
,
private
route
:
ActivatedRoute
)
{
/**
* 1:单身贵族
* 2:二人世界
* 3:独立带娃
* 4:多口之家
* @type {any}
*/
this
.
type
=
this
.
route
.
snapshot
.
queryParams
[
'type'
];
this
.
pageAnswers
=
{
pageId
:
''
,
questions
:
[],
};
}
ngOnInit
()
{
ngOnInit
()
{
this
.
surveyInfo
()
this
.
surveyInfo
()
this
.
hasMate
=
true
;
this
.
hasMate
=
true
;
//判断家庭决定是否显示配偶
if
(
this
.
type
==
2
||
this
.
type
==
4
){
}
else
{
}
}
}
surveyInfo
()
{
surveyInfo
()
{
this
.
commonService
.
surveyInfo
().
then
(
res
=>
{
this
.
commonService
.
surveyInfo
().
then
(
res
=>
{
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
this
.
curPageData
=
res
[
'data'
][
'survey'
].
pages
[
'6'
]
this
.
curPageData
=
res
[
'data'
][
'survey'
].
pages
[
'6'
]
console
.
log
(
this
.
curPageData
)
console
.
log
(
this
.
curPageData
)
this
.
pageAnswers
.
pageId
=
this
.
curPageData
[
'pageId'
];
}
}
})
})
}
}
selectedIncome
(
question
,
option
){
this
.
selectedOptionId
=
option
.
optionId
;
option
.
selected
=
true
;
const
questions
=
{
questionId
:
question
.
questionId
,
questionName
:
question
.
questionName
,
options
:
[
option
]
};
for
(
let
i
=
0
;
i
<
this
.
pageAnswers
.
questions
.
length
;
i
++
)
{
if
(
this
.
pageAnswers
.
questions
[
i
].
questionId
==
question
.
questionId
)
{
const
index
=
this
.
pageAnswers
.
questions
.
indexOf
(
this
.
pageAnswers
.
questions
[
i
]);
this
.
pageAnswers
.
questions
.
splice
(
index
,
1
);
}
}
this
.
pageAnswers
.
questions
.
push
(
questions
);
this
.
commonService
.
addAnswer
(
this
.
pageAnswers
);
console
.
log
(
question
)
console
.
log
(
option
)
console
.
log
(
this
.
pageAnswers
)
}
}
}
questionnaire/src/app/job/job.component.html
View file @
a53903df
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
class=
"questionTitle"
>
{{ this.curPageData?.pageName }}
</div>
<div
class=
"questionTitle"
>
{{ this.curPageData?.pageName }}
</div>
<ul
class=
"jobContent"
>
<ul
class=
"jobContent"
>
<li
<li
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
[
ngClass
]="{
selected:
selectedOptionId =
=
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData?.questions[0].options"
*
ngFor=
"let options of this.curPageData?.questions[0].options"
(
click
)="
selectedJob
(
options
)"
(
click
)="
selectedJob
(
options
)"
>
>
...
...
questionnaire/src/app/transit1/transit1.component.html
View file @
a53903df
...
@@ -4,6 +4,6 @@
...
@@ -4,6 +4,6 @@
</div>
</div>
<div
class=
"content_footer"
>
<div
class=
"content_footer"
>
<div
style=
"color: #8a8a8a;"
>
<
</div>
<div
style=
"color: #8a8a8a;"
>
<
</div>
<div
[
ngStyle
]="{
color:
nextBtn =
=
false
?
'#
8a8a8a
'
:
'#
ec2d37
'
}"
>
下一步
</div>
<div
[
ngStyle
]="{
color:
nextBtn =
=
false
?
'#
8a8a8a
'
:
'#
ec2d37
'
}"
(
click
)="
next
()"
>
下一步
</div>
</div>
</div>
</div>
</div>
questionnaire/src/app/transit1/transit1.component.ts
View file @
a53903df
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
@
Component
({
@
Component
({
selector
:
'app-transit1'
,
selector
:
'app-transit1'
,
templateUrl
:
'./transit1.component.html'
,
templateUrl
:
'./transit1.component.html'
,
styleUrls
:
[
'./transit1.component.css'
]
styleUrls
:
[
'./transit1.component.css'
]
})
})
export
class
Transit1Component
implements
OnInit
{
export
class
Transit1Component
implements
OnInit
{
type
:
any
;
constructor
()
{
}
constructor
(
private
router
:
Router
,
private
route
:
ActivatedRoute
)
{
/**
* 1:单身贵族
* 2:二人世界
* 3:独立带娃
* 4:多口之家
* @type {any}
*/
this
.
type
=
this
.
route
.
snapshot
.
queryParams
[
'type'
];
}
ngOnInit
()
{
ngOnInit
()
{
}
}
next
(){
this
.
router
.
navigate
([
'/income'
],{
queryParams
:{
type
:
this
.
type
}})
}
}
}
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