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
3fba7ea1
Commit
3fba7ea1
authored
May 13, 2019
by
Chao Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checked
parent
2a793f2b
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
338 additions
and
97 deletions
+338
-97
questionnair/src/app/ask/ask.component.html
+15
-3
questionnair/src/app/ask/ask.component.ts
+63
-6
questionnair/src/app/page11/page11.component.html
+4
-5
questionnair/src/app/page11/page11.component.ts
+53
-25
questionnair/src/app/page12/page12.component.html
+5
-4
questionnair/src/app/page12/page12.component.ts
+14
-1
questionnair/src/app/page13/page13.component.html
+3
-2
questionnair/src/app/page13/page13.component.ts
+14
-2
questionnair/src/app/page14/page14.component.html
+3
-2
questionnair/src/app/page14/page14.component.ts
+14
-1
questionnair/src/app/page15/page15.component.html
+3
-2
questionnair/src/app/page15/page15.component.ts
+16
-1
questionnair/src/app/page16/page16.component.html
+1
-1
questionnair/src/app/page2/page2.component.html
+3
-2
questionnair/src/app/page2/page2.component.ts
+6
-0
questionnair/src/app/page3/page3.component.html
+8
-6
questionnair/src/app/page3/page3.component.ts
+40
-3
questionnair/src/app/page4/page4.component.html
+3
-3
questionnair/src/app/page4/page4.component.ts
+5
-0
questionnair/src/app/page5/page5.component.html
+3
-3
questionnair/src/app/page5/page5.component.ts
+5
-0
questionnair/src/app/page7/page7.component.html
+10
-8
questionnair/src/app/page7/page7.component.ts
+9
-0
questionnair/src/app/page8/page8.component.html
+11
-9
questionnair/src/app/page8/page8.component.ts
+9
-0
questionnair/src/app/page9/page9.component.html
+10
-8
questionnair/src/app/page9/page9.component.ts
+8
-0
No files found.
questionnair/src/app/ask/ask.component.html
View file @
3fba7ea1
...
...
@@ -48,9 +48,21 @@
*
ngIf=
"curPage == 10"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page11>
<app-page12
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 11"
></app-page12>
<app-page13
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 12"
></app-page13>
<app-page14
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 13"
></app-page14>
<app-page12
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 11"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page12>
<app-page13
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 12"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page13>
<app-page14
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 13"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page14>
<app-page15
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 14"
></app-page15>
<app-page16
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 15"
></app-page16>
<app-page17
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 16"
></app-page17>
...
...
questionnair/src/app/ask/ask.component.ts
View file @
3fba7ea1
...
...
@@ -67,23 +67,40 @@ export class AskComponent implements OnInit {
setCurPageData
()
{
const
thePateData
=
this
.
allQues
[
this
.
curPage
]
console
.
log
(
'thePateData------'
,
this
.
curPage
,
thePateData
)
this
.
curPageData
=
thePateData
this
.
curPageData
=
thePateData
const
page2Answer
=
this
.
allAnswers
[
1
]
if
(
this
.
curPage
==
2
)
{
const
page2Answer
=
this
.
allAnswers
[
1
]
this
.
filterPage2
(
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
thePateData
)
}
if
(
this
.
curPage
==
4
)
{
const
page2Answerswer
=
this
.
allAnswers
[
1
]
console
.
log
(
page2Answerswer
)
this
.
filterPage5
(
page2Answerswer
.
questions
[
0
].
options
[
0
].
optionId
,
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
thePateData
)
}
if
(
this
.
curPage
==
11
){
this
.
filterPage12
(
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
thePateData
)
}
if
(
this
.
curPage
==
12
){
this
.
filterPage13
(
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
thePateData
)
}
if
(
this
.
curPage
==
14
){
this
.
filterPage15
(
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
thePateData
)
}
}
filterPage2
(
optionId
,
thePateData
)
{
//判断第二页选择家庭1单身2二人3独立带娃4多口
if
(
optionId
==
1
||
optionId
==
2
)
{
...
...
@@ -91,6 +108,7 @@ export class AskComponent implements OnInit {
}
else
{
this
.
isShowChildAgeBtn
=
true
}
//判断页面是否有配偶选项
if
(
optionId
==
1
||
optionId
==
3
)
{
this
.
hasMate
=
false
}
else
{
...
...
@@ -128,13 +146,52 @@ export class AskComponent implements OnInit {
}
filterPage5
(
optionId
,
thePateData
)
{
//判断是否显示配偶工作页
//
page5
判断是否显示配偶工作页
//1单身 3单亲
if
(
optionId
==
1
||
optionId
==
3
)
{
this
.
curPage
++
console
.
log
(
'page5'
,
this
.
curPage
,
this
.
curPageData
)
this
.
curPageData
=
this
.
allQues
[
this
.
curPage
]
}
}
//pege12判断是否显示配偶健康
filterPage12
(
optionId
,
thePateData
){
if
(
optionId
==
1
||
optionId
==
3
)
{
this
.
curPage
++
console
.
log
(
'page12'
,
this
.
curPage
,
this
.
curPageData
)
this
.
curPageData
=
this
.
allQues
[
this
.
curPage
]
}
}
//page13判断是否显示孩子健康
filterPage13
(
optionId
,
thePateData
){
//单身或二人世界
if
(
optionId
==
1
||
optionId
==
2
)
{
this
.
curPage
++
console
.
log
(
'page13'
,
this
.
curPage
,
this
.
curPageData
)
this
.
curPageData
=
this
.
allQues
[
this
.
curPage
]
}
}
//page15判断option内容
filterPage15
(
optionId
,
thePateData
){
//如果单身或者单亲选择相中没有配偶选项
if
(
optionId
==
1
||
optionId
==
3
){
this
.
curPageData
=
{
...
thePateData
,
questions
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
option
.
optionId
==
108
||
option
.
optionId
==
109
})
}
}
if
(
optionId
==
2
||
optionId
==
4
){
this
.
curPageData
=
{
...
thePateData
,
questions
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
option
.
optionId
==
110
||
option
.
optionId
==
111
||
option
.
optionId
==
112
})
}
}
}
}
questionnair/src/app/page11/page11.component.html
View file @
3fba7ea1
...
...
@@ -2,14 +2,13 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['questions'][0]['questionName']
}}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
(
click
)="
getAnswer
(
options
)"
>
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
[
ngClass
]="{'
selected
'
:options
['
selected
']==
true
}"
(
click
)="
getAnswer
(
options
);
changeStyle
(
options
.
optionId
)"
>
{{ options.optionName }}
</li>
</ul>
...
...
questionnair/src/app/page11/page11.component.ts
View file @
3fba7ea1
...
...
@@ -9,39 +9,67 @@ export class Page11Component implements OnInit {
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
allOption
:
object
selectedNum
:
number
;
allOptions
:
Array
<
any
>
;
constructor
()
{}
ngOnInit
()
{
this
.
allOption
=
{}
this
.
allOption
=
{};
this
.
allOptions
=
[];
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
options
)
{
console
.
log
(
options
)
if
(
!
this
.
allOption
[
options
[
'optionId'
]])
{
this
.
allOption
[
options
[
'optionId'
]]
=
{}
}
this
.
allOption
[
options
[
'optionId'
]]
=
{
selected
:
!
this
.
allOption
[
options
[
'optionId'
]][
'selected'
],
options
}
const
options_ret
=
Object
.
keys
(
this
.
allOption
)
.
filter
(
item
=>
{
return
this
.
allOption
[
item
][
'selected'
]
})
.
map
(
questionId
=>
{
return
{
options
:
this
.
allOption
[
questionId
]
options
[
'selected'
]
=
!
options
[
'selected'
];
for
(
let
i
=
0
;
i
<
this
.
allOptions
.
length
;
i
++
){
if
(
options
[
'optionId'
]
==
this
.
allOptions
[
i
][
'optionId'
]){
let
index
=
this
.
allOptions
.
indexOf
(
this
.
allOptions
[
i
]);
if
(
index
>-
1
){
this
.
allOptions
.
splice
(
index
,
1
)
}
})
const
ret
=
{
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
[
{
questionId
:
this
.
curPageData
[
'questions'
][
0
].
questionId
,
options
:
options_ret
}
}
this
.
allOptions
.
push
(
options
);
for
(
let
i
=
0
;
i
<
this
.
allOptions
.
length
;
i
++
){
if
(
!
this
.
allOptions
[
i
][
'selected'
]){
let
index
=
this
.
allOptions
.
indexOf
(
this
.
allOptions
[
i
]);
if
(
index
>-
1
){
this
.
allOptions
.
splice
(
index
,
1
)
}
]
}
}
this
.
getAllAnswer
.
emit
(
ret
)
console
.
log
(
this
.
allOptions
)
// if (!this.allOption[options['optionId']]) {
// this.allOption[options['optionId']] = {}
// }
// console.log(this.allOption)
// this.allOption[options['optionId']] = {
// selected: !this.allOption[options['optionId']]['selected'],
// options
// }
// const options_ret = Object.keys(this.allOption)
// .filter(item => {
// return this.allOption[item]['selected']
// })
// .map(questionId => {
// return {
// options: this.allOption[questionId]
// }
// })
// const ret = {
// pageId: this.curPageData['pageId'],
// questions: [
// {
// questionId: this.curPageData['questions'][0].questionId,
// options: options_ret
// }
// ]
// }
// this.getAllAnswer.emit(ret)
}
changeStyle
(
optionId
){
this
.
selectedNum
=
optionId
}
}
questionnair/src/app/page12/page12.component.html
View file @
3fba7ea1
...
...
@@ -2,16 +2,17 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[0].questionName
.substring(0, 1) }}
{{ this.curPageData
['questions'][0]['questionName']
.substring(0, 1) }}
<span>
{{ this.curPageData
.questions[0].questionName
.substring(1, 3) }}
</span
{{ this.curPageData
['questions'][0]['questionName']
.substring(1, 3) }}
</span
>
{{ this.curPageData
.questions[0].questionName
.substring(3, 8) }}
{{ this.curPageData
['questions'][0]['questionName']
.substring(3, 8) }}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
options
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page12/page12.component.ts
View file @
3fba7ea1
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
@
Component
({
selector
:
'app-page12'
,
...
...
@@ -7,9 +7,22 @@ import { Component, OnInit, Input } from '@angular/core'
})
export
class
Page12Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
constructor
()
{}
ngOnInit
()
{
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
option
)
{
const
ret
=
{
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
[
{
questionId
:
this
.
curPageData
[
'questions'
][
0
].
questionId
,
option
:
[
option
]
}
]
}
this
.
getAllAnswer
.
emit
(
ret
)
}
}
questionnair/src/app/page13/page13.component.html
View file @
3fba7ea1
...
...
@@ -2,12 +2,13 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['questions'][0]['questionName']
}}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
options
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page13/page13.component.ts
View file @
3fba7ea1
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
@
Component
({
selector
:
'app-page13'
,
templateUrl
:
'./page13.component.html'
,
...
...
@@ -6,10 +6,22 @@ import { Component, OnInit, Input } from '@angular/core'
})
export
class
Page13Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
constructor
()
{}
ngOnInit
()
{
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
option
)
{
const
ret
=
{
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
[
{
questionId
:
this
.
curPageData
[
'questions'
][
0
].
questionId
,
option
:
[
option
]
}
]
}
this
.
getAllAnswer
.
emit
(
ret
)
}
}
questionnair/src/app/page14/page14.component.html
View file @
3fba7ea1
...
...
@@ -2,12 +2,13 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle hospitalTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['pageName']
}}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
options
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page14/page14.component.ts
View file @
3fba7ea1
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-page14'
,
...
...
@@ -7,10 +7,23 @@ import { Component, OnInit ,Input} from '@angular/core';
})
export
class
Page14Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
constructor
()
{
}
ngOnInit
()
{
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
option
)
{
const
ret
=
{
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
[
{
questionId
:
this
.
curPageData
[
'questions'
][
0
].
questionId
,
option
:
[
option
]
}
]
}
this
.
getAllAnswer
.
emit
(
ret
)
}
}
questionnair/src/app/page15/page15.component.html
View file @
3fba7ea1
...
...
@@ -2,12 +2,13 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle smokeTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['questions'][0]['questionName']
}}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
options
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page15/page15.component.ts
View file @
3fba7ea1
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-page15'
,
...
...
@@ -7,10 +7,25 @@ import { Component, OnInit,Input } from '@angular/core';
})
export
class
Page15Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
curQues
:
Object
curAllQues
:
Object
constructor
()
{
}
ngOnInit
()
{
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
option
){
const
questionId
=
this
.
curQues
[
'questionId'
]
this
.
curAllQues
[
questionId
]
=
option
const
questions
=
Object
.
keys
(
this
.
curAllQues
).
map
(
questionId
=>
{
return
{
questionId
,
options
:
this
.
curAllQues
[
questionId
]
}
})
const
ret
=
{
pageId
:
15
,
questions
}
this
.
getAllAnswer
.
emit
(
ret
)
}
}
questionnair/src/app/page16/page16.component.html
View file @
3fba7ea1
...
...
@@ -2,7 +2,7 @@
<div
class=
"layout "
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['questions'][0]['questionName']
}}
</div>
<ul
class=
"cityContent"
>
<li
*
ngFor=
"let provinces of this.provinceList"
(
click
)="
showToast
()"
>
...
...
questionnair/src/app/page2/page2.component.html
View file @
3fba7ea1
...
...
@@ -3,11 +3,12 @@
<div
class=
"questionTitle"
>
{{ this.curPageData['pageName'] }}
</div>
<ul
class=
"option_item"
>
<li
*
ngFor=
"let options of this.curPageData
.questions
[0].options"
*
ngFor=
"let options of this.curPageData
['questions']
[0].options"
(
click
)="
getAnswer
(
options
)"
>
<img
class=
"selected"
[
ngClass
]="{'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}"
(
click
)="
changeStyle
(
options
.
optionId
)"
src=
"assets/images/icon{{ options.optionId }}.png"
alt=
"{{ options.optionName }}"
/>
...
...
questionnair/src/app/page2/page2.component.ts
View file @
3fba7ea1
...
...
@@ -8,6 +8,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
export
class
Page2Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
selectedNum
:
number
;
constructor
()
{}
ngOnInit
()
{
...
...
@@ -25,4 +26,9 @@ export class Page2Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
optionId
){
//当前选中项
this
.
selectedNum
=
optionId
}
}
questionnair/src/app/page3/page3.component.html
View file @
3fba7ea1
...
...
@@ -2,13 +2,15 @@
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData['pageName'] }}
</div>
<ul
class=
"ageContent"
>
<li
*
ngFor=
"let optionsList of this.curPageData
.questions
"
>
<li
*
ngFor=
"let optionsList of this.curPageData
['questions'];index as i
"
>
<div>
{{ optionsList.questionName }}
</div>
<b
(
click
)="
showToast
(
optionsList
)"
>
>
</b>
<b
(
click
)="
showToast
(
optionsList
)"
>
<span>
{{optionsList.name}}
</span>
>
</b>
</li>
</ul>
</div>
<div
class=
"addChild"
*
ngIf=
"isShowChildAgeBtn"
>
<div
class=
"addChild"
*
ngIf=
"isShowChildAgeBtn"
(
click
)="
addChild
()"
>
<div
class=
"icon"
>
+
</div>
<div
data-toggle=
"modal"
>
增加孩子年龄
</div>
</div>
...
...
@@ -16,10 +18,10 @@
<div
class=
"toastContent"
>
<ul>
<li
class=
"selected
"
[
ngClass
]="{'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}
"
*
ngFor=
"let options of curQues.options"
(
click
)="
closeToast
();
getAnswer
(
options
)"
>
(
click
)="
closeToast
();
getAnswer
(
options
)
;
changeStyle
(
options
,
options
.
optionId
)
"
>
{{ options.optionName }}
</li>
</ul>
...
...
questionnair/src/app/page3/page3.component.ts
View file @
3fba7ea1
...
...
@@ -13,18 +13,19 @@ export class Page3Component implements OnInit {
isShow
:
boolean
curQues
:
Object
curAllQues
:
Object
selectedNum
:
number
;
options
:
Array
<
any
>
;
curQuesLen
:
number
;
constructor
()
{}
ngOnInit
()
{
this
.
curQues
=
{}
this
.
curAllQues
=
{}
console
.
log
(
this
.
curPageData
)
this
.
curQuesLen
=
this
.
curPageData
[
'questions'
].
length
;
}
showToast
(
question
)
{
this
.
isShow
=
true
this
.
curQues
=
question
console
.
log
(
this
.
curQues
)
}
closeToast
()
{
this
.
isShow
=
false
...
...
@@ -41,4 +42,40 @@ export class Page3Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
options
,
optionId
){
//当前选中项
this
.
selectedNum
=
optionId
for
(
let
i
=
0
;
i
<
this
.
curPageData
[
'questions'
].
length
;
i
++
){
for
(
let
j
=
0
;
j
<
this
.
curPageData
[
'questions'
][
i
][
'options'
].
length
;
j
++
){
if
(
options
.
optionId
==
this
.
curPageData
[
'questions'
][
i
].
options
[
j
].
optionId
){
this
.
curPageData
[
'questions'
].
optionName
=
options
.
optionName
;
this
.
curPageData
[
'questions'
][
i
][
'name'
]
=
this
.
curPageData
[
'questions'
][
i
].
options
[
j
].
optionName
}
}
}
}
addChild
(){
this
.
curQuesLen
++
;
if
(
this
.
curQuesLen
<
5
){
this
.
curPageData
[
'questions'
][
this
.
curQuesLen
-
1
]
=
{
questionId
:
4
,
questionName
:
"孩子"
+
(
this
.
curQuesLen
-
1
)
+
"年龄"
,
optionType
:
1
,
questionOrder
:
4
,
options
:
[
{
optionId
:
22
,
optionName
:
"95后"
,
optionOrder
:
1
,
customerInput
:
null
},
{
optionId
:
23
,
optionName
:
"90后"
,
optionOrder
:
2
,
customerInput
:
null
},
{
optionId
:
24
,
optionName
:
"85后"
,
optionOrder
:
3
,
customerInput
:
null
},
{
optionId
:
25
,
optionName
:
"80后"
,
optionOrder
:
4
,
customerInput
:
null
},
{
optionId
:
26
,
optionName
:
"75后"
,
optionOrder
:
5
,
customerInput
:
null
},
{
optionId
:
27
,
optionName
:
"70后"
,
optionOrder
:
6
,
customerInput
:
null
},
{
optionId
:
28
,
optionName
:
"65后"
,
optionOrder
:
7
,
customerInput
:
null
},
{
optionId
:
29
,
optionName
:
"60后"
,
optionOrder
:
8
,
customerInput
:
null
}
]
}
}
console
.
log
(
this
.
curPageData
[
'questions'
])
}
}
questionnair/src/app/page4/page4.component.html
View file @
3fba7ea1
...
...
@@ -4,9 +4,9 @@
<div
class=
"questionTitle"
>
{{ this.curPageData['pageName'] }}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected
"
*
ngFor=
"let options of this.curPageData
.questions
[0].options"
(
click
)="
getAnswer
(
options
)"
[
ngClass
]="{'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}
"
*
ngFor=
"let options of this.curPageData
['questions']
[0].options"
(
click
)="
getAnswer
(
options
)
;
changeStyle
(
options
.
optionId
)
"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page4/page4.component.ts
View file @
3fba7ea1
...
...
@@ -8,6 +8,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
export
class
Page4Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
selectedNum
:
number
;
constructor
()
{}
ngOnInit
()
{
...
...
@@ -25,4 +26,8 @@ export class Page4Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
optionId
){
//当前选中项
this
.
selectedNum
=
optionId
}
}
questionnair/src/app/page5/page5.component.html
View file @
3fba7ea1
...
...
@@ -8,9 +8,9 @@
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData
.questions[0].options
"
(
click
)="
getAnswer
(
options
)"
[
ngClass
]="{'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData
['questions'][0]['options']
"
(
click
)="
getAnswer
(
options
)
;
changeStyle
(
options
.
optionId
)
"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page5/page5.component.ts
View file @
3fba7ea1
...
...
@@ -8,6 +8,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
export
class
Page5Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
selectedNum
:
number
;
constructor
()
{}
ngOnInit
()
{
...
...
@@ -25,4 +26,8 @@ export class Page5Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
optionId
){
//当前选中项
this
.
selectedNum
=
optionId
}
}
questionnair/src/app/page7/page7.component.html
View file @
3fba7ea1
...
...
@@ -2,25 +2,27 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['questions'][0]['questionName']
}}
</div>
<ul
class=
"income"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
(
click
)="
getAnswer
(
this
.
curPageData
.
questions
[
0
],
options
)"
[
ngClass
]="{'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData['questions'][0].options"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
0
],
options
);
changeStyle
(
options
.
optionId
)"
>
{{ options.optionName }}
</li>
</ul>
<div
class=
"questionTitle"
*
ngIf=
"hasMate"
>
{{ this.curPageData
.questions[1].questionName
}}
{{ this.curPageData
['questions'][1]['questionName']
}}
</div>
<ul
class=
"income"
*
ngIf=
"hasMate"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[1].options"
(
click
)="
getAnswer
(
this
.
curPageData
.
questions
[
1
],
options
)"
[
ngClass
]="{'
selected
'
:this
.
selectedTwo =
==
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData['questions'][1]['options']"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
1
],
options
);
changeStyle2
(
options
.
optionId
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page7/page7.component.ts
View file @
3fba7ea1
...
...
@@ -10,6 +10,9 @@ export class Page7Component implements OnInit {
@
Input
()
hasMate
:
boolean
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
curAllQues
:
Object
selectedNum
:
number
;
//第二个问题的选择
selectedTwo
:
number
;
constructor
()
{}
ngOnInit
()
{
...
...
@@ -30,4 +33,10 @@ export class Page7Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
optionId
){
this
.
selectedNum
=
optionId
}
changeStyle2
(
optionId
){
this
.
selectedTwo
=
optionId
}
}
questionnair/src/app/page8/page8.component.html
View file @
3fba7ea1
...
...
@@ -2,25 +2,27 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['questions'][0]['questionName']
}}
</div>
<ul
class=
"income"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
(
click
)="
getAnswer
(
this
.
curPageData
.
questions
[
0
],
options
)"
[
ngClass
]="{'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
0
],
options
);
changeStyle
(
options
.
optionId
)"
>
{{ options.optionName }}
</li>
</ul>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[1].questionName
}}
{{ this.curPageData
['questions'][1]['questionName']
}}
</div>
<ul
class=
"income"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[1].options"
(
click
)="
getAnswer
(
this
.
curPageData
.
questions
[
1
],
options
)"
<li
[
ngClass
]="{'
selected
'
:this
.
selectedTwo =
==
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData['questions'][1]['options']"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
1
],
options
);
changeStyle2
(
options
.
optionId
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page8/page8.component.ts
View file @
3fba7ea1
...
...
@@ -9,6 +9,8 @@ export class Page8Component implements OnInit {
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
curAllQues
:
Object
selectedNum
:
number
;
selectedTwo
:
number
;
constructor
()
{}
ngOnInit
()
{
...
...
@@ -28,4 +30,11 @@ export class Page8Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
optionId
){
this
.
selectedNum
=
optionId
}
changeStyle2
(
optionId
){
this
.
selectedTwo
=
optionId
}
}
questionnair/src/app/page9/page9.component.html
View file @
3fba7ea1
...
...
@@ -2,25 +2,27 @@
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData
.questions[0].questionName
}}
{{ this.curPageData
['questions'][0]['questionName']
}}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[0].options"
(
click
)="
getAnswer
(
this
.
curPageData
.
questions
[
0
],
options
)"
[
ngClass
]="{'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
0
],
options
);
changeStyle
(
options
.
optionId
)"
>
{{ options.optionName }}
</li>
</ul>
<div
class=
"questionTitle"
*
ngIf=
"hasMate"
>
{{ this.curPageData
.questions[1].questionName
}}
{{ this.curPageData
['questions'][1]['questionName']
}}
</div>
<ul
class=
"jobContent"
*
ngIf=
"hasMate"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData.questions[1].options"
(
click
)="
getAnswer
(
this
.
curPageData
.
questions
[
1
],
options
)"
[
ngClass
]="{'
selected
'
:this
.
selectedTwo =
==
options
.
optionId
}"
*
ngFor=
"let options of this.curPageData['questions'][1]['options']"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
1
],
options
);
changeStyle2
(
options
.
optionId
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page9/page9.component.ts
View file @
3fba7ea1
...
...
@@ -10,6 +10,8 @@ export class Page9Component implements OnInit {
@
Input
()
hasMate
:
boolean
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
curAllQues
:
Object
selectedNum
:
number
;
selectedTwo
:
number
;
constructor
()
{}
ngOnInit
()
{
...
...
@@ -29,4 +31,10 @@ export class Page9Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
optionId
){
this
.
selectedNum
=
optionId
}
changeStyle2
(
optionId
){
this
.
selectedTwo
=
optionId
}
}
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