Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
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
孙凯
8 years ago
Commit
0b0f673698550fc1fdeb3beac7db8dc502b4b2a0
1 parent
e53d9900
add 获取coupon 接口 review by hongmo
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
js/myAssets/reducers/coupon/couponActions.js
js/myAssets/reducers/coupon/couponReducer.js
js/myAssets/reducers/coupon/couponActions.js
View file @
0b0f673
...
...
@@ -141,8 +141,6 @@ function parseCouponList (coupon,status,data) {
unuseCoupon
.
total
=
total
;
let
num
=
unuseCoupon
.
currentPage
*
unuseCoupon
.
pageSize
;
unuseCoupon
.
endReached
=
num
>=
total
;
unuseCoupon
.
isFetching
=
false
;
unuseCoupon
.
error
=
null
;
if
(
coupon
.
unuseCoupon
.
currentPage
>
1
)
{
let
oldList
=
unuseCoupon
.
couponList
;
...
...
@@ -156,8 +154,6 @@ function parseCouponList (coupon,status,data) {
usedCoupon
.
total
=
total
;
let
num
=
usedCoupon
.
currentPage
*
usedCoupon
.
pageSize
;
usedCoupon
.
endReached
=
num
>=
total
;
usedCoupon
.
isFetching
=
false
;
usedCoupon
.
error
=
null
;
if
(
coupon
.
usedCoupon
.
currentPage
>
1
)
{
let
oldList
=
usedCoupon
.
couponList
;
let
list
=
[...
oldList
,
...
data
.
couponList
];
...
...
js/myAssets/reducers/coupon/couponReducer.js
View file @
0b0f673
...
...
@@ -23,7 +23,13 @@ export default function detailReducer(state=initialState, action) {
.
setIn
([
'unuseCoupon'
,
'error'
],
null
);
}
case
UNUSE_COUPON_LIST_SUCCESS
:
{
return
state
.
set
(
'unuseCoupon'
,
action
.
payload
);
return
state
.
setIn
([
'unuseCoupon'
,
'isFetching'
],
false
)
.
setIn
([
'unuseCoupon'
,
'currentPage'
],
action
.
payload
.
currentPage
)
.
setIn
([
'unuseCoupon'
,
'pageSize'
],
action
.
payload
.
pageSize
)
.
setIn
([
'unuseCoupon'
,
'total'
],
action
.
payload
.
total
)
.
setIn
([
'unuseCoupon'
,
'endReached'
],
action
.
payload
.
endReached
)
.
setIn
([
'unuseCoupon'
,
'couponList'
],
Immutable
.
fromJS
(
action
.
payload
.
couponList
))
.
setIn
([
'unuseCoupon'
,
'error'
],
null
);
}
case
UNUSE_COUPON_LIST_FAILURE
:
{
return
state
.
setIn
([
'unuseCoupon'
,
'isFetching'
],
false
)
...
...
@@ -34,7 +40,13 @@ export default function detailReducer(state=initialState, action) {
.
setIn
([
'usedCoupon'
,
'error'
],
null
);
}
case
USED_COUPON_LIST_SUCCESS
:
{
return
state
.
set
(
'usedCoupon'
,
action
.
payload
);
return
state
.
setIn
([
'usedCoupon'
,
'isFetching'
],
false
)
.
setIn
([
'usedCoupon'
,
'currentPage'
],
action
.
payload
.
currentPage
)
.
setIn
([
'usedCoupon'
,
'pageSize'
],
action
.
payload
.
pageSize
)
.
setIn
([
'usedCoupon'
,
'total'
],
action
.
payload
.
total
)
.
setIn
([
'usedCoupon'
,
'endReached'
],
action
.
payload
.
endReached
)
.
setIn
([
'usedCoupon'
,
'couponList'
],
Immutable
.
fromJS
(
action
.
payload
.
couponList
))
.
setIn
([
'usedCoupon'
,
'error'
],
null
);
}
case
USED_COUPON_LIST_FAILURE
:
{
return
state
.
setIn
([
'usedCoupon'
,
'isFetching'
],
false
)
...
...
Please
register
or
login
to post a comment