Authored by hongweigao

Merge branch 'feature/shoppingCart' of http://git.yoho.cn/fe/yohobuy-node into feature/shoppingCart

... ... @@ -410,7 +410,7 @@ const getCartData = (uid, shoppingKey, cartDelList) => {
// 接口异常时,购物车置为空
if (!cartData) {
result.isEmpty = true;
result.isEmpty = false;
// UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
return result;
... ...
... ... @@ -32,18 +32,18 @@ router.post('/easypay/compute', easypay.compute); // 价格重新计算
router.post('/easypay/submit', easypay.submit); // 限购商品订单提交
router.get('/cart', cart.cart);
router.post('/index/select', cart.selectProduct);
router.post('/index/modifyNum', cart.modifyProductNum);
router.post('/index/add', cart.cartAdd);
router.post('/index/updateProduct', cart.modifyProduct);
router.post('/index/remove', cart.removeProduct);
router.post('/index/fav', cart.moveToFav);
router.post('/index/checkFav', cart.checkFav);
router.get('/index/getProductData', cart.getProductData);
router.post('/index/swapGift', cart.swapGift);
router.get('/index/queryPromotionGift', cart.queryUserPromotionGift);
router.get('/data/togetherProduct', cart.getTogetherProduct);
router.get('/data/recommendProduct', cart.getRecommendProductAction);
router.post('/cart/select', cart.selectProduct);
router.post('/cart/modifyNum', cart.modifyProductNum);
router.post('/cart/add', cart.cartAdd);
router.post('/cart/updateProduct', cart.modifyProduct);
router.post('/cart/remove', cart.removeProduct);
router.post('/cart/fav', cart.moveToFav);
router.post('/cart/checkFav', cart.checkFav);
router.get('/cart/getProductData', cart.getProductData);
router.post('/cart/swapGift', cart.swapGift);
router.get('/cart/queryPromotionGift', cart.queryUserPromotionGift);
router.get('/cart/togetherProduct', cart.getTogetherProduct);
router.get('/cart/recommendProduct', cart.getRecommendProductAction);
module.exports = router;
... ...
... ... @@ -25,37 +25,10 @@
<div class="order-pay">
{{#if cart.isEmpty}}
<div class="pay-wapper">
<<<<<<< HEAD
<table>
<thead>
<tr>
<th style="width:7%;">
全选
</th>
<th style="width:40%;">
商品信息
</th>
<th style="width:13%;">单价</th>
<th style="width:10%;">数量</th>
<th style="width:10%;">小计(元)</th>
<th style="width:20%;">操作</th>
</tr>
</thead>
<tbody>
<tr class="pre-sell-box">
<td colspan="6" class="cart-empty">
<a href="{{cart.guangUrl}}">选购商品</a>
<a href="{{cart.viewOrderUrl}}">查看订单</a>
</td>
</tr>
</tbody>
</table>
=======
<div class="shop-cart-empty">
<p>购物车空空的哦,去看看心仪的商品吧~</p>
</div>
>>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a
</div>
<div class="dev-revocation {{#unless cart.deleteShop}}none{{/unless}}">
<table>
... ... @@ -76,18 +49,6 @@
{{^}}
<!-- 购物车商品列表 -->
{{#cart}}
<<<<<<< HEAD
<div class="pay-wapper">
<div class="cart-title">
<p class="left" style="width:6%;">
<input type="checkbox"/> 全选
</p>
<p style="width:40%">商品信息</p>
<p style="width:14%">单价</p>
<p style="width:13%;">数量</p>
<p style="width:16%;">小计(元)</p>
<p class="right" style="width:11%;">操作</p>
=======
<div class="pay-wapper">
<div class="cart-title">
<p class="left" style="width:6%;">
... ... @@ -104,7 +65,6 @@
<!-- 预售商品 -->
<div class="pre-sell">
<code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。
>>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a
</div>
{{#advanceCart}}
... ... @@ -112,62 +72,6 @@
<div class="pre-sell">
<code>预售商品</code>预售商品不参加活动,不可使用优惠券,不同上市期的商品我们将为您先到先发。
</div>
<<<<<<< HEAD
{{#if goodsList}}
<div class="cart-table">
<ul class="table table-group">
{{#each goodsList}}
{{>cart-item}}
{{/each}}
</ul>
</div>
{{/if}}
{{#if offShelves}}
<div class="cart-table">
<ul class="table table-group">
{{#each offShelves}}
{{>cart-item}}
{{/each}}
</ul>
</div>
{{/if}}
{{#if soldOuts}}
<div class="cart-table">
<ul class="table table-group">
{{#each soldOuts}}
{{>cart-item}}
{{/each}}
</ul>
</div>
{{/if}}
{{/advanceCart}}
{{#ordinaryCart}}
{{#pools}}
{{#if promotionInfos}}
<div class="gift-sell mt40">
{{#promotionInfos}}
<p data-role="promotion-wrap">
<code class="{{#unless isReach}}order-pay-mark-white{{/unless}}">{{tag}}</code>{{promotionTitle}}
<!--<a>去换购</a>-->
{{#if isGift}}
{{#if isNotReach}}<a href="javascript:void(0);" data-role="gift-view-btn">查看赠品</a>{{/if}}
{{#if isSelected}}
<a href="javascript:void(0);" data-role="gift-resel-btn">重选赠品</a>
{{else}}
{{#if isReach}}<a href="javascript:void(0);" data-role="gift-sel-btn">领赠品</a>{{/if}}
{{/if}}
{{/if}}
{{#if isNotReach}}
<a class="btn-clear blue" target="_blank" href="{{promotionPageUrl}}" data-together-id="1" >去凑单&nbsp;></a>
{{/if}}
<textarea data-role="gifts-cansel" class="hide" data-promotionid="{{promotionId}}">{{{giftGoodsListStr}}}</textarea>
</p>
{{/promotionInfos}}
=======
<div class="td pay-pro" style="width: 45%;">
<i class="cart-item-check iconfont cart-item-checked" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}></i>
<a class="pay-pro-icon" href="{{link}}" target="_blank">
... ... @@ -272,7 +176,6 @@
<p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">库存不足{{tipMessage}}</p>
{{/if}}
{{/if}}
>>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a
</div>
{{/if}}
... ... @@ -333,33 +236,6 @@
</div>
{{/if}}
{{/ordinaryCart}}
<<<<<<< HEAD
{{#stat}}
<!-- 总价计算 -->
<div class="cartnew-sum">
{{#unless cart.isEmpty}}
<div class="left">
<a href="javascript:void(0);" class="btn_h" style="display:none;"><span>清空商品</span></a>
<input type="checkbox" id="cbSelAllGoods" {{#if cart.isCheckedAll}}checked="checked"{{/if}}>
<span>全选</span>
<a class="delAll" href="javascript:void(0);">删除选中商品</a>
<a class="removeAll" href="javascript:void(0);">移入收藏夹</a>
<a class="emptyDisabled" href="javascript:void(0);">清空失效商品</a>
</div>
{{/unless}}
<div class="right">
<p>
{{#if gainYohoCoin}}<a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>
共返有货币:{{gainYohoCoin}}&#12288;&#12288;{{/if}}
已选商品<strong class="ins">{{selectedGoodsCount}}</strong>&#12288;&#12288;
商品金额:<b>¥&nbsp;{{orderAmount}}</b>
</p>
{{#if discountAmount}}<p>活动优惠:<b>&nbsp;{{discountAmount}}</b></p>{{/if}}
<!--<p>优惠码/优惠券:<b>¥&nbsp;8888.00</b></p>-->
<p class="sum">
应付金额(不含邮费):<strong><kbd>¥&nbsp;</kbd>{{lastOrderAmount}}</strong></p>
=======
{{#stat}}
<!-- 总价计算 -->
<div class="cartnew-sum">
... ... @@ -371,16 +247,8 @@
<a class="delAll" href="javascript:void(0);">删除选中商品</a>
<a class="removeAll" href="javascript:void(0);">移入收藏夹</a>
<a class="emptyDisabled" href="javascript:void(0);">清空失效商品</a>
>>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a
</div>
</div>
<<<<<<< HEAD
<div class="cartnew-submit" id="payDiv">
<span>添加礼品袋</span>
<a href="javascript:void(0);" class="btn-account">去结算</a>
</div>
{{/stat}}
=======
</div>
<div class="cartnew-submit" id="payDiv">
<span>添加礼品袋</span>
... ... @@ -594,7 +462,6 @@
</div>
</li>
</ul>
>>>>>>> 91cc71042ef15455f75f11fdf21902e4cf115f3a
</div>
{{/cart}}
... ...
... ... @@ -18,7 +18,7 @@ module.exports = app => {
app.use('/home', require('./apps/home')); // 会员中心
app.use('/brands', require('./apps/brands')); // 品牌一览
app.use('/guang', require('./apps/guang')); // 逛
app.use('/newcart', require('./apps/cart'));// 购物车
app.use('/cart', require('./apps/cart'));// 购物车
// 第三方,如广告联盟
app.use('/3party', require('./apps/3party'));
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Mon Jan 16 14:33:27 2017
Created by FontForge 20120731 at Tue Jan 17 16:09:10 2017
By admin
</metadata>
<defs>
... ... @@ -302,9 +302,9 @@ t70 146q17 22 12.5 50t-26.5 44.5t-50.5 12t-44.5 -26.5q-51 -68 -80.5 -153t-29.5 -
d="M409.5 787q124.5 0 212.5 -88t88 -212.5t-88 -212.5t-212.5 -88t-212.5 88t-88 212.5t88 212.5t212.5 88zM409.5 896q-110.5 0 -204.5 -55.5t-149.5 -149.5t-55.5 -204.5t55.5 -205t149.5 -149.5t204.5 -55t205 55t149.5 149.5t55 205t-55 204.5t-149.5 149.5t-205 55.5z
M890 -109l-269 269l115 115l269 -269q14 -14 14 -38t-14 -38l-39 -39q-14 -19 -35.5 -19t-40.5 19z" />
<glyph glyph-name="w" unicode="&#xe6d6;"
d="M512 823q89 0 170 -35t140 -94t94 -140t35 -170t-35 -170t-94 -140t-140 -94t-170 -35t-170 35t-140 94t-94 140t-35 170t35 170t94 140t140 94t170 35zM512 896q-105 0 -200 -40t-163.5 -108.5t-108.5 -163.5t-40 -200q0 -140 68 -258t186 -186t258 -68t258 68t186 186
t68 258q0 105 -40 200t-108.5 163.5t-163.5 108.5t-200 40zM505 245q-18 0 -31 11.5t-13 32.5q0 48 23.5 85.5t64.5 60.5q26 11 42 35.5t16 52.5q0 44 -29 73t-73 29t-73.5 -29t-29.5 -73q0 -16 -13.5 -30t-30 -14t-30 14t-13.5 30q0 77 56.5 133.5t133 56.5t133.5 -56.5
t57 -133.5q0 -56 -27 -101.5t-76 -66.5q-43 -30 -43 -66q0 -18 -12 -31t-32 -13zM505 128zM439 128q0 -27 19 -46.5t46.5 -19.5t47 19.5t19.5 46.5t-19.5 46.5t-47 19.5t-46.5 -19.5t-19 -46.5z" />
d="M512 893q-104 0 -197 -39.5t-160.5 -106.5t-107 -160.5t-39.5 -197t39.5 -197t107 -161t160.5 -107t197 -39.5t197 39.5t160.5 107t107 161t39.5 197t-39.5 197t-107 160.5t-160.5 106.5t-197 39.5zM512 -57q-90 0 -172.5 35.5t-142.5 95.5t-95.5 142.5t-35.5 172.5
t35.5 173t95.5 143t142.5 95.5t172.5 35.5t172.5 -35.5t142.5 -95.5t95.5 -143t35.5 -173t-35.5 -172.5t-95.5 -142.5t-142.5 -95.5t-172.5 -35.5zM512 706q-72 0 -122 -50q-51 -63 -51 -123q0 -16 10 -26t26 -10t26 10t10 26q0 29 29 72q29 29 72 29q38 0 66 -28t28 -65
q0 -28 -16 -52t-42 -35q-33 -16 -52.5 -47t-19.5 -68v-43q0 -16 10 -26t26 -10t26 10t10 26v36q0 21 29 50q48 22 74.5 63t26.5 96q0 63 -50 111.5t-116 53.5zM447 137v0q0 -24 17 -40.5t41 -16.5t40.5 16.5t16.5 40.5v0v0q0 24 -16.5 41t-40.5 17t-41 -17t-17 -41v0z" />
<glyph glyph-name="Slice" unicode="&#xe6d8;" horiz-adv-x="2176"
d="M1696 566h-105q-24 -64 -45 -96q21 0 42 12q3 -30 17 -92q13 -61 37 -115q30 56 43.5 149.5t10.5 141.5zM1792 50q-47 24 -87 58q-36 32 -66 71q-38 -36 -79 -65q-40 -28 -119 -70q-15 33 -51 54q39 5 108 46q69 40 105 80q-24 50 -37 105q-15 61 -26 123l-21 -37
q-12 34 -36 61q36 54 66 135q30 80 42 153q36 -18 78 -27q-15 -15 -30 -47q-18 -39 -33 -79q189 0 231 3v-51q-38 3 -77 3h-4q-3 -92 -21 -182q-18 -94 -57 -160q9 -28 59 -63q47 -36 103 -54q-36 -21 -48 -57v0zM1285 165q-32 -34 -102 -88q-22 28 -54 48q45 21 84 51
... ... @@ -321,5 +321,8 @@ t4.5 46q11 21 36.5 28t45.5 -7l185 -171l293 416q11 21 36 28t46 -7q25 -15 32 -38.5
<glyph glyph-name="bi" unicode="&#xe6c7;"
d="M973 845q-51 51 -119 51t-119 -51l-591 -592q-14 -13 -14 -20l-122 -292q-9 -25 6 -55q26 -26 55 -7l292 123q7 0 21 13l591 592q46 51 46 119t-46 119zM239 206v13l483 483h13l102 -102v-13l-285 -279l-204 -204h-14zM912 777q21 -25 19.5 -57t-26.5 -52l-7 -7h-13
l-102 96v13l13 14q25 21 60.5 19.5t55.5 -26.5zM123 -5l61 143l82 -82z" />
<glyph glyph-name="jinzhi" unicode="&#xe6e0;"
d="M998 384q0 99 -38.5 189t-103.5 155t-155 103.5t-189 38.5t-189 -38.5t-155 -103.5t-103.5 -155t-38.5 -189t38.5 -189t103.5 -155t155 -103.5t189 -38.5t189 38.5t155 103.5t103.5 155t38.5 189zM512 806q152 0 275 -102l-595 -595q-102 123 -102 275q0 85 33.5 163
t90.5 135t135 90.5t163 33.5zM237 64l595 595q102 -123 102 -275q0 -114 -55.5 -211t-153 -154t-213.5 -57q-152 0 -275 102z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -94,7 +94,7 @@
<div class="submit">
<button class="btn-red addcart"><i class="addCart iconfont">&#xe600;</i>添加到购物车</button>
<button class="addcart btn-grey"><i class="addCart iconfont">&#xe600;</i>添加到购物车</button>
<button class="btn-sellOut btn-grey"><i class="sellOut iconfont">&#xe6ba;</i>已售罄</button>
<button class="btn-sellOut btn-grey"><i class="sellOut iconfont">&#xe6e0;</i>已售罄</button>
<button class="btn-favCount"><i class="favCount iconfont">&#xe68f;</i>收藏商品</button>
<button class="btn-favCount"><i class="favCount iconfont coled">&#xe68f;</i>已收藏</button>
</div>
... ...
... ... @@ -5,8 +5,8 @@
var $ = require('yoho-jquery'),
dialog = require('../common/dialog'),
Alert = dialog.Alert,
CART_ITEM_DEL_URL = '/newcart/index/remove',
CART_ITEM_FAV_URL = '/newcart/index/fav',
CART_ITEM_DEL_URL = '/cart/cart/remove',
CART_ITEM_FAV_URL = '/cart/cart/fav',
cartItemNumChg;
// checkbox提交ajax
... ... @@ -26,7 +26,7 @@ function choiceOut(items) {
return $.ajax({
type: 'POST',
dataType: 'json',
url: '/newcart/index/select',
url: '/cart/cart/select',
data: {
skuList: JSON.stringify(skuList),
hasPromotion: hasPromotion
... ... @@ -111,7 +111,7 @@ cartItemNumChg = (function() {
$.ajax({
type: 'POST',
dataType: 'json',
url: '/newcart/index/modifyNum',
url: '/cart/cart/modifyNum',
data: data
}).then(function(d) {
... ... @@ -123,12 +123,12 @@ cartItemNumChg = (function() {
countBusy = false;
});
};
})();
}());
function getProductInfo(pid, skn) {
return $.ajax({
type: 'GET',
url: '/newcart/index/getProductData', // '/product/item/getProductInfo',
url: '/cart/cart/getProductData', // '/product/item/getProductInfo',
data: {
productId: pid,
skn: skn
... ... @@ -142,7 +142,7 @@ function getProductInfo(pid, skn) {
function addcart(data, cookieList) {
$.ajax({
type: 'POST',
url: '/newcart/index/add',
url: '/cart/cart/add',
data: data
}).then(function(d) {
if (d.code === 200) {
... ... @@ -243,7 +243,7 @@ function updateCartItem(newSku, oldSku) {
$.ajax({
type: 'POST',
url: '/newcart/index/updateProduct',
url: '/cart/cart/updateProduct',
data: {
swapData: JSON.stringify([{
buy_number: '1',
... ... @@ -265,7 +265,7 @@ function updateCartGiftItem(promotionId, newSkn, newSku) {
$.ajax({
type: 'POST',
url: '/newcart/index/swapGift',
url: '/cart/cart/swapGift',
data: {
promotionId: promotionId,
newSkn: newSkn,
... ... @@ -283,7 +283,7 @@ function updateCartGiftItem(promotionId, newSkn, newSku) {
function getProductByPromotionId(promotionId) {
return $.ajax({
type: 'GET',
url: '/newcart/index/queryPromotionGift',
url: '/cart/cart/queryPromotionGift',
data: {
promotionId: promotionId
}
... ... @@ -298,7 +298,7 @@ function getFineProduct(page) {
return $.ajax({
type: 'GET',
dataType: 'json',
url: '/newcart/data/recommendProduct',
url: '/cart/cart/recommendProduct',
data: {
page: page
}
... ... @@ -339,7 +339,7 @@ function getTogetherProduct(page) {
return $.ajax({
type: 'GET',
dataType: 'json',
url: '/newcart/data/togetherProduct',
url: '/cart/cart/togetherProduct',
data: page
}).then(function(d) {
return d;
... ...
... ... @@ -13,6 +13,15 @@ require('../plugins/slider');
require('../common/center-slider');
require('../common');
$('.side-img-dd').slider2({
shownum: 5,
isCircle: true
});
// var dialogTpl = require('hbs/cart/cart-togetherGoods.hbs');
lazyLoad($('#details-html img'));
function isCheckAll() {
var isAllCheck = true;
... ... @@ -44,7 +53,7 @@ function isCheckFav() {
$.ajax({
type: 'POST',
url: '/newcart/index/checkFav',
url: '/cart/cart/checkFav',
data: {
pidList: pidArray.join(',')
}
... ... @@ -83,12 +92,6 @@ $(function() {
$(this).removeClass('active').children('ul').addClass('none');
});
$('.side-img-dd').each(function(){
$(this).slider2({
shownum: 5,
isCircle: true
});
});
isCheckAll();
isCheckFav();
... ...
... ... @@ -197,8 +197,30 @@
margin-left: 0;
}
}
.focus {
color: #444;
&:after {
background: url(/cart/step-on.png);
}
}
&.min-step {
width: 220px;
&:before {
width: 0;
}
li {
width: 50%
}
}
}
.cart-table {
border: 1px solid #e0e0e0;
&:not(last-child){
... ... @@ -1275,8 +1297,7 @@
}
&:hover {
.name {
color: #000;
font-weight: 500;
color: #d0021b;
}
}
}
... ...