Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
yh_vendor
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
于良
9 years ago
Commit
c90b19fa5214878b2fa40331c3e9171ab541206c
1 parent
b3cb7004
master
...
develop
vendor-2.0.0
6.0.0
2.0.0
1.0.2
1.0.1
1.0.0
ListView使用Immutable Datasource review by 盖剑秋
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
js/containers/DrawerContainer.js
js/containers/HomeContainer.js
js/reducers/home/homeActions.js
js/services/HomeService.js
js/services/Request.js
js/containers/DrawerContainer.js
View file @
c90b19f
...
...
@@ -21,6 +21,7 @@ const actions = [
homeActions
,
];
import
Immutable
,
{
Record
,
List
}
from
'immutable'
;
function
mapStateToProps
(
state
)
{
return
{
...
...
@@ -52,6 +53,7 @@ class DrawerContainer extends Component {
_onPressItem
(
index
)
{
//选择店铺
this
.
drawer
.
close
();
console
.
log
(
index
);
// let item = this.props.user.shops.get(index);
// this.props.actions.switchShop(item.id);
...
...
@@ -98,12 +100,17 @@ class DrawerContainer extends Component {
},
];
let
i
=
List
(
items
);
console
.
log
(
i
);
console
.
log
(
i
.
get
(
0
).
name
);
console
.
log
(
Immutable
.
fromJS
(
items
).
get
(
0
));
const
children
=
this
.
props
.
navigationState
.
children
;
let
disabled
=
children
[
0
].
index
===
0
?
false
:
true
;
//只在第一个tab页启用抽屉菜单
return
(
<
Drawer
ref
=
"navigation"
ref
=
{(
ref
)
=>
this
.
drawer
=
ref
}
type
=
"displace"
content
=
{
<
SideMenu
items
=
{
items
}
onPressItem
=
{
this
.
_onPressItem
}
/>
}
tapToClose
=
{
true
}
...
...
js/containers/HomeContainer.js
View file @
c90b19f
...
...
@@ -97,7 +97,6 @@ class HomeContainer extends Component {
}
componentDidMount
()
{
console
.
log
(
'shopId'
+
this
.
props
.
home
.
shopId
);
this
.
props
.
actions
.
overview
(
this
.
props
.
home
.
shopId
);
}
...
...
js/reducers/home/homeActions.js
View file @
c90b19f
...
...
@@ -54,7 +54,6 @@ export function overview(shopId) {
dispatch
(
overviewRequest
(
shopId
));
return
new
HomeService
().
overview
(
shopId
)
.
then
(
json
=>
{
console
.
log
(
json
);
dispatch
(
overviewSuccess
({
rank
:
76
,
rise
:
true
,
...
...
js/services/HomeService.js
View file @
c90b19f
...
...
@@ -10,7 +10,7 @@ export default class UserService {
}
async
overview
(
shopId
)
{
console
.
log
(
11111
);
return
await
this
.
api
.
get
({
url
:
'/operations/api/v6/category/getCategory'
,
body
:
{
...
...
@@ -18,11 +18,9 @@ export default class UserService {
}
})
.
then
((
json
)
=>
{
console
.
log
(
json
);
return
json
;
})
.
catch
((
error
)
=>
{
console
.
error
(
error
);
throw
(
error
);
});
}
...
...
js/services/Request.js
View file @
c90b19f
...
...
@@ -124,7 +124,6 @@ export default class Request {
}
let
queryStrigPair
=
this
.
_signParam
(
opts
.
body
);
console
.
log
(
opts
);
if
(
opts
.
method
===
'GET'
||
opts
.
method
===
'HEAD'
||
opts
.
method
===
'DELETE'
)
{
opts
.
url
=
opts
.
url
+
'?'
+
queryStrigPair
;
...
...
Please
register
or
login
to post a comment