|
@@ -4,6 +4,7 @@ import ReactNative from 'react-native'; |
|
@@ -4,6 +4,7 @@ import ReactNative from 'react-native'; |
4
|
import DetailService from '../../services/DetailService';
|
4
|
import DetailService from '../../services/DetailService';
|
5
|
import md5 from 'md5';
|
5
|
import md5 from 'md5';
|
6
|
import helper from '../../../common/utils/helper';
|
6
|
import helper from '../../../common/utils/helper';
|
|
|
7
|
+import {Platform} from 'react-native';
|
7
|
|
8
|
|
8
|
const {
|
9
|
const {
|
9
|
SET_ARTICLE_ID,
|
10
|
SET_ARTICLE_ID,
|
|
@@ -230,7 +231,7 @@ export function getArticleContent(reload = false) { |
|
@@ -230,7 +231,7 @@ export function getArticleContent(reload = false) { |
230
|
dispatch(getArticleContentRequest());
|
231
|
dispatch(getArticleContentRequest());
|
231
|
return new DetailService(app.serviceHost).getArticleContent(articleId)
|
232
|
return new DetailService(app.serviceHost).getArticleContent(articleId)
|
232
|
.then(json => {
|
233
|
.then(json => {
|
233
|
- let payload = parseArticleContent(json);
|
234
|
+ let payload = parseArticleContent(json,articleId);
|
234
|
payload.map((item, i) => {
|
235
|
payload.map((item, i) => {
|
235
|
if (item.template_name == 'goods') {
|
236
|
if (item.template_name == 'goods') {
|
236
|
dispatch(goodsProductBySkns(item, i));
|
237
|
dispatch(goodsProductBySkns(item, i));
|
|
@@ -250,7 +251,7 @@ export function getArticleContent(reload = false) { |
|
@@ -250,7 +251,7 @@ export function getArticleContent(reload = false) { |
250
|
};
|
251
|
};
|
251
|
}
|
252
|
}
|
252
|
|
253
|
|
253
|
-function parseArticleContent(json) {
|
254
|
+function parseArticleContent(json,articleId) {
|
254
|
let contents = [];
|
255
|
let contents = [];
|
255
|
json && json.map((item, i) => {
|
256
|
json && json.map((item, i) => {
|
256
|
for (let i in item) {
|
257
|
for (let i in item) {
|
|
@@ -292,6 +293,15 @@ function parseArticleContent(json) { |
|
@@ -292,6 +293,15 @@ function parseArticleContent(json) { |
292
|
}else {
|
293
|
}else {
|
293
|
prod_ids = prod_ids + ',' + pro_id;
|
294
|
prod_ids = prod_ids + ',' + pro_id;
|
294
|
}
|
295
|
}
|
|
|
296
|
+ let param = {
|
|
|
297
|
+ P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
298
|
+ P_PARAM : articleId,
|
|
|
299
|
+ I_INDEX : j,
|
|
|
300
|
+ PRD_SKN : pro.product_skn,
|
|
|
301
|
+ // C_ID:
|
|
|
302
|
+ exposureEnd : 1,
|
|
|
303
|
+ }
|
|
|
304
|
+ pro.yh_exposureData = param;
|
295
|
}
|
305
|
}
|
296
|
let params = {
|
306
|
let params = {
|
297
|
REC_POSE: 100023,
|
307
|
REC_POSE: 100023,
|
|
@@ -388,6 +398,7 @@ export function goodsProductBySkns(item, contentIndex) { |
|
@@ -388,6 +398,7 @@ export function goodsProductBySkns(item, contentIndex) { |
388
|
}
|
398
|
}
|
389
|
|
399
|
|
390
|
let {app, detail} = getState();
|
400
|
let {app, detail} = getState();
|
|
|
401
|
+ let {articleId} = detail;
|
391
|
|
402
|
|
392
|
dispatch(productBySknsRequest());
|
403
|
dispatch(productBySknsRequest());
|
393
|
return new DetailService(app.host).productInfoBySkns(skns)
|
404
|
return new DetailService(app.host).productInfoBySkns(skns)
|
|
@@ -402,6 +413,15 @@ export function goodsProductBySkns(item, contentIndex) { |
|
@@ -402,6 +413,15 @@ export function goodsProductBySkns(item, contentIndex) { |
402
|
item3.tags = [];
|
413
|
item3.tags = [];
|
403
|
}
|
414
|
}
|
404
|
item3.default_images = helper.image(item3.default_images, 235, 314);
|
415
|
item3.default_images = helper.image(item3.default_images, 235, 314);
|
|
|
416
|
+ let param = {
|
|
|
417
|
+ P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
418
|
+ P_PARAM : articleId,
|
|
|
419
|
+ I_INDEX : i3,
|
|
|
420
|
+ PRD_SKN : item3.product_skn,
|
|
|
421
|
+ // C_ID:
|
|
|
422
|
+ exposureEnd : 1,
|
|
|
423
|
+ }
|
|
|
424
|
+ item3.yh_exposureData = param;
|
405
|
productList.push(item3);
|
425
|
productList.push(item3);
|
406
|
});
|
426
|
});
|
407
|
dispatch(productBySknsSuccess({
|
427
|
dispatch(productBySknsSuccess({
|
|
@@ -431,6 +451,7 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
|
@@ -431,6 +451,7 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
431
|
}
|
451
|
}
|
432
|
|
452
|
|
433
|
let {app, detail} = getState();
|
453
|
let {app, detail} = getState();
|
|
|
454
|
+ let {articleId} = detail;
|
434
|
|
455
|
|
435
|
dispatch(productBySknsRequest());
|
456
|
dispatch(productBySknsRequest());
|
436
|
return new DetailService(app.host).productInfoBySkns(skns)
|
457
|
return new DetailService(app.host).productInfoBySkns(skns)
|
|
@@ -442,6 +463,17 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
|
@@ -442,6 +463,17 @@ export function goodsGroupProductBySkns(item, contentIndex) { |
442
|
} else {
|
463
|
} else {
|
443
|
item4.tags = [];
|
464
|
item4.tags = [];
|
444
|
}
|
465
|
}
|
|
|
466
|
+
|
|
|
467
|
+ let param = {
|
|
|
468
|
+ P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
469
|
+ P_PARAM : articleId,
|
|
|
470
|
+ // I_INDEX : i3,
|
|
|
471
|
+ PRD_SKN : item4.product_skn,
|
|
|
472
|
+ // C_ID:
|
|
|
473
|
+ exposureEnd : 1,
|
|
|
474
|
+ }
|
|
|
475
|
+ item4.yh_exposureData = param;
|
|
|
476
|
+
|
445
|
item4.default_images = helper.image(item4.default_images, 235, 314);
|
477
|
item4.default_images = helper.image(item4.default_images, 235, 314);
|
446
|
});
|
478
|
});
|
447
|
|
479
|
|
|
@@ -499,6 +531,7 @@ export function recommendProductBySkns(item, contentIndex) { |
|
@@ -499,6 +531,7 @@ export function recommendProductBySkns(item, contentIndex) { |
499
|
}
|
531
|
}
|
500
|
|
532
|
|
501
|
let {app, detail} = getState();
|
533
|
let {app, detail} = getState();
|
|
|
534
|
+ let {articleId} = detail;
|
502
|
|
535
|
|
503
|
dispatch(productBySknsRequest());
|
536
|
dispatch(productBySknsRequest());
|
504
|
return new DetailService(app.host).productInfoBySkns(skns)
|
537
|
return new DetailService(app.host).productInfoBySkns(skns)
|
|
@@ -513,6 +546,17 @@ export function recommendProductBySkns(item, contentIndex) { |
|
@@ -513,6 +546,17 @@ export function recommendProductBySkns(item, contentIndex) { |
513
|
} else {
|
546
|
} else {
|
514
|
item3.tags = [];
|
547
|
item3.tags = [];
|
515
|
}
|
548
|
}
|
|
|
549
|
+
|
|
|
550
|
+ let param = {
|
|
|
551
|
+ P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
|
|
|
552
|
+ P_PARAM : articleId,
|
|
|
553
|
+ I_INDEX : i3,
|
|
|
554
|
+ PRD_SKN : item3.product_skn,
|
|
|
555
|
+ // C_ID:
|
|
|
556
|
+ exposureEnd : 1,
|
|
|
557
|
+ }
|
|
|
558
|
+ item3.yh_exposureData = param;
|
|
|
559
|
+
|
516
|
item3.default_images = helper.image(item3.default_images, 235, 314);
|
560
|
item3.default_images = helper.image(item3.default_images, 235, 314);
|
517
|
productList.push(item3);
|
561
|
productList.push(item3);
|
518
|
});
|
562
|
});
|