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-10-01 13:27:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
aea70106fc1276f6edf5b522a47325f450693647
aea70106
1 parent
1493e7e1
share
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
26 deletions
src/Components/articleTemplate.js
src/pages/Home/index.js
src/pages/InsuranceChurch/index.js
src/pages/Mine/discover.js
src/Components/articleTemplate.js
View file @
aea7010
...
...
@@ -25,7 +25,7 @@ export default class ArticleTemplate extends Component {
style
=
{{
marginRight
:
13
}}
onPress
=
{()
=>
state
.
params
.
share
()}
>
<
Text
>
分享
<
/Text
>
<
Text
style
=
{{
fontSize
:
16
,
color
:
"#0071E1"
}}
>
分享
<
/Text
>
<
/TouchableOpacity
>
)
};
...
...
@@ -33,10 +33,11 @@ export default class ArticleTemplate extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
IS_LOGIN
:
''
,
USER_ID
:
''
,
IS_LOGIN
:
""
,
USER_ID
:
""
,
id
:
this
.
props
.
navigation
.
state
.
params
.
item
.
id
,
model
:
this
.
props
.
navigation
.
state
.
params
.
model
,
type
:
this
.
props
.
navigation
.
state
.
params
.
type
,
articleData
:
{
paragraph
:
[]
}
...
...
@@ -51,23 +52,26 @@ export default class ArticleTemplate extends Component {
share
:
this
.
share
.
bind
(
this
)
});
}
componentDidMount
()
{
console
.
log
(
`https://devpay.brae.co/insurance.html?uid=
${
this
.
state
.
USER_ID
}
&sid=
${
this
.
state
.
id
}
`
)
}
componentDidMount
()
{}
share
()
{
const
that
=
this
;
console
.
log
(
"share"
)
Share
.
share
(
{
Share
.
share
(
{
title
:
"保护神"
,
message
:
this
.
state
.
articleData
.
title
,
url
:
`https://devpay.brae.co/insurance.html?uid=
${
this
.
state
.
USER_ID
}
&sid=
${
this
.
state
.
id
}
`
},{
// dialogTitle: 'Share React Native website',
excludedActivityTypes
:
[
'com.apple.UIKit.activity.PostToTwitter'
],
tintColor
:
'green'
})
message
:
that
.
state
.
articleData
.
title
,
url
:
that
.
state
.
type
==
"home"
?
`https://devpay.brae.co/insurance.html?uid=
${
this
.
state
.
USER_ID
}
&tid=
${
this
.
state
.
id
}
`
:
`https://devpay.brae.co/insurance.html?uid=
${
this
.
state
.
USER_ID
}
&sid=
${
this
.
state
.
id
}
`
},
{
excludedActivityTypes
:
[
"com.apple.UIKit.activity.PostToTwitter"
],
tintColor
:
"green"
}
)
.
then
(
that
.
_showResult
)
.
catch
(
error
=>
this
.
setState
({
result
:
"error: "
+
error
.
message
}));
}
...
...
@@ -96,7 +100,7 @@ export default class ArticleTemplate extends Component {
}
})
.
then
(
resp
=>
{
console
.
log
(
"大爷"
,
resp
);
console
.
log
(
"大爷"
,
resp
);
if
(
resp
.
status
===
200
)
{
return
resp
.
json
();
}
else
{
...
...
@@ -135,12 +139,19 @@ export default class ArticleTemplate extends Component {
)
:
null
}
{
item
.
image
?
(
<
Image
style
=
{{
width
:
item
.
width
,
height
:
item
.
height
,
alignSelf
:
"center"
,
marginBottom
:
20
}}
style
=
{{
width
:
item
.
width
,
height
:
item
.
height
,
alignSelf
:
"center"
,
marginBottom
:
20
}}
resizeMode
=
"contain"
source
=
{{
uri
:
item
.
image
}}
/
>
)
:
null
}
<
Text
style
=
{
styles
.
paragraphContent
}
>
{
" "
+
item
.
content
}
<
/Text
>
<
Text
style
=
{
styles
.
paragraphContent
}
>
{
" "
+
item
.
content
}
<
/Text
>
<
/View
>
);
})}
...
...
@@ -194,7 +205,7 @@ const styles = StyleSheet.create({
fontSize
:
15
,
marginBottom
:
15
,
lineHeight
:
28
,
textAlign
:
"center"
,
textAlign
:
"center"
// backgroundColor: "red",
},
paragraphImage
:
{
...
...
@@ -206,7 +217,7 @@ const styles = StyleSheet.create({
paragraphContent
:
{
color
:
"#555555"
,
fontSize
:
15
,
lineHeight
:
25
,
lineHeight
:
25
// backgroundColor: "yellow",
}
});
...
...
src/pages/Home/index.js
View file @
aea7010
...
...
@@ -259,7 +259,7 @@ export default class Home extends Component {
<
TouchableOpacity
style
=
{
styles
.
itemContainer
}
onPress
=
{()
=>
navigate
(
"ArticleTemplate"
,
{
item
:
item
,
model
:
"topic"
})}
navigate
(
"ArticleTemplate"
,
{
item
:
item
,
model
:
"topic"
,
type
:
"home"
})}
>
<
View
style
=
{
styles
.
itemImgWrapper
}
>
<
Image
...
...
src/pages/InsuranceChurch/index.js
View file @
aea7010
...
...
@@ -71,7 +71,7 @@ export default class InsuranceChurch extends Component {
style
=
{
styles
.
itemContainer
}
key
=
{
index
}
onPress
=
{()
=>
navigate
(
"ArticleTemplate"
,
{
item
:
item
,
model
:
"story"
})}
navigate
(
"ArticleTemplate"
,
{
item
:
item
,
model
:
"story"
,
type
:
"church"
})}
>
<
Image
style
=
{
styles
.
itemImgWrapper
}
...
...
src/pages/Mine/discover.js
View file @
aea7010
...
...
@@ -124,14 +124,14 @@ export default class Discover extends Component {
/
>
<
Text
style
=
{
styles
.
btnText
}
>
复制文案
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
{
/*
<TouchableOpacity
style={styles.shareContaier}
onPress={() => {
this.ShareSomething();
}}
>
<Text style={styles.shareText}>分享</Text>
<
/TouchableOpacity
>
</TouchableOpacity>
*/
}
<
/Image
>
);
}
...
...
Please
register
or
login
to post a comment