Authored by 毕凯

Merge branch 'feature/buynow' into 'release/5.8.1'

closeBuyNowButton



See merge request !681
... ... @@ -153,6 +153,7 @@ const newDetail = {
let uid = req.user.uid || 0;
let shoppingKey = req.cookies._SPK || '';
let closeBuyNowButton = _.get(req.app.locals.wap, 'close.buyNowButton', false);
detailModel.getNewProductAsyncData(Object.assign({
id: req.query.id,
... ... @@ -161,7 +162,8 @@ const newDetail = {
bundleType: req.query.bundleType,
uid: uid,
shoppingKey: shoppingKey,
ua: req.get('user-agent') || ''
ua: req.get('user-agent') || '',
closeBuyNowButton: closeBuyNowButton
}, req.__User__)).then((result) => {
if (_.isEmpty(result)) {
return res.json({
... ...
... ... @@ -479,7 +479,7 @@ let getNewProductAsyncData = (data) => {
let apiArray = [
_cartCount(data.uid, data.shoppingKey),
_detailDataPkgAsync(result, data.uid, data.vipLevel, data.ua), // eslint-disable-line
_detailDataPkgAsync(_.assign(result, {closeBuyNowButton: data.closeBuyNowButton}), data.uid, data.vipLevel, data.ua), // eslint-disable-line
_getFavorite(result.product_id, data.uid)
];
... ... @@ -758,7 +758,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
return resolve(dest);
}
});
} else if (origin.buy_now === 1) { // 显示立即购买和加入购物车两个按钮
} else if (origin.buy_now === 1 && !origin.closeBuyNowButton) { // 显示立即购买和加入购物车两个按钮,closeBuyNowButton 关闭开关
Object.assign(dest.cartInfo, cartInfo, {
price: dest.goodsPrice.previousPrice ? dest.goodsPrice.previousPrice : '',
salePrice: dest.goodsPrice.currentPrice ? dest.goodsPrice.currentPrice : '',
... ...