Authored by 张文文

获取优惠券信息添加参数 reviewd by 朱傲哲

... ... @@ -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>
);
... ...
... ... @@ -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);
}
}
... ...
... ... @@ -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 => {
});
});
};
}
... ...
... ... @@ -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) => {
... ...