Authored by uedxwg

'购物车商品详情'

... ... @@ -6,6 +6,7 @@
var $ = require('jquery'),
ellipsis = require('mlellipsis'),
chosePanel = require('../shopping-cart/chose-panel'),
lazyLoad = require('yoho.lazyload');
var dialog = require('../me/dialog'),
... ... @@ -156,4 +157,32 @@ $('.btn-balance').on('touchend', function() {
window.location.href = '/shoppingCart/orderEnsure?cartType=' + cartType;
});
$('.down').on('touchend', function() {
chosePanel.show();
});
$('.cut').on('touchend', function() {
var $this = $(this),
id = $(this).closest('.shopping-cart-good').data('id');
console.log(id);
$.ajax({
type: 'GET',
url: '/shoppingCart/modify',
data: {
old_product_sku: id ,
new_product_sku: id ,
buy_number: '0',
selected: 'Y'
},
success: function(data) {
if (data.code === 200) {
window.history.go(0);
}
},
error: function() {
tip.show('网络错误');
}
});
});
... ...
... ... @@ -151,6 +151,61 @@
}
}
}
.calculate-num{
float: right;
.calculate{
float: right;
border:1px solid #b0b0b0;
border-radius:.2rem;
p{
color: #444;
&:first-child{
height: 60rem / $pxConvertRem;
border-bottom:1px solid #b0b0b0;
span {
border-left:1px solid #b0b0b0;
border-right:1px solid #b0b0b0;
}
}
i{
width: 72rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
float: left;
line-height: 60rem / $pxConvertRem;
text-align: center;
}
span{
width: 96rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
float: left;
font-size: 40rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
text-align: center;
}
&:last-child {
span{
width: 168rem / $pxConvertRem;
overflow: hidden;
font-size: 48em / $pxConvertRem;
text-overflow:ellipsis;
white-space:nowrap;
}
}
}
}
.price{
line-height: 60rem / $pxConvertRem;
font-size: 52em / $pxConvertRem;
font-weight: bold;
}
.count{
position: absolute;
right: 20rem / $pxConvertRem;;
top: 20rem / $pxConvertRem;;
font-size: 52em / $pxConvertRem;
}
}
}
.shopping-cart-good:last-child {
... ...
{{> layout/header}}
<div class="shopping-cart-page yoho-page" style="display: none;">
<div class="shopping-cart-page yoho-page">
{{# shoppingCart}}
{{#if cartNav}}
<ul class="cart-nav clearfix">
... ... @@ -44,12 +44,13 @@
{{/ shoppingCart}}
</div>
<div class="shopping-cart-zero yoho-page">
<div class="shopping-cart-zero yoho-page" style="display: none;">
<div class="cart-zero">
<i class="iconfont">&#xe62c</i>
<p>您的购物车暂无商品</p>
<a href="">随便逛逛</a>
</div>
{{> product/recommend-for-you}}
{{> shopping-cart/chose-panel}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{#cartInfo}}
<div class="chose-panel">
<div class="main">
<div class="infos">
... ... @@ -61,4 +61,3 @@
</div>
</div>
</div>
{{/cartInfo}}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<span class="checkbox icon-cb-checked iconfont"></span>
<div class="info">
<img class="thumb lazy" data-original={{thumb}}>
<div class="deps">
<!-- <div class="deps">
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
... ... @@ -49,6 +49,16 @@
</span>
{{/if}}
</p>
</div> -->
<div class="calculate-num">
<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 class="opt-panel hide">
... ... @@ -62,4 +72,5 @@
删除
</div>
</div>-->
</div>
... ...