Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
allCampaign
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
allCampaign
Commits
c97681d4
Commit
c97681d4
authored
Nov 27, 2019
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问卷检测有无疾病
parent
7a114f4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
24 deletions
+40
-24
2019Double12/.idea/workspace.xml
+6
-6
questionnaire/src/app/live/live.component.ts
+34
-18
No files found.
2019Double12/.idea/workspace.xml
View file @
c97681d4
...
...
@@ -44,7 +44,7 @@
<entry
file=
"file://$PROJECT_DIR$/js/base.js"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"310"
>
<caret
line=
"614"
column=
"20"
lean-forward=
"
tru
e"
selection-start-line=
"614"
selection-start-column=
"20"
selection-end-line=
"614"
selection-end-column=
"20"
/>
<caret
line=
"614"
column=
"20"
lean-forward=
"
fals
e"
selection-start-line=
"614"
selection-start-column=
"20"
selection-end-line=
"614"
selection-end-column=
"20"
/>
<folding>
<element
signature=
"e#395#639#0"
expanded=
"false"
/>
<element
signature=
"e#658#790#0"
expanded=
"false"
/>
...
...
@@ -197,7 +197,7 @@
<property
name=
"node.js.path.for.package.jscs"
value=
"project"
/>
<property
name=
"node.js.selected.package.jscs"
value=
""
/>
<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=
""
/>
</component>
<component
name=
"RunDashboard"
>
...
...
@@ -344,12 +344,12 @@
<workItem
from=
"1574734356824"
duration=
"16228000"
/>
<workItem
from=
"1574766778454"
duration=
"63000"
/>
<workItem
from=
"1574820391944"
duration=
"2942000"
/>
<workItem
from=
"1574835867481"
duration=
"
6099
000"
/>
<workItem
from=
"1574835867481"
duration=
"
7225
000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"15
7033
000"
/>
<option
name=
"totallyTimeSpent"
value=
"15
8159
000"
/>
</component>
<component
name=
"TodoView"
>
<todo-panel
id=
"selected-file"
>
...
...
@@ -361,7 +361,7 @@
</todo-panel>
</component>
<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"
/>
<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"
/>
...
...
@@ -1029,7 +1029,7 @@
<entry
file=
"file://$PROJECT_DIR$/js/base.js"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"310"
>
<caret
line=
"614"
column=
"20"
lean-forward=
"
tru
e"
selection-start-line=
"614"
selection-start-column=
"20"
selection-end-line=
"614"
selection-end-column=
"20"
/>
<caret
line=
"614"
column=
"20"
lean-forward=
"
fals
e"
selection-start-line=
"614"
selection-start-column=
"20"
selection-end-line=
"614"
selection-end-column=
"20"
/>
<folding>
<element
signature=
"e#395#639#0"
expanded=
"false"
/>
<element
signature=
"e#658#790#0"
expanded=
"false"
/>
...
...
questionnaire/src/app/live/live.component.ts
View file @
c97681d4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
CommonService
}
from
'../common.service'
import
{
ActivatedRoute
,
Router
}
from
"@angular/router"
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
CommonService
}
from
'../common.service'
import
{
ActivatedRoute
,
Router
}
from
"@angular/router"
;
@
Component
({
selector
:
'app-live'
,
...
...
@@ -36,17 +36,20 @@ export class LiveComponent implements OnInit {
isDisease
:
boolean
=
true
;
// 不能进行自动评测
autoEvaluationModal
:
boolean
;
selfDisease
:
boolean
=
true
;
spouseDisease
:
boolean
=
true
;
childrenDisease
:
boolean
=
true
;
constructor
(
private
commonService
:
CommonService
,
private
router
:
Router
,
private
route
:
ActivatedRoute
)
{
private
router
:
Router
,
private
route
:
ActivatedRoute
)
{
this
.
type
=
this
.
route
.
snapshot
.
queryParams
[
'type'
];
this
.
pageAnswers
=
{
pageId
:
''
,
questions
:
[{
questionId
:
''
,
questionName
:
''
,
options
:
[{
optionId
:
''
,
optionName
:
''
,
optionOrder
:
''
,
selected
:
''
}]
options
:
[{
optionId
:
''
,
optionName
:
''
,
optionOrder
:
''
,
selected
:
''
}]
}],
};
this
.
loginData
=
{
...
...
@@ -62,7 +65,7 @@ export class LiveComponent implements OnInit {
this
.
tipsFlag
=
false
;
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'
])
{
this
.
provinceList
=
res
[
'data'
].
provinceList
;
}
...
...
@@ -184,13 +187,13 @@ export class LiveComponent implements OnInit {
if
(
!
sessionStorage
.
getItem
(
'campaignInfo'
))
{
this
.
router
.
navigate
([
'/transit3'
]);
}
else
{
//判断有无疾病
if
(
this
.
isDisease
)
{
const
task
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'campaignInfo'
))[
'campaignTaskCode'
]
//判断有无疾病
if
(
this
.
isDisease
&&
task
==
'12task1'
)
{
//双12活动有疾病出弹框,确定后跳活动首页
this
.
autoEvaluationModal
=
true
;
}
else
{
//无疾病判断如果是任务二或者任务三跳活动首页否则条查看方案
const
task
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'campaignInfo'
))[
'campaignTaskCode'
]
if
(
task
==
'12task2'
||
task
==
'12task3'
)
{
setTimeout
(()
=>
{
window
.
location
.
href
=
`https://
${
window
.
location
.
host
}
/2019Double12/index.html?customerId=
${
sessionStorage
.
getItem
(
'customerId'
)}
`
;
...
...
@@ -231,7 +234,7 @@ export class LiveComponent implements OnInit {
this
.
errorModal
(
'手机号码输入有误'
);
return
;
}
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'
])
{
this
.
sendBtnFlag
=
true
;
this
.
errorModal
(
'发送成功'
);
...
...
@@ -275,7 +278,7 @@ export class LiveComponent implements OnInit {
}).
then
(
res
=>
{
if
(
res
[
'success'
])
{
// 登录
this
.
commonService
.
login
({
'mobileNo'
:
this
.
loginData
.
mobileNo
}).
then
(
response
=>
{
this
.
commonService
.
login
({
'mobileNo'
:
this
.
loginData
.
mobileNo
}).
then
(
response
=>
{
if
(
response
[
'success'
])
{
// 登录成功
this
.
loginModalFlag
=
false
;
...
...
@@ -325,24 +328,37 @@ export class LiveComponent implements OnInit {
const
spouseQuestionsArr
=
spouseArr
?
spouseArr
.
questions
:
[];
const
childrenArr
=
arr
.
filter
(
item
=>
item
.
pageId
===
13
).
pop
();
const
childrenQuestionsArr
=
childrenArr
?
childrenArr
.
questions
:
[];
this
.
diseaseQuestions
(
selfQuestionsArr
,
13
,
67
);
this
.
diseaseQuestions
(
spouseQuestionsArr
,
14
,
83
);
this
.
diseaseQuestions
(
childrenQuestionsArr
,
15
,
99
);
this
.
diseaseQuestions
(
selfQuestionsArr
,
13
,
67
,
1
);
this
.
diseaseQuestions
(
spouseQuestionsArr
,
14
,
83
,
2
);
this
.
diseaseQuestions
(
childrenQuestionsArr
,
15
,
99
,
3
);
}
// 循环疾病选项
diseaseQuestions
(
arr
,
questionId
,
optionId
)
{
diseaseQuestions
(
arr
,
questionId
,
optionId
,
type
)
{
if
(
arr
&&
arr
.
length
>
0
)
{
arr
.
forEach
((
item
,
index
,
arr
)
=>
{
item
.
options
.
forEach
((
list
,
i
,
array
)
=>
{
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
;
}
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
;
}
});
this
.
isDisease
=
this
.
selfDisease
||
this
.
spouseDisease
||
this
.
childrenDisease
;
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment