...
|
...
|
@@ -255,12 +255,12 @@ const setBrandBanner = (base, brand, shop) => { |
|
|
let resData = {},
|
|
|
banner = {};
|
|
|
|
|
|
if (base.brand) {
|
|
|
let info = base.brand;
|
|
|
if (base.brandInfo) {
|
|
|
let info = base.brandInfo;
|
|
|
|
|
|
// 基础品牌数据
|
|
|
banner = {
|
|
|
brandId: info.id,
|
|
|
brandId: info.brandId,
|
|
|
bgColor: '#000',
|
|
|
brandLogo: {
|
|
|
link: `/product/shop/${info.brandDomain}`, // 品牌跳转链接
|
...
|
...
|
@@ -319,12 +319,12 @@ const setBrandBanner = (base, brand, shop) => { |
|
|
*/
|
|
|
const setProductData = base => {
|
|
|
let resData = {
|
|
|
id: base.id,
|
|
|
id: base.productId,
|
|
|
name: base.productName,
|
|
|
brandName: _.has(base, 'brand.brandName') ? base.brand.brandName : '',
|
|
|
brandName: _.has(base, 'brandInfo.brandName') ? base.brandInfo.brandName : '',
|
|
|
intro: base.salesPhrase,
|
|
|
sellPrice: base.productPriceBo.salesPrice,
|
|
|
marketPrice: base.productPriceBo.marketPrice,
|
|
|
sellPrice: base.salesPrice,
|
|
|
marketPrice: base.marketPrice,
|
|
|
total: 0
|
|
|
};
|
|
|
|
...
|
...
|
@@ -350,7 +350,7 @@ const setProductData = base => { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (value.goodsImagesList) {
|
|
|
if (value.imagesList) {
|
|
|
group = {
|
|
|
name: value.colorName,
|
|
|
title: `${resData.name} ${value.colorName}`,
|
...
|
...
|
@@ -369,7 +369,7 @@ const setProductData = base => { |
|
|
}
|
|
|
|
|
|
// 商品颜色列表
|
|
|
_.forEach(value.goodsImagesList, function(subValue) {
|
|
|
_.forEach(value.imagesList, function(subValue) {
|
|
|
thumbs.push(subValue.imageUrl);
|
|
|
});
|
|
|
group.thumbs = thumbs;
|
...
|
...
|
@@ -390,22 +390,22 @@ const setProductData = base => { |
|
|
}
|
|
|
|
|
|
// 商品尺码列表
|
|
|
_.forEach(value.goodsSizeBoList, function(subValue) {
|
|
|
_.forEach(value.sizeList, function(subValue) {
|
|
|
let size = {
|
|
|
name: subValue.sizeName,
|
|
|
title: subValue.sizeName,
|
|
|
sku: subValue.goodsSizeSkuId,
|
|
|
num: _.toInteger(subValue.goodsSizeStorageNum),
|
|
|
goodsId: subValue.goodsId
|
|
|
sku: subValue.productSku,
|
|
|
num: _.toInteger(subValue.storageNumber),
|
|
|
goodsId: value.goodsId
|
|
|
};
|
|
|
|
|
|
// 虚拟商品,增加为一件
|
|
|
if (subValue.attribute === 3) {
|
|
|
if (base.attribute === 3) {
|
|
|
size.num = size.num > 1 ? 1 : 0;
|
|
|
}
|
|
|
|
|
|
// 如果status为0,即skc下架时,则库存设为0
|
|
|
if (subValue.status === 0) {
|
|
|
if (base.status === 0 || subValue.status === 0) {
|
|
|
size.num = 0;
|
|
|
}
|
|
|
|
...
|
...
|
|