...
|
...
|
@@ -4,6 +4,7 @@ import ReactNative from 'react-native'; |
|
|
import DetailService from '../../services/DetailService';
|
|
|
import md5 from 'md5';
|
|
|
import helper from '../../../common/utils/helper';
|
|
|
import {Platform} from 'react-native';
|
|
|
|
|
|
const {
|
|
|
SET_ARTICLE_ID,
|
...
|
...
|
@@ -230,7 +231,7 @@ export function getArticleContent(reload = false) { |
|
|
dispatch(getArticleContentRequest());
|
|
|
return new DetailService(app.serviceHost).getArticleContent(articleId)
|
|
|
.then(json => {
|
|
|
let payload = parseArticleContent(json);
|
|
|
let payload = parseArticleContent(json,articleId);
|
|
|
payload.map((item, i) => {
|
|
|
if (item.template_name == 'goods') {
|
|
|
dispatch(goodsProductBySkns(item, i));
|
...
|
...
|
@@ -250,7 +251,7 @@ export function getArticleContent(reload = false) { |
|
|
};
|
|
|
}
|
|
|
|
|
|
function parseArticleContent(json) {
|
|
|
function parseArticleContent(json,articleId) {
|
|
|
let contents = [];
|
|
|
json && json.map((item, i) => {
|
|
|
for (let i in item) {
|
...
|
...
|
@@ -292,6 +293,15 @@ function parseArticleContent(json) { |
|
|
}else {
|
|
|
prod_ids = prod_ids + ',' + pro_id;
|
|
|
}
|
|
|
let param = {
|
|
|
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
P_PARAM : articleId,
|
|
|
I_INDEX : j,
|
|
|
PRD_SKN : pro.product_skn,
|
|
|
// C_ID:
|
|
|
exposureEnd : 1,
|
|
|
}
|
|
|
pro.yh_exposureData = param;
|
|
|
}
|
|
|
let params = {
|
|
|
REC_POSE: 100023,
|
...
|
...
|
@@ -388,6 +398,7 @@ export function goodsProductBySkns(item, contentIndex) { |
|
|
}
|
|
|
|
|
|
let {app, detail} = getState();
|
|
|
let {articleId} = detail;
|
|
|
|
|
|
dispatch(productBySknsRequest());
|
|
|
return new DetailService(app.host).productInfoBySkns(skns)
|
...
|
...
|
@@ -402,6 +413,15 @@ export function goodsProductBySkns(item, contentIndex) { |
|
|
item3.tags = [];
|
|
|
}
|
|
|
item3.default_images = helper.image(item3.default_images, 235, 314);
|
|
|
let param = {
|
|
|
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
P_PARAM : articleId,
|
|
|
I_INDEX : i3,
|
|
|
PRD_SKN : item3.product_skn,
|
|
|
// C_ID:
|
|
|
exposureEnd : 1,
|
|
|
}
|
|
|
item3.yh_exposureData = param;
|
|
|
productList.push(item3);
|
|
|
});
|
|
|
dispatch(productBySknsSuccess({
|
...
|
...
|
@@ -431,6 +451,7 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
|
|
}
|
|
|
|
|
|
let {app, detail} = getState();
|
|
|
let {articleId} = detail;
|
|
|
|
|
|
dispatch(productBySknsRequest());
|
|
|
return new DetailService(app.host).productInfoBySkns(skns)
|
...
|
...
|
@@ -442,6 +463,17 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
|
|
} else {
|
|
|
item4.tags = [];
|
|
|
}
|
|
|
|
|
|
let param = {
|
|
|
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
P_PARAM : articleId,
|
|
|
// I_INDEX : i3,
|
|
|
PRD_SKN : item4.product_skn,
|
|
|
// C_ID:
|
|
|
exposureEnd : 1,
|
|
|
}
|
|
|
item4.yh_exposureData = param;
|
|
|
|
|
|
item4.default_images = helper.image(item4.default_images, 235, 314);
|
|
|
});
|
|
|
|
...
|
...
|
@@ -499,6 +531,7 @@ export function recommendProductBySkns(item, contentIndex) { |
|
|
}
|
|
|
|
|
|
let {app, detail} = getState();
|
|
|
let {articleId} = detail;
|
|
|
|
|
|
dispatch(productBySknsRequest());
|
|
|
return new DetailService(app.host).productInfoBySkns(skns)
|
...
|
...
|
@@ -513,6 +546,17 @@ export function recommendProductBySkns(item, contentIndex) { |
|
|
} else {
|
|
|
item3.tags = [];
|
|
|
}
|
|
|
|
|
|
let param = {
|
|
|
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
P_PARAM : articleId,
|
|
|
I_INDEX : i3,
|
|
|
PRD_SKN : item3.product_skn,
|
|
|
// C_ID:
|
|
|
exposureEnd : 1,
|
|
|
}
|
|
|
item3.yh_exposureData = param;
|
|
|
|
|
|
item3.default_images = helper.image(item3.default_images, 235, 314);
|
|
|
productList.push(item3);
|
|
|
});
|
...
|
...
|
|