Authored by 郝肖肖

购物车 促销描述 promotion_title 改成 promotion_desc字段

... ... @@ -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 + '满足&nbsp;&nbsp;&nbsp;' + info.promotionTitle;
} else if (info.isReach) {
info.promotionTitle = '已满足&nbsp;&nbsp;&nbsp;' + info.promotionTitle;
}
if (info.giftGoodsList) {
info.giftGoodsListStr = JSON.stringify(info.giftGoodsList);
}
return info;
};
... ...
... ... @@ -79,7 +79,7 @@
<ul class="none">
{{#promotionInfos}}
<li data-role="promotion-wrap"
data-promotionid="{{promotionId}}">{{{promotionTitle}}}
data-promotionid="{{promotionId}}">{{{promotionDesc}}}
{{>mix/cart/cart-promotion-btn}}
{{#if isNotReach}}
<a class="btn-clear blue order-pay-link" target="_blank" href="{{promotionPageUrl}}">&nbsp;&nbsp;去凑单&nbsp;</a>
... ...
... ... @@ -63,7 +63,7 @@
{{!--{{#if promotionInfos}}
<!--<div class="gift-sell">-->
<!--{{#promotionInfos}}-->
<!--<p class="gift-sell-info"><code class="order-pay-mark">{{tag}}</code>{{promotionTitle}}-->
<!--<p class="gift-sell-info"><code class="order-pay-mark">{{tag}}</code>{{promotionDesc}}-->
<!--&lt;!&ndash;<a class="btn-clear blue" data-together-id="6">去凑单&nbsp;&gt;</a>&ndash;&gt;-->
<!--</p>-->
<!--{{/promotionInfos}}-->
... ... @@ -144,7 +144,7 @@
{{#promotionInfos}}
{{#and (eq promotionId 0) tag}}
<p class="gift-sell-info">{{#if tag}}<code class="order-pay-mark">{{tag}}</code>{{/if}}
{{promotionTitle}}
{{promotionDesc}}
<!--<a class="btn-clear blue" data-together-id="6">去凑单&nbsp;&gt;</a>-->
</p>
{{/and}}
... ...
... ... @@ -3,7 +3,7 @@
data-promotionid="{{promotionId}}">
<code class="order-pay-mark {{#unless isReach}}order-pay-mark-white{{/unless}}">
{{tag}}
</code>{{{promotionTitle}}}
</code>{{{promotionDesc}}}
{{> mix/cart/cart-promotion-btn}}
... ...
<div class="slide-img">
<p class="sell-class-title">
{{#if isGift}}选赠品:{{/if}}<!--选赠品:-->
{{#if isPriceGift}}{{promotionTitle}}{{/if}}
{{#if isPriceGift}}{{promotionDesc}}{{/if}}
</p>
<div class="side-img-dd">
<ul class="img-list">
... ...