Commit 4abe372f by Chao Sun

回返键问题

parent 66649675
......@@ -79,7 +79,7 @@
<div>获取家庭分析报告</div>
</div>
<div class="content_footer" *ngIf="curPage != 0 && curPage!=16">
<div (click)="reducePage()">&lt;</div>
<div (click)="reducePage()" style="color: #8a8a8a;">&lt;</div>
<div
(click)="addPage()"
[ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }"
......
......@@ -46,7 +46,10 @@ export class AskComponent implements OnInit {
})
}
reducePage() {
// console.log('start', this.curPage)
if(this.questionInfo){
this.allAnswers[this.curPage] = this.questionInfo;
this.questionInfo = null
}
if (this.curPage > 0) {
const page2Answer = this.allAnswers[1]
if(page2Answer){
......@@ -85,6 +88,24 @@ export class AskComponent implements OnInit {
} else {
return
}
// if(this.curPage == 6 || this.curPage == 8){
// const page2Answer = this.allAnswers[1]
// const optionId = page2Answer.questions[0].options[0].optionId
// if(optionId==1 || optionId==3){
// if(this.questionInfo['questions'].length>0){
// this.nextBtn = true
// }
// }
// }
// if(this.curPageData['questions'].length == this.questionInfo['questions'].length){
// this.nextBtn = true
// }
console.log(this.questionInfo)
// if(){
// }
}
filterItems() {
return this.allAnswers.filter(item => {
......@@ -146,7 +167,6 @@ export class AskComponent implements OnInit {
}
setCurPageData() {
const thePateData = this.allQues[this.curPage]
this.curPageData = thePateData
const page2Answer = this.allAnswers[1]
if (this.curPage == 2) {
......
......@@ -50,7 +50,17 @@ export class Page2Component implements OnInit {
}
options.forEach(option => {
if (option['selected']) {
this.selectedObj = option
this.selectedObj = option;
const ret = {
pageId: this.curPageData['pageId'],
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
options: [this.selectedObj]
}
]
}
this.getAllAnswer.emit(ret);
}
})
}
......
......@@ -57,7 +57,7 @@ export class Page3Component implements OnInit {
//当前选中项
this.curPageData['questions'][this.curQuesIndex]['name'] =
options.optionName
this.selectedNum = optionId
}
addChild() {
......
......@@ -45,7 +45,17 @@ export class Page4Component implements OnInit {
}
options.forEach(option => {
if (option['selected']) {
this.selectedObj = option
this.selectedObj = option;
const ret = {
pageId: this.curPageData['pageId'],
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
options: [this.selectedObj]
}
]
}
this.getAllAnswer.emit(ret);
}
})
}
......
......@@ -44,7 +44,17 @@ export class Page5Component implements OnInit {
}
options.forEach(option => {
if (option['selected']) {
this.selectedObj = option
this.selectedObj = option;
const ret = {
pageId: this.curPageData['pageId'],
questions: [
{
questionId: this.curPageData['questions'][0].questionId,
options: [this.selectedObj]
}
]
}
this.getAllAnswer.emit(ret);
}
})
}
......
......@@ -53,6 +53,7 @@ export class Page7Component implements OnInit {
if (option['selected']) {
// console.log(this.selectedObj)
this.selectedObj[question['questionId']] = option
}
})
})
......
......@@ -95,7 +95,7 @@ ul li,ol li{
.content_footer div{
text-align: center;
color: #ec2d37;
font-size: 26px;
font-size: 20px;
height: 60px;
line-height: 60px;
font-weight: bold;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment