...
|
...
|
@@ -20,6 +20,10 @@ export const UserType = { |
|
|
buy: 'buy'
|
|
|
};
|
|
|
|
|
|
const COUPON_TYPE = {
|
|
|
HUO_DONG: 100
|
|
|
};
|
|
|
|
|
|
export default function() {
|
|
|
return {
|
|
|
namespaced: true,
|
...
|
...
|
@@ -97,6 +101,15 @@ export default function() { |
|
|
|
|
|
state.orderDetail.recommendedCouponInfo.coupon_code =
|
|
|
filter(get(state.orderDetail, 'couponList', []), { selected: 'Y' }).map(i => i.coupon_code).join(',');
|
|
|
|
|
|
// 清除促消活动
|
|
|
if (item.coupon_type === COUPON_TYPE.HUO_DONG) {
|
|
|
get(state.orderDetail, 'promotionList', []).forEach(i => {
|
|
|
i.selected = 'N';
|
|
|
});
|
|
|
|
|
|
state.orderDetail.promotionTips.promotionIds = '';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
[Types.CHANGE_SELECT_PROMOTION](state, { promotionId }) {
|
...
|
...
|
@@ -117,6 +130,14 @@ export default function() { |
|
|
});
|
|
|
item.selected = 'Y';
|
|
|
state.orderDetail.promotionTips.promotionIds = promotionId;
|
|
|
|
|
|
// 清除活动优惠券
|
|
|
get(state.orderDetail, 'couponList', []).filter(i => i.coupon_type === COUPON_TYPE.HUO_DONG).forEach(i => {
|
|
|
i.selected = 'N';
|
|
|
});
|
|
|
|
|
|
state.orderDetail.recommendedCouponInfo.coupon_code =
|
|
|
filter(get(state.orderDetail, 'couponList', []), { selected: 'Y' }).map(i => i.coupon_code).join(',');
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
|