|
@@ -529,6 +529,29 @@ function _getSortNavAsync(smallSortId, gender) { |
|
@@ -529,6 +529,29 @@ function _getSortNavAsync(smallSortId, gender) { |
529
|
})();
|
529
|
})();
|
530
|
}
|
530
|
}
|
531
|
|
531
|
|
|
|
532
|
+// 保存在 gids 和 skns ,最近流览功能
|
|
|
533
|
+const saveRecentGoodInCookies = (oldGids, oldSkns, res, addGids, addSkns) => {
|
|
|
534
|
+ oldGids = (oldGids || '').split(',');
|
|
|
535
|
+ oldSkns = (oldSkns || '').split(',');
|
|
|
536
|
+ addSkns = `${addSkns}-${addGids}`;
|
|
|
537
|
+
|
|
|
538
|
+ _.remove(oldGids, addGids);
|
|
|
539
|
+ _.remove(oldSkns, addSkns);
|
|
|
540
|
+
|
|
|
541
|
+ oldGids.unshift(addGids);
|
|
|
542
|
+ oldSkns.unshift(addSkns);
|
|
|
543
|
+
|
|
|
544
|
+ res.cookie('_browse', oldGids.splice(0, 30).join(','), {
|
|
|
545
|
+ maxAge: 2000000000,
|
|
|
546
|
+ domain: 'yohobuy.com'
|
|
|
547
|
+ });
|
|
|
548
|
+
|
|
|
549
|
+ res.cookie('_browseskn', oldSkns.splice(0, 30).join(','), {
|
|
|
550
|
+ maxAge: 2000000000,
|
|
|
551
|
+ domain: 'yohobuy.com'
|
|
|
552
|
+ });
|
|
|
553
|
+};
|
|
|
554
|
+
|
532
|
/**
|
555
|
/**
|
533
|
* 详情页数据格式化
|
556
|
* 详情页数据格式化
|
534
|
* @param origin Object 原始数据
|
557
|
* @param origin Object 原始数据
|
|
@@ -736,24 +759,21 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
@@ -736,24 +759,21 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
736
|
|
759
|
|
737
|
if (domainBrand.type && domainBrand.shopId) {
|
760
|
if (domainBrand.type && domainBrand.shopId) {
|
738
|
switch (parseInt(domainBrand.type, 10)) {
|
761
|
switch (parseInt(domainBrand.type, 10)) {
|
739
|
- case 1:
|
|
|
740
|
- {
|
762
|
+ case 1: {
|
741
|
// 多品店不显示
|
763
|
// 多品店不显示
|
742
|
- banner = [];
|
|
|
743
|
- break;
|
|
|
744
|
- }
|
|
|
745
|
- case 2:
|
|
|
746
|
- {
|
764
|
+ banner = [];
|
|
|
765
|
+ break;
|
|
|
766
|
+ }
|
|
|
767
|
+ case 2: {
|
747
|
// 单品店显示新版的店铺banner
|
768
|
// 单品店显示新版的店铺banner
|
748
|
- let basisData = yield shopService.basisTemplateAsync(domainBrand.shopId);
|
|
|
749
|
-
|
|
|
750
|
- banner.bgImg = basisData.shopTopBanner.banner || banner.bgImg;
|
|
|
751
|
- break;
|
|
|
752
|
- }
|
|
|
753
|
- default:
|
|
|
754
|
- {
|
|
|
755
|
- break;
|
|
|
756
|
- }
|
769
|
+ let basisData = yield shopService.basisTemplateAsync(domainBrand.shopId);
|
|
|
770
|
+
|
|
|
771
|
+ banner.bgImg = basisData.shopTopBanner.banner || banner.bgImg;
|
|
|
772
|
+ break;
|
|
|
773
|
+ }
|
|
|
774
|
+ default: {
|
|
|
775
|
+ break;
|
|
|
776
|
+ }
|
757
|
}
|
777
|
}
|
758
|
}
|
778
|
}
|
759
|
}
|
779
|
}
|
|
@@ -1372,12 +1392,17 @@ const showMainAsync = (data) => { |
|
@@ -1372,12 +1392,17 @@ const showMainAsync = (data) => { |
1372
|
HeaderModel.requestHeaderData(data.channel)
|
1392
|
HeaderModel.requestHeaderData(data.channel)
|
1373
|
]);
|
1393
|
]);
|
1374
|
|
1394
|
|
1375
|
- // 分类导航
|
1395
|
+ // 分类导航 ,seo
|
1376
|
let navs = requestData[0];
|
1396
|
let navs = requestData[0];
|
1377
|
const seo = _getSeoByGoodsInfo(productInfo.goodsInfo, navs);
|
1397
|
const seo = _getSeoByGoodsInfo(productInfo.goodsInfo, navs);
|
1378
|
|
1398
|
|
1379
|
result.seo = seo;
|
1399
|
result.seo = seo;
|
1380
|
|
1400
|
|
|
|
1401
|
+ // 最近浏览功能 ,限量商品不能使用这个功能
|
|
|
1402
|
+ if (!_.has(productInfo, 'goodsInfo.fashionTopGoods')) {
|
|
|
1403
|
+ data.saveInCookies(data.gid, _.get(productInfo, 'goodsInfo.skn', ''));
|
|
|
1404
|
+ }
|
|
|
1405
|
+
|
1381
|
// 获取商品尺寸相关
|
1406
|
// 获取商品尺寸相关
|
1382
|
let sizeInfo = _getSizeInfo(productInfo.goodsInfo, productInfo.goodsInfo.maxSortId);
|
1407
|
let sizeInfo = _getSizeInfo(productInfo.goodsInfo, productInfo.goodsInfo.maxSortId);
|
1383
|
|
1408
|
|
|
@@ -1407,5 +1432,6 @@ module.exports = { |
|
@@ -1407,5 +1432,6 @@ module.exports = { |
1407
|
indexConsultAsync: consultService.indexAsync, // 获取咨询列表
|
1432
|
indexConsultAsync: consultService.indexAsync, // 获取咨询列表
|
1408
|
createConsultAsync: consultService.createAsync, // 添加咨询
|
1433
|
createConsultAsync: consultService.createAsync, // 添加咨询
|
1409
|
showMainAsync: showMainAsync, // 获取某一个商品详情主页面
|
1434
|
showMainAsync: showMainAsync, // 获取某一个商品详情主页面
|
1410
|
- indexHotAreaAsync: hotAreaService.indexAsync // 获取某一个商品的热区数据
|
1435
|
+ indexHotAreaAsync: hotAreaService.indexAsync, // 获取某一个商品的热区数据
|
|
|
1436
|
+ saveRecentGoodInCookies // 保存最近的商品
|
1411
|
}; |
1437
|
}; |