...
|
...
|
@@ -9,7 +9,7 @@ const { |
|
|
SET_PLATFORM,
|
|
|
|
|
|
SET_ACTIVITY_FLITER,
|
|
|
|
|
|
SET_YH_CHANNEL,
|
|
|
SET_FLITER,
|
|
|
SHOW_TOAST,
|
|
|
HIDE_TOAST,
|
...
|
...
|
@@ -38,6 +38,13 @@ export function onPressCoupon() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function setChannel(channel) {
|
|
|
return {
|
|
|
type: SET_YH_CHANNEL,
|
|
|
payload: channel
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getCategoryRequest() {
|
|
|
return {
|
|
|
type: GET_CATEGORY_REQUEST,
|
...
|
...
|
@@ -62,10 +69,11 @@ export function getCategory() { |
|
|
return (dispatch, getState) => {
|
|
|
let {app, outlet} = getState();
|
|
|
let parent_id = app.categoryId;
|
|
|
let channel = outlet.channel;
|
|
|
dispatch(getCategoryRequest());
|
|
|
return new OutletService(app.serviceHost).getCategory(parent_id)
|
|
|
.then(json => {
|
|
|
let params = parseListFromCategory(json);
|
|
|
let params = parseListFromCategory(channel,json);
|
|
|
dispatch(getCategorySuccess(params));
|
|
|
})
|
|
|
.catch(error => {
|
...
|
...
|
@@ -74,8 +82,8 @@ export function getCategory() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
function parseListFromCategory(json) {
|
|
|
|
|
|
function parseListFromCategory(channel,json) {
|
|
|
let initialPage = 0;
|
|
|
json.map((item, i) => {
|
|
|
let url = item.sort_url;
|
|
|
let content_code = GetQueryString(url,'content_code');
|
...
|
...
|
@@ -87,8 +95,15 @@ function parseListFromCategory(json) { |
|
|
item.content_code = content_code;
|
|
|
item.type = type?type:0;
|
|
|
item.yh_channel=yh_channel?yh_channel:0;
|
|
|
if (yh_channel == channel) {
|
|
|
initialPage = i;
|
|
|
}
|
|
|
})
|
|
|
return json;
|
|
|
|
|
|
return {
|
|
|
json,
|
|
|
initialPage,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getOutletHomeResourceRequest(content_code) {
|
...
|
...
|
|