Authored by yyq

hide presell

... ... @@ -22,7 +22,9 @@ const stepper = [
];
const index = (req, res, next) => {
let cartType = req.query.type === '2' ? 'advance' : 'ordinary';
// 6.7.5 web端下架预售购物车功能
// let cartType = req.query.type === '2' ? 'advance' : 'ordinary';
let cartType = 'ordinary';
req.ctx(oeModel).index(req.user.uid, cartType).then(result => {
let header = headerModel.setSimpleHeaderData() || {};
... ... @@ -69,7 +71,9 @@ const getGiftCards = (req, res, next) => {
// 订单金额计算
const compute = (req, res, next) => {
let params = req.body;
let cartType = params.cartType === '2' ? 'advance' : 'ordinary';
// 6.7.5 web端下架预售购物车功能
// let cartType = req.query.type === '2' ? 'advance' : 'ordinary';
let cartType = 'ordinary';
if (params.sku) { // 快捷结算
req.ctx(easypayModel).getOrderComputeData(req.user.uid, 'ordinary', params).then(result => {
... ... @@ -118,7 +122,9 @@ const submitCheck = (req, res, next) => {
// 提交订单
const submit = (req, res, next) => {
let params = req.body;
let cartType = params.cartType === '2' ? 'advance' : 'ordinary';
// 6.7.5 web端下架预售购物车功能
// let cartType = req.query.type === '2' ? 'advance' : 'ordinary';
let cartType = 'ordinary';
let uid = req.user.uid;
let remoteIp = req.ip;
... ...
... ... @@ -564,7 +564,6 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
// 调用接口,获取购物车数据
// let cartDataRet = yield cartApi.cartData(uid, shoppingKey);
let cartData = cartDataRet && cartDataRet.data;
let advCartData = _.get(cartData, 'advance_cart_data');
let ordCartData = _.get(cartData, 'ordinary_cart_data');
// 移除的商品列表
... ... @@ -582,20 +581,23 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
// 预售购物车,普通购物车 凑单链接
result.moreGoodsLink = '//list.yohobuy.com/new';
result.advanceCart = {
// 未参加活动的商品
// goodsList: chelper.formatCartGoods(_.get(advCartData, 'goods_list'), true, false, false, analysisData),
pools: formatPromotionPools(_.get(advCartData, 'goods_pool_list'), null, true, analysisData),
offShelves: formatOffShelves(_.get(advCartData, 'off_shelves_goods_list'), true, analysisData),
soldOuts: formatSoldOuts(_.get(advCartData, 'sold_out_goods_list'), true, analysisData),
promotionInfos: formatPromotionInfos(_.get(advCartData, 'promotion_info')),
stat: formatShoppingCartData(_.get(advCartData, 'shopping_cart_data')),
isShippingCostFree: _.get(advCartData, 'shipping_cost_prompt.is_shipping_cost_free', '') === 'Y',
tips: _.get(advCartData, 'shipping_cost_prompt.shipping_cost_tips', ''),
ensureUrl: helpers.urlFormat('/cart/ensure', {
type: 2
})
};
// 6.7.5 web端下架预售购物车功能
result.advanceCart = {};
// let advCartData = _.get(cartData, 'advance_cart_data');
// result.advanceCart = {
// // 未参加活动的商品
// // goodsList: chelper.formatCartGoods(_.get(advCartData, 'goods_list'), true, false, false, analysisData),
// pools: formatPromotionPools(_.get(advCartData, 'goods_pool_list'), null, true, analysisData),
// offShelves: formatOffShelves(_.get(advCartData, 'off_shelves_goods_list'), true, analysisData),
// soldOuts: formatSoldOuts(_.get(advCartData, 'sold_out_goods_list'), true, analysisData),
// promotionInfos: formatPromotionInfos(_.get(advCartData, 'promotion_info')),
// stat: formatShoppingCartData(_.get(advCartData, 'shopping_cart_data')),
// isShippingCostFree: _.get(advCartData, 'shipping_cost_prompt.is_shipping_cost_free', '') === 'Y',
// tips: _.get(advCartData, 'shipping_cost_prompt.shipping_cost_tips', ''),
// ensureUrl: helpers.urlFormat('/cart/ensure', {
// type: 2
// })
// };
// let giftsList = formatPriceGifts(_.get(ordCartData, 'gift_list'));
// let priceGifts = formatPriceGifts(_.get(ordCartData, 'price_gift'));
... ...
... ... @@ -1252,6 +1252,7 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) {
// 是否显示虚拟商品,立即购买按钮
result.isVirtualBtn = soldOut ? false : true;
result.hideCollect = true;
}
if (!soldOut && !notForSale && !virtualGoods) {
... ... @@ -1270,6 +1271,12 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) {
delete result.fashTopGoods;
}
// 普通预售商品
if (result.presale === 'Y') {
result.addToCart = false;
result.hideCollect = true;
}
// 预上架普通商品
let isPreShelve = _isPreShelves(origin); // 预上架普通商品
... ...
... ... @@ -161,7 +161,7 @@
<span id="enable-notify" class="buy-btn hide"> <i class="iconfont">
&#xe6e2;</i> <span>到货通知</span></span>
{{#unless isVirtualBtn}}
{{#unless hideCollect}}
<span id="collect-product" class="{{#if isCollect}}coled {{/if}}collect-product">
<i class="iconfont">&#xe641;</i> {{#if isCollect}} <em>已收藏</em> {{^}} <em>收藏商品</em> {{/if}}
</span>
... ...