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
张文文
6 years ago
Commit
cd5ae25caba3849cd4b5a187ebb9721a88048657
1 parent
c6cec21b
获取优惠券信息添加参数 reviewd by 朱傲哲
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
14 deletions
js/groupPurchase/GroupPurchase.js
js/groupPurchase/containers/GroupPurchaseDetailContainer.js
js/groupPurchase/reducers/groupPurchaseDetail/groupPurchaseDetailActions.js
js/groupPurchase/services/GroupPurchaseService.js
js/groupPurchase/GroupPurchase.js
View file @
cd5ae25
...
...
@@ -60,6 +60,7 @@ export default function native(platform) {
FP_NAME
=
{
this
.
props
.
FP_NAME
}
FP_PARAM
=
{
this
.
props
.
FP_PARAM
}
popShare
=
{
this
.
props
.
popShare
}
orderCode
=
{
this
.
props
.
orderCode
}
/
>
<
/Provider
>
);
...
...
js/groupPurchase/containers/GroupPurchaseDetailContainer.js
View file @
cd5ae25
...
...
@@ -72,7 +72,7 @@ class GroupPurchaseDetailContainer extends Component {
this
.
props
.
actions
.
fetchResourceInfo
();
if
(
this
.
props
.
popShare
==
"1"
){
this
.
props
.
actions
.
fetchCouponInfo
();
this
.
props
.
actions
.
fetchCouponInfo
(
this
.
props
.
orderCode
);
}
}
...
...
js/groupPurchase/reducers/groupPurchaseDetail/groupPurchaseDetailActions.js
View file @
cd5ae25
...
...
@@ -183,6 +183,7 @@ export function fetchActivityGroupDetail(FP_NAME, FP_PARAM) {
});
});
};
}
...
...
@@ -241,22 +242,39 @@ export function fetchResourceInfo() {
};
}
export
function
fetchCouponInfo
()
{
export
function
fetchCouponInfo
(
orderCode
)
{
return
(
dispatch
,
getState
)
=>
{
let
{
app
:
{
host
}}
=
getState
();
dispatch
(
couponInfoRequest
());
return
new
GroupPurchaseService
(
host
).
fetchCouponInfo
()
.
then
(
json
=>
{
if
(
typeof
json
===
'string'
&&
json
)
{
dispatch
(
showCouponView
());
dispatch
(
couponInfoSuccess
(
json
));
}
else
{
dispatch
(
showShareView
());
}
let
fetchCouponInfo
=
(
orderCode
,
uid
)
=>
{
dispatch
(
couponInfoRequest
());
return
new
GroupPurchaseService
(
host
).
fetchCouponInfo
(
orderCode
,
uid
)
.
then
(
json
=>
{
if
(
typeof
json
===
'string'
&&
json
)
{
dispatch
(
showCouponView
());
dispatch
(
couponInfoSuccess
(
json
));
}
else
{
dispatch
(
showShareView
());
}
})
.
catch
(
error
=>
{
dispatch
(
showShareView
());
dispatch
(
couponInfoFailure
(
error
));
});
};
ReactNative
.
NativeModules
.
YH_CommonHelper
.
uid
()
.
then
(
uid
=>
{
fetchCouponInfo
(
orderCode
,
uid
);
})
.
catch
(
error
=>
{
dispatch
(
showShareView
());
dispatch
(
couponInfoFailure
(
error
));
ReactNative
.
NativeModules
.
YH_CommonHelper
.
login
()
.
then
(
uid
=>
{
fetchCouponInfo
(
orderCode
,
uid
);
})
.
catch
(
error
=>
{
});
});
};
}
...
...
js/groupPurchase/services/GroupPurchaseService.js
View file @
cd5ae25
...
...
@@ -135,10 +135,12 @@ export default class groupPurchaseService {
});
}
async
fetchCouponInfo
()
{
async
fetchCouponInfo
(
orderCode
,
uid
)
{
return
await
this
.
api
.
get
({
url
:
'/operations/api/v5/pop/getGroupOrderPopInfo'
,
body
:
{
orderCode
,
uid
}
})
.
then
((
json
)
=>
{
...
...
Please
register
or
login
to post a comment