Authored by hf

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

... ... @@ -93,7 +93,7 @@ function orderCompute() {
}).then(function(res) {
var priceHtml;
if (!res.length) {
if ($.type(res) !== 'object') {
window.location.reload();
} else {
/*if (res.order_amount) {
... ...
... ... @@ -70,6 +70,16 @@ $('#coupon-list').on('touchend', '.employ-main', function() {
orderInfo('couponCode', $this.data('coupon-code'));
orderInfo('couponName', $this.data('coupon-name'));
}).on('touchstart', '.employ-main', function() {
var $this = $(this);
$this.siblings().removeClass('focus');
$this.addClass('focus');
}).on('touchend touchcancel', '.employ-main', function() {
var $this = $(this);
$this.siblings().removeClass('focus');
$this.removeClass('focus');
});
$('body').on('touchend', '.not-use', function() {
... ...
... ... @@ -42,13 +42,10 @@ optHammer.on('tap', function(e) {
}).then(function(res) {
$('#dialog-wrapper').hide();
if (!res) {
tip.show('网络错误');
return;
}
if (res.code === 200) {
tip.show('删除成功');
} else {
tip.show(res.message || '网络错误');
if (res.message) {
tip.show(res.message);
}
window.location.href = '/home/orders';
}).fail(function() {
... ... @@ -74,13 +71,10 @@ optHammer.on('tap', function(e) {
}).then(function(res) {
$('#dialog-wrapper').hide();
if (!res) {
tip.show('网络错误');
return;
}
if (res.code === 200) {
tip.show('取消成功');
} else {
tip.show(res.message || '网络错误');
if (res.message) {
tip.show(res.message);
}
window.location.href = '/home/orders';
}).fail(function() {
... ...
... ... @@ -3,6 +3,14 @@
position: relative;
padding-left: 16rem / $pxConvertRem;
.prevent-img-click {
width: 20rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
position: absolute;
background-color: transparent;
z-index: 99;
}
.checkbox {
position: absolute;
top: 50%;
... ...
... ... @@ -234,9 +234,9 @@
}
}
.price-cal {
font-family: monospace;
}
// .price-cal {
// font-family: monospace;
// }
.cost {
border-top: 1px solid #f7f7f7;
... ...
... ... @@ -40,6 +40,9 @@
background-size: 100% 100%;
color: #fff;
position: relative;
&.focus {
background-image: image-url('me/employ/employ-red.jpg');
}
span{
width: 34.482759%;
height: 100%;
... ...
... ... @@ -12,7 +12,7 @@
{{else}}
{{# freebie}}
<div class="advance-block gift-block" data-promotion-id="{{promotionId}}">
<p class="title">{{title}}</p>
<p class="title">{{promotionTitle}}</p>
{{#goods}}
{{> cart/gift-advance-good}}
{{/goods}}
... ...
... ... @@ -20,7 +20,7 @@
<span class="iconfont">&#xe620;</span>
赠品
<span class="iconfont icon-right-arrow">&#xe614;</span>
<span class="count">{{count}}</span>
<span class="count">{{giftCount}}</span>
</a>
</li>
{{/ freebie}}
... ...
... ... @@ -8,6 +8,7 @@
{{/if}}
<div class="info">
<div class="prevent-img-click"></div>
<a href="{{link}}">
<img class="thumb lazy" data-original="{{thumb}}">
</a>
... ...
... ... @@ -5,11 +5,11 @@
<a class="swiper-slide" href="{{url}}">
<img class="swiper-lazy img-box" data-src="{{thumb}}">
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">&yen;{{salePrice}}</span>
{{#price}}<span class="old-price">&yen;{{.}}</span>{{/price}}
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}<span class="old-price">¥{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</a>
{{/recommendList}}
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -46,7 +46,7 @@ class CartModel
*
* @param integer $uid 用户ID
* @param string $shoppingKey 未登录用户唯一识别码
* @param string $cartType 购物车类型
* @param string $cartType 购物车类型,默认是是所有购物车,ordinary为普通购物车,advance为预售购物车
* @param bool $onlyGift 只获取赠品的商品数据
* @param bool $onlyAdvanceBuy 只获取加价购的商品数据
* @return array|mixed 处理之后的购物车数据
... ... @@ -73,7 +73,7 @@ class CartModel
$cart = $cartData['data'];
if ($cartType !== 'all') { // 加价购或者赠品数据
if ($onlyGift || $onlyAdvanceBuy) { // 加价购或者赠品数据
$result = self::procCartData($cart['ordinary_cart_data'], $onlyGift, $onlyAdvanceBuy);
break;
}
... ... @@ -99,7 +99,7 @@ class CartModel
// 以上两个购物车中都有数据, 默认显示普通购物车
else {
$result['cartNav'] = true;
$result['cartType'] = 'ordinary';
$result['cartType'] = $cartType !== 'all' ? $cartType : 'ordinary';
}
/* 普通购物车 */
... ...
... ... @@ -40,10 +40,11 @@ class IndexController extends AbstractAction
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(true);
$cartType = $this->get('cartType', 'all');
$data = array(
'shoppingCartPage' => true,
'shoppingCart' => CartModel::getCartData($uid, $shoppingKey)
'shoppingCart' => CartModel::getCartData($uid, $shoppingKey, $cartType)
);
// 渲染模板
... ...