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-19 12:03:40 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e92dc7f9d25ba4f10ab62f30599ba30e29b0d804
e92dc7f9
1 parent
5c7f81d9
中央文案 发现
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
3 deletions
index.ios.js
ios/ProtectGod.xcodeproj/xcshareddata/xcschemes/ProtectGod.xcscheme
src/Components/ProductTemplate.js
src/pages/Discover/index.js
index.ios.js
View file @
e92dc7f
...
...
@@ -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
Discover
from
"./src/pages/Discover/index"
;
// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
const
MainTabBar
=
TabNavigator
({
...
...
@@ -44,6 +45,20 @@ const MainTabBar = TabNavigator({
)
}
},
Discover
:
{
screen
:
Discover
,
navigationOptions
:
{
title
:
"发现"
,
// header: null,
// tabBarVisible: false,
tabBarIcon
:
({
focused
})
=>
focused
?
(
<
Image
source
=
{
require
(
"./src/assets/tabbar/ic_discover_s.png"
)}
/
>
)
:
(
<
Image
source
=
{
require
(
"./src/assets/tabbar/ic_discover_n.png"
)}
/
>
)
}
},
InsuranceChurch
:
{
screen
:
InsuranceChurch
,
navigationOptions
:
{
...
...
@@ -89,7 +104,8 @@ const ProtectGod = StackNavigator(
},
ProductTemplate
:
{
screen
:
ProductTemplate
},
ArticleTemplate
:
{
screen
:
ArticleTemplate
},
Details
:
{
screen
:
Details
}
Details
:
{
screen
:
Details
},
Discover
:
{
screen
:
Discover
}
},{
navigationOptions
:
{
// headerTintColor: "blue",
...
...
ios/ProtectGod.xcodeproj/xcshareddata/xcschemes/ProtectGod.xcscheme
View file @
e92dc7f
...
...
@@ -80,7 +80,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration =
"
Release
"
buildConfiguration =
"
Debug
"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
...
...
src/Components/ProductTemplate.js
View file @
e92dc7f
...
...
@@ -121,7 +121,9 @@ const styles = StyleSheet.create({
justifyContent
:
"flex-start"
,
backgroundColor
:
"#EFEFEF"
},
scrollViewContainer
:
{},
scrollViewContainer
:
{
marginBottom
:
49
,
},
headerContainer
:
{},
headerImage
:
{
width
:
Dimensions
.
get
(
"window"
).
width
,
...
...
src/pages/Discover/index.js
0 → 100644
View file @
e92dc7f
import
React
,
{
Component
}
from
"react"
;
import
{
StyleSheet
,
WebView
,
View
,
Image
,
Dimensions
,
ScrollView
,
Text
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
export
default
class
Discover
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
image
:
""
,
};
}
componentWillMount
()
{
this
.
getImages
();
}
getImages
()
{
let
that
=
this
,
id
=
this
.
state
.
id
,
model
=
this
.
state
.
model
;
return
fetch
(
`https://devpay.brae.co/test/insurance/wallpaper`
,
{
method
:
"POST"
,
headers
:
{
Accept
:
"application/json"
,
"Content-Type"
:
"application/json"
}
})
.
then
(
resp
=>
{
console
.
log
(
"大爷"
,
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
({
image
:
respJson
.
data
.
image
});
console
.
log
(
"图片文章"
,
respJson
.
data
);
}
});
}
render
()
{
const
{
image
}
=
this
.
state
;
return
(
<
View
style
=
{
styles
.
container
}
>
{
/* <Text>图片首页</Text> */
}
<
Image
style
=
{
styles
.
image
}
source
=
{{
uri
:
image
}}
resizeMode
=
"contain"
>
<
Text
>
中央文案
<
/Text
>
<
/Image
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
"white"
},
image
:
{
width
:
Dimensions
.
get
(
"window"
).
width
,
height
:
Dimensions
.
get
(
"window"
).
height
,
justifyContent
:
"center"
,
alignItems
:
"center"
,
}
});
...
...
Please
register
or
login
to post a comment