Commit a71b911a by Chao Sun

去掉上一步

parent a4b55950
......@@ -79,7 +79,7 @@
<div>获取家庭分析报告</div>
</div>
<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
(click)="addPage()"
[ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }"
......
......@@ -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 => {
......
<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)"
......
......@@ -27,7 +27,7 @@
*ngFor="let options of curQues.options"
(click)="
closeToast();
getAnswer(curQues['questionId'],options);
getAnswer(options);
changeStyle(options, options.optionId)
"
>
......
......@@ -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--
......
......@@ -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%;
......
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