Commit f20e21c2 by Chao Sun

传参

parent a308ae59
...@@ -23,7 +23,7 @@ export class LiveComponent implements OnInit { ...@@ -23,7 +23,7 @@ export class LiveComponent implements OnInit {
pageAnswers: any; pageAnswers: any;
type: any; type: any;
nextBtn: boolean; nextBtn: boolean;
lastQuestions: Array<any>;
constructor(private commonService: CommonService, constructor(private commonService: CommonService,
private router: Router, private router: Router,
private route: ActivatedRoute) { private route: ActivatedRoute) {
...@@ -39,24 +39,55 @@ export class LiveComponent implements OnInit { ...@@ -39,24 +39,55 @@ export class LiveComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.surveyInfo()
this.nextBtn = false; this.nextBtn = false;
this.showAddress = false; this.showAddress = false;
this.lastQuestions = this.commonService.todosCopy.filter(item => item.pageId == 16).pop();
// 获取省份
this.commonService.provinceqry({insurerId: 11}).then(res => {
if (res['success']) {
this.provinceList = res['data'].provinceList;
}
})
setTimeout(()=>{
this.surveyInfo()
},200)
} }
surveyInfo() { surveyInfo() {
// 获取问题 // 获取问题
this.commonService.surveyInfo().then(res => { this.commonService.surveyInfo().then(res => {
if (res['success']) { if (res['success']) {
this.curPageData = res['data']['survey'].pages['15']; this.curPageData = res['data']['survey'].pages['15'];
if(this.lastQuestions){
let customerInput = this.lastQuestions['questions'][0]['options'][0]['customerInput']
customerInput = customerInput.split(',')
const left = customerInput[0]
const right = customerInput[1]
if(this.provinceList.length>0){
for(let i=0;i<this.provinceList.length;i++){
if(this.provinceList[i].provinceName == left) {
// console.log(this.provinceList[i])
this.selectProvince(this.provinceList[i])
} }
}) }
// 获取省份 }
this.commonService.provinceqry({insurerId: 11}).then(res => { setTimeout(()=>{
if (res['success']) { for(let j=0;j<this.cityList.length;j++){
this.provinceList = res['data'].provinceList; if(this.cityList[j].cityName == right){
this.selectCity(this.cityList[j])
}
}
},200)
}
} }
}) })
} }
showToast() { showToast() {
...@@ -89,7 +120,6 @@ export class LiveComponent implements OnInit { ...@@ -89,7 +120,6 @@ export class LiveComponent implements OnInit {
this.commonService.getCityqry(param).then(res => { this.commonService.getCityqry(param).then(res => {
if (res['success']) { if (res['success']) {
this.cityList = res['data'].cityList; this.cityList = res['data'].cityList;
// console.log(this.cityList)
} }
}) })
} }
...@@ -114,17 +144,25 @@ export class LiveComponent implements OnInit { ...@@ -114,17 +144,25 @@ export class LiveComponent implements OnInit {
} else { } else {
this.nextBtn = false; this.nextBtn = false;
} }
// console.log(this.pageAnswers);
console.log(this.commonService.todos)
} }
next() { next() {
if (this.nextBtn == true) { if (this.nextBtn == true) {
console.log(this.commonService.todosCopy) const param = {
survey:{
// customerId:,
// orderId:,
pages:this.commonService.todosCopy
}
}
// this.commonService.saveCustomerAnwers(param).then(res=>{
// })
this.router.navigate(['/transit3']); this.router.navigate(['/transit3']);
} else { } else {
return; return;
} }
} }
// 上一步 // 上一步
......
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