...
|
...
|
@@ -321,12 +321,35 @@ export function getOderDetail(orderCode) { |
|
|
|
|
|
export function getSettlementRecord() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app} = getState();
|
|
|
let {app, alliance} = getState();
|
|
|
let list = alliance.settlementRecordList;
|
|
|
|
|
|
/**
|
|
|
* 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 fetchSettlementRecord = (uid) => {
|
|
|
dispatch(settlementRecordRequest());
|
|
|
return new AllianceService(app.host).fetchSettlementRecord(uid, 1, 20)
|
|
|
return new AllianceService(app.host).fetchSettlementRecord(uid, page, pageSize)
|
|
|
.then(json => {
|
|
|
dispatch(settlementRecordSuccess(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(settlementRecordSuccess(payload));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(settlementRecordFailure(error));
|
...
|
...
|
@@ -345,14 +368,37 @@ export function getSettlementRecord() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getOrderList(orderType, orderStatus) {
|
|
|
export function getOrderList(orderType, orderStatus, isChanged) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app} = getState();
|
|
|
let {app, alliance} = getState();
|
|
|
let list = alliance.orderList;
|
|
|
|
|
|
/**
|
|
|
* page: 0, //当前页面
|
|
|
* page_size: 20, //每页显示的数量
|
|
|
* total: 0, //总共多少条
|
|
|
* totalPage: 0, //总共多少页
|
|
|
* endReached: false, //到达底部
|
|
|
*/
|
|
|
if (!isChanged && (list.isFetching || list.endReached || list.error || (!list.endReached && list.totalPage === 1))) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let page = isChanged ? 1 : list.page + 1;
|
|
|
let pageSize = list.page_size;
|
|
|
|
|
|
let fetchOrderList = (uid) => {
|
|
|
dispatch(orderListRequest());
|
|
|
return new AllianceService(app.host).fetchOrderList(uid, orderType, orderStatus, 1, 20)
|
|
|
return new AllianceService(app.host).fetchOrderList(uid, orderType, orderStatus, page, pageSize)
|
|
|
.then(json => {
|
|
|
dispatch(orderListSuccess(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(orderListSuccess(payload));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(orderListFailure(error));
|
...
|
...
|
@@ -383,10 +429,6 @@ export function getTop100List() { |
|
|
* page_total: 0, //总共多少页
|
|
|
* endReached: false, //到达底部
|
|
|
*/
|
|
|
console.log(list.page);
|
|
|
console.log(list.product_list);
|
|
|
console.log(list.product_list.toJS());
|
|
|
console.log('herer');
|
|
|
if (list.isFetching || list.endReached || list.error || (!list.endReached && list.page_total === 1)) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -399,7 +441,7 @@ export function getTop100List() { |
|
|
return new AllianceService(app.host).fetchTop100List(uid, page, pageSize)
|
|
|
.then(json => {
|
|
|
let payload = json;
|
|
|
payload.endReached = (payload.page === payload.page_total) && (payload.pageCount !== 1);
|
|
|
payload.endReached = (payload.page === payload.page_total) && (payload.page_total !== 1);
|
|
|
if (payload.page > 1) {
|
|
|
let oldList = list.product_list.toJS();
|
|
|
let newList = [...oldList, ...payload.product_list];
|
...
|
...
|
|