Authored by OF1706

Merge branch 'feature/shoppingCart' of http://git.yoho.cn/fe/yohobuy-node into feature/shoppingCart

... ... @@ -43,6 +43,17 @@ const transPrice = (price) => {
return price ? (price * 1).toFixed(2) : '0.00';
};
const priceIconReplace = (title) => {
let ret = title;
if (ret) {
ret = ret.replace(/¥/g, '¥');
}
return ret;
};
/**
* 生成公开的TOKEN凭证
*
... ... @@ -259,7 +270,7 @@ const formatPromotionInfos = (infoList) => {
return {
cutdownAmount: it.cutdown_amount,
promotionId: it.promotion_id,
promotionTitle: it.promotion_title,
promotionTitle: priceIconReplace(it.promotion_title),
promotionType: it.promotion_type,
tag: PROMOTION_TYPE_TAG_MAP[it.promotion_type]
};
... ... @@ -291,7 +302,7 @@ const formatPriceGiftOne = (it) => {
// isShowGift: isGift, // 控制是否显示赠品
// isFold: true, // 控制是否[展开]
promotionId: it.promotion_id,
promotionTitle: it.promotion_title.replace('¥', '¥'), // + '(注:您看到的商品可能因为下单时间差已售完)', // subjoinType
promotionTitle: priceIconReplace(it.promotion_title), // + '(注:您看到的商品可能因为下单时间差已售完)', // subjoinType
maxSelectNumber: it.max_select_number,
promotionType: it.promotion_type,
tag: PROMOTION_TYPE_TAG_MAP[it.promotion_type],
... ... @@ -380,7 +391,7 @@ const formatPromotion = (it, selectedGiftsList) => {
giftPrice: it.gift_price, // 赠品或加价购商品价格
giftGoodsList: formatCartGoods(it.gift_goods_List), // 可供选择的赠品或加价购商品列表
promotionId: it.promotion_id, // 促销id
promotionTitle: it.promotion_title, // "已满足[满30减10-dev30]",
promotionTitle: priceIconReplace(it.promotion_title), // "已满足[满30减10-dev30]",
promotionType: it.promotion_type, // 促销类型
// list.yohobuy.com?psp_id=10408
promotionPageUrl: helpers.urlFormat('', { psp_id: it.promotion_id }, 'list'),
... ...
... ... @@ -759,7 +759,9 @@ const getRecommendProduct = (channel, uid, udid, page) => {
title: it.product_name,
img: it.default_images ? helpers.image(it.default_images, 190, 250) : '',
alt: it.product_name,
price: chelper.transPrice(it.sales_price)
price: '¥' + chelper.transPrice(it.sales_price),
marketPrice: (it.market_price && it.market_price > it.sales_price) ?
'¥' + chelper.transPrice(it.market_price) : ''
};
// 商品链接
... ...