...
|
...
|
@@ -95,6 +95,14 @@ const { |
|
|
GET_MINEUSERINFO_SUCCESS,
|
|
|
GET_MINEUSERINFO_FAILURE,
|
|
|
|
|
|
SHARETOTAL_REQUEST,
|
|
|
SHARETOTAL_SUCCESS,
|
|
|
SHARETOTAL_FAILURE,
|
|
|
|
|
|
INVITED_FRIENDS_REQUEST,
|
|
|
INVITED_FRIENDS_SUCCESS,
|
|
|
INVITED_FRIENDS_FAILURE,
|
|
|
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
|
|
|
export function showTipsAlertDialog() {
|
...
|
...
|
@@ -506,6 +514,26 @@ export function getStatisticsInfoFailure() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getShareTotalInfoRequest() {
|
|
|
return {
|
|
|
type: SHARETOTAL_REQUEST,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getShareTotalInfoSuccess(json) {
|
|
|
return {
|
|
|
type: SHARETOTAL_SUCCESS,
|
|
|
payload: json,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getShareTotalInfoFailure() {
|
|
|
return {
|
|
|
type: SHARETOTAL_FAILURE,
|
|
|
payload: error
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getMineUserInfoSuccess(json) {
|
|
|
return {
|
|
|
type: GET_MINEUSERINFO_SUCCESS,
|
...
|
...
|
@@ -527,6 +555,26 @@ export function getMineUserInfoRequest() { |
|
|
}
|
|
|
|
|
|
|
|
|
export function invitedFriendsRequest() {
|
|
|
return {
|
|
|
type: INVITED_FRIENDS_REQUEST
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function invitedFriendsSuccess(json) {
|
|
|
return {
|
|
|
type: INVITED_FRIENDS_SUCCESS,
|
|
|
payload: json
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function invitedFriendsFailue(error) {
|
|
|
return {
|
|
|
type: INVITED_FRIENDS_FAILURE,
|
|
|
payload: error
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getSettlementInfo() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app} = getState();
|
...
|
...
|
@@ -771,6 +819,55 @@ export function getSettlementRecord() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getInvitedFriends() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, alliance} = getState();
|
|
|
let list = alliance.invitedFriendsList;
|
|
|
|
|
|
/**
|
|
|
* page: 0, //当前页面
|
|
|
* page_size: 20, //每页显示的数量
|
|
|
* total: 0, //总共多少条
|
|
|
* totalPage: 0, //总共多少页
|
|
|
* endReached: false, //到达底部
|
|
|
*/
|
|
|
if (list.isFetching || list.endReached || list.error || (!list.endReached && list.totalPage === 1)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let page = list.page + 1;
|
|
|
let pageSize = list.page_size;
|
|
|
|
|
|
let fetchInvitedFriends = (uid) => {
|
|
|
dispatch(invitedFriendsRequest());
|
|
|
return new AllianceService(app.host).fetchInvitedFriends(uid, page, pageSize)
|
|
|
.then(json => {
|
|
|
let payload = json;
|
|
|
payload.endReached = (payload.page === payload.totalPage) && (payload.totalPage !== 1);
|
|
|
if (payload.page > 1) {
|
|
|
let oldList = list.list.toJS();
|
|
|
let newList = [...oldList, ...payload.list];
|
|
|
payload.list = newList;
|
|
|
}
|
|
|
dispatch(invitedFriendsSuccess(payload));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(invitedFriendsFailue(error));
|
|
|
});
|
|
|
};
|
|
|
|
|
|
let uid = 0;
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
fetchInvitedFriends(uid)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
fetchInvitedFriends(uid)
|
|
|
});
|
|
|
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getOrderList(orderType, orderStatus, isChanged) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, alliance} = getState();
|
...
|
...
|
@@ -1000,6 +1097,31 @@ export function getStatisticsInfo(queryTimeType) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getShareTotalInfo() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app} = getState();
|
|
|
let fetchShareTotalInfo = (uid) => {
|
|
|
dispatch(getShareTotalInfoRequest());
|
|
|
return new AllianceService(app.host).fetchShareTotalInfo(uid)
|
|
|
.then(json => {
|
|
|
dispatch(getShareTotalInfoSuccess(json));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(getShareTotalInfoFailure());
|
|
|
});
|
|
|
};
|
|
|
|
|
|
let uid = 0;
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
fetchShareTotalInfo(uid)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
fetchShareTotalInfo(uid)
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getMineUserInfo() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app} = getState();
|
...
|
...
|
|