...
|
...
|
@@ -37,6 +37,8 @@ const { |
|
|
PRODUCT_BY_SKNS_SUCCESS,
|
|
|
PRODUCT_BY_SKNS_FAILURE,
|
|
|
|
|
|
SET_GOOESGROUP_FILTER,
|
|
|
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
|
|
|
export function setArticleId(id) {
|
...
|
...
|
@@ -78,16 +80,16 @@ export function getArticle(reload = false) { |
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
dispatch(getArticleRequest());
|
|
|
return new DetailService(app.serviceHost).getArticle(articleId)
|
|
|
.then(json => {
|
|
|
.then(json => {
|
|
|
dispatch(getArticleSuccess(json));
|
|
|
dispatch(getAuthor(json));
|
|
|
dispatch(getOtherArticle(json));
|
|
|
|
|
|
// dispatch(dataExposure(payload.logFloors));
|
|
|
|
|
|
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(getArticleFailure(error));
|
...
|
...
|
@@ -137,7 +139,7 @@ export function getAuthor(article, reload = false) { |
|
|
return new DetailService(app.serviceHost).getAuthor(authorId)
|
|
|
.then(json => {
|
|
|
let payload = json;
|
|
|
|
|
|
|
|
|
dispatch(getAuthorSuccess(json));
|
|
|
// dispatch(dataExposure(payload.logFloors));
|
|
|
})
|
...
|
...
|
@@ -184,7 +186,7 @@ export function getArticleContent(reload = false) { |
|
|
return new DetailService(app.serviceHost).getArticleContent(articleId)
|
|
|
.then(json => {
|
|
|
let payload = parseArticleContent(json);
|
|
|
|
|
|
|
|
|
payload.map((item, i) => {
|
|
|
if (item.template_name == 'goods') {
|
|
|
dispatch(goodsProductBySkns(item, i));
|
...
|
...
|
@@ -229,9 +231,9 @@ function parseArticleContent(json) { |
|
|
url: data.data[0].url,
|
|
|
};
|
|
|
} else if (templateName == 'goods_group') {
|
|
|
|
|
|
|
|
|
} else if (templateName == 'goods') {
|
|
|
|
|
|
|
|
|
} else if (templateName == 'text') {
|
|
|
|
|
|
}
|
...
|
...
|
@@ -315,7 +317,7 @@ export function goodsProductBySkns(item, contentIndex) { |
|
|
item3.default_images = helper.image(src, 235, 314);
|
|
|
productList.push(item3);
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
dispatch(productBySknsSuccess({
|
|
|
productList,
|
...
|
...
|
@@ -332,7 +334,7 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
|
|
return (dispatch, getState) => {
|
|
|
let skns = [];
|
|
|
let productImages = {};
|
|
|
|
|
|
|
|
|
// 遍历取得SKN
|
|
|
item.data.map((item2) => {
|
|
|
item2.list.map((item3) => {
|
...
|
...
|
@@ -359,7 +361,7 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
|
|
item4.default_images = helper.image(src, 235, 314);
|
|
|
products[item4.product_skn] = item4;
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
let productList = []
|
...
|
...
|
@@ -482,7 +484,7 @@ export function getOtherArticle(article, reload = false) { |
|
|
return new DetailService(app.serviceHost).getOtherArticle(articleId, tags, offset, limit)
|
|
|
.then(json => {
|
|
|
let payload = parseOtherArticle(json);
|
|
|
|
|
|
|
|
|
dispatch(getOtherArticleSuccess(payload));
|
|
|
// dispatch(dataExposure(payload.logFloors));
|
|
|
})
|
...
|
...
|
@@ -539,4 +541,11 @@ export function getWeixinPublic() { |
|
|
dispatch(getWeixinPublicFailure(error));
|
|
|
});
|
|
|
};
|
|
|
} |
|
|
\ No newline at end of file |
|
|
}
|
|
|
|
|
|
export function setGoodsGroupFilter(filter) {
|
|
|
return {
|
|
|
type: SET_GOOESGROUP_FILTER,
|
|
|
payload: filter
|
|
|
};
|
|
|
} |
...
|
...
|
|