Commit f20e21c2 by Chao Sun

传参

parent a308ae59
......@@ -23,7 +23,7 @@ export class LiveComponent implements OnInit {
pageAnswers: any;
type: any;
nextBtn: boolean;
lastQuestions: Array<any>;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
......@@ -39,24 +39,55 @@ export class LiveComponent implements OnInit {
}
ngOnInit() {
this.surveyInfo()
this.nextBtn = 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() {
// 获取问题
this.commonService.surveyInfo().then(res => {
if (res['success']) {
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])
}
}
}
setTimeout(()=>{
for(let j=0;j<this.cityList.length;j++){
if(this.cityList[j].cityName == right){
this.selectCity(this.cityList[j])
}
}
},200)
}
}
})
// 获取省份
this.commonService.provinceqry({insurerId: 11}).then(res => {
if (res['success']) {
this.provinceList = res['data'].provinceList;
}
})
}
showToast() {
......@@ -89,7 +120,6 @@ export class LiveComponent implements OnInit {
this.commonService.getCityqry(param).then(res => {
if (res['success']) {
this.cityList = res['data'].cityList;
// console.log(this.cityList)
}
})
}
......@@ -114,17 +144,25 @@ export class LiveComponent implements OnInit {
} else {
this.nextBtn = false;
}
// console.log(this.pageAnswers);
console.log(this.commonService.todos)
}
next() {
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']);
} else {
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