Toggle navigation
Toggle navigation
This project
Loading...
Sign in
罗广聪
/
ProtectGod
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
罗广聪
2017-09-26 10:52:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a6345bcd6816f9055f8089a4b837e3095e38ec54
a6345bcd
1 parent
2f3f0eb2
prepare AH
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
267 additions
and
11 deletions
index.ios.js
src/pages/Home/HealthQuestionnaire/HealthBegin.js
src/pages/Home/HealthQuestionnaire/HealthQuestion.js
src/pages/Home/HealthQuestionnaire/HealthResult.js
src/pages/Home/index.js
index.ios.js
View file @
a6345bc
...
...
@@ -18,9 +18,16 @@ import ProductTemplate from "./src/Components/ProductTemplate";
import
ArticleTemplate
from
"./src/Components/articleTemplate"
;
import
Details
from
"./src/pages/InsuranceCircle/details"
;
import
Discover
from
"./src/pages/Discover/index"
;
import
AIBegin
from
"./src/pages/Home/AISolution/Begin"
;
import
AIQuestion
from
"./src/pages/Home/AISolution/Question"
;
import
AISolution
from
"./src/pages/Home/AISolution/Solution"
;
import
HealthBegin
from
"./src/pages/Home/HealthQuestionnaire/HealthBegin"
;
import
HealthQuestion
from
"./src/pages/Home/HealthQuestionnaire/HealthQuestion"
;
import
HealthResult
from
"./src/pages/Home/HealthQuestionnaire/HealthResult"
;
// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
const
MainTabBar
=
TabNavigator
({
const
MainTabBar
=
TabNavigator
(
{
Home
:
{
screen
:
Home
,
navigationOptions
:
{
...
...
@@ -83,12 +90,14 @@ const MainTabBar = TabNavigator({
)
}
}
},{
},
{
swipeEnabled
:
true
,
tabBarOptions
:
{
activeTintColor
:
"#1B9341"
}
});
}
);
const
ProtectGod
=
StackNavigator
(
{
...
...
@@ -105,8 +114,33 @@ const ProtectGod = StackNavigator(
ProductTemplate
:
{
screen
:
ProductTemplate
},
ArticleTemplate
:
{
screen
:
ArticleTemplate
},
Details
:
{
screen
:
Details
},
Discover
:
{
screen
:
Discover
}
},{
Discover
:
{
screen
:
Discover
},
AIBegin
:
{
screen
:
AIBegin
,
navigationOptions
:
{
headerTitle
:
"智能方案"
}
},
AIQuestion
:
{
screen
:
AIQuestion
,
navigationOptions
:
{
headerTitle
:
"智能方案"
}
},
AISolution
:
{
screen
:
AISolution
,
navigationOptions
:
{
headerTitle
:
"智能方案"
}
},
HealthBegin
:
{
screen
:
HealthBegin
,
navigationOptions
:
{
headerTitle
:
"健康问卷"
}
},
HealthQuestion
:
{
screen
:
HealthQuestion
,
navigationOptions
:
{
headerTitle
:
"健康问卷"
}
},
HealthResult
:
{
screen
:
HealthResult
,
navigationOptions
:
{
headerTitle
:
"健康问卷"
}
},
},
{
navigationOptions
:
{
// headerTintColor: "blue",
headerBackTitle
:
"返回"
,
...
...
@@ -117,8 +151,6 @@ const ProtectGod = StackNavigator(
}
);
const
styles
=
StyleSheet
.
create
(
);
const
styles
=
StyleSheet
.
create
();
AppRegistry
.
registerComponent
(
"ProtectGod"
,
()
=>
ProtectGod
);
...
...
src/pages/Home/HealthQuestionnaire/HealthBegin.js
0 → 100644
View file @
a6345bc
import
React
,
{
Component
}
from
"react"
;
import
{
AppRegistry
,
StyleSheet
,
Text
,
View
,
Image
,
TouchableOpacity
,
ScrollView
,
ListView
,
Dimensions
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
componentWillMount
()
{}
componentDidMount
()
{}
getListData
()
{
let
that
=
this
;
return
fetch
(
`https://devpay.brae.co/test/insurance/topic`
,
{
method
:
"POST"
,
headers
:
{
Accept
:
"application/json"
,
"Content-Type"
:
"application/json"
}
})
.
then
(
resp
=>
{
if
(
resp
.
status
===
200
)
{
return
resp
.
json
();
}
else
{
console
.
error
(
"something went wrong!"
);
}
})
.
then
(
respJson
=>
{
if
(
respJson
.
enmsg
!=
"ok"
)
{
alert
(
respJson
.
cnmsg
);
}
else
{
that
.
setState
({
ListData
:
respJson
.
data
.
topic
});
console
.
log
(
"首页列表"
,
this
.
state
.
ListData
);
}
});
}
render
()
{
// console.log("首页的this.props", this);
// console.log("render首页文章列表", this.state.ListData);
const
{
navigate
}
=
this
.
props
.
navigation
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
>
健康问卷开始
<
/Text
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
justifyContent
:
"flex-start"
,
alignItems
:
"stretch"
,
backgroundColor
:
"#EFEFEF"
},
});
...
...
src/pages/Home/HealthQuestionnaire/HealthQuestion.js
0 → 100644
View file @
a6345bc
import
React
,
{
Component
}
from
"react"
;
import
{
AppRegistry
,
StyleSheet
,
Text
,
View
,
Image
,
TouchableOpacity
,
ScrollView
,
ListView
,
Dimensions
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
componentWillMount
()
{}
componentDidMount
()
{}
getListData
()
{
let
that
=
this
;
return
fetch
(
`https://devpay.brae.co/test/insurance/topic`
,
{
method
:
"POST"
,
headers
:
{
Accept
:
"application/json"
,
"Content-Type"
:
"application/json"
}
})
.
then
(
resp
=>
{
if
(
resp
.
status
===
200
)
{
return
resp
.
json
();
}
else
{
console
.
error
(
"something went wrong!"
);
}
})
.
then
(
respJson
=>
{
if
(
respJson
.
enmsg
!=
"ok"
)
{
alert
(
respJson
.
cnmsg
);
}
else
{
that
.
setState
({
ListData
:
respJson
.
data
.
topic
});
console
.
log
(
"首页列表"
,
this
.
state
.
ListData
);
}
});
}
render
()
{
// console.log("首页的this.props", this);
// console.log("render首页文章列表", this.state.ListData);
const
{
navigate
}
=
this
.
props
.
navigation
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
>
健康问卷
问题
<
/Text
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
justifyContent
:
"flex-start"
,
alignItems
:
"stretch"
,
backgroundColor
:
"#EFEFEF"
},
});
...
...
src/pages/Home/HealthQuestionnaire/HealthResult.js
0 → 100644
View file @
a6345bc
import
React
,
{
Component
}
from
"react"
;
import
{
AppRegistry
,
StyleSheet
,
Text
,
View
,
Image
,
TouchableOpacity
,
ScrollView
,
ListView
,
Dimensions
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
componentWillMount
()
{}
componentDidMount
()
{}
getListData
()
{
let
that
=
this
;
return
fetch
(
`https://devpay.brae.co/test/insurance/topic`
,
{
method
:
"POST"
,
headers
:
{
Accept
:
"application/json"
,
"Content-Type"
:
"application/json"
}
})
.
then
(
resp
=>
{
if
(
resp
.
status
===
200
)
{
return
resp
.
json
();
}
else
{
console
.
error
(
"something went wrong!"
);
}
})
.
then
(
respJson
=>
{
if
(
respJson
.
enmsg
!=
"ok"
)
{
alert
(
respJson
.
cnmsg
);
}
else
{
that
.
setState
({
ListData
:
respJson
.
data
.
topic
});
console
.
log
(
"首页列表"
,
this
.
state
.
ListData
);
}
});
}
render
()
{
// console.log("首页的this.props", this);
// console.log("render首页文章列表", this.state.ListData);
const
{
navigate
}
=
this
.
props
.
navigation
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
>
健康问卷
结果
<
/Text
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
justifyContent
:
"flex-start"
,
alignItems
:
"stretch"
,
backgroundColor
:
"#EFEFEF"
},
});
...
...
src/pages/Home/index.js
View file @
a6345bc
...
...
@@ -160,11 +160,21 @@ export default class Home extends Component {
{
/* 智能方案和健康问卷入口 */
}
<
View
style
=
{
styles
.
AIAndHealthContainer
}
>
<
TouchableOpacity
style
=
{
styles
.
AHContainer
}
>
<
TouchableOpacity
style
=
{
styles
.
AHContainer
}
onPress
=
{()
=>
{
navigate
(
"AIBegin"
);
}}
>
<
Image
style
=
{
styles
.
AHIcon
}
/
>
<
Text
style
=
{
styles
.
AHText
}
>
智能方案
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
AHContainer
}
>
<
TouchableOpacity
style
=
{
styles
.
AHContainer
}
onPress
=
{()
=>
{
navigate
(
"HealthBegin"
);
}}
>
<
Image
style
=
{
styles
.
AHIcon
}
/
>
<
Text
style
=
{
styles
.
AHText
}
>
健康问卷
<
/Text
>
<
/TouchableOpacity
>
...
...
@@ -251,8 +261,9 @@ const styles = StyleSheet.create({
justifyContent
:
"space-around"
,
alignItems
:
"center"
,
marginTop
:
10
,
// marginBottom: 10,
backgroundColor
:
"white"
,
paddingTop
:
10
,
paddingBottom
:
10
,
},
AHContainer
:
{},
AHIcon
:
{},
...
...
Please
register
or
login
to post a comment