...
|
...
|
@@ -270,7 +270,7 @@ const formatPromotionInfos = (infoList) => { |
|
|
return {
|
|
|
cutdownAmount: it.cutdown_amount,
|
|
|
promotionId: it.promotion_id,
|
|
|
promotionTitle: priceIconReplace(it.promotion_title),
|
|
|
promotionDesc: priceIconReplace(it.promotion_desc),
|
|
|
promotionType: it.promotion_type,
|
|
|
tag: PROMOTION_TYPE_TAG_MAP[it.promotion_type]
|
|
|
};
|
...
|
...
|
@@ -302,7 +302,7 @@ const formatPriceGiftOne = (it) => { |
|
|
// isShowGift: isGift, // 控制是否显示赠品
|
|
|
// isFold: true, // 控制是否[展开]
|
|
|
promotionId: it.promotion_id,
|
|
|
promotionTitle: priceIconReplace(it.promotion_title), // + '(注:您看到的商品可能因为下单时间差已售完)', // subjoinType
|
|
|
promotionDesc: priceIconReplace(it.promotion_desc), // + '(注:您看到的商品可能因为下单时间差已售完)', // subjoinType
|
|
|
maxSelectNumber: it.max_select_number,
|
|
|
promotionType: it.promotion_type,
|
|
|
tag: PROMOTION_TYPE_TAG_MAP[it.promotion_type],
|
...
|
...
|
@@ -391,7 +391,7 @@ const formatPromotion = (it, selectedGiftsList) => { |
|
|
giftPrice: it.gift_price, // 赠品或加价购商品价格
|
|
|
giftGoodsList: formatCartGoods(it.gift_goods_List), // 可供选择的赠品或加价购商品列表
|
|
|
promotionId: it.promotion_id, // 促销id
|
|
|
promotionTitle: priceIconReplace(it.promotion_title), // "已满足[满30减10-dev30]",
|
|
|
promotionDesc: priceIconReplace(it.promotion_desc),
|
|
|
promotionType: it.promotion_type, // 促销类型
|
|
|
// list.yohobuy.com?psp_id=10408
|
|
|
promotionPageUrl: helpers.urlFormat('', { psp_id: it.promotion_id }, 'list'),
|
...
|
...
|
@@ -408,42 +408,10 @@ const formatPromotion = (it, selectedGiftsList) => { |
|
|
// 判断赠品/加价购商品,是否被选中
|
|
|
info.giftGoodsList = checkGoodsIsSel(info.giftGoodsList, info.promotionId, selectedGiftsList);
|
|
|
|
|
|
function toDecimal(x) {
|
|
|
var original = Math.round(Math.abs(x) * 100) / 100;
|
|
|
var s = original.toString();
|
|
|
var rs = s.indexOf('.');
|
|
|
|
|
|
if (rs < 0) {
|
|
|
rs = s.length;
|
|
|
s += '.';
|
|
|
}
|
|
|
while (s.length <= rs + 2) {
|
|
|
s += '0';
|
|
|
}
|
|
|
return s;
|
|
|
}
|
|
|
|
|
|
if (info.isNotReach) {
|
|
|
|
|
|
let tipTxtMoney = `${ toDecimal(info.conditionValue)}`;
|
|
|
|
|
|
let tipTxt = `${ -(Math.round(parseFloat(info.conditionValue) * 100) / 100)}`;
|
|
|
|
|
|
if (info.conditionUnit === 1) {
|
|
|
tipTxt += '件';
|
|
|
} else if (info.conditionUnit === 2) {
|
|
|
tipTxt = tipTxtMoney + '元';
|
|
|
}
|
|
|
|
|
|
tipTxt = '<span style=\'color:#ff575c\'>' + tipTxt + '</span>';
|
|
|
info.promotionTitle = '还差' + tipTxt + '满足 ' + info.promotionTitle;
|
|
|
} else if (info.isReach) {
|
|
|
info.promotionTitle = '已满足 ' + info.promotionTitle;
|
|
|
}
|
|
|
|
|
|
if (info.giftGoodsList) {
|
|
|
info.giftGoodsListStr = JSON.stringify(info.giftGoodsList);
|
|
|
}
|
|
|
|
|
|
return info;
|
|
|
};
|
|
|
|
...
|
...
|
|