Authored by 郝肖肖

'购物车promotionId兼容'

... ... @@ -379,17 +379,18 @@ const formatPromotion = (it, selectedGiftsList) => {
// "status": 0, // 状态 0 未满足 10 已满足 [20 售光 30 更换 ]
let status = parseInt(it.status, 10);
let tsPromotionIds = (it.ts_promotion_ids && it.ts_promotion_ids.join(',')) || it.promotion_id || '';
let info = {
status: status,
conditionUnit: it.condition_unit, // 0满足,1 件,2金额
conditionValue: it.condition_value,
giftPrice: it.gift_price, // 赠品或加价购商品价格
giftGoodsList: formatCartGoods(it.gift_goods_List), // 可供选择的赠品或加价购商品列表
promotionId: it.ts_promotion_ids.join(','), // 促销id
promotionId: tsPromotionIds, // 促销id
promotionDesc: identIconReplace(it.promotion_desc),
promotionType: it.promotion_type, // 促销类型
// list.yohobuy.com?psp_id=10408
promotionPageUrl: helpers.urlFormat('', { psp_id: it.ts_promotion_ids.join(',') }, 'list'),
promotionPageUrl: helpers.urlFormat('', {psp_id: tsPromotionIds}, 'list'),
tag: PROMOTION_TYPE_TAG_MAP[it.promotion_type],
isGift: it.promotion_type === 'Gift',
... ...
... ... @@ -1437,7 +1437,11 @@ exports.getListSeo = (channel, sorts, checked) => {
});
_.forEach(checked, ck => {
switch (ck.itemType) {
if (!(ck && ck.itemType)) {
return false;
}
switch (ck && ck.itemType) {
case 'brand':
case 'color':
case 'size':
... ...
... ... @@ -52,6 +52,12 @@ GoodsWinAction = {
var $selectedItem;
var selectedSkn;
if ($this.data('select')) {
return false;
}
$this.data('select', true);
if (role === 'pg-resel-btn') {
$selectedItem = $promotionPool.find('[data-role=pitem]')
.filter('[data-ispricegift]')
... ... @@ -71,6 +77,7 @@ GoodsWinAction = {
if (!promotionInfo) {
capi.getProductByPromotionId(promotionid).done(function(pinfo) {
$this.data('select', false);
if (!pinfo && pinfo.code !== 200) {
return new Alert('获取商品失败,请稍后再试!').show();
... ... @@ -90,6 +97,7 @@ GoodsWinAction = {
$wrap.data('_promotionInfo', promotionInfo);
renderAndShowGiftWin(promotionInfo);
}).fail(function() {
$this.data('select', false);
new Alert('获取商品失败,请稍后再试!').show();
});
return;
... ...