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
a71b911a
Commit
a71b911a
authored
May 16, 2019
by
Chao Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉上一步
parent
a4b55950
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
95 deletions
+49
-95
questionnair/src/app/ask/ask.component.html
+1
-1
questionnair/src/app/ask/ask.component.ts
+0
-1
questionnair/src/app/page2/page2.component.html
+1
-1
questionnair/src/app/page3/page3.component.html
+1
-1
questionnair/src/app/page3/page3.component.ts
+43
-89
questionnair/src/styles.css
+3
-2
No files found.
questionnair/src/app/ask/ask.component.html
View file @
a71b911a
...
...
@@ -79,7 +79,7 @@
<div>
获取家庭分析报告
</div>
</div>
<div
class=
"content_footer"
*
ngIf=
"curPage != 0 && curPage!=16"
>
<
div
(
click
)="
reducePage
()"
style=
"color: #8a8a8a;"
>
<
</div
>
<
!-- <div (click)="reducePage()" style="color: #8a8a8a;"><</div> --
>
<div
(
click
)="
addPage
()"
[
ngStyle
]="{
color:
nextBtn =
=
false
?
'#
8a8a8a
'
:
'#
ec2d37
'
}"
...
...
questionnair/src/app/ask/ask.component.ts
View file @
a71b911a
...
...
@@ -121,7 +121,6 @@ export class AskComponent implements OnInit {
pages
:
this
.
filterItems
()
}
}
console
.
log
(
answerParam
)
if
(
this
.
curPage
==
16
)
{
this
.
commonService
.
saveCustomerAnwers
(
answerParam
).
then
(
res
=>
{
...
...
questionnair/src/app/page2/page2.component.html
View file @
a71b911a
<div
class=
"layout"
>
<div
class=
"content"
>
<div
class=
"questionTitle"
>
{{ this.curPageData['pageName'] }}
</div>
<ul
class=
"option_item"
>
<ul
class=
"option_item"
style=
"margin-top: 20%;"
>
<li
*
ngFor=
"let options of this.curPageData['questions'][0]['options']"
(
click
)="
getAnswer
(
options
)"
...
...
questionnair/src/app/page3/page3.component.html
View file @
a71b911a
...
...
@@ -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 @
a71b911a
...
...
@@ -22,7 +22,7 @@ export class Page3Component implements OnInit {
addChildCount
:
number
curQuestionSelecte
:
string
;
questions
:
Array
<
any
>
;
selectedObj
:
Object
;
constructor
()
{
this
.
questions
=
[];
}
...
...
@@ -34,14 +34,12 @@ export class Page3Component implements OnInit {
//初始化增加孩子按钮可以点2次
this
.
addChildCount
=
2
;
// console.log(this.curPageData)
this
.
selectedOptions
();
}
showToast
(
question
,
idx
)
{
this
.
isShow
=
true
this
.
curQues
=
question
this
.
curQuesIndex
=
idx
// console.log(question)
this
.
curQuestionSelecte
=
question
.
name
}
...
...
@@ -50,19 +48,18 @@ 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
}
this
.
getAllAnswer
.
emit
(
ret
)
}
changeStyle
(
options
,
optionId
)
{
//当前选中项
...
...
@@ -74,80 +71,37 @@ export class Page3Component implements OnInit {
}
// 保存用户选择的信息
selectedOptions
()
{
if
(
this
.
curPageData
[
'questions'
].
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
curPageData
[
'questions'
].
length
;
i
++
)
{
if
(
!
this
.
curPageData
[
'questions'
][
i
][
'name'
])
{
return
;
}
let
option
=
{};
let
question
=
{
questionId
:
''
,
options
:
[]
};
question
.
questionId
=
this
.
curPageData
[
'questions'
][
i
].
questionId
;
option
=
{
customerInput
:
null
,
optionId
:
this
.
curPageData
[
'questions'
][
i
][
'optionId'
],
optionName
:
this
.
curPageData
[
'questions'
][
i
][
'name'
],
optionOrder
:
2
,
selected
:
true
};
question
.
options
.
push
(
option
);
this
.
questions
.
push
(
question
);
}
}
const
ret
=
{
pageId
:
3
,
questions
:
this
.
questions
}
console
.
log
(
ret
);
this
.
getAllAnswer
.
emit
(
ret
);
}
getAnswer
(
questionId
,
option
)
{
debugger
;
if
(
this
.
curPageData
[
'questions'
].
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
curPageData
[
'questions'
].
length
;
i
++
)
{
let
oldOption
=
{};
let
question
=
{
questionId
:
''
,
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
);
}
}
}
}
const
ret
=
{
pageId
:
3
,
questions
:
this
.
questions
}
console
.
log
(
ret
);
this
.
getAllAnswer
.
emit
(
ret
);
}
// selectedOptions() {
// if (this.curPageData['questions'].length > 0) {
// for (let i = 0; i < this.curPageData['questions'].length; i++) {
// if (!this.curPageData['questions'][i]['name']) {
// return;
// }
// let option = {};
// let question = {
// questionId: '',
// options: []
// };
// question.questionId = this.curPageData['questions'][i].questionId;
// option = {
// customerInput: null,
// optionId: this.curPageData['questions'][i]['optionId'],
// optionName: this.curPageData['questions'][i]['name'],
// optionOrder: 2,
// selected: true
// };
// question.options.push(option);
// this.questions.push(question);
// }
// }
// const ret = {
// pageId: 3,
// questions: this.questions
// }
// console.log(ret);
// this.getAllAnswer.emit(ret);
// }
addChild
()
{
// this.addChildCount--
...
...
questionnair/src/styles.css
View file @
a71b911a
...
...
@@ -104,8 +104,9 @@ ul li,ol li{
color
:
#8a8a8a
;
}
.content_footer
div
:nth-child
(
1
)
{
flex
:
0
0
15%
;
font-size
:
30px
;
font-size
:
20px
;
width
:
40%
;
margin
:
0
auto
;
}
.content_footer
div
:nth-child
(
2
)
{
flex
:
0
0
60%
;
...
...
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