Commit c97681d4 by Sweet Zhang

问卷检测有无疾病

parent 7a114f4d
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<entry file="file://$PROJECT_DIR$/js/base.js"> <entry file="file://$PROJECT_DIR$/js/base.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="310"> <state relative-caret-position="310">
<caret line="614" column="20" lean-forward="true" selection-start-line="614" selection-start-column="20" selection-end-line="614" selection-end-column="20" /> <caret line="614" column="20" lean-forward="false" selection-start-line="614" selection-start-column="20" selection-end-line="614" selection-end-column="20" />
<folding> <folding>
<element signature="e#395#639#0" expanded="false" /> <element signature="e#395#639#0" expanded="false" />
<element signature="e#658#790#0" expanded="false" /> <element signature="e#658#790#0" expanded="false" />
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
<property name="node.js.path.for.package.jscs" value="project" /> <property name="node.js.path.for.package.jscs" value="project" />
<property name="node.js.selected.package.jscs" value="" /> <property name="node.js.selected.package.jscs" value="" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../questionnaire" />
<property name="HbShouldOpenHtmlAsHb" value="" /> <property name="HbShouldOpenHtmlAsHb" value="" />
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
...@@ -344,12 +344,12 @@ ...@@ -344,12 +344,12 @@
<workItem from="1574734356824" duration="16228000" /> <workItem from="1574734356824" duration="16228000" />
<workItem from="1574766778454" duration="63000" /> <workItem from="1574766778454" duration="63000" />
<workItem from="1574820391944" duration="2942000" /> <workItem from="1574820391944" duration="2942000" />
<workItem from="1574835867481" duration="6099000" /> <workItem from="1574835867481" duration="7225000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="157033000" /> <option name="totallyTimeSpent" value="158159000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
...@@ -361,7 +361,7 @@ ...@@ -361,7 +361,7 @@
</todo-panel> </todo-panel>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="7" /> <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.10437533" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.10437533" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
...@@ -1029,7 +1029,7 @@ ...@@ -1029,7 +1029,7 @@
<entry file="file://$PROJECT_DIR$/js/base.js"> <entry file="file://$PROJECT_DIR$/js/base.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="310"> <state relative-caret-position="310">
<caret line="614" column="20" lean-forward="true" selection-start-line="614" selection-start-column="20" selection-end-line="614" selection-end-column="20" /> <caret line="614" column="20" lean-forward="false" selection-start-line="614" selection-start-column="20" selection-end-line="614" selection-end-column="20" />
<folding> <folding>
<element signature="e#395#639#0" expanded="false" /> <element signature="e#395#639#0" expanded="false" />
<element signature="e#658#790#0" expanded="false" /> <element signature="e#658#790#0" expanded="false" />
......
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
import { CommonService } from '../common.service' import {CommonService} from '../common.service'
import { ActivatedRoute, Router } from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
@Component({ @Component({
selector: 'app-live', selector: 'app-live',
...@@ -36,17 +36,20 @@ export class LiveComponent implements OnInit { ...@@ -36,17 +36,20 @@ export class LiveComponent implements OnInit {
isDisease: boolean = true; isDisease: boolean = true;
// 不能进行自动评测 // 不能进行自动评测
autoEvaluationModal: boolean; autoEvaluationModal: boolean;
selfDisease: boolean = true;
spouseDisease: boolean = true;
childrenDisease: boolean = true;
constructor(private commonService: CommonService, constructor(private commonService: CommonService,
private router: Router, private router: Router,
private route: ActivatedRoute) { private route: ActivatedRoute) {
this.type = this.route.snapshot.queryParams['type']; this.type = this.route.snapshot.queryParams['type'];
this.pageAnswers = { this.pageAnswers = {
pageId: '', pageId: '',
questions: [{ questions: [{
questionId: '', questionId: '',
questionName: '', questionName: '',
options: [{ optionId: '', optionName: '', optionOrder: '', selected: '' }] options: [{optionId: '', optionName: '', optionOrder: '', selected: ''}]
}], }],
}; };
this.loginData = { this.loginData = {
...@@ -62,7 +65,7 @@ export class LiveComponent implements OnInit { ...@@ -62,7 +65,7 @@ export class LiveComponent implements OnInit {
this.tipsFlag = false; this.tipsFlag = false;
this.lastQuestions = this.commonService.todosCopy.filter(item => item.pageId == 16).pop(); this.lastQuestions = this.commonService.todosCopy.filter(item => item.pageId == 16).pop();
// 获取省份 // 获取省份
this.commonService.provinceqry({ insurerId: 11 }).then(res => { this.commonService.provinceqry({insurerId: 11}).then(res => {
if (res['success']) { if (res['success']) {
this.provinceList = res['data'].provinceList; this.provinceList = res['data'].provinceList;
} }
...@@ -184,13 +187,13 @@ export class LiveComponent implements OnInit { ...@@ -184,13 +187,13 @@ export class LiveComponent implements OnInit {
if (!sessionStorage.getItem('campaignInfo')) { if (!sessionStorage.getItem('campaignInfo')) {
this.router.navigate(['/transit3']); this.router.navigate(['/transit3']);
} else { } else {
//判断有无疾病 const task = JSON.parse(sessionStorage.getItem('campaignInfo'))['campaignTaskCode']
if (this.isDisease) { //判断有无疾病
if (this.isDisease && task == '12task1') {
//双12活动有疾病出弹框,确定后跳活动首页 //双12活动有疾病出弹框,确定后跳活动首页
this.autoEvaluationModal = true; this.autoEvaluationModal = true;
} else { } else {
//无疾病判断如果是任务二或者任务三跳活动首页否则条查看方案 //无疾病判断如果是任务二或者任务三跳活动首页否则条查看方案
const task = JSON.parse(sessionStorage.getItem('campaignInfo'))['campaignTaskCode']
if (task == '12task2' || task == '12task3') { if (task == '12task2' || task == '12task3') {
setTimeout(() => { setTimeout(() => {
window.location.href = `https://${window.location.host}/2019Double12/index.html?customerId=${sessionStorage.getItem('customerId')}`; window.location.href = `https://${window.location.host}/2019Double12/index.html?customerId=${sessionStorage.getItem('customerId')}`;
...@@ -231,7 +234,7 @@ export class LiveComponent implements OnInit { ...@@ -231,7 +234,7 @@ export class LiveComponent implements OnInit {
this.errorModal('手机号码输入有误'); this.errorModal('手机号码输入有误');
return; return;
} else if (this.loginData.mobileNo) { } else if (this.loginData.mobileNo) {
this.commonService.verificationCode({ mobileNo: this.loginData.mobileNo, type: '1' }).then(res => { this.commonService.verificationCode({mobileNo: this.loginData.mobileNo, type: '1'}).then(res => {
if (res['success']) { if (res['success']) {
this.sendBtnFlag = true; this.sendBtnFlag = true;
this.errorModal('发送成功'); this.errorModal('发送成功');
...@@ -275,7 +278,7 @@ export class LiveComponent implements OnInit { ...@@ -275,7 +278,7 @@ export class LiveComponent implements OnInit {
}).then(res => { }).then(res => {
if (res['success']) { if (res['success']) {
// 登录 // 登录
this.commonService.login({ 'mobileNo': this.loginData.mobileNo }).then(response => { this.commonService.login({'mobileNo': this.loginData.mobileNo}).then(response => {
if (response['success']) { if (response['success']) {
// 登录成功 // 登录成功
this.loginModalFlag = false; this.loginModalFlag = false;
...@@ -325,24 +328,37 @@ export class LiveComponent implements OnInit { ...@@ -325,24 +328,37 @@ export class LiveComponent implements OnInit {
const spouseQuestionsArr = spouseArr ? spouseArr.questions : []; const spouseQuestionsArr = spouseArr ? spouseArr.questions : [];
const childrenArr = arr.filter(item => item.pageId === 13).pop(); const childrenArr = arr.filter(item => item.pageId === 13).pop();
const childrenQuestionsArr = childrenArr ? childrenArr.questions : []; const childrenQuestionsArr = childrenArr ? childrenArr.questions : [];
this.diseaseQuestions(selfQuestionsArr, 13, 67); this.diseaseQuestions(selfQuestionsArr, 13, 67, 1);
this.diseaseQuestions(spouseQuestionsArr, 14, 83); this.diseaseQuestions(spouseQuestionsArr, 14, 83, 2);
this.diseaseQuestions(childrenQuestionsArr, 15, 99); this.diseaseQuestions(childrenQuestionsArr, 15, 99, 3);
} }
// 循环疾病选项 // 循环疾病选项
diseaseQuestions(arr, questionId, optionId) { diseaseQuestions(arr, questionId, optionId, type) {
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
arr.forEach((item, index, arr) => { arr.forEach((item, index, arr) => {
item.options.forEach((list, i, array) => { item.options.forEach((list, i, array) => {
if (item.questionId === questionId && list.optionId !== optionId) { if (item.questionId === questionId && list.optionId !== optionId) {
this.isDisease = true; if (type === 1) {
this.selfDisease = true;
} else if (type === 2) {
this.spouseDisease = true;
} else if (type === 3) {
this.childrenDisease = true;
}
return; return;
} else { } else {
this.isDisease = false; if (type === 1) {
this.selfDisease = false;
} else if (type === 2) {
this.spouseDisease = false;
} else if (type === 3) {
this.childrenDisease = false;
}
return; return;
} }
}); });
this.isDisease = this.selfDisease || this.spouseDisease || this.childrenDisease;
}); });
} }
......
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