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
9391fe3e
Commit
9391fe3e
authored
May 14, 2019
by
Chao Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: many bug
parent
3fba7ea1
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
275 additions
and
106 deletions
+275
-106
questionnair/src/app/ask/ask.component.ts
+69
-20
questionnair/src/app/page11/page11.component.html
+3
-2
questionnair/src/app/page11/page11.component.ts
+25
-30
questionnair/src/app/page12/page12.component.html
+4
-2
questionnair/src/app/page12/page12.component.ts
+24
-3
questionnair/src/app/page13/page13.component.html
+1
-0
questionnair/src/app/page13/page13.component.ts
+24
-3
questionnair/src/app/page3/page3.component.html
+10
-5
questionnair/src/app/page3/page3.component.ts
+86
-27
questionnair/src/app/page9/page9.component.html
+4
-6
questionnair/src/app/page9/page9.component.ts
+25
-8
No files found.
questionnair/src/app/ask/ask.component.ts
View file @
9391fe3e
import
{
Component
,
OnInit
}
from
'@angular/core'
import
{
CommonService
}
from
'../common.service'
import
{
Options
}
from
'selenium-webdriver/chrome'
@
Component
({
selector
:
'app-ask'
,
templateUrl
:
'./ask.component.html'
,
...
...
@@ -17,7 +18,7 @@ export class AskComponent implements OnInit {
constructor
(
private
commonService
:
CommonService
)
{}
ngOnInit
()
{
this
.
curPage
=
1
0
this
.
curPage
=
0
this
.
totalPage
=
17
this
.
curPageData
=
[]
this
.
allAnswers
=
[]
...
...
@@ -81,22 +82,24 @@ export class AskComponent implements OnInit {
thePateData
)
}
if
(
this
.
curPage
==
11
)
{
if
(
this
.
curPage
==
11
)
{
this
.
filterPage12
(
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
thePateData
)
}
if
(
this
.
curPage
==
12
)
{
if
(
this
.
curPage
==
12
)
{
this
.
filterPage13
(
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
thePateData
)
}
if
(
this
.
curPage
==
14
){
this
.
filterPage15
(
console
.
log
(
'page start'
,
this
.
curPage
)
if
(
this
.
curPage
==
13
)
{
console
.
log
(
'page end'
,
this
.
curPage
)
this
.
filterPage14
(
page2Answer
.
questions
[
0
].
options
[
0
].
optionId
,
th
ePateData
th
is
.
allQues
[
this
.
curPage
]
)
}
}
...
...
@@ -156,42 +159,88 @@ export class AskComponent implements OnInit {
}
//pege12判断是否显示配偶健康
filterPage12
(
optionId
,
thePateData
){
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
){
filterPage13
(
optionId
,
thePateData
)
{
//单身或二人世界
if
(
optionId
==
1
||
optionId
==
2
)
{
if
(
optionId
==
1
||
optionId
==
2
)
{
this
.
curPage
++
console
.
log
(
'page13'
,
this
.
curPage
,
this
.
curPageData
)
this
.
curPageData
=
this
.
allQues
[
this
.
curPage
]
}
}
//page1
5
判断option内容
filterPage1
5
(
optionId
,
thePateData
)
{
//page1
4
判断option内容
filterPage1
4
(
optionId
,
thePateData
)
{
//如果单身或者单亲选择相中没有配偶选项
if
(
optionId
==
1
||
optionId
==
3
){
if
(
optionId
==
1
)
{
this
.
curPageData
=
{
...
thePateData
,
questions
:
[
{
...
thePateData
.
questions
[
0
],
options
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
option
.
optionId
==
106
||
option
.
optionId
==
107
})
}
]
}
}
if
(
optionId
==
2
)
{
this
.
curPageData
=
{
...
thePateData
,
questions
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
option
.
optionId
==
108
||
option
.
optionId
==
109
questions
:
[
{
...
thePateData
.
questions
[
0
],
options
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
(
option
.
optionId
==
108
||
option
.
optionId
==
109
||
option
.
optionId
==
111
)
})
}
]
}
}
if
(
optionId
==
3
)
{
this
.
curPageData
=
{
...
thePateData
,
questions
:
[
{
...
thePateData
.
questions
[
0
],
options
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
(
option
.
optionId
==
108
||
option
.
optionId
==
110
||
option
.
optionId
==
111
)
})
}
]
}
if
(
optionId
==
2
||
optionId
==
4
){
}
if
(
optionId
==
4
)
{
this
.
curPageData
=
{
...
thePateData
,
questions
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
option
.
optionId
==
110
||
option
.
optionId
==
111
||
option
.
optionId
==
112
questions
:
[
{
...
thePateData
.
questions
[
0
],
options
:
thePateData
.
questions
[
0
][
'options'
].
filter
(
option
=>
{
return
(
option
.
optionId
==
108
||
option
.
optionId
==
109
||
option
.
optionId
==
110
||
option
.
optionId
==
111
)
})
}
]
}
}
}
}
questionnair/src/app/page11/page11.component.html
View file @
9391fe3e
...
...
@@ -7,8 +7,9 @@
<ul
class=
"jobContent"
>
<li
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
[
ngClass
]="{'
selected
'
:options
['
selected
']==
true
}"
(
click
)="
getAnswer
(
options
);
changeStyle
(
options
.
optionId
)"
>
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
(
click
)="
getAnswer
(
options
)"
>
{{ options.optionName }}
</li>
</ul>
...
...
questionnair/src/app/page11/page11.component.ts
View file @
9391fe3e
...
...
@@ -8,32 +8,31 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
export
class
Page11Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
allOption
:
object
selectedNum
:
number
;
allOptions
:
Array
<
any
>
;
// allOption: object
allOptions
:
Array
<
any
>
constructor
()
{}
ngOnInit
()
{
this
.
allOption
=
{};
this
.
allOptions
=
[]
;
// this.allOption = {}
this
.
allOptions
=
[]
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
options
)
{
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
)
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
)
}
}
}
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
.
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
)
}
}
}
...
...
@@ -57,19 +56,15 @@ export class Page11Component implements OnInit {
// options: this.allOption[questionId]
// }
// })
// const ret = {
// pageId: this.curPageData['pageId'],
// questions: [
// {
// questionId: this.curPageData['questions'][0].questionId,
// options: options_ret
// }
// ]
// }
// this.getAllAnswer.emit(ret)
const
ret
=
{
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
[
{
questionId
:
this
.
curPageData
[
'questions'
][
0
].
questionId
,
options
:
this
.
allOptions
}
changeStyle
(
optionId
){
this
.
selectedNum
=
optionId
]
}
this
.
getAllAnswer
.
emit
(
ret
)
}
}
questionnair/src/app/page12/page12.component.html
View file @
9391fe3e
...
...
@@ -4,14 +4,16 @@
<div
class=
"questionTitle"
>
{{ 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) }}
</div>
<ul
class=
"jobContent"
>
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
(
click
)="
getAnswer
(
options
)"
>
{{ options.optionName }}
...
...
questionnair/src/app/page12/page12.component.ts
View file @
9391fe3e
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
@
Component
({
selector
:
'app-page12'
,
...
...
@@ -8,18 +8,39 @@ import { Component, OnInit, Input , Output, EventEmitter} from '@angular/core'
export
class
Page12Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
allOptions
:
Array
<
any
>
constructor
()
{}
ngOnInit
()
{
this
.
allOptions
=
[]
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
option
)
{
getAnswer
(
options
)
{
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
)
}
}
}
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
)
}
}
}
console
.
log
(
this
.
allOptions
)
const
ret
=
{
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
[
{
questionId
:
this
.
curPageData
[
'questions'
][
0
].
questionId
,
option
:
[
option
]
option
s
:
this
.
allOptions
}
]
}
...
...
questionnair/src/app/page13/page13.component.html
View file @
9391fe3e
...
...
@@ -8,6 +8,7 @@
<li
class=
"selected"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
(
click
)="
getAnswer
(
options
)"
>
{{ options.optionName }}
...
...
questionnair/src/app/page13/page13.component.ts
View file @
9391fe3e
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'@angular/core'
@
Component
({
selector
:
'app-page13'
,
templateUrl
:
'./page13.component.html'
,
...
...
@@ -7,18 +7,39 @@ import { Component, OnInit, Input, Output, EventEmitter} from '@angular/core'
export
class
Page13Component
implements
OnInit
{
@
Input
()
curPageData
:
Array
<
any
>
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
allOptions
:
Array
<
any
>
constructor
()
{}
ngOnInit
()
{
this
.
allOptions
=
[]
console
.
log
(
this
.
curPageData
)
}
getAnswer
(
option
)
{
getAnswer
(
options
)
{
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
)
}
}
}
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
)
}
}
}
console
.
log
(
this
.
allOptions
)
const
ret
=
{
pageId
:
this
.
curPageData
[
'pageId'
],
questions
:
[
{
questionId
:
this
.
curPageData
[
'questions'
][
0
].
questionId
,
option
:
[
option
]
option
s
:
this
.
allOptions
}
]
}
...
...
questionnair/src/app/page3/page3.component.html
View file @
9391fe3e
...
...
@@ -2,10 +2,11 @@
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData['pageName'] }}
</div>
<ul
class=
"ageContent"
>
<li
*
ngFor=
"let optionsList of this.curPageData['questions'];index as i"
>
<li
*
ngFor=
"let optionsList of this.curPageData['questions'];
index as i"
>
<div>
{{ optionsList.questionName }}
</div>
<b
(
click
)="
showToast
(
optionsList
)"
>
<span>
{{optionsList.name}}
</span>
>
<b
(
click
)="
showToast
(
optionsList
,
i
)"
>
<span>
{{ optionsList.name }}
</span
>
>
</b>
</li>
</ul>
...
...
@@ -18,9 +19,13 @@
<div
class=
"toastContent"
>
<ul>
<li
[
ngClass
]="{
'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}"
[
ngClass
]="{
selected:
this
.
selectedNum =
==
options
.
optionId
}"
*
ngFor=
"let options of curQues.options"
(
click
)="
closeToast
();
getAnswer
(
options
);
changeStyle
(
options
,
options
.
optionId
)"
(
click
)="
closeToast
();
getAnswer
(
options
);
changeStyle
(
options
,
options
.
optionId
)
"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page3/page3.component.ts
View file @
9391fe3e
...
...
@@ -13,19 +13,27 @@ export class Page3Component implements OnInit {
isShow
:
boolean
curQues
:
Object
curAllQues
:
Object
selectedNum
:
number
;
options
:
Array
<
any
>
;
curQuesLen
:
number
;
selectedNum
:
number
options
:
Array
<
any
>
curQuesIndex
:
number
//当前问题长度
curQuesLen
:
number
//增加孩子点击次数
addChildCount
:
number
constructor
()
{}
ngOnInit
()
{
this
.
curQues
=
{}
this
.
curAllQues
=
{}
this
.
curQuesLen
=
this
.
curPageData
[
'questions'
].
length
;
this
.
curQuesLen
=
this
.
curPageData
[
'questions'
].
length
//初始化增加孩子按钮可以点2次
this
.
addChildCount
=
2
}
showToast
(
question
)
{
showToast
(
question
,
idx
)
{
this
.
isShow
=
true
this
.
curQues
=
question
this
.
curQuesIndex
=
idx
}
closeToast
()
{
this
.
isShow
=
false
...
...
@@ -43,36 +51,87 @@ export class Page3Component implements OnInit {
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
options
,
optionId
)
{
changeStyle
(
options
,
optionId
)
{
//当前选中项
this
.
curPageData
[
'questions'
][
this
.
curQuesIndex
][
'name'
]
=
options
.
optionName
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
}
}
}
// for (let i = 0; i < this.curQuesLen; 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'][i]['name'] = this.curPageData[
// 'questions'
// ][i].options[j].optionName
// }
// }
// }
}
addChild
(){
this
.
curQuesLen
++
;
if
(
this
.
curQuesLen
<
5
)
{
this
.
curPageData
[
'questions'
][
this
.
curQuesLen
-
1
]
=
{
addChild
()
{
this
.
addChildCount
--
if
(
this
.
addChildCount
>=
0
)
{
this
.
curPageData
[
'questions'
][
this
.
curQuesLen
++
]
=
{
questionId
:
4
,
questionName
:
"孩子"
+
(
this
.
curQuesLen
-
1
)
+
"年龄"
,
questionName
:
`孩子
${
this
.
addChildCount
==
1
?
'1'
:
'2'
}
年龄`
,
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
}
{
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
}
]
}
}
...
...
questionnair/src/app/page9/page9.component.html
View file @
9391fe3e
...
...
@@ -6,10 +6,9 @@
</div>
<ul
class=
"jobContent"
>
<li
[
ngClass
]="{
'
selected
'
:this
.
selectedNum =
==
options
.
optionId
}"
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
0
],
options
);
changeStyle
(
options
.
optionId
)"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
0
],
options
)"
>
{{ options.optionName }}
</li>
...
...
@@ -19,10 +18,9 @@
</div>
<ul
class=
"jobContent"
*
ngIf=
"hasMate"
>
<li
[
ngClass
]="{
'
selected
'
:this
.
selectedTwo =
==
options
.
optionId
}"
[
ngClass
]="{
selected:
options
['
selected
']
==
true
}"
*
ngFor=
"let options of this.curPageData['questions'][1]['options']"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
1
],
options
);
changeStyle2
(
options
.
optionId
)"
(
click
)="
getAnswer
(
this
.
curPageData
['
questions
'][
1
],
options
)"
>
{{ options.optionName }}
</li>
...
...
questionnair/src/app/page9/page9.component.ts
View file @
9391fe3e
...
...
@@ -10,17 +10,27 @@ export class Page9Component implements OnInit {
@
Input
()
hasMate
:
boolean
@
Output
()
getAllAnswer
=
new
EventEmitter
<
any
>
()
curAllQues
:
Object
selectedNum
:
number
;
selectedTwo
:
number
;
selectedObj
:
Object
constructor
()
{}
ngOnInit
()
{
this
.
curAllQues
=
{}
console
.
log
(
this
.
curPageData
)
this
.
selectedObj
=
{}
this
.
setOptionSelected
()
}
getAnswer
(
question
,
options
)
{
console
.
log
(
'page9'
,
question
,
options
)
const
questionId
=
question
[
'questionId'
]
console
.
log
(
'select'
,
this
.
selectedObj
,
options
)
if
(
!
this
.
selectedObj
[
questionId
])
{
this
.
selectedObj
[
questionId
]
=
options
options
[
'selected'
]
=
true
}
else
{
if
(
this
.
selectedObj
[
questionId
].
optionId
!=
options
.
optionId
)
{
this
.
selectedObj
[
questionId
][
'selected'
]
=
false
options
[
'selected'
]
=
true
this
.
selectedObj
[
questionId
]
=
options
}
}
this
.
curAllQues
[
questionId
]
=
options
const
questions
=
Object
.
keys
(
this
.
curAllQues
).
map
(
questionId
=>
{
return
{
questionId
,
options
:
this
.
curAllQues
[
questionId
]
}
...
...
@@ -31,10 +41,17 @@ export class Page9Component implements OnInit {
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
optionId
){
this
.
selectedNum
=
optionId
setOptionSelected
()
{
const
questions
=
this
.
curPageData
[
'questions'
]
if
(
!
questions
)
{
return
}
questions
.
map
(
question
=>
{
question
[
'options'
].
forEach
(
option
=>
{
if
(
option
[
'selected'
])
{
this
.
selectedObj
[
question
[
'questionId'
]]
=
option
}
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