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-28 16:49:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2bcdc497d3c65778d69866c06d4fcd763508f1c1
2bcdc497
1 parent
57ebe860
评价页面提交按钮
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
30 deletions
index.ios.js
src/pages/Mine/Evaluate.js
src/pages/Mine/index.js
src/pages/Template.js
index.ios.js
View file @
2bcdc49
...
...
@@ -23,6 +23,7 @@ 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
HealthQuestionnaire
from
"./src/pages/Home/healthQuestionnaire"
;
import
Evaluate
from
"./src/pages/Mine/Evaluate"
;
// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
const
MainTabBar
=
TabNavigator
(
...
...
@@ -133,6 +134,10 @@ const ProtectGod = StackNavigator(
HealthQuestionnaire
:
{
screen
:
HealthQuestionnaire
,
navigationOptions
:
{
headerTitle
:
"健康问卷"
}
},
Evaluate
:
{
screen
:
Evaluate
,
navigationOptions
:
{
headerTitle
:
"评价"
}
}
},
{
...
...
src/pages/Mine/Evaluate.js
0 → 100644
View file @
2bcdc49
import
React
,
{
Component
}
from
"react"
;
import
{
AppRegistry
,
StyleSheet
,
Text
,
View
,
Image
,
TouchableOpacity
,
ScrollView
,
ListView
,
Dimensions
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
post
from
"../../utils/fetch"
;
export
default
class
Home
extends
Component
{
static
navigationOptions
=
({
navigation
})
=>
{
const
{
state
,
setParams
,
navigate
}
=
navigation
;
return
{
headerRight
:
(
<
TouchableOpacity
style
=
{{
marginRight
:
13
}}
onPress
=
{()
=>
state
.
params
.
submit
()}
>
<
Text
style
=
{{
fontSize
:
16
,
color
:
"#0071E1"
}}
>
提交
<
/Text
>
<
/TouchableOpacity
>
)
};
};
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
componentWillMount
()
{}
componentDidMount
()
{
this
.
props
.
navigation
.
setParams
({
submit
:
this
.
submit
.
bind
(
this
)
});
}
//
submit
()
{
console
.
log
(
"提交成功"
)
}
getListData
()
{
post
(
"/test/insurance/article"
,
{},
res
=>
{},
err
=>
{});
}
render
()
{
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/Mine/index.js
View file @
2bcdc49
...
...
@@ -315,7 +315,7 @@ export default class Mine extends Component {
{
/* 评价和客服 */
}
<
View
style
=
{
styles
.
midContainer
}
>
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
>
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
navigate
(
'Evaluate'
)}
>
<
View
style
=
{
styles
.
itemLeft
}
>
<
Text
style
=
{
styles
.
leftTitle
}
>
评价我们
<
/Text
>
<
/View
>
...
...
src/pages/Template.js
View file @
2bcdc49
...
...
@@ -11,6 +11,7 @@ import {
Dimensions
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
post
from
"../../utils/fetch"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
...
...
@@ -22,40 +23,14 @@ export default class Home extends Component {
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
);
}
});
post
(
"/test/insurance/article"
,
{},
res
=>
{},
err
=>
{});
}
render
()
{
// console.log("首页的this.props", this);
// console.log("render首页文章列表", this.state.ListData);
const
{
navigate
}
=
this
.
props
.
navigation
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
>
智能问题
<
/Text
>
<
Text
>
页面
<
/Text
>
<
/View
>
);
}
...
...
@@ -67,5 +42,5 @@ const styles = StyleSheet.create({
justifyContent
:
"flex-start"
,
alignItems
:
"stretch"
,
backgroundColor
:
"#EFEFEF"
}
,
}
});
...
...
Please
register
or
login
to post a comment