...
|
...
|
@@ -92,7 +92,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
totalStorageNum = 0;
|
|
|
|
|
|
// 商品名称
|
|
|
if (origin.productName === null || origin.productName === 'undefined') {
|
|
|
if (origin.productName === null || origin.productName === undefined) {
|
|
|
return dest;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -101,12 +101,12 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
// 用户未登录时
|
|
|
|
|
|
// 商品促销短语
|
|
|
if (origin.salesPhrase !== null && origin.salesPhrase !== 'undefined') {
|
|
|
if (origin.salesPhrase !== null && origin.salesPhrase !== undefined) {
|
|
|
dest.goodsSubtitle = origin.salesPhrase;
|
|
|
}
|
|
|
|
|
|
// 商品标签
|
|
|
if (origin.productTagBoList !== null && origin.productTagBoList !== 'undefined') {
|
|
|
if (origin.productTagBoList !== null && origin.productTagBoList !== undefined) {
|
|
|
_.forEach(origin.productTagBoList, function(value) {
|
|
|
switch (value.tagLabel) {
|
|
|
case 'is_soon_sold_out':
|
...
|
...
|
@@ -136,7 +136,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
// 商品价格
|
|
|
dest.goodsPrice = {};
|
|
|
|
|
|
if (origin.productPriceBo !== null && origin.productPriceBo !== 'undefined') {
|
|
|
if (origin.productPriceBo !== null && origin.productPriceBo !== undefined) {
|
|
|
dest.goodsPrice.currentPrice = origin.productPriceBo.formatSalesPrice;
|
|
|
if (origin.productPriceBo.formatMarketPrice !== origin.productPriceBo.formatSalesPrice) {
|
|
|
dest.goodsPrice.previousPrice = origin.productPriceBo.formatMarketPrice;
|
...
|
...
|
@@ -152,7 +152,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
dest.vipLevel = {};
|
|
|
dest.vipLevel.list = {};
|
|
|
|
|
|
if (origin.productPriceBo.vipPrices !== null && origin.productPriceBo.vipPrices !== 'undefined') {
|
|
|
if (origin.productPriceBo.vipPrices !== null && origin.productPriceBo.vipPrices !== undefined) {
|
|
|
_.forEach(origin.productPriceBo.vipPrices, function(value, key) {
|
|
|
dest.vipLevel.list[key] = {};
|
|
|
dest.vipLevel.list[key].level = value.vipLevel;
|
...
|
...
|
@@ -162,7 +162,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
}
|
|
|
|
|
|
// 上市期
|
|
|
if (origin.expectArrivalTime !== null && origin.expectArrivalTime !== 'undefined') {
|
|
|
if (origin.expectArrivalTime !== null && origin.expectArrivalTime !== undefined) {
|
|
|
dest.periodOfMarket = origin.expectArrivalTime + '月';
|
|
|
}
|
|
|
|
...
|
...
|
@@ -170,7 +170,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
dest.goodsDiscount = {};
|
|
|
dest.goodsDiscount.list = {};
|
|
|
|
|
|
if (origin.promotionBoList !== null && origin.promotionBoList !== 'undefined') {
|
|
|
if (origin.promotionBoList !== null && origin.promotionBoList !== undefined) {
|
|
|
_.forEach(origin.promotionBoList, function(value, key) {
|
|
|
dest.goodsDiscount.list[key] = {};
|
|
|
dest.goodsDiscount.list[key].text = '【' + value.promotionType + '】';
|
...
|
...
|
@@ -182,7 +182,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
dest.feedbacks.consults = {};
|
|
|
dest.feedbacks.consultsNum = 0;
|
|
|
|
|
|
if (origin.consultBoWrapper !== null && origin.consultBoWrapper !== 'undefined') {
|
|
|
if (origin.consultBoWrapper !== null && origin.consultBoWrapper !== undefined) {
|
|
|
dest.feedbacks.consultsNum = origin.consultBoWrapper.consultTotal;
|
|
|
_.forEach(origin.consultBoWrapper.consultBoList, function(value, key) {
|
|
|
dest.feedbacks.consults[key] = {};
|
...
|
...
|
@@ -209,7 +209,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
|
|
|
// 商品评价
|
|
|
dest.feedbacks.commentsNum = 0;
|
|
|
if (origin.commentBoWrapper !== null && origin.commentBoWrapper !== 'undefined') {
|
|
|
if (origin.commentBoWrapper !== null && origin.commentBoWrapper !== undefined) {
|
|
|
dest.feedbacks.commentsNum = origin.commentBoWrapper.commentTotal;
|
|
|
dest.feedbacks.comments = {};
|
|
|
|
...
|
...
|
@@ -219,7 +219,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
dest.feedbacks.comments[key].desc = value.colorName +
|
|
|
'/' + value.sizeName;
|
|
|
dest.feedbacks.comments[key].content = (value.content !== null &&
|
|
|
value.content !== 'undefined') ? value.content : '';
|
|
|
value.content !== undefined) ? value.content : '';
|
|
|
dest.feedbacks.comments[key].time = value.createTime;
|
|
|
});
|
|
|
|
...
|
...
|
@@ -232,7 +232,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
}
|
|
|
|
|
|
// 品牌信息 待开发
|
|
|
if (origin.brand !== null && origin.brand !== 'undefined') {
|
|
|
if (origin.brand !== null && origin.brand !== undefined) {
|
|
|
|
|
|
// 为你优选的链接
|
|
|
let params = {};
|
...
|
...
|
@@ -245,7 +245,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
dest.productSkn = origin.erpProductId;
|
|
|
|
|
|
// 商品信息
|
|
|
if (origin.goodsList !== null && origin.goodsList !== 'undefined') {
|
|
|
if (origin.goodsList !== null && origin.goodsList !== undefined) {
|
|
|
let goodsGroup = {},
|
|
|
sizeName = '',
|
|
|
colorList = {},
|
...
|
...
|
@@ -262,7 +262,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
colorStorageNum = 0;
|
|
|
|
|
|
// 商品分组
|
|
|
if (value.goodsImagesList !== null && value.goodsImagesList !== 'undefined') {
|
|
|
if (value.goodsImagesList !== null && value.goodsImagesList !== undefined) {
|
|
|
_.forEach(value.goodsImagesList, function(good, keyForGood) {
|
|
|
goodsGroup[keyForGood] = {};
|
|
|
goodsGroup[keyForGood].goodsId = good.goodsId;
|
...
|
...
|
@@ -272,7 +272,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
|
|
|
// 商品的尺码列表
|
|
|
colorStorageGroup[value.productSkc] = {};
|
|
|
if (value.goodsSizeBoList !== null && value.goodsSizeBoList !== 'undefined') {
|
|
|
if (value.goodsSizeBoList !== null && value.goodsSizeBoList !== undefined) {
|
|
|
|
|
|
_.forEach(value.goodsSizeBoList, function(size, keyForSize) {
|
|
|
sizeList[value.productSkc] = {};
|
...
|
...
|
@@ -293,7 +293,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
build.storage = size.goodsSizeStorageNum;
|
|
|
build.id = size.id;
|
|
|
allSizeList[sizeName] = (allSizeList[sizeName] === null ||
|
|
|
allSizeList[sizeName] === 'undefined') ? build :
|
|
|
allSizeList[sizeName] === undefined) ? build :
|
|
|
allSizeList[sizeName];
|
|
|
|
|
|
colorStorageNum += parseInt(size.goodsSizeStorageNum);
|
...
|
...
|
@@ -323,12 +323,14 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
let i = 1;
|
|
|
|
|
|
_.forEach(allSizeList, function(value, key) {
|
|
|
|
|
|
// 默认尺码
|
|
|
sizeGroup[0] = {};
|
|
|
|
|
|
sizeGroup[0].size = {};
|
|
|
sizeGroup[0].size[key] = {};
|
|
|
sizeGroup[0].size[key].name = sizeName;
|
|
|
sizeGroup[0].size[key].sizeNum = (value.storage === null || value.storage === 'undefined') ? false : true;
|
|
|
sizeGroup[0].size[key].sizeNum = (value.storage === undefined || value.storage === null) ? false : true;
|
|
|
sizeGroup[0].size[key].id = value.id;
|
|
|
|
|
|
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
|
...
|
...
|
@@ -338,7 +340,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
colorGroup[i].color[keyForColorArr] = {};
|
|
|
colorGroup[i].color[keyForColorArr].colorNum =
|
|
|
(colorStorageGroup[colorArr.skcId][sizeName] !== null &&
|
|
|
colorStorageGroup[colorArr.skcId][sizeName] !== 'undefined') ?
|
|
|
colorStorageGroup[colorArr.skcId][sizeName] !== undefined) ?
|
|
|
colorStorageGroup[colorArr.skcId][sizeName] : 0;
|
|
|
});
|
|
|
colorGroup[i].id = value.id;
|
...
|
...
|
@@ -364,7 +366,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
});
|
|
|
|
|
|
// 商品图:多个
|
|
|
if (goodsGroup[1] !== null && goodsGroup[1] !== 'undefined') {
|
|
|
if (goodsGroup[1] !== null && goodsGroup[1] !== undefined) {
|
|
|
_.forEach(goodsGroup, function(value, key) {
|
|
|
dest.bannerTop = {};
|
|
|
|
...
|
...
|
@@ -374,7 +376,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
params.img = helpers.getImageUrl(value.img, 450, 600);
|
|
|
dest.bannerTop.list[key] = params;
|
|
|
});
|
|
|
} else if (goodsGroup[0] !== null && goodsGroup[0] !== 'undefined') {
|
|
|
} else if (goodsGroup[0] !== null && goodsGroup[0] !== undefined) {
|
|
|
dest.bannerTop = {};
|
|
|
dest.bannerTop.img = helpers.getImageUrl(goodsGroup[0].img, 450, 600);
|
|
|
}
|
...
|
...
|
@@ -396,11 +398,11 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
dest.cartInfo = {};
|
|
|
dest.cartInfo.productId = origin.id;
|
|
|
dest.cartInfo.thumbs = thumbImageList;
|
|
|
dest.cartInfo.name = (dest.goodsName !== null && dest.goodsName !== 'undefined') ? dest.goodsName : '';
|
|
|
dest.cartInfo.name = (dest.goodsName !== null && dest.goodsName !== undefined) ? dest.goodsName : '';
|
|
|
dest.cartInfo.price = (dest.goodsPrice.previousPrice !== null &&
|
|
|
dest.goodsPrice.previousPrice !== 'undefined') ? dest.goodsPrice.previousPrice : '';
|
|
|
dest.goodsPrice.previousPrice !== undefined) ? dest.goodsPrice.previousPrice : '';
|
|
|
dest.cartInfo.salePrice = (dest.goodsPrice.currentPrice !== null &&
|
|
|
dest.goodsPrice.currentPrice !== 'undefined') ? dest.goodsPrice.currentPrice : '';
|
|
|
dest.goodsPrice.currentPrice !== undefined) ? dest.goodsPrice.currentPrice : '';
|
|
|
dest.cartInfo.totalNum = totalStorageNum;
|
|
|
dest.cartInfo.colors = colorGroup;
|
|
|
dest.cartInfo.sizes = sizeGroup;
|
...
|
...
|
@@ -408,13 +410,13 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
// 限购商品
|
|
|
if (origin.isLimitBuy === 'Y') {
|
|
|
// 是否开售
|
|
|
let isBeginSale = (origin.saleStatus !== null && origin.saleStatus !== 'undefined' &&
|
|
|
let isBeginSale = (origin.saleStatus !== null && origin.saleStatus !== undefined &&
|
|
|
origin.saleStatus === 1);
|
|
|
|
|
|
// 限购商品有关的展示状态
|
|
|
let showStatus = 1;
|
|
|
|
|
|
if (origin.showStatus !== null && origin.showStatus !== 'undefined') {
|
|
|
if (origin.showStatus !== null && origin.showStatus !== undefined) {
|
|
|
showStatus = parseInt(origin.showStatus);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -437,7 +439,7 @@ const detailDataPkg = (origin, vipLevel) => { |
|
|
// 是否收藏
|
|
|
|
|
|
dest.isCollect = false;
|
|
|
if (origin.isCollect !== null && origin.isCollect !== 'undefined' && origin.isCollect === 'Y') {
|
|
|
if (origin.isCollect !== null && origin.isCollect !== undefined && origin.isCollect === 'Y') {
|
|
|
dest.isCollect = true;
|
|
|
}
|
|
|
|
...
|
...
|
|