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
807ed9c8
Commit
807ed9c8
authored
May 16, 2019
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂存
parent
adc478ef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
48 deletions
+43
-48
questionnair/src/app/ask/ask.component.html
+9
-10
questionnair/src/app/page3/page3.component.html
+1
-1
questionnair/src/app/page3/page3.component.ts
+33
-37
No files found.
questionnair/src/app/ask/ask.component.html
View file @
807ed9c8
...
...
@@ -48,13 +48,13 @@
*
ngIf=
"curPage == 10"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page11>
<app-page12
[
curPageData
]="
curPageData
"
<app-page12
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 11"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page12>
<app-page13
[
curPageData
]="
curPageData
"
<app-page13
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 12"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page13>
...
...
@@ -63,13 +63,13 @@
*
ngIf=
"curPage == 13"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page14>
<app-page15
[
curPageData
]="
curPageData
"
<app-page15
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 14"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
></app-page15>
<app-page16
[
curPageData
]="
curPageData
"
<app-page16
[
curPageData
]="
curPageData
"
*
ngIf=
"curPage == 15"
(
getAllAnswer
)="
getAllAnswer
($
event
)"
[
provinceList
]
=
"
provinceList
"
...
...
@@ -80,8 +80,7 @@
</div>
<div
class=
"content_footer"
*
ngIf=
"curPage != 0 && curPage!=16"
>
<div
(
click
)="
reducePage
()"
style=
"color: #8a8a8a;"
>
<
</div>
<div
(
click
)="
addPage
()"
<div
(
click
)="
addPage
()"
[
ngStyle
]="{
color:
nextBtn =
=
false
?
'#
8a8a8a
'
:
'#
ec2d37
'
}"
>
下一步
</div>
</div>
...
...
questionnair/src/app/page3/page3.component.html
View file @
807ed9c8
...
...
@@ -27,7 +27,7 @@
*
ngFor=
"let options of curQues.options"
(
click
)="
closeToast
();
getAnswer
(
curQues
['
questionId
'],
options
);
getAnswer
(
options
);
changeStyle
(
options
,
options
.
optionId
)
"
>
...
...
questionnair/src/app/page3/page3.component.ts
View file @
807ed9c8
...
...
@@ -49,19 +49,19 @@ export class Page3Component implements OnInit {
this
.
isShow
=
false
}
//
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: 3,
//
questions
//
}
//
console.log(ret);
//
this.getAllAnswer.emit(ret)
//
}
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
:
3
,
questions
}
console
.
log
(
ret
);
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
options
,
optionId
)
{
//当前选中项
...
...
@@ -105,8 +105,7 @@ export class Page3Component implements OnInit {
this
.
getAllAnswer
.
emit
(
ret
);
}
getAnswer
(
questionId
,
option
)
{
debugger
;
/* getAnswer(questionId, option) {
if (this.curPageData['questions'].length > 0) {
for (let i = 0; i < this.curPageData['questions'].length; i++) {
let oldOption = {};
...
...
@@ -115,29 +114,26 @@ export class Page3Component implements OnInit {
options: []
};
question.questionId = this.curPageData['questions'][i].questionId;
oldOption
=
{
customerInput
:
null
,
optionId
:
this
.
curPageData
[
'questions'
][
i
][
'optionId'
],
optionName
:
this
.
curPageData
[
'questions'
][
i
][
'name'
],
optionOrder
:
2
,
selected
:
true
};
if
(
this
.
curPageData
[
'questions'
][
i
][
'optionId'
])
{
question
.
options
.
push
(
oldOption
);
this
.
questions
.
push
(
question
);
}
for
(
let
j
=
0
;
j
<
this
.
questions
.
length
;
j
++
)
{
if
(
this
.
questions
[
j
].
questionId
==
questionId
)
{
this
.
questions
[
j
].
options
[
0
]
=
option
;
}
else
{
const
questions
=
{
questionId
:
''
,
options
:
[
option
]
};
this
.
questions
.
push
(
questions
);
}
if (questionId == this.curPageData['questions'][i].questionId) {
oldOption = option;
} else {
oldOption = {
customerInput: null,
optionId: this.curPageData['questions'][i]['optionId'],
optionName: this.curPageData['questions'][i]['name'],
optionOrder: 2,
selected: true
};
}
question.options.push(oldOption);
this.questions.push(question);
}
} else {
let curQuestion = {
questionId: questionId,
options: [option]
};
this.questions.push(curQuestion);
}
const ret = {
pageId: 3,
...
...
@@ -145,7 +141,7 @@ export class Page3Component implements OnInit {
}
console.log(ret);
this.getAllAnswer.emit(ret);
}
}
*/
addChild
()
{
// this.addChildCount--
...
...
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