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-14 09:02:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dd6fc240324ebf8f21cf217eab366cec244631ad
dd6fc240
1 parent
fbd52a15
长图OK
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
5 deletions
index.ios.js
src/Components/CommonImageView.js
src/pages/Home/allProduct.js
index.ios.js
View file @
dd6fc24
...
...
@@ -15,6 +15,7 @@ import Mine from "./src/pages/Mine/index";
import
Login
from
"./src/pages/Login"
;
import
AllProduct
from
"./src/pages/Home/allProduct"
;
import
CommonWebView
from
"./src/Components/CommonWebView"
;
import
CommonImageView
from
"./src/Components/CommonImageView"
;
import
Details
from
"./src/pages/InsuranceCircle/details"
;
// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
...
...
@@ -87,6 +88,7 @@ const ProtectGod = StackNavigator(
navigationOptions
:
{
headerTitle
:
"全部产品"
}
},
CommonWebView
:
{
screen
:
CommonWebView
},
CommonImageView
:
{
screen
:
CommonImageView
},
Details
:
{
screen
:
Details
}
},{
navigationOptions
:
{
...
...
src/Components/CommonImageView.js
0 → 100644
View file @
dd6fc24
import
React
,
{
Component
}
from
"react"
;
import
{
StyleSheet
,
WebView
,
View
,
Image
,
Dimensions
,
ScrollView
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
export
default
class
CommonImageView
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
console
.
log
(
"Image index"
,
this
.
props
.
navigation
.
state
.
params
.
index
);
const
index
=
this
.
props
.
navigation
.
state
.
params
.
index
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
>
{
index
==
0
?
(
<
Image
style
=
{
styles
.
imgOne
}
resizeMode
=
"contain"
source
=
{
require
(
"../assets/home/product_long_1.jpg"
)}
/
>
)
:
(
<
Image
style
=
{
styles
.
imgTwo
}
resizeMode
=
"contain"
source
=
{
require
(
"../assets/home/product_long_2.jpg"
)}
/
>
)}
<
/ScrollView
>
<
/View
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
// paddingTop: 64,
justifyContent
:
"flex-start"
,
// alignItems: "stretch",
backgroundColor
:
"#EFEFEF"
,
// paddingLeft: 10,
// paddingRight: 10
},
imgOne
:
{
width
:
Dimensions
.
get
(
"window"
).
width
,
// height: Dimensions.get("window").width * 640 / 3118,
height
:
Dimensions
.
get
(
"window"
).
width
*
3118
/
640
,
},
imgTwo
:
{
width
:
Dimensions
.
get
(
"window"
).
width
,
// height: Dimensions.get("window").width * 690 / 1651,
height
:
Dimensions
.
get
(
"window"
).
width
*
1651
/
690
,
}
});
...
...
src/pages/Home/allProduct.js
View file @
dd6fc24
...
...
@@ -10,6 +10,7 @@ import {
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
'react-navigation'
;
import
CommonWebView
from
"../../Components/CommonWebView"
;
import
CommonImageView
from
"../../Components/CommonImageView"
;
export
default
class
AllProduct
extends
Component
{
...
...
@@ -20,15 +21,15 @@ export default class AllProduct extends Component {
{
title
:
"平安e生保2017版-100万(有社保含新农合)"
,
time
:
"刚刚"
,
url
:
"http://hankschan.legendh5.com/h5/b8302dac-0563-478c-ff82-ba8ab20c1cb3.html"
,
//
url: require("../../assets/home/product_long_1.jpg"),
//
url: "http://hankschan.legendh5.com/h5/b8302dac-0563-478c-ff82-ba8ab20c1cb3.html",
url
:
require
(
"../../assets/home/product_long_1.jpg"
),
imgurl
:
require
(
"../../assets/home/product_1.png"
)
},
{
title
:
"泰康在线“住院宝”必备版(0-49周岁)"
,
time
:
"刚刚"
,
url
:
"http://hankschan.legendh5.com/h5/f782ab69-6515-3e70-025a-5da78f1f745f.html"
,
// url: require("../../assets/home/product_long_1
.jpg"),
//
url: "http://hankschan.legendh5.com/h5/f782ab69-6515-3e70-025a-5da78f1f745f.html",
url
:
require
(
"../../assets/home/product_long_2
.jpg"
),
imgurl
:
require
(
"../../assets/home/product_2.png"
)
},
]
...
...
@@ -49,7 +50,7 @@ export default class AllProduct extends Component {
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
key
=
{
index
}
onPress
=
{()
=>
navigate
(
"Common
Webview"
,
{
item
:
item
})}
onPress
=
{()
=>
navigate
(
"Common
ImageView"
,
{
index
:
index
})}
>
<
Image
style
=
{
styles
.
itemImgWrapper
}
source
=
{
item
.
imgurl
}
/
>
<
View
style
=
{
styles
.
itemRightWrapper
}
>
...
...
Please
register
or
login
to post a comment