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 14:53:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
524f04eb51f0b5efc6d6181448e76b918f2766ae
524f04eb
1 parent
eabf5f55
OK
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
src/Components/articleTemplate.js
src/Components/articleTemplate.js
View file @
524f04e
...
...
@@ -11,7 +11,8 @@ import {
ListView
,
Share
,
TouchableOpacity
,
AsyncStorage
AsyncStorage
,
Alert
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
post
from
"../utils/fetch"
;
...
...
@@ -56,6 +57,19 @@ export default class ArticleTemplate extends Component {
share
()
{
const
that
=
this
;
AsyncStorage
.
multiGet
([
"IS_LOGIN"
,
"USER_ID"
],
(
err
,
result
)
=>
{
if
(
err
)
{
console
.
error
(
err
);
}
that
.
setState
(
{
IS_LOGIN
:
result
[
0
][
1
],
USER_ID
:
result
[
1
][
1
]
!=
null
?
result
[
1
][
1
]
:
""
},
()
=>
{
if
(
that
.
state
.
IS_LOGIN
!=
"yes"
)
{
Alert
.
alert
(
"请先登录账号"
);
}
else
{
Share
.
share
(
{
title
:
"保护神"
,
...
...
@@ -63,17 +77,25 @@ export default class ArticleTemplate extends Component {
url
:
that
.
state
.
type
==
"home"
?
`https://devpay.brae.co/insurance.html?uid=
${
this
.
state
.
USER_ID
}
&tid=
${
this
.
state
.
id
}
`
.
USER_ID
}
&tid=
${
that
.
state
.
id
}
`
:
`https://devpay.brae.co/insurance.html?uid=
${
this
.
state
.
USER_ID
}
&sid=
${
this
.
state
.
id
}
`
.
USER_ID
}
&sid=
${
that
.
state
.
id
}
`
},
{
excludedActivityTypes
:
[
"com.apple.UIKit.activity.PostToTwitter"
],
excludedActivityTypes
:
[
"com.apple.UIKit.activity.PostToTwitter"
],
tintColor
:
"green"
}
)
.
then
(
that
.
_showResult
)
.
catch
(
error
=>
this
.
setState
({
result
:
"error: "
+
error
.
message
}));
.
catch
(
error
=>
this
.
setState
({
result
:
"error: "
+
error
.
message
})
);
}
}
);
});
}
getAsyncStorage
()
{
...
...
Please
register
or
login
to post a comment