Commit 807ed9c8 by Sweet Zhang

暂存

parent adc478ef
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
*ngIf="curPage == 10" *ngIf="curPage == 10"
(getAllAnswer)="getAllAnswer($event)" (getAllAnswer)="getAllAnswer($event)"
></app-page11> ></app-page11>
<app-page12 <app-page12
[curPageData]="curPageData" [curPageData]="curPageData"
*ngIf="curPage == 11" *ngIf="curPage == 11"
(getAllAnswer)="getAllAnswer($event)" (getAllAnswer)="getAllAnswer($event)"
></app-page12> ></app-page12>
<app-page13 <app-page13
[curPageData]="curPageData" [curPageData]="curPageData"
*ngIf="curPage == 12" *ngIf="curPage == 12"
(getAllAnswer)="getAllAnswer($event)" (getAllAnswer)="getAllAnswer($event)"
></app-page13> ></app-page13>
...@@ -63,13 +63,13 @@ ...@@ -63,13 +63,13 @@
*ngIf="curPage == 13" *ngIf="curPage == 13"
(getAllAnswer)="getAllAnswer($event)" (getAllAnswer)="getAllAnswer($event)"
></app-page14> ></app-page14>
<app-page15 <app-page15
[curPageData]="curPageData" [curPageData]="curPageData"
*ngIf="curPage == 14" *ngIf="curPage == 14"
(getAllAnswer)="getAllAnswer($event)" (getAllAnswer)="getAllAnswer($event)"
></app-page15> ></app-page15>
<app-page16 <app-page16
[curPageData]="curPageData" [curPageData]="curPageData"
*ngIf="curPage == 15" *ngIf="curPage == 15"
(getAllAnswer)="getAllAnswer($event)" (getAllAnswer)="getAllAnswer($event)"
[provinceList] = "provinceList" [provinceList] = "provinceList"
...@@ -80,8 +80,7 @@ ...@@ -80,8 +80,7 @@
</div> </div>
<div class="content_footer" *ngIf="curPage != 0 && curPage!=16"> <div class="content_footer" *ngIf="curPage != 0 && curPage!=16">
<div (click)="reducePage()" style="color: #8a8a8a;">&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' }"
>下一步</div> >下一步</div>
</div> </div>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*ngFor="let options of curQues.options" *ngFor="let options of curQues.options"
(click)=" (click)="
closeToast(); closeToast();
getAnswer(curQues['questionId'],options); getAnswer(options);
changeStyle(options, options.optionId) changeStyle(options, options.optionId)
" "
> >
......
...@@ -49,19 +49,19 @@ export class Page3Component implements OnInit { ...@@ -49,19 +49,19 @@ export class Page3Component implements OnInit {
this.isShow = false this.isShow = false
} }
// getAnswer(option) { getAnswer(option) {
// const questionId = this.curQues['questionId'] const questionId = this.curQues['questionId']
// this.curAllQues[questionId] = option this.curAllQues[questionId] = option
// const questions = Object.keys(this.curAllQues).map(questionId => { const questions = Object.keys(this.curAllQues).map(questionId => {
// return {questionId, options: [this.curAllQues[questionId]]} return {questionId, options: [this.curAllQues[questionId]]}
// }) })
// const ret = { const ret = {
// pageId: 3, pageId: 3,
// questions questions
// } }
// console.log(ret); console.log(ret);
// this.getAllAnswer.emit(ret) this.getAllAnswer.emit(ret)
// } }
changeStyle(options, optionId) { changeStyle(options, optionId) {
//当前选中项 //当前选中项
...@@ -105,8 +105,7 @@ export class Page3Component implements OnInit { ...@@ -105,8 +105,7 @@ export class Page3Component implements OnInit {
this.getAllAnswer.emit(ret); this.getAllAnswer.emit(ret);
} }
getAnswer(questionId, option) { /* getAnswer(questionId, option) {
debugger;
if (this.curPageData['questions'].length > 0) { if (this.curPageData['questions'].length > 0) {
for (let i = 0; i < this.curPageData['questions'].length; i++) { for (let i = 0; i < this.curPageData['questions'].length; i++) {
let oldOption = {}; let oldOption = {};
...@@ -115,29 +114,26 @@ export class Page3Component implements OnInit { ...@@ -115,29 +114,26 @@ export class Page3Component implements OnInit {
options: [] options: []
}; };
question.questionId = this.curPageData['questions'][i].questionId; question.questionId = this.curPageData['questions'][i].questionId;
oldOption = { if (questionId == this.curPageData['questions'][i].questionId) {
customerInput: null, oldOption = option;
optionId: this.curPageData['questions'][i]['optionId'], } else {
optionName: this.curPageData['questions'][i]['name'], oldOption = {
optionOrder: 2, customerInput: null,
selected: true optionId: this.curPageData['questions'][i]['optionId'],
}; optionName: this.curPageData['questions'][i]['name'],
if (this.curPageData['questions'][i]['optionId']) { optionOrder: 2,
question.options.push(oldOption); selected: true
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);
}
} }
question.options.push(oldOption);
this.questions.push(question);
} }
} else {
let curQuestion = {
questionId: questionId,
options: [option]
};
this.questions.push(curQuestion);
} }
const ret = { const ret = {
pageId: 3, pageId: 3,
...@@ -145,7 +141,7 @@ export class Page3Component implements OnInit { ...@@ -145,7 +141,7 @@ export class Page3Component implements OnInit {
} }
console.log(ret); console.log(ret);
this.getAllAnswer.emit(ret); this.getAllAnswer.emit(ret);
} }*/
addChild() { addChild() {
// this.addChildCount-- // 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