Showing
1 changed file
with
20 additions
and
19 deletions
@@ -8,29 +8,30 @@ const helpers = global.yoho.helpers; | @@ -8,29 +8,30 @@ const helpers = global.yoho.helpers; | ||
8 | const _ = require('lodash'); | 8 | const _ = require('lodash'); |
9 | const productProcess = require('./product-process'); | 9 | const productProcess = require('./product-process'); |
10 | 10 | ||
11 | -const regPromoTitle = /^【[^】]+】(.*)/; | 11 | +// const regPromoTitle = /^【[^】]+】(.*)/; |
12 | 12 | ||
13 | const transPrice = (price, isSepcialZero) => { | 13 | const transPrice = (price, isSepcialZero) => { |
14 | return (price > 0 || isSepcialZero) ? parseFloat(price).toFixed(2) : 0; | 14 | return (price > 0 || isSepcialZero) ? parseFloat(price).toFixed(2) : 0; |
15 | }; | 15 | }; |
16 | -const formatPromotionTitle = (promo) => { | ||
17 | - let title; | ||
18 | 16 | ||
19 | - if (promo.status === 0) { | ||
20 | - if (promo.condition_unit === 1) { | ||
21 | - title = `再购${Math.abs(promo.condition_value)}件`; | ||
22 | - } else if (promo.condition_unit === 2) { | ||
23 | - title = `再购¥${transPrice(Math.abs(promo.condition_value))}`; | ||
24 | - } | ||
25 | - } else { | ||
26 | - title = '已满足'; | ||
27 | - } | ||
28 | - let match = regPromoTitle.exec(promo.promotion_title); | ||
29 | - let promotionTitle = match !== null && match.length > 1 ? match[1] : promo.promotion_title; | ||
30 | - | ||
31 | - promotionTitle = promotionTitle.replace(/¥/g, '¥'); | ||
32 | - return `${title}【${promotionTitle}】`; | ||
33 | -}; | 17 | +// const formatPromotionTitle = (promo) => { |
18 | +// let title; | ||
19 | + | ||
20 | +// if (promo.status === 0) { | ||
21 | +// if (promo.condition_unit === 1) { | ||
22 | +// title = `再购${Math.abs(promo.condition_value)}件`; | ||
23 | +// } else if (promo.condition_unit === 2) { | ||
24 | +// title = `再购¥${transPrice(Math.abs(promo.condition_value))}`; | ||
25 | +// } | ||
26 | +// } else { | ||
27 | +// title = '已满足'; | ||
28 | +// } | ||
29 | +// let match = regPromoTitle.exec(promo.promotion_title); | ||
30 | +// let promotionTitle = match !== null && match.length > 1 ? match[1] : promo.promotion_title; | ||
31 | + | ||
32 | +// promotionTitle = promotionTitle.replace(/¥/g, '¥'); | ||
33 | +// return `${title}【${promotionTitle}】`; | ||
34 | +// }; | ||
34 | const formatPromotionOpt = (promo) => { | 35 | const formatPromotionOpt = (promo) => { |
35 | if (promo.status === 0) { | 36 | if (promo.status === 0) { |
36 | return '去凑单'; | 37 | return '去凑单'; |
@@ -221,7 +222,7 @@ const formatPromotion = (promo) => { | @@ -221,7 +222,7 @@ const formatPromotion = (promo) => { | ||
221 | giftPrice: promo.gift_price, | 222 | giftPrice: promo.gift_price, |
222 | promotionId: _.get(promo, 'ts_promotion_ids', 0), | 223 | promotionId: _.get(promo, 'ts_promotion_ids', 0), |
223 | promotionOriginTitle: promo.promotion_title, | 224 | promotionOriginTitle: promo.promotion_title, |
224 | - promotionTitle: formatPromotionTitle(promo), | 225 | + promotionTitle: _.get(promo, 'promotion_desc', ''), |
225 | promotionType: promo.promotion_type, | 226 | promotionType: promo.promotion_type, |
226 | alreadyMatch: promo.alreadyMatch, | 227 | alreadyMatch: promo.alreadyMatch, |
227 | optTitle: formatPromotionOpt(promo), | 228 | optTitle: formatPromotionOpt(promo), |
-
Please register or login to post a comment