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-27 15:45:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8d439360bd9ce645e316308eee065ee408f2a176
8d439360
1 parent
1a09c4a3
发布
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
4 deletions
index.ios.js
src/pages/InsuranceCircle/details.js
src/pages/InsuranceCircle/index.js
src/pages/InsuranceCircle/release.js
src/pages/Login.js
index.ios.js
View file @
8d43936
...
...
@@ -17,6 +17,7 @@ import AllProduct from "./src/pages/Home/allProduct";
import
ProductTemplate
from
"./src/Components/ProductTemplate"
;
import
ArticleTemplate
from
"./src/Components/articleTemplate"
;
import
Details
from
"./src/pages/InsuranceCircle/details"
;
import
Release
from
"./src/pages/InsuranceCircle/release"
;
import
Discover
from
"./src/pages/Discover/index"
;
import
AIBegin
from
"./src/pages/Home/AISolution/Begin"
;
import
AIQuestion
from
"./src/pages/Home/AISolution/Question"
;
...
...
@@ -114,6 +115,7 @@ const ProtectGod = StackNavigator(
ProductTemplate
:
{
screen
:
ProductTemplate
},
ArticleTemplate
:
{
screen
:
ArticleTemplate
},
Details
:
{
screen
:
Details
},
Release
:
{
screen
:
Release
},
Discover
:
{
screen
:
Discover
},
AIBegin
:
{
screen
:
AIBegin
,
...
...
src/pages/InsuranceCircle/details.js
View file @
8d43936
...
...
@@ -238,11 +238,7 @@ const styles = StyleSheet.create({
backgroundColor
:
"white"
},
KAVContainer
:
{
// flex: 1,
justifyContent
:
"center"
// paddingBottom: 52,
// paddingHorizontal: 20,
// paddingTop: 20,
},
scrollViewContainer
:
{
flex
:
1
...
...
src/pages/InsuranceCircle/index.js
View file @
8d43936
...
...
@@ -12,17 +12,50 @@ import { StackNavigator, TabNavigator } from "react-navigation";
import
Details
from
"./details"
;
export
default
class
InsuranceCircle
extends
Component
{
static
navigationOptions
=
{
// headerRight: this._rightBtn()
}
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
ListData
:
[],
IS_LOGIN
:
""
,
USER_ID
:
""
,
NICKNAME
:
""
,
PROFESSION
:
""
,
};
}
componentWillMount
()
{
this
.
getAsyncStorage
();
this
.
getArticles
();
}
_rightBtn
()
{
return
(
<
TouchableOpacity
style
=
{{
marginRight
:
13
}}
onPress
=
{()
=>
{}}
>
<
Image
source
=
{
require
(
"../../assets/circle/ic_announce.png"
)}
style
=
{{
width
:
19
,
height
:
19
}}
/
>
<
/TouchableOpacity
>
)
}
getAsyncStorage
()
{
const
that
=
this
;
AsyncStorage
.
multiGet
([
"IS_LOGIN"
,
"USER_ID"
,
"NICKNAME"
,
"PROFESSION"
],(
err
,
result
)
=>
{
if
(
err
)
{
console
.
error
(
err
);
}
console
.
log
(
"点击登录后的值"
,
result
)
that
.
setState
({
IS_LOGIN
:
result
[
0
][
1
],
USER_ID
:
(
result
[
1
][
1
]
!=
null
)
?
result
[
1
][
1
]
:
""
,
NICKNAME
:
(
result
[
2
][
1
]
!=
null
)
?
result
[
2
][
1
]
:
""
,
PROFESSION
:
(
result
[
3
][
1
]
!=
null
)
?
result
[
3
][
1
]
:
""
,
})
})
}
getArticles
()
{
var
that
=
this
;
// 请求文章数据
...
...
src/pages/InsuranceCircle/release.js
0 → 100644
View file @
8d43936
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/Login.js
View file @
8d43936
Please
register
or
login
to post a comment