Commit de9334f1 by Sweet Zhang

Merge branch 'master' of 139.224.139.2:Sweet/allCampaign

parents 5394f7dd 70e97be1
......@@ -17,7 +17,7 @@
<div data-toggle="modal">增加孩子年龄</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;">&lt;</div>
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div>
</div>
<div class="toastWrapper toast" *ngIf="isShow" (click)="closeToast()">
......
......@@ -163,4 +163,7 @@ export class AgeComponent implements OnInit {
}
}
before(){
history.go(-1);
}
}
......@@ -13,6 +13,8 @@ export class FamilyComponent implements OnInit {
// 上一次的答案
lastQuestions: Array<any>;
nextBtn: boolean = false;
Obj:Object = {}
targetObj:Object = {}
constructor(private commonService: CommonService, private router: Router) {
this.pageAnswers = {
......@@ -29,6 +31,27 @@ export class FamilyComponent implements OnInit {
this.lastQuestions = this.commonService.todosCopy.filter(item => item.pageId == 2).pop();
this.commonService.surveyInfo().then(res => {
this.curPageData = res['data']['survey']['pages'].filter(item => item.pageId === 2).pop();
console.log(this.lastQuestions)
console.log(this.curPageData)
for (let i = 0; i < this.lastQuestions['questions'].length; i++) {
for (let j = 0; j < this.curPageData['questions'].length; j++) {
if (this.lastQuestions['questions'][i].questionId == this.curPageData['questions'][j].questionId) {
this.lastQuestions['questions'][i]['options'].forEach(option => {
if(Object.keys(option).indexOf('optionId')>-1){
this.targetObj = option
}
// this.curPageData['questions'][j]['options'].forEach(option=>{
// if(Object.keys(option).indexOf('optionId')>-1){
// this.Obj = option
// }
// })
// this.Obj['optionId'] = this.targetObj['optionId']
console.log(this.targetObj)
this.selectedFamily(this.targetObj);
});
}
}
}
// for (let i = 0; i < this.lastQuestions['questions'].length; i++) {
// for (let j = 0; j < this.curPageData['questions'].length; j++) {
// if (this.lastQuestions['questions'][i].questionId == this.curPageData['questions'][j].questionId) {
......@@ -44,6 +67,7 @@ export class FamilyComponent implements OnInit {
// }
// console.log(this.curPageData)
});
}
// 选择家庭结构
......
......@@ -34,6 +34,7 @@ export class LoanComponent implements OnInit {
ngOnInit() {
this.nextBtn = false;
this.surveyInfo();
}
surveyInfo() {
......
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