Commit 9901c22c by Sweet Zhang

解决冲突

parents 09cb8c21 4abe372f
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<div>获取家庭分析报告</div> <div>获取家庭分析报告</div>
</div> </div>
<div class="content_footer" *ngIf="curPage != 0 && curPage!=16"> <div class="content_footer" *ngIf="curPage != 0 && curPage!=16">
<div (click)="reducePage()">&lt;</div> <div (click)="reducePage()" style="color: #8a8a8a;">&lt;</div>
<div <div
(click)="addPage()" (click)="addPage()"
[ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }"
......
...@@ -46,7 +46,10 @@ export class AskComponent implements OnInit { ...@@ -46,7 +46,10 @@ export class AskComponent implements OnInit {
}) })
} }
reducePage() { reducePage() {
// console.log('start', this.curPage) if(this.questionInfo){
this.allAnswers[this.curPage] = this.questionInfo;
this.questionInfo = null
}
if (this.curPage > 0) { if (this.curPage > 0) {
const page2Answer = this.allAnswers[1] const page2Answer = this.allAnswers[1]
if(page2Answer){ if(page2Answer){
...@@ -85,6 +88,24 @@ export class AskComponent implements OnInit { ...@@ -85,6 +88,24 @@ export class AskComponent implements OnInit {
} else { } else {
return 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() { filterItems() {
return this.allAnswers.filter(item => { return this.allAnswers.filter(item => {
...@@ -97,7 +118,7 @@ export class AskComponent implements OnInit { ...@@ -97,7 +118,7 @@ export class AskComponent implements OnInit {
} }
if(this.questionInfo){ if(this.questionInfo){
this.allAnswers[this.curPage] = this.questionInfo; this.allAnswers[this.curPage] = this.questionInfo;
this.questionInfo = null; this.questionInfo = null
} }
if (this.curPage < 16) { if (this.curPage < 16) {
//判断当前页是否有答案 //判断当前页是否有答案
...@@ -109,7 +130,6 @@ export class AskComponent implements OnInit { ...@@ -109,7 +130,6 @@ export class AskComponent implements OnInit {
) { ) {
this.curPage++ this.curPage++
this.setCurPageData() this.setCurPageData()
} }
} else { } else {
this.curPage = 0 this.curPage = 0
...@@ -123,7 +143,7 @@ export class AskComponent implements OnInit { ...@@ -123,7 +143,7 @@ export class AskComponent implements OnInit {
pages: this.filterItems() pages: this.filterItems()
} }
} }
console.log(answerParam)
if (this.curPage == 16) { if (this.curPage == 16) {
this.commonService.saveCustomerAnwers(answerParam).then(res => { this.commonService.saveCustomerAnwers(answerParam).then(res => {
// console.log(res) // console.log(res)
...@@ -132,7 +152,6 @@ export class AskComponent implements OnInit { ...@@ -132,7 +152,6 @@ export class AskComponent implements OnInit {
} }
getAllAnswer(e) { getAllAnswer(e) {
this.questionInfo = e; this.questionInfo = e;
console.log(e)
if(this.curPage == 6 || this.curPage == 8){ if(this.curPage == 6 || this.curPage == 8){
const page2Answer = this.allAnswers[1] const page2Answer = this.allAnswers[1]
const optionId = page2Answer.questions[0].options[0].optionId const optionId = page2Answer.questions[0].options[0].optionId
...@@ -148,7 +167,6 @@ export class AskComponent implements OnInit { ...@@ -148,7 +167,6 @@ export class AskComponent implements OnInit {
} }
setCurPageData() { setCurPageData() {
const thePateData = this.allQues[this.curPage] const thePateData = this.allQues[this.curPage]
this.curPageData = thePateData this.curPageData = thePateData
const page2Answer = this.allAnswers[1] const page2Answer = this.allAnswers[1]
if (this.curPage == 2) { if (this.curPage == 2) {
......
...@@ -57,7 +57,7 @@ export class Page3Component implements OnInit { ...@@ -57,7 +57,7 @@ export class Page3Component implements OnInit {
//当前选中项 //当前选中项
this.curPageData['questions'][this.curQuesIndex]['name'] = this.curPageData['questions'][this.curQuesIndex]['name'] =
options.optionName options.optionName
this.selectedNum = optionId
} }
addChild() { addChild() {
......
...@@ -45,7 +45,17 @@ export class Page4Component implements OnInit { ...@@ -45,7 +45,17 @@ export class Page4Component implements OnInit {
} }
options.forEach(option => { options.forEach(option => {
if (option['selected']) { 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 { ...@@ -44,7 +44,17 @@ export class Page5Component implements OnInit {
} }
options.forEach(option => { options.forEach(option => {
if (option['selected']) { 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 { ...@@ -53,6 +53,7 @@ export class Page7Component implements OnInit {
if (option['selected']) { if (option['selected']) {
// console.log(this.selectedObj) // console.log(this.selectedObj)
this.selectedObj[question['questionId']] = option this.selectedObj[question['questionId']] = option
} }
}) })
}) })
......
...@@ -95,7 +95,7 @@ ul li,ol li{ ...@@ -95,7 +95,7 @@ ul li,ol li{
.content_footer div{ .content_footer div{
text-align: center; text-align: center;
color: #ec2d37; color: #ec2d37;
font-size: 26px; font-size: 20px;
height: 60px; height: 60px;
line-height: 60px; line-height: 60px;
font-weight: bold; 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