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 10:17:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
52e9c7e54f66a2321f4ae83cb2b804500d288606
52e9c7e5
1 parent
a4247ce8
6s 适配OK
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
71 deletions
index.ios.js
src/Components/CommonWebView.js
src/Components/ProductTemplate.js
src/pages/Home/index.js
src/pages/InsuranceChurch/index.js
src/pages/InsuranceCircle/details.js
src/pages/InsuranceCircle/index.js
index.ios.js
View file @
52e9c7e
...
...
@@ -14,7 +14,6 @@ import InsuranceChurch from "./src/pages/InsuranceChurch/index";
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
ProductTemplate
from
"./src/Components/ProductTemplate"
;
import
ArticleTemplate
from
"./src/Components/articleTemplate"
;
import
Details
from
"./src/pages/InsuranceCircle/details"
;
...
...
@@ -88,7 +87,6 @@ const ProtectGod = StackNavigator(
screen
:
AllProduct
,
navigationOptions
:
{
headerTitle
:
"全部产品"
}
},
CommonWebView
:
{
screen
:
CommonWebView
},
ProductTemplate
:
{
screen
:
ProductTemplate
},
ArticleTemplate
:
{
screen
:
ArticleTemplate
},
Details
:
{
screen
:
Details
}
...
...
src/Components/CommonWebView.js
deleted
100644 → 0
View file @
a4247ce
import
React
,
{
Component
}
from
'react'
;
import
{
StyleSheet
,
WebView
,
View
,
Image
,
Dimensions
}
from
'react-native'
;
import
{
StackNavigator
,
TabNavigator
}
from
'react-navigation'
;
export
default
class
CommonWebview
extends
Component
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
console
.
log
(
"url"
,
this
.
props
)
const
url
=
this
.
props
.
navigation
.
state
.
params
.
item
.
url
;
return
(
<
WebView
style
=
{
styles
.
container
}
source
=
{{
uri
:
this
.
props
.
navigation
.
state
.
params
.
item
.
url
}}
/
>
);
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
paddingTop
:
64
,
justifyContent
:
"flex-start"
,
alignItems
:
"stretch"
,
backgroundColor
:
"#EFEFEF"
,
paddingLeft
:
10
,
paddingRight
:
10
,
},
// img: {
// width: Dimensions.get("window").width - 20,
// },
});
src/Components/ProductTemplate.js
View file @
52e9c7e
...
...
@@ -7,7 +7,8 @@ import {
Dimensions
,
ScrollView
,
Text
,
TouchableOpacity
TouchableOpacity
,
Alert
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
...
...
@@ -100,7 +101,12 @@ export default class ProductTemplate extends Component {
<
View
style
=
{
styles
.
footerLeft
}
>
<
Text
style
=
{
styles
.
price
}
>
{
item
.
price
}
<
/Text
>
<
/View
>
<
TouchableOpacity
style
=
{
styles
.
footerRight
}
>
<
TouchableOpacity
style
=
{
styles
.
footerRight
}
onPress
=
{()
=>
{
Alert
.
alert
(
"您好,网站正在备案中,暂时无法投保。"
)
}}
>
<
Text
style
=
{
styles
.
button
}
>
立即投保
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
...
...
src/pages/Home/index.js
View file @
52e9c7e
...
...
@@ -13,8 +13,6 @@ import {
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
Swiper
from
"react-native-swiper"
;
// import AllProduct from "./allProduct";
import
CommonWebView
from
"../../Components/CommonWebView"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
...
...
@@ -24,17 +22,11 @@ export default class Home extends Component {
this
.
state
=
{
ListData
:
[],
swiperImgList
:
[
// {
// img: require("../../assets/home/slider_1.jpeg")
// // url: "https://www.baidu.com/"
// },
{
img
:
require
(
"../../assets/home/slider_2.jpeg"
)
// url: "https://www.baidu.com/"
},
{
img
:
require
(
"../../assets/home/slider_3.jpeg"
)
// url: "https://www.baidu.com/"
}
]
};
...
...
@@ -143,9 +135,6 @@ export default class Home extends Component {
}}
>
{
this
.
state
.
swiperImgList
.
map
((
item
,
index
)
=>
{
{
/* console.log("图片item",item); */
}
return
(
<
TouchableOpacity
style
=
{
styles
.
slide
}
key
=
{
index
}
>
<
Image
...
...
src/pages/InsuranceChurch/index.js
View file @
52e9c7e
...
...
@@ -9,8 +9,7 @@ import {
Image
,
ListView
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
'react-navigation'
;
import
CommonWebView
from
"../../Components/CommonWebView"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
export
default
class
InsuranceChurch
extends
Component
{
// static navigationOptions = {
...
...
@@ -25,6 +24,7 @@ export default class InsuranceChurch extends Component {
componentWillMount
()
{
this
.
getListData
();
}
getListData
()
{
let
that
=
this
;
return
fetch
(
`https://devpay.brae.co/test/insurance/story`
,
{
...
...
@@ -47,30 +47,36 @@ export default class InsuranceChurch extends Component {
}
else
{
that
.
setState
({
ListData
:
respJson
.
data
.
story
})
console
.
log
(
"保堂列表"
,
respJson
.
data
.
story
)
})
;
console
.
log
(
"保堂列表"
,
respJson
.
data
.
story
);
}
});
}
render
()
{
const
{
navigate
}
=
this
.
props
.
navigation
;
const
ds
=
new
ListView
.
DataSource
({
rowHasChanged
:
(
r1
,
r2
)
=>
r1
!==
r2
});
const
ds
=
new
ListView
.
DataSource
({
rowHasChanged
:
(
r1
,
r2
)
=>
r1
!==
r2
});
const
dataSource
=
ds
.
cloneWithRows
(
this
.
state
.
ListData
);
return
(
<
View
style
=
{
styles
.
container
}
>
<
ListView
style
=
{
styles
.
scrollViewContainer
}
dataSource
=
{
dataSource
}
enableEmptySections
=
{
true
}
renderRow
=
{(
item
,
index
)
=>
{
enableEmptySections
=
{
true
}
renderRow
=
{(
item
,
index
)
=>
{
return
(
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
key
=
{
index
}
onPress
=
{()
=>
navigate
(
"ArticleTemplate"
,
{
item
:
item
,
model
:
"story"
})}
onPress
=
{()
=>
navigate
(
"ArticleTemplate"
,
{
item
:
item
,
model
:
"story"
})}
>
<
Image
style
=
{
styles
.
itemImgWrapper
}
source
=
{{
uri
:
item
.
imgurl
}}
/
>
<
Image
style
=
{
styles
.
itemImgWrapper
}
source
=
{{
uri
:
item
.
imgurl
}}
/
>
<
View
style
=
{
styles
.
itemRightWrapper
}
>
<
Text
style
=
{
styles
.
itemTextTop
}
numberOfLines
=
{
2
}
>
{
item
.
title
}
...
...
@@ -78,7 +84,7 @@ export default class InsuranceChurch extends Component {
<
Text
style
=
{
styles
.
itemTextBottom
}
>
{
item
.
time
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
)
)
;
}}
/
>
<
Text
style
=
{
styles
.
scrollViewText
}
>
没有更多了
<
/Text
>
...
...
@@ -92,10 +98,10 @@ const styles = StyleSheet.create({
flex
:
1
,
justifyContent
:
"flex-start"
,
alignItems
:
"stretch"
,
backgroundColor
:
"#EFEFEF"
,
backgroundColor
:
"#EFEFEF"
},
scrollViewContainer
:
{
flex
:
1
,
flex
:
1
},
scrollViewText
:
{
color
:
"#7A7A7A"
,
...
...
src/pages/InsuranceCircle/details.js
View file @
52e9c7e
...
...
@@ -14,7 +14,6 @@ import {
Dimensions
,
Keyboard
}
from
"react-native"
;
import
WebView
from
"../../Components/CommonWebView"
;
export
default
class
Details
extends
Component
{
constructor
(
props
)
{
...
...
src/pages/InsuranceCircle/index.js
View file @
52e9c7e
...
...
@@ -9,7 +9,6 @@ import {
Image
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
CommonWebView
from
"../../Components/CommonWebView"
;
import
Details
from
"./details"
;
export
default
class
InsuranceCircle
extends
Component
{
...
...
Please
register
or
login
to post a comment