...
|
...
|
@@ -9,9 +9,9 @@ const { |
|
|
|
|
|
SET_PLATFORM,
|
|
|
|
|
|
INSTALLMENT_PRODUCT_REQUEST,
|
|
|
INSTALLMENT_PRODUCT_SUCCESS,
|
|
|
INSTALLMENT_PRODUCT_FAILURE,
|
|
|
MINECENTER_PRODUCT_REQUEST,
|
|
|
MINECENTER_PRODUCT_SUCCESS,
|
|
|
MINECENTER_PRODUCT_FAILURE,
|
|
|
|
|
|
GET_MINEUSERINFO_REQUEST,
|
|
|
GET_MINEUSERINFO_SUCCESS,
|
...
|
...
|
@@ -66,22 +66,22 @@ const { |
|
|
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
|
|
|
export function productListForInstallmentRequest() {
|
|
|
export function productListForMineCenterRequest() {
|
|
|
return {
|
|
|
type: INSTALLMENT_PRODUCT_REQUEST,
|
|
|
type: MINECENTER_PRODUCT_REQUEST,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function productListForInstallmentSuccess(json) {
|
|
|
export function productListForMineCenterSuccess(json) {
|
|
|
return {
|
|
|
type: INSTALLMENT_PRODUCT_SUCCESS,
|
|
|
type: MINECENTER_PRODUCT_SUCCESS,
|
|
|
payload: json,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function productListForInstallmentFailure() {
|
|
|
export function productListForMineCenterFailure() {
|
|
|
return {
|
|
|
type: INSTALLMENT_PRODUCT_FAILURE,
|
|
|
type: MINECENTER_PRODUCT_FAILURE,
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -259,7 +259,7 @@ export function getMineAllIconSuccess(json) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
export function productListForInstallment() {
|
|
|
export function getProductListForMineCenter() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, mine} = getState();
|
|
|
let {isFetching, open} = mine;
|
...
|
...
|
@@ -267,21 +267,21 @@ export function productListForInstallment() { |
|
|
return
|
|
|
}
|
|
|
console.log('----productListForInstallment-----');
|
|
|
dispatch(productListForInstallmentRequest());
|
|
|
return new MineService(app.host).fetchInstallmentProductList()
|
|
|
dispatch(productListForMineCenterRequest());
|
|
|
return new MineService(app.host).fetchMineCenterProductList()
|
|
|
.then(json => {
|
|
|
console.log(json);
|
|
|
let payload = json;//product_list
|
|
|
if (payload.page > 1) {
|
|
|
let oldList = open.fetchInstallmentProductList.list.toJS();
|
|
|
let oldList = open.productListForMineCenter.list.toJS();
|
|
|
let list = [...oldList, ...payload.list];
|
|
|
payload.product_list = list;
|
|
|
}
|
|
|
dispatch(productListForInstallmentSuccess(payload));
|
|
|
dispatch(productListForMineCenterSuccess(payload));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
console.log(error);
|
|
|
dispatch(productListForInstallmentFailure());
|
|
|
dispatch(productListForMineCenterFailure());
|
|
|
});
|
|
|
}
|
|
|
}
|
...
|
...
|
|