Commit c2a98a9d by Chao Sun

多选问题

parent aa5efb33
......@@ -7,17 +7,19 @@ import { Options } from 'selenium-webdriver/chrome'
styleUrls: ['./ask.component.css']
})
export class AskComponent implements OnInit {
allQues: Array<any>
curPage: number
totalPage: number
curQues: string
curPageData: Object
allAnswers: Array<any>
isShowChildAgeBtn: boolean
hasMate: boolean
allQues: Array<any>;
curPage: number;
totalPage: number;
curQues: string;
curPageData: Object;
allAnswers: Array<any>;
isShowChildAgeBtn: boolean;
hasMate: boolean;
//获取省份
provinceList: Array<any>
provinceList: Array<any>;
nextBtn:boolean;
// 暂存问题也信息
questionInfo:any;
constructor(private commonService: CommonService) {}
ngOnInit() {
......@@ -90,6 +92,8 @@ export class AskComponent implements OnInit {
if(this.nextBtn===false){
return;
}
console.log(this.questionInfo)
this.allAnswers[this.curPage] = this.questionInfo;
if (this.curPage < 16) {
//判断当前页是否有答案
if (
......@@ -120,13 +124,23 @@ export class AskComponent implements OnInit {
}
}
getAllAnswer(e) {
this.allAnswers[this.curPage] = e
// console.log(this.allAnswers);
let result=false;
this.questionInfo = e;
console.log(e)
const questions = e.questions;
if(questions.length>0){
for(let i=0;i<questions.length;i++){
let options = questions[i].options;
if(options.length>0){
result = true;
}
}
}
if (this.curPage < 16) {
//判断当前页是否有答案
if (
this.curPage == 0 ||
this.allAnswers[this.curPage] ||
result ||
this.curPage == 5 ||
this.curPage == 9
) {
......
......@@ -107,8 +107,11 @@ export class Page11Component implements OnInit {
// }
// questions[0]['options'].forEach(option => {
// if(option['selected']){
// // this.allOptions[questions] = option
// console.log(this.allOptions)
// console.log(questions)
// this.allOptions = questions[0]['options']
// // console.log(questions[0]['options'])
// // console.log(this.allOptions[question])
// }
// });
}
......
......@@ -16,6 +16,7 @@
<div class="icon">+</div>
<div data-toggle="modal">增加孩子年龄</div>
</div>
<div>{{result}}</div>
<div class="toastWrapper toast" *ngIf="isShow">
<div class="toastContent">
<ul>
......
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