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
e2da9242
Commit
e2da9242
authored
May 21, 2019
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加年龄的判断
parent
aa75d93c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
questionnaire/src/app/age/age.component.ts
+18
-3
questionnaire/src/app/family/family.component.ts
+1
-1
questionnaire/src/app/health/health.component.ts
+1
-3
No files found.
questionnaire/src/app/age/age.component.ts
View file @
e2da9242
...
...
@@ -21,6 +21,7 @@ export class AgeComponent implements OnInit {
question
:
any
;
// 上一次的答案
lastQuestions
:
Array
<
any
>
;
nextBtn
:
boolean
=
false
;
constructor
(
private
commonService
:
CommonService
,
private
router
:
Router
,
private
route
:
ActivatedRoute
)
{
/**
...
...
@@ -96,14 +97,18 @@ export class AgeComponent implements OnInit {
// console.log(this.curPageData);
this
.
commonService
.
addAnswer
(
this
.
pageAnswers
);
this
.
closeToast
();
console
.
log
(
this
.
pageAnswers
)
console
.
log
(
this
.
pageAnswers
);
if
(
this
.
curPageData
[
'questions'
].
length
==
this
.
pageAnswers
.
questions
.
length
)
{
this
.
nextBtn
=
true
;
}
else
{
this
.
nextBtn
=
false
;
}
}
showToast
(
question
,
idx
)
{
this
.
isShow
=
true
;
this
.
curQues
=
question
;
this
.
curQuesIndex
=
idx
;
console
.
log
(
question
)
for
(
let
i
=
0
;
i
<
question
[
'options'
].
length
;
i
++
)
{
if
(
question
.
optionName
==
question
[
'options'
][
i
].
optionName
)
{
question
[
'options'
][
i
][
'selected'
]
=
true
...
...
@@ -130,6 +135,11 @@ export class AgeComponent implements OnInit {
this
.
question
.
optionName
=
null
;
this
.
question
.
questionName
=
'孩子'
+
this
.
questionSubId
+
'年龄'
;
this
.
curPageData
[
'questions'
].
push
(
this
.
question
);
if
(
this
.
curPageData
[
'questions'
].
length
==
this
.
pageAnswers
.
questions
.
length
)
{
this
.
nextBtn
=
true
;
}
else
{
this
.
nextBtn
=
false
;
}
}
// 根据家庭结构处理展示数据
...
...
@@ -146,6 +156,11 @@ export class AgeComponent implements OnInit {
// 下一步
next
()
{
this
.
router
.
navigate
([
'/job'
],
{
queryParams
:
{
type
:
this
.
type
}});
if
(
this
.
nextBtn
)
{
this
.
router
.
navigate
([
'/job'
],
{
queryParams
:
{
type
:
this
.
type
}});
}
else
{
return
;
}
}
}
questionnaire/src/app/family/family.component.ts
View file @
e2da9242
...
...
@@ -66,7 +66,7 @@ export class FamilyComponent implements OnInit {
}],
};
this
.
commonService
.
addAnswer
(
this
.
pageAnswers
);
// console.log(this.pageAnswers)
// console.log(this.pageAnswers)
;
if
(
this
.
pageAnswers
.
questions
[
0
].
options
.
every
((
item
)
=>
{
return
item
.
selected
;
}))
{
...
...
questionnaire/src/app/health/health.component.ts
View file @
e2da9242
...
...
@@ -108,9 +108,7 @@ export class HealthComponent implements OnInit {
// 下一步
next
()
{
if
(
this
.
pageAnswers
.
questions
[
0
].
options
.
every
((
item
)
=>
{
return
item
.
selected
;
}))
{
if
(
this
.
nextBtn
)
{
// 如果是二人世界或是多口之家跳转到配偶页
// 先判断当前页是您的页还是配偶页
if
(
this
.
id
==
1
)
{
...
...
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