Commit 807ed9c8 by Sweet Zhang

暂存

parent adc478ef
......@@ -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;">&lt;</div>
<div
(click)="addPage()"
<div (click)="addPage()"
[ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }"
>下一步</div>
</div>
......
......@@ -27,7 +27,7 @@
*ngFor="let options of curQues.options"
(click)="
closeToast();
getAnswer(curQues['questionId'],options);
getAnswer(options);
changeStyle(options, options.optionId)
"
>
......
......@@ -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--
......
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