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 08:03:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f36fcd9e5beaa165ec078a8ce11c22450a4c1482
f36fcd9e
1 parent
46d59e73
开始处理客户管理的回调
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
ios/ProtectGod.xcodeproj/xcshareddata/xcschemes/ProtectGod.xcscheme
src/pages/Home/AISolution/Question.js
ios/ProtectGod.xcodeproj/xcshareddata/xcschemes/ProtectGod.xcscheme
View file @
f36fcd9
...
...
@@ -81,7 +81,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration =
"
Debug
"
buildConfiguration =
"
Release
"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
...
...
src/pages/Home/AISolution/Question.js
View file @
f36fcd9
...
...
@@ -9,14 +9,18 @@ import {
ScrollView
,
ListView
,
Dimensions
,
DatePickerIOS
DatePickerIOS
,
AsyncStorage
}
from
"react-native"
;
import
{
StackNavigator
,
TabNavigator
}
from
"react-navigation"
;
import
post
from
"../../../utils/fetch"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
IS_LOGIN
:
""
,
USER_ID
:
""
,
QuesList
:
[
{
title
:
"1.我该称呼您先生还是女士呢?"
,
...
...
@@ -59,7 +63,9 @@ export default class Home extends Component {
date
:
new
Date
()
};
}
componentWillMount
()
{}
componentWillMount
()
{
this
.
getAsyncStorage
();
}
componentDidMount
()
{}
...
...
@@ -91,6 +97,19 @@ export default class Home extends Component {
});
}
getAsyncStorage
()
{
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
]
:
""
});
});
}
_renderQuestion
()
{
return
this
.
state
.
QuesList
.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -155,6 +174,7 @@ export default class Home extends Component {
submit
()
{
const
that
=
this
;
const
{
answerList
,
USER_ID
}
=
this
.
state
;
const
{
navigate
}
=
this
.
props
.
navigation
;
let
Temp
=
this
.
state
.
QuesList
.
map
(
item
=>
item
.
answers
[
item
.
selected
]);
console
.
log
(
Temp
);
...
...
@@ -164,7 +184,21 @@ export default class Home extends Component {
answerList
:
Temp
},
()
=>
{
post
(
`/test/insurance/advice`
,
{
userid
:
USER_ID
,
// result: answerList
},
res
=>
{
Alert
.
alert
(
"导入成功,点击“OK”查看结果"
,
null
,
()
=>
{
navigate
(
"AISolution"
,
{
answerList
:
that
.
state
.
answerList
});
});
},
err
=>
{
console
.
log
(
err
);
}
);
}
);
}
...
...
Please
register
or
login
to post a comment