Authored by 刘传洋

m

... ... @@ -7,6 +7,7 @@
const _ = require('lodash');
const co = require('bluebird').coroutine;
const logger = global.yoho.logger;
const yohoHelpers = global.yoho.helpers;
const service = require('../models/cart-service');
const helper = require('../models/cart-helper');
const ghelper = require('../../guang/models/guang-helper');
... ... @@ -105,6 +106,11 @@ const cart = (req, res, next) => {
let shoppingKey = helper.getShoppingKeyByCookie(req);
let cartDelList = req.cookies['cart-del-list'];
let isNewCart = _.get(req.app.locals.pc, 'pay.oldCart', false);
if (isNewCart) {
return res.redirect(yohoHelpers.urlFormat('/shopping/cart'));
}
if (cartDelList) {
res.cookie('cart-del-list', '', {
domain: '.yohobuy.com',
... ...
... ... @@ -346,13 +346,13 @@ const swapGift = (uid, shoppingKey, promotionId, newSkn, newSku) => {
/**
* 查询所有可选的赠品或者加价购活动下的商品
* @param promotionId
* @param promotionId array
* @returns {*}
*/
const queryPromotionGift = (promotionId) => {
const queryPromotionGift = (promotionIds) => {
let param = {
method: 'app.Shopping.queryPromotionGift',
promotion_id: promotionId
method: 'app.Shopping.queryPromotionGifts',
promotion_ids: promotionIds
};
return api.get('', param);
... ...
... ... @@ -521,7 +521,7 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
// 未登录
if (!uid) {
result.loginUrl = helpers.urlFormat('/signin.html', {
refer: helpers.urlFormat('/shopping/cart')
refer: helpers.urlFormat('/cart/cart')
});
}
... ...
... ... @@ -630,7 +630,7 @@ const addToFav = (uid, skuList, hasPromotion, cartDelList) => {
message: '请先登录!',
data: {
url: helpers.urlFormat('/signin.html', {
refer: helpers.urlFormat('/shopping/cart')
refer: helpers.urlFormat('/cart/cart')
})
}
};
... ... @@ -920,7 +920,14 @@ const queryUserPromotionGift = (promotionId, uid, shoppingKey) => {
let currentProduct = null; // 默认展示第一个商品
if (promotionGifts && promotionGifts.code === 200) {
promotionGifts.data = chelper.formatPriceGiftOne(promotionGifts.data);
// chelper.formatPriceGiftOne(promotionGifts.data);
let promotionList = chelper.formatPriceGifts(_.get(promotionGifts, 'data.arrays'));
if (promotionList && promotionList.length >= 0) {
promotionGifts.data = promotionList[0];
} else {
promotionGifts.data = {};
}
if (promotionGifts.data.goodsList && promotionGifts.data.goodsList.length) {
currentProduct = promotionGifts.data.goodsList[0];
... ...
... ... @@ -1107,7 +1107,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
result.maxSortId = propOrigin('maxSortId', '');
result.smallSortId = propOrigin('smallSortId', '');
result.goCartUrl = helpers.urlFormat('/shopping/cart');
result.goCartUrl = helpers.urlFormat('/cart/cart');
// 定金预售
result.deposit = propOrigin('is_deposit_advance', 'N');
... ...
... ... @@ -101,7 +101,7 @@
</form>
</div>
<div class="go-cart">
<a href="//www.yohobuy.com/shopping/cart">
<a href="//www.yohobuy.com/cart/cart">
<span class="iconfont ">&#xe600;</span>
{{#unless @root.pc.common.removeCartCount}}
<span class="goods-num-tip hide">0</span>
... ...
... ... @@ -58,7 +58,7 @@
<div>
<p data-role="totalinfo"
data-total="{{total}}">购物车里还有<span data-role="last-num">{{total}}</span>件商品</p>
<a href="//www.yohobuy.com/shopping/cart">查看我的购物车</a>
<a href="//www.yohobuy.com/cart/cart">查看我的购物车</a>
</div>
</div>
</div>
... ...