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-27 16:54:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7f4485636fc3a0c35550e7097b52acd90bae705f
7f448563
1 parent
8d439360
发布按钮的条件判断
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
24 deletions
index.ios.js
src/pages/Home/AISolution/Solution.js
src/pages/InsuranceCircle/index.js
index.ios.js
View file @
7f44856
...
...
@@ -115,7 +115,10 @@ const ProtectGod = StackNavigator(
ProductTemplate
:
{
screen
:
ProductTemplate
},
ArticleTemplate
:
{
screen
:
ArticleTemplate
},
Details
:
{
screen
:
Details
},
Release
:
{
screen
:
Release
},
Release
:
{
screen
:
Release
,
navigationOptions
:
{
headerTitle
:
"发布"
}
},
Discover
:
{
screen
:
Discover
},
AIBegin
:
{
screen
:
AIBegin
,
...
...
@@ -140,7 +143,7 @@ const ProtectGod = StackNavigator(
HealthResult
:
{
screen
:
HealthResult
,
navigationOptions
:
{
headerTitle
:
"健康问卷"
}
}
,
}
},
{
navigationOptions
:
{
...
...
src/pages/Home/AISolution/Solution.js
View file @
7f44856
...
...
@@ -19,6 +19,8 @@ export default class Home extends Component {
this
.
state
=
{
gridData
:
{
title
:
[
"角色"
,
"建议产品"
,
"建议保额"
,
"保险年限"
,
"缴费期限"
,
"年缴保费"
],
actor
:
"父亲"
,
age
:
"42岁"
,
products
:
[
{
name
:
"成人意外险"
,
...
...
src/pages/InsuranceCircle/index.js
View file @
7f44856
...
...
@@ -7,15 +7,30 @@ import {
ScrollView
,
TouchableOpacity
,
Image
,
AsyncStorage
,
Alert
,
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
Details
from
"./details"
;
export
default
class
InsuranceCircle
extends
Component
{
static
navigationOptions
=
{
// headerRight: this._rightBtn()
}
static
navigationOptions
=
({
navigation
})
=>
{
const
{
state
,
setParams
,
navigate
}
=
navigation
;
// console.log("保圈页面-发布", state);
return
{
headerRight
:
(
<
TouchableOpacity
style
=
{{
marginRight
:
13
}}
onPress
=
{()
=>
state
.
params
.
testLoginAndGo
()}
>
<
Image
source
=
{
require
(
"../../assets/circle/ic_announce.png"
)}
style
=
{{
width
:
19
,
height
:
19
}}
/
>
<
/TouchableOpacity
>
)
};
};
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
...
...
@@ -23,37 +38,68 @@ export default class InsuranceCircle extends Component {
IS_LOGIN
:
""
,
USER_ID
:
""
,
NICKNAME
:
""
,
PROFESSION
:
""
,
PROFESSION
:
""
};
}
componentWillMount
()
{
this
.
getAsyncStorage
();
//
this.getAsyncStorage();
this
.
getArticles
();
}
_rightBtn
()
{
return
(
<
TouchableOpacity
style
=
{{
marginRight
:
13
}}
onPress
=
{()
=>
{}}
>
<
Image
source
=
{
require
(
"../../assets/circle/ic_announce.png"
)}
style
=
{{
width
:
19
,
height
:
19
}}
/
>
<
/TouchableOpacity
>
)
componentDidMount
()
{
this
.
props
.
navigation
.
setParams
({
testLoginAndGo
:
this
.
testLoginAndGo
.
bind
(
this
)
});
}
testLoginAndGo
()
{
const
that
=
this
;
const
{
navigate
}
=
this
.
props
.
navigation
;
console
.
log
(
"为何是underfined?"
,
this
);
// this.getAsyncStorage();
AsyncStorage
.
multiGet
(
[
"IS_LOGIN"
,
"USER_ID"
,
"NICKNAME"
,
"PROFESSION"
],
(
err
,
result
)
=>
{
if
(
err
)
{
console
.
error
(
err
);
}
console
.
log
(
"点击登录后的值"
,
result
);
that
.
setState
({
IS_LOGIN
:
result
[
0
][
1
],
USER_ID
:
result
[
1
][
1
]
!=
null
?
result
[
1
][
1
]
:
""
,
NICKNAME
:
result
[
2
][
1
]
!=
null
?
result
[
2
][
1
]
:
""
,
PROFESSION
:
result
[
3
][
1
]
!=
null
?
result
[
3
][
1
]
:
""
},()
=>
{
if
(
this
.
state
.
IS_LOGIN
==
'yes'
)
{
navigate
(
"Release"
);
}
else
{
Alert
.
alert
(
"请先登录账号"
);
}
});
}
);
// if (this.state.IS_LOGIN == 'yes') {
// navigate("Release");
// } else {
// Alert.alert("请先登录账号");
// }
}
getAsyncStorage
()
{
const
that
=
this
;
AsyncStorage
.
multiGet
([
"IS_LOGIN"
,
"USER_ID"
,
"NICKNAME"
,
"PROFESSION"
],(
err
,
result
)
=>
{
AsyncStorage
.
multiGet
(
[
"IS_LOGIN"
,
"USER_ID"
,
"NICKNAME"
,
"PROFESSION"
],
(
err
,
result
)
=>
{
if
(
err
)
{
console
.
error
(
err
);
}
console
.
log
(
"点击登录后的值"
,
result
)
console
.
log
(
"点击登录后的值"
,
result
);
that
.
setState
({
IS_LOGIN
:
result
[
0
][
1
],
USER_ID
:
(
result
[
1
][
1
]
!=
null
)
?
result
[
1
][
1
]
:
""
,
NICKNAME
:
(
result
[
2
][
1
]
!=
null
)
?
result
[
2
][
1
]
:
""
,
PROFESSION
:
(
result
[
3
][
1
]
!=
null
)
?
result
[
3
][
1
]
:
""
,
})
})
USER_ID
:
result
[
1
][
1
]
!=
null
?
result
[
1
][
1
]
:
""
,
NICKNAME
:
result
[
2
][
1
]
!=
null
?
result
[
2
][
1
]
:
""
,
PROFESSION
:
result
[
3
][
1
]
!=
null
?
result
[
3
][
1
]
:
""
});
}
);
}
getArticles
()
{
...
...
@@ -78,7 +124,7 @@ export default class InsuranceCircle extends Component {
alert
(
respJson
.
cnmsg
);
}
else
{
that
.
setState
({
ListData
:
respJson
.
data
.
data
,
ListData
:
respJson
.
data
.
data
});
console
.
log
(
"state.ListData"
,
this
.
state
.
ListData
);
}
...
...
Please
register
or
login
to post a comment