Authored by 梁志锋

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -846,7 +846,16 @@
{
id: 1,
inValid: true, //是否是失效商品,
showCheckbox: true, //是否显示checkbox【赠品和加价购不显示】
checked: true, //是否选中
thumb: '',
isAdvanceBuy: true, //是否是加价购商品
isGift: ture, //是否是赠品
name: '',
color: '黄色',
size: 'L',
... ...
... ... @@ -50,6 +50,10 @@ if ($('.cart-nav').length > 0) {
//trigger lazyload
$(window).trigger('scroll');
});
setTimeout(function() {
$('#presell-tip').addClass('hide');
}, 3000);
}
$('.btn-balance').on('touchend', function() {
... ...
... ... @@ -25,7 +25,7 @@ function getProductInfo(skn, promotionId) {
return;
}
chosePanel.show(html);
}).fail(function() {
}, function() {
tip.show('网络错误');
}).always(function() {
loading.hideLoadingMask();
... ...
... ... @@ -107,12 +107,11 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
fast: true
});
history.go(0);
} else {
tip.show(data.message);
}
}, function() {
dialog.showDialog({
autoHide: true,
dialogText: '网络异常'
});
tip.show('网络异常');
});
});
... ...
... ... @@ -78,7 +78,7 @@ function orderCompute() {
method: 'POST',
url: '/cart/index/orderCompute',
data: {
cartType: orderInfo('cartType'),
cartType: queryString.cartType || queryString.carttype || 'ordinary',
deliveryId: orderInfo('deliveryId'),
paymentTypeId: orderInfo('paymentTypeId'),
couponCode: orderInfo('couponCode'),
... ... @@ -89,6 +89,7 @@ function orderCompute() {
if (!res) {
tip.show('网络出错');
window.location.reload();
} else {
/*if (res.order_amount) {
res.order_amount = (+res.order_amount).toFixed(2);
... ... @@ -108,6 +109,7 @@ function orderCompute() {
}
}).fail(function() {
tip.show('网络出错');
window.location.reload();
});
}
... ...
... ... @@ -7,9 +7,20 @@
var $ = require('jquery'),
orderInfo = require('./order-info').orderInfo;
var $confim = $('.confim-mask'),
deleteId;
$('.address-item').on('touchend', function() {
orderInfo('addressId', $(this).data('address-id'));
}).on('touchend', '.edit', function() {
window.location.href = $(this).data('href');
return false;
}).on('touchend', '.del', function() {
deleteId = $(this).data('address-id');
});
$confim.on('touchend', '.confim', function() {
if (orderInfo('addressId') === deleteId) {
orderInfo('addressId', null);
}
});
... ...
... ... @@ -36,6 +36,37 @@
li:first-child span {
border-right: 1px solid #e0e0e0;
}
li:last-child {
position: relative;
}
.presell-tip {
position: absolute;
z-index: 1;
left: -2rem;
top: 1.75rem;
}
.triangle {
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 12px solid #000;
margin-left: 6rem;
}
.pt-content {
position: relative;
padding: 10px;
background: #000;
color: #fff;
font-size: 20px;
@include border-radius(5px);
text-align: center;
width: 7rem;
}
}
.login-info {
... ... @@ -195,8 +226,6 @@
}
}
}
.shopping-cart-zero{
.cart-zero{
width: 100%;
height: auto;
... ...
{{> layout/header}}
{{# shoppingCart}}
{{#if isEmptyCart}}
<div class="shopping-cart-zero yoho-page">
<div class="cart-zero">
<i class="iconfont">&#xe62c</i>
<p>您的购物车暂无商品</p>
<a href="/product/new">随便逛逛</a>
</div>
{{> product/recommend-for-you}}
</div>
{{^}}
<div id="mainCart" class="shopping-cart-page yoho-page">
{{#if showLoginInfo}}
<div id="mainCart" class="shopping-cart-page yoho-page">
{{# shoppingCart}}
{{#if showLoginInfo}}
<p class="login-info">
<span class="iconfont">&#xe628;</span>
请您先
<a class="btn btn-login" href="{{signurl}}">登录</a>
可以同步电脑和手机中的商品
</p>
{{^}}
{{#if cartNav}}
{{/if}}
{{#if isEmptyCart}}
<div class="cart-zero">
<i class="iconfont">&#xe62c</i>
<p>您的购物车暂无商品</p>
<a href="/product/new">随便逛逛</a>
</div>
{{> product/recommend-for-you}}
{{^}}
{{#if cartNav}}
<ul class="cart-nav clearfix">
<li class="active">
<span>
... ... @@ -33,33 +28,33 @@
<span>
预售商品({{presellGoodsCount}})
</span>
<div id="presell-tip" class="presell-tip">
<div class="triangle"></div>
<p class="pt-content">预售商品点这里结算哦~</p>
</div>
</li>
</ul>
{{/if}}
{{/if}}
{{# commonCart}}
<div class="cart-content common">
{{> cart/cart-content}}
</div>
<div class="cart-content common">
{{> cart/cart-content}}
</div>
{{/ commonCart}}
{{# preSellCart}}
<div class="cart-content presell hide">
<p class="presell-info">
<span class="iconfont">&#xe61a;</span>
<span class="txt">预售商品全场包邮,到货后立即发货</span>
<span class="txt">预售商品不参加活动,不可使用优惠券</span>
</p>
{{> cart/cart-content}}
</div>
<div class="cart-content presell hide">
<p class="presell-info">
<span class="iconfont">&#xe61a;</span>
<span class="txt">预售商品全场包邮,到货后立即发货</span>
<span class="txt">预售商品不参加活动,不可使用优惠券</span>
</p>
{{> cart/cart-content}}
</div>
{{/ preSellCart}}
</div>
{{/if}}
<input id="cartType" type="hidden" value="{{cartType}}">
{{/ shoppingCart}}
{{> cart/chose-panel}}
{{/ shoppingCart}}
</div>
{{> layout/footer}}
... ...
... ... @@ -65,11 +65,18 @@
</li>
<li class="coin" data-yoho-coin="{{yohoCoin}}">
<span class="title">YOHO币</span>
<span class="desc">可抵¥{{yohoCoin}}</span>
<span class="coin-check">
<em>- ¥ {{yohoCoin}}</em>
<i class="iconfont checkbox icon-cb-checked"></i>
</span>
{{#if yohoCoin}}
<span class="desc">可抵¥{{yohoCoin}}</span>
<span class="coin-check">
<em>- ¥ {{yohoCoin}}</em>
<i class="iconfont checkbox icon-cb-checked"></i>
</span>
{{^}}
<span class="not-used coin-check">
无YOHO币可用
</span>
{{/if}}
</li>
{{#if invoice}}
... ...
<div class="shopping-cart-good clearfix" data-id={{id}}>
{{#if isSoldOut}}
<div class="shopping-cart-good clearfix" data-id="{{id}}">
{{#if inValid}}
<span class="few-tag-expire">失效</span>
{{^}}
{{#if isSelected}}
<span class="checkbox icon-cb-checked iconfont"></span>
{{^}}
<span class="checkbox icon-checkbox iconfont"></span>
{{/if}}
{{/if}}
{{#if showCheckbox}}
<span class="checkbox{{#if checked}} icon-cb-checked{{^}} icon-checkbox{{/if}}iconfont"></span>
{{/if}}
<div class="info">
<img class="thumb lazy" data-original={{thumb}}>
<img class="thumb lazy" data-original="{{thumb}}">
{{#if isAdvanceBuy}}
<p class="few-tag plus-tag">加价购</p>
{{^}}
{{#if isGift}}
{{/if}}
{{#if isGift}}
<p class="few-tag gift-tag">赠品</p>
{{/if}}
{{/if}}
</a>
<div class="deps show">
<p class="name row">{{name}}</p>
... ... @@ -67,15 +63,5 @@
</p>
{{/if}}
</div>
<div class="calculate-num hide">
<div class="calculate">
<p><i class="iconfont cut">&#xe625;</i><span>{{count}}</span><i class="iconfont add">&#xe624;</i></p>
<p><span>颜色:{{color}}尺码:{{size}}{{name}}</span><i class="iconfont down">&#xe616;</i></p>
</div>
<p><span class="price"> ¥{{price}}</span></p>
<span class="count">
×{{count}}
</span>
</div>
</div>
</div>
... ...
... ... @@ -271,7 +271,7 @@ class IndexController extends AbstractAction
$this->auditJumpLogin();
$this->setTitle('确认订单');
$this->setNavHeader('确认订单');
$this->setNavHeader('确认订单', true, false); // 不显示右上角home按钮
// 购物车商品为空跳转到购物车页面
$shoppingKey = Helpers::getShoppingKeyByCookie();
... ...