Authored by uedxwg

'购物车商品详情'

@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 ellipsis = require('mlellipsis'), 8 ellipsis = require('mlellipsis'),
  9 + chosePanel = require('../shopping-cart/chose-panel'),
9 lazyLoad = require('yoho.lazyload'); 10 lazyLoad = require('yoho.lazyload');
10 11
11 var dialog = require('../me/dialog'), 12 var dialog = require('../me/dialog'),
@@ -156,4 +157,32 @@ $('.btn-balance').on('touchend', function() { @@ -156,4 +157,32 @@ $('.btn-balance').on('touchend', function() {
156 window.location.href = '/shoppingCart/orderEnsure?cartType=' + cartType; 157 window.location.href = '/shoppingCart/orderEnsure?cartType=' + cartType;
157 }); 158 });
158 159
  160 +$('.down').on('touchend', function() {
  161 + chosePanel.show();
  162 +});
  163 +$('.cut').on('touchend', function() {
  164 + var $this = $(this),
  165 + id = $(this).closest('.shopping-cart-good').data('id');
  166 + console.log(id);
  167 + $.ajax({
  168 + type: 'GET',
  169 + url: '/shoppingCart/modify',
  170 + data: {
  171 + old_product_sku: id ,
  172 + new_product_sku: id ,
  173 + buy_number: '0',
  174 + selected: 'Y'
  175 + },
  176 + success: function(data) {
  177 + if (data.code === 200) {
  178 + window.history.go(0);
  179 + }
  180 + },
  181 + error: function() {
  182 + tip.show('网络错误');
  183 + }
  184 + });
  185 +
  186 +});
  187 +
159 188
@@ -151,6 +151,61 @@ @@ -151,6 +151,61 @@
151 } 151 }
152 } 152 }
153 } 153 }
  154 + .calculate-num{
  155 + float: right;
  156 + .calculate{
  157 + float: right;
  158 + border:1px solid #b0b0b0;
  159 + border-radius:.2rem;
  160 + p{
  161 + color: #444;
  162 + &:first-child{
  163 + height: 60rem / $pxConvertRem;
  164 + border-bottom:1px solid #b0b0b0;
  165 + span {
  166 + border-left:1px solid #b0b0b0;
  167 + border-right:1px solid #b0b0b0;
  168 + }
  169 + }
  170 + i{
  171 + width: 72rem / $pxConvertRem;
  172 + height: 60rem / $pxConvertRem;
  173 + float: left;
  174 + line-height: 60rem / $pxConvertRem;
  175 + text-align: center;
  176 + }
  177 + span{
  178 + width: 96rem / $pxConvertRem;
  179 + height: 60rem / $pxConvertRem;
  180 + float: left;
  181 + font-size: 40rem / $pxConvertRem;
  182 + line-height: 60rem / $pxConvertRem;
  183 + text-align: center;
  184 +
  185 + }
  186 + &:last-child {
  187 + span{
  188 + width: 168rem / $pxConvertRem;
  189 + overflow: hidden;
  190 + font-size: 48em / $pxConvertRem;
  191 + text-overflow:ellipsis;
  192 + white-space:nowrap;
  193 + }
  194 + }
  195 + }
  196 + }
  197 + .price{
  198 + line-height: 60rem / $pxConvertRem;
  199 + font-size: 52em / $pxConvertRem;
  200 + font-weight: bold;
  201 + }
  202 + .count{
  203 + position: absolute;
  204 + right: 20rem / $pxConvertRem;;
  205 + top: 20rem / $pxConvertRem;;
  206 + font-size: 52em / $pxConvertRem;
  207 + }
  208 + }
154 } 209 }
155 210
156 .shopping-cart-good:last-child { 211 .shopping-cart-good:last-child {
1 {{> layout/header}} 1 {{> layout/header}}
2 -<div class="shopping-cart-page yoho-page" style="display: none;"> 2 +<div class="shopping-cart-page yoho-page">
3 {{# shoppingCart}} 3 {{# shoppingCart}}
4 {{#if cartNav}} 4 {{#if cartNav}}
5 <ul class="cart-nav clearfix"> 5 <ul class="cart-nav clearfix">
@@ -44,12 +44,13 @@ @@ -44,12 +44,13 @@
44 44
45 {{/ shoppingCart}} 45 {{/ shoppingCart}}
46 </div> 46 </div>
47 -<div class="shopping-cart-zero yoho-page"> 47 +<div class="shopping-cart-zero yoho-page" style="display: none;">
48 <div class="cart-zero"> 48 <div class="cart-zero">
49 <i class="iconfont">&#xe62c</i> 49 <i class="iconfont">&#xe62c</i>
50 <p>您的购物车暂无商品</p> 50 <p>您的购物车暂无商品</p>
51 <a href="">随便逛逛</a> 51 <a href="">随便逛逛</a>
52 </div> 52 </div>
53 {{> product/recommend-for-you}} 53 {{> product/recommend-for-you}}
  54 + {{> shopping-cart/chose-panel}}
54 </div> 55 </div>
55 {{> layout/footer}} 56 {{> layout/footer}}
1 -{{#cartInfo}} 1 +
2 <div class="chose-panel"> 2 <div class="chose-panel">
3 <div class="main"> 3 <div class="main">
4 <div class="infos"> 4 <div class="infos">
@@ -61,4 +61,3 @@ @@ -61,4 +61,3 @@
61 </div> 61 </div>
62 </div> 62 </div>
63 </div> 63 </div>
64 -{{/cartInfo}}  
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <span class="checkbox icon-cb-checked iconfont"></span> 2 <span class="checkbox icon-cb-checked iconfont"></span>
3 <div class="info"> 3 <div class="info">
4 <img class="thumb lazy" data-original={{thumb}}> 4 <img class="thumb lazy" data-original={{thumb}}>
5 - <div class="deps"> 5 + <!-- <div class="deps">
6 <p class="name row">{{name}}</p> 6 <p class="name row">{{name}}</p>
7 <p class="row"> 7 <p class="row">
8 {{#if color}} 8 {{#if color}}
@@ -49,6 +49,16 @@ @@ -49,6 +49,16 @@
49 </span> 49 </span>
50 {{/if}} 50 {{/if}}
51 </p> 51 </p>
  52 + </div> -->
  53 + <div class="calculate-num">
  54 + <div class="calculate">
  55 + <p><i class="iconfont cut">&#xe625;</i><span>{{count}}</span><i class="iconfont add">&#xe624;</i></p>
  56 + <p><span>颜色:{{color}}尺码:{{size}}{{name}}</span><i class="iconfont down">&#xe616;</i></p>
  57 + </div>
  58 + <p><span class="price"> ¥{{price}}</span></p>
  59 + <span class="count">
  60 + ×{{count}}
  61 + </span>
52 </div> 62 </div>
53 </div> 63 </div>
54 <!--<div class="opt-panel hide"> 64 <!--<div class="opt-panel hide">
@@ -62,4 +72,5 @@ @@ -62,4 +72,5 @@
62 删除 72 删除
63 </div> 73 </div>
64 </div>--> 74 </div>-->
  75 +
65 </div> 76 </div>