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
fe2dbc64
Commit
fe2dbc64
authored
May 22, 2019
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存
parent
f20e21c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
56 deletions
+72
-56
questionnaire/src/app/app.component.ts
+13
-2
questionnaire/src/app/app.module.ts
+26
-24
questionnaire/src/app/live/live.component.ts
+33
-30
No files found.
questionnaire/src/app/app.component.ts
View file @
fe2dbc64
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
CommonService
}
from
"./common.service"
;
@
Component
({
selector
:
'app-root'
,
templateUrl
:
'./app.component.html'
,
styleUrls
:
[
'./app.component.css'
]
})
export
class
AppComponent
{
export
class
AppComponent
implements
OnInit
{
constructor
(
private
commonService
:
CommonService
)
{
}
ngOnInit
()
{
const
customerId
=
this
.
commonService
.
getQueryString
(
'customerId'
);
const
orderId
=
this
.
commonService
.
getQueryString
(
'orderId'
);
sessionStorage
.
setItem
(
'customerId'
,
customerId
);
sessionStorage
.
setItem
(
'orderId'
,
orderId
);
}
}
questionnaire/src/app/app.module.ts
View file @
fe2dbc64
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
BrowserModule
}
from
'@angular/platform-browser'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
HashLocationStrategy
,
LocationStrategy
}
from
'@angular/common'
;
import
{
AppRoutingModule
}
from
'./app-routing.module'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
FamilyComponent
}
from
'./family/family.component'
;
import
{
AgeComponent
}
from
'./age/age.component'
;
import
{
JobComponent
}
from
'./job/job.component'
;
import
{
IncomeComponent
}
from
'./income/income.component'
;
import
{
LoanComponent
}
from
'./loan/loan.component'
;
import
{
SocialSecurityComponent
}
from
'./social-security/social-security.component'
;
import
{
HealthComponent
}
from
'./health/health.component'
;
import
{
ChildrenHealthComponent
}
from
'./children-health/children-health.component'
;
import
{
DiseaseComponent
}
from
'./disease/disease.component'
;
import
{
SmokingComponent
}
from
'./smoking/smoking.component'
;
import
{
LiveComponent
}
from
'./live/live.component'
;
import
{
TransitComponent
}
from
'./transit/transit.component'
;
import
{
Transit1Component
}
from
'./transit1/transit1.component'
;
import
{
Transit2Component
}
from
'./transit2/transit2.component'
;
import
{
Transit3Component
}
from
'./transit3/transit3.component'
;
import
{
AppRoutingModule
}
from
'./app-routing.module'
;
import
{
AppComponent
}
from
'./app.component'
;
import
{
FamilyComponent
}
from
'./family/family.component'
;
import
{
AgeComponent
}
from
'./age/age.component'
;
import
{
JobComponent
}
from
'./job/job.component'
;
import
{
IncomeComponent
}
from
'./income/income.component'
;
import
{
LoanComponent
}
from
'./loan/loan.component'
;
import
{
SocialSecurityComponent
}
from
'./social-security/social-security.component'
;
import
{
HealthComponent
}
from
'./health/health.component'
;
import
{
ChildrenHealthComponent
}
from
'./children-health/children-health.component'
;
import
{
DiseaseComponent
}
from
'./disease/disease.component'
;
import
{
SmokingComponent
}
from
'./smoking/smoking.component'
;
import
{
LiveComponent
}
from
'./live/live.component'
;
import
{
TransitComponent
}
from
'./transit/transit.component'
;
import
{
Transit1Component
}
from
'./transit1/transit1.component'
;
import
{
Transit2Component
}
from
'./transit2/transit2.component'
;
import
{
Transit3Component
}
from
'./transit3/transit3.component'
;
import
{
HttpClientModule
}
from
'@angular/common/http'
import
{
CommonService
}
from
'./common.service'
import
{
LocalStorage
}
from
'./local.storage'
import
{
HttpClientModule
}
from
'@angular/common/http'
import
{
CommonService
}
from
'./common.service'
import
{
LocalStorage
}
from
'./local.storage'
@
NgModule
({
declarations
:
[
AppComponent
,
...
...
@@ -46,7 +47,8 @@ import { LocalStorage } from './local.storage'
AppRoutingModule
,
HttpClientModule
],
providers
:
[
CommonService
,
LocalStorage
,
],
providers
:
[
CommonService
,
LocalStorage
,
{
provide
:
LocationStrategy
,
useClass
:
HashLocationStrategy
}
],
bootstrap
:
[
AppComponent
]
})
export
class
AppModule
{
}
export
class
AppModule
{
}
questionnaire/src/app/live/live.component.ts
View file @
fe2dbc64
...
...
@@ -24,6 +24,7 @@ export class LiveComponent implements OnInit {
type
:
any
;
nextBtn
:
boolean
;
lastQuestions
:
Array
<
any
>
;
constructor
(
private
commonService
:
CommonService
,
private
router
:
Router
,
private
route
:
ActivatedRoute
)
{
...
...
@@ -41,53 +42,53 @@ export class LiveComponent implements OnInit {
ngOnInit
()
{
this
.
nextBtn
=
false
;
this
.
showAddress
=
false
;
this
.
lastQuestions
=
this
.
commonService
.
todosCopy
.
filter
(
item
=>
item
.
pageId
==
16
).
pop
();
// 获取省份
this
.
commonService
.
provinceqry
({
insurerId
:
11
}).
then
(
res
=>
{
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
(()
=>
{
setTimeout
(()
=>
{
this
.
surveyInfo
()
},
200
)
},
200
)
}
surveyInfo
()
{
// 获取问题
this
.
commonService
.
surveyInfo
().
then
(
res
=>
{
if
(
res
[
'success'
])
{
this
.
curPageData
=
res
[
'data'
][
'survey'
].
pages
[
'15'
];
if
(
this
.
lastQuestions
)
{
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
)
{
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
)
{
setTimeout
(()
=>
{
for
(
let
j
=
0
;
j
<
this
.
cityList
.
length
;
j
++
)
{
if
(
this
.
cityList
[
j
].
cityName
==
right
)
{
this
.
selectCity
(
this
.
cityList
[
j
])
}
}
},
200
)
},
200
)
}
}
})
}
showToast
()
{
...
...
@@ -149,16 +150,18 @@ export class LiveComponent implements OnInit {
next
()
{
if
(
this
.
nextBtn
==
true
)
{
const
param
=
{
survey
:{
// customerId:
,
// orderId:
,
pages
:
this
.
commonService
.
todosCopy
survey
:
{
customerId
:
sessionStorage
.
getItem
(
'customerId'
)
,
orderId
:
sessionStorage
.
getItem
(
'orderId'
)
,
pages
:
this
.
commonService
.
todosCopy
}
}
// this.commonService.saveCustomerAnwers(param).then(res=>{
// })
this
.
router
.
navigate
([
'/transit3'
]);
};
this
.
commonService
.
saveCustomerAnwers
(
param
).
then
(
res
=>
{
if
(
res
[
'success'
])
{
this
.
router
.
navigate
([
'/transit3'
]);
}
else
{
}
});
}
else
{
return
;
}
...
...
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