...
|
...
|
@@ -13,6 +13,7 @@ const { |
|
|
SET_CHANNEL,
|
|
|
SET_HOST,
|
|
|
SET_SERVICE_HOST,
|
|
|
SET_PRODUCT_POOL,
|
|
|
|
|
|
PRODUCT_LIST_REQUEST,
|
|
|
PRODUCT_LIST_SUCCESS,
|
...
|
...
|
@@ -25,14 +26,14 @@ const { |
|
|
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
|
|
|
export function setAppSelectedCategory(sort_id, index) {
|
|
|
export function setAppSelectedCategory(productPool,sort_id, index) {
|
|
|
|
|
|
return (dispatch, getState) => {
|
|
|
dispatch({
|
|
|
type: APP_SET_SELECTED_CATEGORY,
|
|
|
payload: {index}
|
|
|
});
|
|
|
dispatch(getProductList(sort_id));
|
|
|
dispatch(getProductList(productPool,sort_id));
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -64,6 +65,13 @@ export function setServiceHost(host) { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function setproductPool(productPool) {
|
|
|
return {
|
|
|
type: SET_PRODUCT_POOL,
|
|
|
payload: productPool,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function productListRequest() {
|
|
|
return {
|
|
|
type: PRODUCT_LIST_REQUEST,
|
...
|
...
|
@@ -218,7 +226,7 @@ function exposeHtmlContent(json, callbackFun) { |
|
|
|
|
|
}
|
|
|
|
|
|
export function getProductList(msort = 0) {
|
|
|
export function getProductList(product_pool = 0,msort = 0) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app} = getState();
|
|
|
let list = app.productList;
|
...
|
...
|
@@ -239,7 +247,7 @@ export function getProductList(msort = 0) { |
|
|
console.log(pageSize);
|
|
|
let fetchProductList = (uid) => {
|
|
|
dispatch(productListRequest());
|
|
|
return new AppService(app.host).fetchProductList(uid, page, pageSize, msort)
|
|
|
return new AppService(app.host).fetchProductList(uid, page, pageSize, msort, product_pool)
|
|
|
.then(json => {
|
|
|
let payload = json;
|
|
|
try {
|
...
|
...
|
|