Commit 9dd56f96 by Chao Sun

页数显示判断

parent 97b9bc59
<div class="layout">
<div class="content">
<div class="questionTitle">{{ this.curPageData?.pageName }}</div>
<div class="questionTitle">
<div class="titleName">{{ curPageData?.pageName }}</div>
<div class="page">2/{{this.totalPage}}</div>
</div>
<ul class="ageContent">
<li *ngFor="let optionsList of this.curPageData?.questions; index as i">
<div>{{ optionsList.questionName }}</div>
......@@ -98,7 +101,7 @@
<!-- &lt; -->
上一步
</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#4242dd' }" (click)="next()"> 下一步</div>
<div class="next" (click)="next()"> 下一步</div>
</div>
<div class="toastWrapper toast" *ngIf="isShow" (click)="closeToast()">
......
......@@ -26,6 +26,7 @@ export class AgeComponent implements OnInit {
disabled: boolean;
value2: number = 25;
marks: any;
totalPage: any;
constructor(private commonService: CommonService, private router: Router, private route: ActivatedRoute) {
/**
* 1:单身贵族
......@@ -35,6 +36,7 @@ export class AgeComponent implements OnInit {
* @type {any}
*/
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.totalChildLimitCount = 2;
this.questionSubId = 0;
this.pageAnswers = {
......@@ -177,6 +179,7 @@ export class AgeComponent implements OnInit {
} else {
this.nextBtn = false;
}
this.totalPage = Number(this.totalPage) + 1;
}
// 根据家庭结构处理展示数据
......@@ -194,7 +197,7 @@ export class AgeComponent implements OnInit {
// 下一步
next() {
if (this.nextBtn) {
this.router.navigate(['/job'], { queryParams: { type: this.type } });
this.router.navigate(['/job'], { queryParams: { type: this.type, totalPage: this.totalPage } });
} else {
return;
}
......
......@@ -2,7 +2,8 @@
<div class="layout">
<div class="content">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<div class="titleName">{{ this.curPageData?.questions[0]['questionName'] }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
<!-- <span style="font-size: 14px;position: relative;top: 3px;color:#ec2d37;">(请在下列7种情况中选择)</span> -->
</div>
<div class="subTitle">(健康状况决定了能不能投保,共7项,可多选)</div>
......
......@@ -24,7 +24,8 @@ export class ChildrenHealthComponent implements OnInit {
childTotalQuestions: Array<any> = [];
nextBtn: boolean = false;
lastQuestions: Array<any>;
curPage: any;
totalPage: any;
constructor(
private commonService: CommonService,
private router: Router,
......@@ -39,6 +40,8 @@ export class ChildrenHealthComponent implements OnInit {
*/
this.type = this.route.snapshot.queryParams["type"];
this.id = this.route.snapshot.params["childId"];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: "",
questions: [
......@@ -179,6 +182,7 @@ export class ChildrenHealthComponent implements OnInit {
// 下一步
next() {
this.curPage = Number(this.curPage) + 1;
const age = this.commonService.todosCopy
.filter(item => item.pageId == 3)
.pop();
......@@ -190,15 +194,13 @@ export class ChildrenHealthComponent implements OnInit {
// 查看有几个孩子,一个直接跳到疾病页,多个跳多个孩子页
if (this.id < parseInt(this.childTotalCount, 0)) {
this.router.navigate(["/children_health", parseInt(this.id, 0) + 1], {
queryParams: {
type: this.type
}
queryParams: { type: this.type, totalPage: this.totalPage, curPage: this.curPage }
});
this.nextBtn = false;
this.surveyInfo();
} else {
this.router.navigate(["/disease"], {
queryParams: { type: this.type }
queryParams: { type: this.type, totalPage: this.totalPage, curPage: this.curPage }
});
}
} else {
......@@ -209,6 +211,7 @@ export class ChildrenHealthComponent implements OnInit {
// 上一步
before() {
this.surveyInfo();
this.curPage = Number(this.curPage) - 1;
this.commonService.before();
}
}
......@@ -2,7 +2,8 @@
<div class="layout">
<div class="content">
<div class="questionTitle hospitalTitle">
{{ this.curPageData?.pageName }}
<div class="titleName">{{ curPageData?.pageName }}</div>
<div class="page" style="margin-top: -7%;">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<ul class="jobContent" style="margin-top: 2.5em;">
<li *ngFor="let options of this.options" [ngClass]="{ selected: options['selected'] == true }"
......
......@@ -15,10 +15,14 @@ export class DiseaseComponent implements OnInit {
options: Array<any>;
questions: Array<any> = [];
lastQuestions: Array<any>;
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: '',
questions: [{
......@@ -158,7 +162,7 @@ export class DiseaseComponent implements OnInit {
next() {
if (this.nextBtn == true) {
this.router.navigate(['/smoke'], { queryParams: { type: this.type } })
this.router.navigate(['/smoke'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } })
} else {
return
}
......
<div class="layout">
<div class="content">
<div class="questionTitle">{{ curPageData?.pageName }}</div>
<div class="questionTitle">
<div class="titleName">{{ curPageData?.pageName }}</div>
<div class="page">1/{{this.totalPage}}</div>
</div>
<ul class="option_item" style="margin-top: 20%;">
<li *ngFor="let options of curPageData?.questions[0]['options']" (click)="selectedFamily(options)">
<div class="imgBox">
......
......@@ -16,7 +16,7 @@ export class FamilyComponent implements OnInit {
lastSelectedOptionId: any;
nextBtn: boolean = false;
targetObj: any = {};
totalPage: any;
constructor(private commonService: CommonService, private router: Router) {
this.pageAnswers = {
......@@ -30,6 +30,8 @@ export class FamilyComponent implements OnInit {
}
ngOnInit() {
//初始化总页数
this.totalPage = 12;
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();
......@@ -59,6 +61,18 @@ export class FamilyComponent implements OnInit {
if (this.lastSelectedOptionId != this.selectedOptionId) {
this.commonService.remove();
}
if (this.selectedOptionId == 1) {
this.totalPage = 10;
}
if (this.selectedOptionId == 2) {
this.totalPage = 12;
}
if (this.selectedOptionId == 3) {
this.totalPage = 11;
}
if (this.selectedOptionId == 4) {
this.totalPage = 13;
}
const options = this.curPageData['questions'][0]['options'];
for (let i = 0; i < options.length; i++) {
if (option['optionId'] == options[i]['optionId']) {
......@@ -82,14 +96,15 @@ export class FamilyComponent implements OnInit {
this.nextBtn = false;
}
if (!isReturn) {
this.next()
this.next();
}
}
// 下一步
next() {
if (this.nextBtn) {
this.router.navigate(['/age'], { queryParams: { type: this.selectedOptionId } });
this.router.navigate(['/age'], { queryParams: { type: this.selectedOptionId, totalPage: this.totalPage } });
} else {
return;
}
......
......@@ -2,7 +2,8 @@
<div class="layout">
<div class="content healthContent">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<div class="titleName">{{ this.curPageData?.questions[0]['questionName'] }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<div class="subTitle">
(健康决定了能不能投保,共16项,可多选)
......
......@@ -20,7 +20,8 @@ export class HealthComponent implements OnInit {
questions: Array<any> = [];
nextBtn: boolean = false;
lastQuestions: Array<any>;
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
......@@ -33,6 +34,8 @@ export class HealthComponent implements OnInit {
*/
this.type = this.route.snapshot.queryParams['type'];
this.id = this.route.snapshot['data']['0']['id'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: '',
questions: [{
......@@ -105,7 +108,6 @@ export class HealthComponent implements OnInit {
// 选择健康情况(多选)
selectedHealth(option, lastFlag, isReturn?: any) {
console.log(option)
if (lastFlag === false) {
option['selected'] = !option['selected'];
}
......@@ -170,27 +172,23 @@ export class HealthComponent implements OnInit {
// 先判断当前页是您的页还是配偶页
if (this.id == 1) {
if (this.type == 2 || this.type == 4) {
this.router.navigate(['/spouse_health'], { queryParams: { type: this.type } });
this.router.navigate(['/spouse_health'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } });
} else if (this.type == 3) {
this.router.navigate(['/children_health', 1], {
queryParams: {
type: this.type
}
queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 }
});
} else if (this.type == 1) {
this.router.navigate(['/disease'], { queryParams: { type: this.type } });
this.router.navigate(['/disease'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } });
}
} else {
if (this.type == 1 || this.type == 2) {
this.router.navigate(['/disease'], { queryParams: { type: this.type } });
this.router.navigate(['/disease'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } });
} else if (this.type == 3 || this.type == 4) {
this.router.navigate(['/children_health', 1], {
queryParams: {
type: this.type
}
queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 }
});
} else {
this.router.navigate(['/disease'], { queryParams: { type: this.type } });
this.router.navigate(['/disease'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } });
}
}
} else {
......
......@@ -3,7 +3,8 @@
<div class="content">
<div class="twoContent">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<div class="titleName">{{ this.curPageData?.questions[0]['questionName'] }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<div class="subTitle">(收入决定了所需保障额度)</div>
<ul class="income">
......
......@@ -14,7 +14,9 @@ export class IncomeComponent implements OnInit {
type: any;
nextBtn: boolean;
lastQuestions: Array<any>;
targetObj: Object = {}
targetObj: Object = {};
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
......@@ -26,6 +28,8 @@ export class IncomeComponent implements OnInit {
* @type {any}
*/
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: '',
questions: [],
......@@ -114,7 +118,7 @@ export class IncomeComponent implements OnInit {
next() {
if (this.nextBtn == true) {
this.router.navigate(['/loan'], { queryParams: { type: this.type } })
this.router.navigate(['/loan'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } })
} else {
return;
}
......
<div class="container">
<div class="layout">
<div class="content">
<div class="questionTitle">{{ this.curPageData?.pageName }}</div>
<div class="questionTitle">
<div class="titleName">{{ curPageData?.pageName }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<div class="subTitle">(职业不同,风险保障侧重不同)</div>
<ul class="jobContent">
<li [ngClass]="{ selected: options['selected'] }" *ngFor="let options of this.curPageData?.questions[0].options"
......
......@@ -14,8 +14,9 @@ export class JobComponent implements OnInit {
id: any;
nextBtn: boolean;
lastQuestions: Array<any>;
targetObj: Object = {}
targetObj: Object = {};
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
......@@ -32,7 +33,14 @@ export class JobComponent implements OnInit {
* @id
* */
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.id = this.route.snapshot['data']['0']['id'];
if (this.id == 1) {
this.curPage = 3;
}
if (this.id == 2) {
this.curPage = 4;
}
this.pageAnswers = {
pageId: '',
questions: [{
......@@ -128,12 +136,12 @@ export class JobComponent implements OnInit {
if (this.nextBtn == true) {
if (this.id == 1) {
if (this.type == 2 || this.type == 4) {
this.router.navigate(['/spouse_job'], { queryParams: { type: this.type } })
this.router.navigate(['/spouse_job'], { queryParams: { type: this.type, totalPage: this.totalPage } })
} else {
this.router.navigate(['/income'], { queryParams: { type: this.type } })
this.router.navigate(['/income'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } })
}
} else {
this.router.navigate(['/income'], { queryParams: { type: this.type } })
this.router.navigate(['/income'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } })
}
} else {
return;
......
......@@ -2,7 +2,8 @@
<div class="layout ">
<div class="content">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<div class="titleName">{{ this.curPageData?.questions[0]['questionName'] }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<ul class="cityContent">
<li *ngFor="let provinces of this.provinceList" [ngClass]="{ selected: provinces['selected'] == true }"
......@@ -30,14 +31,16 @@
</div>
<div class="province" style="position: relative;">
<div>{{ this.provinceName }}</div>
<ul class="city">
<li *ngFor="let city of this.cityList" (click)="closeToast(); selectCity(city);">
{{ city.cityName }}
</li>
</ul>
<div style="text-align: left;border-bottom:2px #5566e9 solid;">{{this.cityName}}</div>
<div style="height: 35px;line-height:35px;border-bottom:1px #e5e5e5 solid;width: 100%;position: absolute;">
</div>
</div>
<ul class="city">
<li [ngClass]="{selected:city.cityName == this.cityName}" *ngFor="let city of this.cityList"
(click)="selectCity(city);">
{{ city.cityName }}
</li>
</ul>
</div>
</div>
<!--提示框-->
......
......@@ -46,11 +46,15 @@ export class LiveComponent implements OnInit {
selfDisease: boolean = false;
spouseDisease: boolean = false;
childrenDisease: boolean = false;
cityName: string;
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: '',
questions: [{
......@@ -109,10 +113,8 @@ export class LiveComponent implements OnInit {
}
}, 300)
}
}
})
}
showToast() {
......@@ -120,16 +122,20 @@ export class LiveComponent implements OnInit {
}
selectProvince(option) {
this.provinceName = option.provinceName;
this.provinceId = option.provinceId;
for (let i = 0; i < this.provinceList.length; i++) {
if (option['provinceId'] == this.provinceList[i]['provinceId']) {
this.provinceList[i]['selected'] = true;
} else {
this.provinceList[i]['selected'] = false;
if (this.provinceName != option.provinceName) {
this.cityName = null;
this.provinceName = option.provinceName;
this.provinceId = option.provinceId;
for (let i = 0; i < this.provinceList.length; i++) {
if (option['provinceId'] == this.provinceList[i]['provinceId']) {
this.provinceList[i]['selected'] = true;
} else {
this.provinceList[i]['selected'] = false;
}
}
this.getCityqry();
}
this.getCityqry();
}
closeToast() {
......@@ -150,6 +156,7 @@ export class LiveComponent implements OnInit {
selectCity(e, isReturn?: any) {
this.showAddress = true;
this.cityName = e.cityName;
this.strAddress = this.provinceName + e.cityName;
this.address = {
customerInput: this.provinceName + ',' + e.cityName,
......
......@@ -2,7 +2,8 @@
<div class="layout">
<div class="content">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<div class="titleName">{{ this.curPageData?.questions[0]['questionName'] }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<div class="subTitle">(负债决定了所需保障额度)</div>
<ul class="income">
......
......@@ -15,7 +15,8 @@ export class LoanComponent implements OnInit {
nextBtn: boolean;
lastQuestions: Array<any>;
targetObj: Object = {}
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
......@@ -27,6 +28,8 @@ export class LoanComponent implements OnInit {
* @type {any}
*/
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: '',
questions: [],
......@@ -104,7 +107,7 @@ export class LoanComponent implements OnInit {
next() {
if (this.nextBtn == true) {
this.router.navigate(['/social'], { queryParams: { type: this.type } })
this.router.navigate(['/social'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } })
} else {
return;
}
......
......@@ -2,7 +2,8 @@
<div class="layout">
<div class="content">
<div class="questionTitle smokeTitle">
{{ this.curPageData?.pageName.substr(0,5) }}
<div class="titleName">{{ curPageData?.pageName.substr(0,5) }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<div class="subTitle">(抽烟大于400支年,支年 = 抽烟支数/每日*烟龄)</div>
<ul class="jobContent">
......
......@@ -15,11 +15,14 @@ export class SmokingComponent implements OnInit {
options: Array<any>;
questions: Array<any> = [];
lastQuestions: Array<any>;
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: '',
questions: [{
......@@ -157,7 +160,7 @@ export class SmokingComponent implements OnInit {
next() {
if (this.nextBtn == true) {
this.router.navigate(['/live'], { queryParams: { type: this.type } })
this.router.navigate(['/live'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } })
} else {
return;
}
......
......@@ -2,7 +2,8 @@
<div class="layout">
<div class="content">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<div class="titleName">{{ this.curPageData?.questions[0]['questionName'] }}</div>
<div class="page">{{this.curPage}}/{{this.totalPage}}</div>
</div>
<div class="subTitle">
(城镇居民和新农合都算)
......
......@@ -14,7 +14,9 @@ export class SocialSecurityComponent implements OnInit {
nextBtn: boolean;
pageAnswers: any;
lastQuestions: Array<any>;
targetObj: Object = {}
targetObj: Object = {};
curPage: any;
totalPage: any;
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
......@@ -26,6 +28,8 @@ export class SocialSecurityComponent implements OnInit {
* @type {any}
*/
this.type = this.route.snapshot.queryParams['type'];
this.totalPage = this.route.snapshot.queryParams['totalPage'];
this.curPage = this.route.snapshot.queryParams['curPage'];
this.pageAnswers = {
pageId: '',
questions: [],
......@@ -112,7 +116,7 @@ export class SocialSecurityComponent implements OnInit {
next() {
if (this.nextBtn == true) {
this.router.navigate(['/health'], { queryParams: { type: this.type } })
this.router.navigate(['/health'], { queryParams: { type: this.type, totalPage: this.totalPage, curPage: Number(this.curPage) + 1 } })
} else {
return;
}
......
......@@ -129,12 +129,22 @@ ol li {
} */
.questionTitle {
color: #4446e2;
font-size: 24px;
font-size: 20px;
height: 50px;
line-height: 60px;
width: 100%;
display: flex;
padding-left: 10px;
padding: 0 10px;
justify-content: space-between;
align-items: center;
}
.questionTitle .page{
width: 65px;
height: 28px;
line-height:28px;
background: #5566e9;
color: #fff;
text-align: center;
}
.subTitle{
color: #999999;
......@@ -161,7 +171,7 @@ ol li {
width: 100%;
position: fixed;
bottom: 0;
background-color: #f6f6f6;
background-color: #f8f8ff;
min-width: 320px;
max-width: 640px;
margin: 0 auto;
......@@ -221,7 +231,7 @@ ol li {
align-items: center;
padding: 0 3%;
font-size: 14px;
background: #f2f1f1;
background: #f4f4f4;
}
......@@ -235,7 +245,7 @@ ol li {
box-sizing: border-box;
padding-left: 5%;
font-size: 14px;
background: #f2f1f1;
background: #f4f4f4;
}
.jobContent li.selected,
......@@ -351,13 +361,14 @@ ol li {
}
.toastContent .province div {
width: 45%;
font-size: 16px;
text-align: center;
height: 35px;
line-height: 35px;
}
.toastContent .province div:nth-child(1){
width: 40%;
}
/* .toastContent .province span.selected{
border-bottom:2px solid #ff0000;
} */
......@@ -384,9 +395,11 @@ ol li {
.toastContent ul.city {
margin: 0;
margin-left: 40%;
overflow: scroll;
max-height: 250px;
/* max-height: 250px; */
-webkit-overflow-scrolling: touch;
max-height: 80%;
}
.toastContent ul.city li {
......@@ -399,7 +412,9 @@ ol li {
text-align: left;
font-size: 16px;
}
.toastContent ul.city li.selected{
color: #5566e9;
}
.address {
width: 80%;
margin: 2% auto;
......
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