Commit 97b9bc59 by Chao Sun

下一页跳转逻辑修

parent c600e886
......@@ -4,7 +4,9 @@
"scripts": {
"ng": "ng",
"start": "ng serve --port 4204",
"build": "ng build -c=dev --prod",
"buildDev": "ng build -c=dev",
"buildStage": "ng build -c=stage",
"buildProd": "ng build -c=prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
......@@ -47,4 +49,4 @@
"tslint": "~5.11.0",
"typescript": "~3.9.7"
}
}
}
\ No newline at end of file
......@@ -54,7 +54,7 @@
width: 1px;
background: #5566e9;
z-index: 1;
top:66%;
top:82%;
}
#dot span{
width: 8px;
......
......@@ -15,86 +15,90 @@
<div class="icon">+</div>
<div data-toggle="modal">增加孩子年龄</div>
</div>
</div>
<div class="ageWrapper">
<div id="dot" [ngStyle]="{'left': (value2-20)/60*100 + '%'}">
<span></span>
</div>
<input style="position: absolute; opacity: 0; left: 0;width: '100%';top: 58%;z-index: 2; " type="range"
[(ngModel)]="value2" (ngModelChange)="selectAge($event)" min="20" max="80" step="1" />
<div class="ageWrapper">
<div id="dot" [ngStyle]="{'left': (value2-20)/60*100 + '%'}">
<span></span>
</div>
<input style="height:35px;position: absolute; opacity: 0; left: 0;width: '100%';top: 58%;z-index: 2; "
type="range" [(ngModel)]="value2" (ngModelChange)="selectAge($event)" min="20" max="80" step="1" />
<h2 style="text-align: center;">{{value2}}</h2>
<!-- <div style="text-align: center;font-size: 36px;color:#5566e9;">{{value2}}</div>
<nz-slider [(ngModel)]="value2" [nzDisabled]="disabled" [nzMin]='20' [nzMax]="80" [nzTipFormatter]="null"
(ngModelChange)="selectAge($event)">
</nz-slider> -->
<ul class="age">
<li><span>20</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>30</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>40</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>50</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>60</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>70</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>80</span></li>
</ul>
<h2 style="text-align: center;">{{value2}}</h2>
<!-- <div style="text-align: center;font-size: 36px;color:#5566e9;">{{value2}}</div>
<nz-slider [(ngModel)]="value2" [nzDisabled]="disabled" [nzMin]='20' [nzMax]="80" [nzTipFormatter]="null"
(ngModelChange)="selectAge($event)">
</nz-slider> -->
<ul class="age">
<li><span>20</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>30</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>40</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>50</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>60</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>70</span></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li><span>80</span></li>
</ul>
</div>
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div>
<div style="color: #4242dd;" (click)="before()">
<!-- &lt; -->
上一步
</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#4242dd' }" (click)="next()"> 下一步</div>
</div>
<div class="toastWrapper toast" *ngIf="isShow" (click)="closeToast()">
......
......@@ -30,7 +30,7 @@ import { NZ_I18N } from 'ng-zorro-antd/i18n';
import { zh_CN } from 'ng-zorro-antd/i18n';
import zh from '@angular/common/locales/zh'
import { NzSliderModule } from 'ng-zorro-antd/slider';
import { NzIconModule } from 'ng-zorro-antd/icon';
registerLocaleData(zh);
@NgModule({
......@@ -59,7 +59,8 @@ registerLocaleData(zh);
AppRoutingModule,
HttpClientModule,
BrowserAnimationsModule,
NzSliderModule
NzSliderModule,
NzIconModule
],
providers: [CommonService, LocalStorage, { provide: LocationStrategy, useClass: HashLocationStrategy }, { provide: NZ_I18N, useValue: zh_CN }],
bootstrap: [AppComponent]
......
......@@ -3,10 +3,12 @@
<div class="content">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<span style="font-size: 14px;position: relative;top: 3px;color:#ec2d37;">(请在下列7种情况中选择)</span>
<!-- <span style="font-size: 14px;position: relative;top: 3px;color:#ec2d37;">(请在下列7种情况中选择)</span> -->
</div>
<ul class="jobContent">
<li class="selected" *ngFor="let options of this.curPageData?.questions[0]['options']"
<div class="subTitle">(健康状况决定了能不能投保,共7项,可多选)</div>
<ul class="jobContent" style="display: flex;flex-wrap: wrap;">
<li class="selected" style="width: 48%;margin-left:1%;margin-right: 1%;justify-content: center;"
*ngFor="let options of this.curPageData?.questions[0]['options']"
[ngClass]="{ selected: options['selected'] == true }" (click)="selectedHealth(options,false)">
{{ options.optionName }}
</li>
......@@ -14,7 +16,7 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div>
<div style="color: #4242dd;" (click)="before()">上一步</div>
<div class="next" (click)="next()"> 下一步</div>
</div>
</div>
\ No newline at end of file
......@@ -58,7 +58,7 @@ export class ChildrenHealthComponent implements OnInit {
}
// 选择健康情况(多选)
selectedHealth(option, lastFlag) {
selectedHealth(option, lastFlag, isReturn?: any) {
if (lastFlag === false) {
option["selected"] = !option["selected"];
}
......@@ -91,6 +91,11 @@ export class ChildrenHealthComponent implements OnInit {
this.nextBtn = false;
}
this.commonService.addAnswer(this.pageAnswers);
if (!isReturn) {
if (option.optionId == 99) {
this.next();
}
}
}
// 获取所有用户选择的健康选项
......@@ -159,7 +164,7 @@ export class ChildrenHealthComponent implements OnInit {
}
}
);
this.selectedHealth(targetObj, true);
this.selectedHealth(targetObj, true, 'isReturn');
}
}
);
......
......@@ -4,7 +4,7 @@
<div class="questionTitle hospitalTitle">
{{ this.curPageData?.pageName }}
</div>
<ul class="jobContent">
<ul class="jobContent" style="margin-top: 2.5em;">
<li *ngFor="let options of this.options" [ngClass]="{ selected: options['selected'] == true }"
(click)="checkFun(options,false)">
{{ options.optionName }}
......@@ -13,7 +13,7 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div>
<div style="color: #4242dd;" (click)="before()">上一步</div>
<div class="next" (click)="next()"> 下一步 </div>
</div>
</div>
\ No newline at end of file
......@@ -56,9 +56,9 @@ export class DiseaseComponent implements OnInit {
}
});
if (this.type == 1) {
this.getOneAnswer(targetObj)
this.getOneAnswer(targetObj, 'isReturn')
} else {
this.getManyAnswer(targetObj, true)
this.getManyAnswer(targetObj, true, 'isReturn')
}
}
});
......@@ -70,7 +70,7 @@ export class DiseaseComponent implements OnInit {
})
}
getOneAnswer(option) {
getOneAnswer(option, isReturn?: any) {
for (let i = 0; i < this.options.length; i++) {
if (option['optionId'] == this.options[i]['optionId']) {
this.options[i]['selected'] = true;
......@@ -96,9 +96,12 @@ export class DiseaseComponent implements OnInit {
} else {
this.nextBtn = false;
}
if (!isReturn) {
this.next();
}
}
getManyAnswer(option, lastFlag) {
getManyAnswer(option, lastFlag, isReturn?: any) {
if (lastFlag === false) {
option['selected'] = !option['selected'];
}
......@@ -137,12 +140,17 @@ export class DiseaseComponent implements OnInit {
this.nextBtn = false;
}
this.commonService.addAnswer(this.pageAnswers);
if (!isReturn) {
if (option.optionId == 111) {
this.next();
}
}
}
// 根据type区分单选多选
checkFun(option) {
if (this.type == 1) {
this.getOneAnswer(option)
this.getOneAnswer(option);
} else {
this.getManyAnswer(option, false)
}
......
......@@ -9,7 +9,7 @@
align-items: center;
justify-content: center;
flex: 0 0 50%;
margin-bottom: 20%;
margin-bottom: 23%;
}
.option_item li .imgBox {
......
......@@ -4,16 +4,18 @@
<ul class="option_item" style="margin-top: 20%;">
<li *ngFor="let options of curPageData?.questions[0]['options']" (click)="selectedFamily(options)">
<div class="imgBox">
<img [ngClass]="{ selected: options['selected'] }"
src="assets/images/icon{{ options.optionId }}.png"
alt="{{ options.optionName }}"/>
<img [ngClass]="{ selected: options['selected'] }" src="assets/images/icon{{ options.optionId }}.png"
alt="{{ options.optionName }}" />
</div>
<span>{{ options.optionName }}</span>
</li>
</ul>
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div>
</div>
<div style="color: #4242dd;width: 100%;" (click)="before()">
上一步
</div>
<!-- <div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div> -->
</div>
\ No newline at end of file
......@@ -42,7 +42,7 @@ export class FamilyComponent implements OnInit {
if (Object.keys(option).indexOf('optionId') > -1) {
this.targetObj = option;
}
this.selectedFamily(this.targetObj);
this.selectedFamily(this.targetObj, 'isReturn');
});
}
}
......@@ -53,7 +53,7 @@ export class FamilyComponent implements OnInit {
}
// 选择家庭结构
selectedFamily(option) {
selectedFamily(option, isReturn?: any) {
this.selectedOptionId = option.optionId;
// 如果选择的跟上一次的家庭结构不一样,那么将以前的答案清空
if (this.lastSelectedOptionId != this.selectedOptionId) {
......@@ -81,6 +81,9 @@ export class FamilyComponent implements OnInit {
} else {
this.nextBtn = false;
}
if (!isReturn) {
this.next()
}
}
// 下一步
......
<div class="container">
<div class="layout">
<div class="content healthContent" style="min-height: 300px;">
<div class="content healthContent">
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
<span style="font-size: 14px;position: relative;top: 3px;color:#ec2d37;">(请在下列16种情况中选择)</span>
</div>
<div class="subTitle">
(健康决定了能不能投保,共16项,可多选)
</div>
<ul class="jobContent">
<li *ngFor="let options of this.curPageData?.questions[0]['options']"
......@@ -14,7 +16,9 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div>
<div style="color: #4242dd;" (click)="before()">上一步</div>
<!-- <div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步</div> -->
<div class="next" (click)="next()"> 下一步</div>
</div>
</div>
\ No newline at end of file
......@@ -49,7 +49,6 @@ export class HealthComponent implements OnInit {
} else {
this.lastQuestions = this.commonService.todosCopy.filter(item => item.pageId == 12).pop();
}
this.surveyInfo();
}
......@@ -70,14 +69,13 @@ export class HealthComponent implements OnInit {
this.curPageData['questions'][j]['options'][this.curPageData['questions'][j]['options'].indexOf(option)] = targetObj;
}
});
this.selectedHealth(targetObj, true);
this.selectedHealth(targetObj, true, 'isReturn');
}
});
}
}
}
}
} else {
this.curPageData = res['data'].survey.pages['11'];
if (this.lastQuestions) {
......@@ -92,7 +90,7 @@ export class HealthComponent implements OnInit {
this.curPageData['questions'][j]['options'][this.curPageData['questions'][j]['options'].indexOf(option)] = targetObj;
}
});
this.selectedHealth(targetObj, true);
this.selectedHealth(targetObj, true, 'isReturn');
}
});
}
......@@ -106,7 +104,8 @@ export class HealthComponent implements OnInit {
}
// 选择健康情况(多选)
selectedHealth(option, lastFlag) {
selectedHealth(option, lastFlag, isReturn?: any) {
console.log(option)
if (lastFlag === false) {
option['selected'] = !option['selected'];
}
......@@ -134,6 +133,14 @@ export class HealthComponent implements OnInit {
} else {
this.nextBtn = false;
}
if (!isReturn) {
if (this.id == 1 && option.optionId == 67) {
this.next();
}
if (this.id == 2 && option.optionId == 83) {
this.next();
}
}
}
// 获取所有用户选择的健康选项
......
......@@ -5,6 +5,7 @@
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
</div>
<div class="subTitle">(收入决定了所需保障额度)</div>
<ul class="income">
<li [ngClass]="{ selected: options['selected'] }"
*ngFor="let options of this.curPageData?.questions[0].options"
......@@ -26,7 +27,7 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div>
<div style="color: #4242dd;width: 100%;" (click)="before()">上一步</div>
<!-- <div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div> -->
</div>
</div>
\ No newline at end of file
......@@ -51,7 +51,7 @@ export class IncomeComponent implements OnInit {
if (Object.keys(option).indexOf('optionId') > -1) {
this.targetObj = option
}
this.selectedIncome(this.curPageData['questions'][j], this.targetObj);
this.selectedIncome(this.curPageData['questions'][j], this.targetObj, 'isReturn');
});
}
}
......@@ -63,7 +63,7 @@ export class IncomeComponent implements OnInit {
})
}
selectedIncome(question, option) {
selectedIncome(question, option, isReturn?: any) {
option.selected = !option.selected;
const questions = {
questionId: question.questionId,
......@@ -107,6 +107,9 @@ export class IncomeComponent implements OnInit {
this.nextBtn = false;
}
}
if (!isReturn) {
this.next()
}
}
next() {
......
......@@ -2,12 +2,10 @@
<div class="layout">
<div class="content">
<div class="questionTitle">{{ this.curPageData?.pageName }}</div>
<div class="subTitle">(职业不同,风险保障侧重不同)</div>
<ul class="jobContent">
<li
[ngClass]="{ selected: options['selected'] }"
*ngFor="let options of this.curPageData?.questions[0].options"
(click)="selectedJob(options)"
>
<li [ngClass]="{ selected: options['selected'] }" *ngFor="let options of this.curPageData?.questions[0].options"
(click)="selectedJob(options)">
{{ options.optionName }}
</li>
</ul>
......@@ -15,6 +13,9 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div>
</div>
<div style="color: #4242dd;width: 100%;" (click)="before()">
上一步
<!-- &lt; -->
</div>
<!-- <div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div> -->
</div>
\ No newline at end of file
import {Component, OnInit} from '@angular/core';
import {CommonService} from '../common.service';
import {Router, ActivatedRoute} from "@angular/router";
import { Component, OnInit } from '@angular/core';
import { CommonService } from '../common.service';
import { Router, ActivatedRoute } from "@angular/router";
@Component({
selector: 'app-job',
templateUrl: './job.component.html',
styleUrls: ['./job.component.css']
})
export class JobComponent implements OnInit {
curPageData:any;
curPageData: any;
pageAnswers: any;
selectedOptionId: any;
type: any;
......@@ -17,8 +17,8 @@ export class JobComponent implements OnInit {
targetObj: Object = {}
constructor(private commonService: CommonService,
private router: Router,
private route: ActivatedRoute) {
private router: Router,
private route: ActivatedRoute) {
/**
* 1:单身贵族
* 2:二人世界
......@@ -38,7 +38,7 @@ export class JobComponent implements OnInit {
questions: [{
questionId: '',
questionName: '',
options: [{optionId: '', optionName: '', optionOrder: '', selected: ''}]
options: [{ optionId: '', optionName: '', optionOrder: '', selected: '' }]
}],
};
}
......@@ -58,7 +58,7 @@ export class JobComponent implements OnInit {
if (Object.keys(option).indexOf('optionId') > -1) {
this.targetObj = option
}
this.selectedJob(this.targetObj);
this.selectedJob(this.targetObj, 'isReturn');
});
}
......@@ -78,7 +78,7 @@ export class JobComponent implements OnInit {
if (Object.keys(option).indexOf('optionId') > -1) {
this.targetObj = option;
}
this.selectedJob(this.targetObj);
this.selectedJob(this.targetObj, 'isReturn');
});
}
......@@ -92,7 +92,7 @@ export class JobComponent implements OnInit {
});
}
selectedJob(option) {
selectedJob(option, isReturn?: any) {
const options = this.curPageData['questions'][0]['options']
for (let i = 0; i < options.length; i++) {
if (option['optionId'] == options[i]['optionId']) {
......@@ -115,6 +115,9 @@ export class JobComponent implements OnInit {
} else {
this.nextBtn = false;
}
if (!isReturn) {
this.next()
}
}
// 下一步
......@@ -125,12 +128,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 } })
} else {
this.router.navigate(['/transit1'], {queryParams: {type: this.type}})
this.router.navigate(['/income'], { queryParams: { type: this.type } })
}
} else {
this.router.navigate(['/transit1'], {queryParams: {type: this.type}})
this.router.navigate(['/income'], { queryParams: { type: this.type } })
}
} else {
return;
......
......@@ -16,22 +16,28 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next(null)"> 下一步</div>
<div style="color: #4242dd;width: 100%;" (click)="before()">上一步</div>
<!-- <div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next(null)"> 下一步</div> -->
</div>
<div class="toastWrapper toast" *ngIf="isShow" (click)="closeToast();">
</div>
<div class="toastContent city" *ngIf="isShow">
<div class="live">所在地区</div>
<div class="province">
<span>{{ this.provinceName }}</span>
<div class="live">
所在地区
<span nz-icon [nzType]="'close'" style="position: absolute;right: 15px;top: 10px;"
(click)="this.isShow = false;"></span>
</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="height: 35px;line-height:35px;border-bottom:1px #e5e5e5 solid;width: 100%;position: absolute;">
</div>
</div>
<ul class="city">
<li *ngFor="let city of this.cityList" (click)="closeToast(); selectCity(city);">
{{ city.cityName }}
</li>
</ul>
</div>
</div>
<!--提示框-->
......
......@@ -84,7 +84,6 @@ export class LiveComponent implements OnInit {
}
surveyInfo() {
// 获取问题
this.commonService.surveyInfo().then(res => {
if (res['success']) {
......@@ -105,10 +104,10 @@ export class LiveComponent implements OnInit {
setTimeout(() => {
for (let j = 0; j < this.cityList.length; j++) {
if (this.cityList[j].cityName == right) {
this.selectCity(this.cityList[j])
this.selectCity(this.cityList[j], 'isReturn')
}
}
}, 200)
}, 300)
}
}
......@@ -149,7 +148,7 @@ export class LiveComponent implements OnInit {
})
}
selectCity(e) {
selectCity(e, isReturn?: any) {
this.showAddress = true;
this.strAddress = this.provinceName + e.cityName;
this.address = {
......@@ -170,6 +169,9 @@ export class LiveComponent implements OnInit {
} else {
this.nextBtn = false;
}
if (!isReturn) {
this.next(null);
}
}
next(type) {
......@@ -336,7 +338,7 @@ export class LiveComponent implements OnInit {
}).then(res => {
if (res['success']) {
// 登录
this.commonService.login({ 'mobileNo': this.loginData.mobileNo ,campaignInfo:{campaignCode:JSON.parse(sessionStorage.getItem('campaignInfo'))['campaignCode']}}).then(response => {
this.commonService.login({ 'mobileNo': this.loginData.mobileNo, campaignInfo: { campaignCode: JSON.parse(sessionStorage.getItem('campaignInfo'))['campaignCode'] } }).then(response => {
if (response['success']) {
const double12_customerInfo = {
customerId: response['data']['customerId'],
......
......@@ -4,6 +4,7 @@
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
</div>
<div class="subTitle">(负债决定了所需保障额度)</div>
<ul class="income">
<li [ngClass]="{ selected: options['selected'] == true }"
*ngFor="let options of this.curPageData?.questions[0]['options']"
......@@ -24,7 +25,7 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div>
<div style="color: #4242dd;width: 100%;" (click)="before()">上一步</div>
<!-- <div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div> -->
</div>
</div>
\ No newline at end of file
......@@ -52,8 +52,7 @@ export class LoanComponent implements OnInit {
if (Object.keys(option).indexOf('optionId') > -1) {
this.targetObj = option
}
this.selectedLoan(this.curPageData['questions'][j], this.targetObj);
this.selectedLoan(this.curPageData['questions'][j], this.targetObj, 'isReturn');
});
}
}
......@@ -65,7 +64,7 @@ export class LoanComponent implements OnInit {
})
}
selectedLoan(question, option) {
selectedLoan(question, option, isReturn?: any) {
option.selected = !option.selected;
const questions = {
questionId: question.questionId,
......@@ -98,6 +97,9 @@ export class LoanComponent implements OnInit {
} else {
this.nextBtn = false;
}
if (!isReturn) {
this.next()
}
}
next() {
......
......@@ -2,8 +2,9 @@
<div class="layout">
<div class="content">
<div class="questionTitle smokeTitle">
{{ this.curPageData?.pageName }}
{{ this.curPageData?.pageName.substr(0,5) }}
</div>
<div class="subTitle">(抽烟大于400支年,支年 = 抽烟支数/每日*烟龄)</div>
<ul class="jobContent">
<li *ngFor="let options of this.options" [ngClass]="{ selected: options['selected'] == true }"
(click)="checkFun(options,false)">
......@@ -13,7 +14,7 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div>
<div style="color: #4242dd;" (click)="before()">上一步</div>
<div class="next" (click)="next()"> 下一步 </div>
</div>
</div>
\ No newline at end of file
......@@ -56,9 +56,9 @@ export class SmokingComponent implements OnInit {
}
});
if (this.type == 1) {
this.getOneAnswer(targetObj)
this.getOneAnswer(targetObj, 'isReturn')
} else {
this.getManyAnswer(targetObj, true)
this.getManyAnswer(targetObj, true, 'isReturn')
}
}
});
......@@ -70,7 +70,7 @@ export class SmokingComponent implements OnInit {
})
}
getOneAnswer(option) {
getOneAnswer(option, isReturn?: any) {
for (let i = 0; i < this.options.length; i++) {
if (option['optionId'] == this.options[i]['optionId']) {
this.options[i]['selected'] = true;
......@@ -96,9 +96,12 @@ export class SmokingComponent implements OnInit {
} else {
this.nextBtn = false;
}
if (!isReturn) {
this.next();
}
}
getManyAnswer(option, lastFlag) {
getManyAnswer(option, lastFlag, isReturn?: any) {
if (lastFlag === false) {
option['selected'] = !option['selected'];
}
......@@ -137,6 +140,11 @@ export class SmokingComponent implements OnInit {
this.nextBtn = false;
}
this.commonService.addAnswer(this.pageAnswers);
if (!isReturn) {
if (option.optionId == 117) {
this.next();
}
}
}
checkFun(option) {
......
......@@ -4,8 +4,12 @@
<div class="questionTitle">
{{ this.curPageData?.questions[0]['questionName'] }}
</div>
<ul class="jobContent">
<div class="subTitle">
(城镇居民和新农合都算)
</div>
<ul class="jobContent" style="display: flex;">
<li [ngClass]="{ selected: options['selected'] == true }"
style="width: 48%;margin: 0 2%;text-align: center;justify-content: center;"
*ngFor="let options of this.curPageData?.questions[0]['options']"
(click)=selectedSocial(this.curPageData?.questions[0],options)>
{{ options.optionName }}
......@@ -14,8 +18,9 @@
<div class="questionTitle" *ngIf="this.type == 2 || this.type == 4">
{{ this.curPageData?.questions[1]['questionName'] }}
</div>
<ul class="jobContent" *ngIf="this.type == 2 || this.type == 4">
<ul class="jobContent" *ngIf="this.type == 2 || this.type == 4" style="display: flex;">
<li [ngClass]="{ selected: options['selected'] == true }"
style="width: 48%;margin: 0 2%;text-align: center;justify-content: center;"
*ngFor="let options of this.curPageData?.questions[1]['options']"
(click)=selectedSocial(this.curPageData?.questions[1],options)>
{{ options.optionName }}
......@@ -24,7 +29,7 @@
</div>
</div>
<div class="content_footer">
<div style="color: #8a8a8a;" (click)="before()">&lt;</div>
<div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div>
<div style="color: #4242dd;width: 100%;" (click)="before()">上一步</div>
<!-- <div [ngStyle]="{ color: nextBtn == false ? '#8a8a8a' : '#ec2d37' }" (click)="next()"> 下一步 </div> -->
</div>
</div>
\ No newline at end of file
......@@ -51,7 +51,7 @@ export class SocialSecurityComponent implements OnInit {
if (Object.keys(option).indexOf('optionId') > -1) {
this.targetObj = option
}
this.selectedSocial(this.curPageData['questions'][j], this.targetObj);
this.selectedSocial(this.curPageData['questions'][j], this.targetObj, 'isReturn');
});
}
}
......@@ -63,7 +63,7 @@ export class SocialSecurityComponent implements OnInit {
})
}
selectedSocial(question, option) {
selectedSocial(question, option, isReturn?: any) {
option.selected = !option.selected;
const questions = {
questionId: question.questionId,
......@@ -105,11 +105,14 @@ export class SocialSecurityComponent implements OnInit {
this.nextBtn = false;
}
}
if (!isReturn) {
this.next()
}
}
next() {
if (this.nextBtn == true) {
this.router.navigate(['/transit2'], { queryParams: { type: this.type } })
this.router.navigate(['/health'], { queryParams: { type: this.type } })
} else {
return;
}
......
......@@ -12,12 +12,13 @@ html,
body {
position: relative;
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-family: "Microsoft YaHei",-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Helvetica, Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"!important;
/* overflow: hidden; */
min-width: 320px;
max-width: 640px;
margin: 0 auto;
color: #333333;
}
img {
......@@ -39,6 +40,7 @@ ol li {
.title {
text-align: center;
font-family: 'Microsoft YaHei';
}
.wrapper {
......@@ -49,8 +51,10 @@ ol li {
.layout {
display: flex;
flex-direction: column;
padding: 0 10px;
height: 100%;
background: url('../src/assets/images/bg.png') no-repeat;
padding: 15px 10px 0px;
background-size: 100% 100%;
}
.layout.wrapper {
......@@ -83,9 +87,11 @@ ol li {
} */
.content {
overflow: auto;
padding-bottom: 60px;
padding-right: 5px;
/* padding-bottom: 60px; */
-webkit-overflow-scrolling: touch;
padding: 10px 8px;
background: #fff;
height:calc(100% - 60px)
}
.content.healthContent::-webkit-scrollbar-track-piece {
......@@ -124,10 +130,16 @@ ol li {
.questionTitle {
color: #4446e2;
font-size: 24px;
height: 60px;
height: 50px;
line-height: 60px;
width: 100%;
display: flex;
padding-left: 10px;
}
.subTitle{
color: #999999;
padding-left: 10px;
}
.questionTitle span {
......@@ -136,12 +148,12 @@ ol li {
.questionTitle.hospitalTitle {
line-height: unset;
margin: 25px auto 15px auto;
margin: 15px auto 15px auto;
}
.questionTitle.smokeTitle {
line-height: unset;
margin: 25px auto 55px auto;
/* line-height: unset;
margin: 25px auto 55px auto; */
}
.content_footer {
......@@ -165,21 +177,27 @@ ol li {
font-weight: bold;
}
.content_footer div.next {
/* .content_footer div.next {
color: #8a8a8a;
}
.content_footer div:nth-child(1) {
} */
.content_footer div.next {
color: #fff;
background: #4242dd;
}
.content_footer div {
font-size: 20px;
width: 10%;
}
.content_footer div:nth-child(2) {
font-weight: 500;
font-weight: 800;
width: 50%;
margin-left: 15%;
font-family: '微软雅黑';
/* width: 10%; */
}
.content_footer div:nth-child(2) {
/* font-weight: 500;
width: 50%; */
/* margin-left: 15%; */
}
.twoContent {
height: 100%;
}
......@@ -188,13 +206,13 @@ ol li {
.income,
.cityContent {
width: 100%;
margin-top: 1em;
}
.jobContent li {
width: 100%;
height: 55px;
border: 1px #8a8a8a solid;
margin-bottom: 15px;
height: 60px;
margin-bottom: 10px;
border-radius: 4px;
box-sizing: border-box;
padding-left: 5%;
......@@ -202,29 +220,34 @@ ol li {
display: flex;
align-items: center;
padding: 0 3%;
font-size: 14px;
background: #f2f1f1;
}
.cityContent li,
.income li {
width: 100%;
height: 55px;
line-height: 55px;
border: 1px #8a8a8a solid;
margin-bottom: 15px;
height: 60px;
line-height: 60px;
margin-bottom: 10px;
border-radius: 4px;
box-sizing: border-box;
padding-left: 5%;
font-size: 14px;
background: #f2f1f1;
}
.jobContent li.selected,
.income li.selected {
border: 2px #ff0000 solid;
color: #fff;
background: #4242dd;
}
.cityContent {
display: flex;
flex-wrap: wrap;
margin-top: 10%;
margin-top: 5%;
margin-bottom: 0px;
}
......@@ -249,29 +272,32 @@ ol li {
}
.cityContent li {
width: 12%;
height: 46px;
line-height: 46px;
/* width: 12%; */
width: 16%;
height: 55px;
line-height: 55px;
text-align: center;
padding-left: 0;
margin-left: 1%;
margin-right: 1%;
margin-left: 2%;
margin-right: 2%;
border: none;
-moz-box-shadow: 0px 3px 7px rgb(206, 208, 210);
/* -moz-box-shadow: 0px 3px 7px rgb(206, 208, 210);
-webkit-box-shadow: 0px 3px 7px rgb(206, 208, 210);
box-shadow: 0px 3px 7px rgb(206, 208, 210);
box-shadow: 0px 3px 7px rgb(206, 208, 210); */
font-size: 18px;
border-radius: 0;
}
.cityContent li:nth-child(7),
.cityContent li:nth-child(14),
.cityContent li:nth-child(21),
.cityContent li:nth-child(28) {
margin-right: 0;
/* margin-right: 0; */
}
.cityContent li.selected {
background: #94D1CC;
background: #5566e9;
color: #fff;
}
.toastWrapper {
......@@ -310,25 +336,26 @@ ol li {
}
.toastContent .live {
display: flex;
position: relative;
height: 40px;
line-height: 40px;
text-align: center;
justify-content: center;
border-bottom: 1px rgb(220, 220, 220) solid;
/* border-bottom: 1px rgb(220, 220, 220) solid; */
font-size: 16px;
}
.toastContent .province {
display: flex;
height: 40px;
line-height: 40px;
/* height: 40px;
line-height: 40px; */
}
.toastContent .province span {
.toastContent .province div {
width: 45%;
font-size: 16px;
text-align: center;
height: 35px;
line-height: 35px;
}
/* .toastContent .province span.selected{
......@@ -365,16 +392,17 @@ ol li {
.toastContent ul.city li {
width: 100%;
border: none;
border-bottom: 1px rgb(220, 220, 220) solid;
border-radius: 0;
margin: 0;
height: 35px;
line-height: 35px;
text-align: left;
font-size: 16px;
}
.address {
width: 80%;
margin: 15% auto;
margin: 2% auto;
text-align: center;
font-size: 18px;
}
......
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