...
|
...
|
@@ -393,18 +393,34 @@ const formatPromotion = (it, selectedGiftsList) => { |
|
|
// 判断赠品/加价购商品,是否被选中
|
|
|
info.giftGoodsList = checkGoodsIsSel(info.giftGoodsList, info.promotionId, selectedGiftsList);
|
|
|
|
|
|
function toDecimal(x) {
|
|
|
var f = Math.round(x * 100) / 100;
|
|
|
var s = f.toString();
|
|
|
var rs = s.indexOf('.');
|
|
|
if (rs < 0) {
|
|
|
rs = s.length;
|
|
|
s += '.';
|
|
|
}
|
|
|
while (s.length <= rs + 2) {
|
|
|
s += '0';
|
|
|
}
|
|
|
return s;
|
|
|
}
|
|
|
|
|
|
if (status === 0) {
|
|
|
let tipTxt = `差${ -Math.round(info.conditionValue * 100) / 100}`;
|
|
|
|
|
|
console.log(toDecimal(info.conditionValue));
|
|
|
let tipTxt = `还差${ -(Math.round(parseFloat(info.conditionValue) * 100) / 100)}`;
|
|
|
|
|
|
if (info.conditionUnit === 1) {
|
|
|
tipTxt += '件满足 ';
|
|
|
tipTxt += '件满足';
|
|
|
} else if (info.conditionUnit === 2) {
|
|
|
tipTxt += '元满足 ';
|
|
|
tipTxt += '元满足';
|
|
|
}
|
|
|
|
|
|
info.promotionTitle = tipTxt + info.promotionTitle;
|
|
|
info.promotionTitle = tipTxt + '(' + info.promotionTitle + ')';
|
|
|
} else if (status === 10) {
|
|
|
info.promotionTitle = '已满足' + info.promotionTitle;
|
|
|
info.promotionTitle = '已满足' + '(' + info.promotionTitle + ')';
|
|
|
}
|
|
|
|
|
|
if (info.giftGoodsList) {
|
...
|
...
|
|