...
|
...
|
@@ -31,7 +31,7 @@ const BLANK_STR = ' '; |
|
|
const cachedRequestData = {};
|
|
|
|
|
|
// 展览票
|
|
|
const EXHIBITION_TICKET = 512579596;
|
|
|
const EXHIBITION_TICKET = 51335912;
|
|
|
|
|
|
const _getProductAdditionInfoAsync = (data) => {
|
|
|
return co(function * () {
|
...
|
...
|
@@ -381,19 +381,19 @@ const _getSkuDataByProductBaseInfo = (data) => { |
|
|
goodsGroup.size.push({
|
|
|
name: size.sizeName,
|
|
|
sku: size.goodsSizeSkuId,
|
|
|
num: parseInt(size.goodsSizeStorageNum, 10),
|
|
|
num: parseInt(size.goodsSizeStorageNum),
|
|
|
goodsId: size.goodsId
|
|
|
});
|
|
|
|
|
|
// 单个sku商品的总数
|
|
|
goodsGroup.total += parseInt(size.goodsSizeStorageNum, 10);
|
|
|
goodsGroup.total += parseInt(size.goodsSizeStorageNum);
|
|
|
|
|
|
if (goodsGroup.total > 0 && !chooseSkuFlag) { // 默认选中该sku商品
|
|
|
goodsGroup.focus = true;
|
|
|
chooseSkuFlag = true;// 选中sku商品
|
|
|
}
|
|
|
|
|
|
totalStorageNum += parseInt(size.goodsSizeStorageNum, 10);
|
|
|
totalStorageNum += parseInt(size.goodsSizeStorageNum);
|
|
|
|
|
|
});
|
|
|
|
...
|
...
|
@@ -423,14 +423,14 @@ const _getSkuDataByProductBaseInfo = (data) => { |
|
|
const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => {
|
|
|
// 潮流尖货状态
|
|
|
// getLimitedCode //限购码状态
|
|
|
// hasLimitedCode //是否已经获取限购码
|
|
|
// hadLimitedCode //是否已经获取限购码
|
|
|
// limitedCodeSoldOut //限购码是否已经抢光
|
|
|
// openSoon//即将开售
|
|
|
// dis //失效
|
|
|
// buyNow //是否立即购买
|
|
|
let result = {
|
|
|
getLimitedCode: true,
|
|
|
hasLimitedCode: false,
|
|
|
hadLimitedCode: false,
|
|
|
limitedCodeSoldOut: false,
|
|
|
openSoon: false,
|
|
|
dis: false,
|
...
|
...
|
@@ -447,7 +447,7 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { |
|
|
result.dis = true;
|
|
|
} else {
|
|
|
result.openSoon = true;
|
|
|
result.hasLimitedCode = false;
|
|
|
result.hadLimitedCode = false;
|
|
|
}
|
|
|
break;
|
|
|
case 2: // 开售后,限购码已抢光(用户未领取限购码)
|
...
|
...
|
@@ -455,7 +455,7 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { |
|
|
result.dis = true;
|
|
|
result.limitedCodeSoldOut = true;
|
|
|
result.getLimitedCode = false;
|
|
|
result.hasLimitedCode = false;
|
|
|
result.hadLimitedCode = false;
|
|
|
break;
|
|
|
case 3: // 开售后,商品已经售罄
|
|
|
result.soldOut = true;
|
...
|
...
|
@@ -464,20 +464,20 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { |
|
|
case 4:// 开售后,立即购买(用户已领取限购码)
|
|
|
result.buyNow = true;
|
|
|
result.dis = false;
|
|
|
result.hasLimitedCode = true;
|
|
|
result.hadLimitedCode = true;
|
|
|
if (uid) { // 限购码失效
|
|
|
result.getLimitedCodeDis = true;
|
|
|
}
|
|
|
break;
|
|
|
case 5: // 开售前,限购码已被抢光(用户未领取限购码)
|
|
|
result.openSoon = true;
|
|
|
result.hasLimitedCode = true;
|
|
|
result.hadLimitedCode = true;
|
|
|
result.limitedCodeSoldOut = true;
|
|
|
result.getLimitedCode = false;
|
|
|
break;
|
|
|
case 6: // 开售前,即将开售(用户已领取限购码)
|
|
|
result.openSoon = true;
|
|
|
result.hasLimitedCode = true;
|
|
|
result.hadLimitedCode = true;
|
|
|
if (uid) { // 限购码失效
|
|
|
result.getLimitedCodeDis = true;
|
|
|
}
|
...
|
...
|
@@ -485,7 +485,7 @@ const _getFashionTopGoodsStatus = (uid, showStatus, isBeginSale) => { |
|
|
case 7: // 开售后,用户已经用获得的限购码购买过商品
|
|
|
result.buyNow = true;
|
|
|
result.dis = true;
|
|
|
result.hasLimitedCode = true;
|
|
|
result.hadLimitedCode = true;
|
|
|
if (uid) { // 限购码失效
|
|
|
result.getLimitedCodeDis = true;
|
|
|
}
|
...
|
...
|
@@ -571,7 +571,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
result.tags = _getTagsDataByProductInfo(origin);
|
|
|
|
|
|
// 商品促销短语
|
|
|
if (origin.salesPhase) {
|
|
|
if (origin.salesPhrase) {
|
|
|
result.saleTip = origin.salesPhrase;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -596,7 +596,6 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
// VIP学生数据
|
|
|
result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
|
|
|
}
|
|
|
|
|
|
// 促销活动banner,虚拟商品无促销
|
|
|
if (origin.attribute !== 3) {
|
|
|
result.activity = _getActivityDataByProductBaseInfo(origin);
|
...
|
...
|
@@ -662,9 +661,9 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
|
|
|
let fashTopGoods = _getFashionTopGoodsStatus(uid, showStatus, isBeginSale);
|
|
|
|
|
|
result.fashTopGoods = {
|
|
|
result.fashionTopGoods = {
|
|
|
getLimitedCode: fashTopGoods.getLimitedCode, // 限购码状态
|
|
|
hasLimitedCode: fashTopGoods.hasLimitedCode, // 是否已经获取限购码
|
|
|
hadLimitedCode: fashTopGoods.hadLimitedCode, // 是否已经获取限购码
|
|
|
limitedCodeSoldOut: fashTopGoods.limitedCodeSoldOut, // 限购码是否已经抢光
|
|
|
getLimitedCodeDis: fashTopGoods.getLimitedCodeDis // 限购码是否失效
|
|
|
};
|
...
|
...
|
@@ -757,7 +756,9 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
banner.bgImg = basisData.shopTopBanner.banner || banner.bgImg;
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -765,7 +766,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
statGoodsInfo.imageUrl = result.img;
|
|
|
statGoodsInfo.productUrl = result.weixinUrl;
|
|
|
statGoodsInfo.smallSortId = result.smallSortId;
|
|
|
statGoodsInfo.soldOut = parseInt(soldOut, 10);
|
|
|
statGoodsInfo.soldOut = parseInt(soldOut);
|
|
|
|
|
|
return {
|
|
|
goodsInfo: result,
|
...
|
...
|
@@ -1130,8 +1131,8 @@ const _getDetailDataBySizeInfo = (sizeInfo) => { |
|
|
let details = '';
|
|
|
|
|
|
// 详情配图
|
|
|
if (sizeInfo.productIntroBo.productIntro) {
|
|
|
if (sizeInfo.productDescBo.phrase) {
|
|
|
if (_.get(sizeInfo, 'productIntroBo.productIntro', null)) {
|
|
|
if (_.get(sizeInfo, 'productIntroBo.phrase', null)) {
|
|
|
details += `${sizeInfo.productDescBo.phrase}<br/>`;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -1144,7 +1145,7 @@ const _getDetailDataBySizeInfo = (sizeInfo) => { |
|
|
'///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==" data-original='
|
|
|
};
|
|
|
|
|
|
let intro = sizeInfo.productIntroBo.productIntro;
|
|
|
let intro = _.get(sizeInfo, 'productIntroBo.productIntro', '');
|
|
|
|
|
|
_(replacePairs).forEach((value, key)=> {
|
|
|
intro = _.replace(intro, key, value);
|
...
|
...
|
|