Authored by 梁志锋

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

@@ -846,7 +846,16 @@ @@ -846,7 +846,16 @@
846 846
847 { 847 {
848 id: 1, 848 id: 1,
  849 + inValid: true, //是否是失效商品,
  850 +
  851 + showCheckbox: true, //是否显示checkbox【赠品和加价购不显示】
  852 + checked: true, //是否选中
  853 +
849 thumb: '', 854 thumb: '',
  855 +
  856 + isAdvanceBuy: true, //是否是加价购商品
  857 + isGift: ture, //是否是赠品
  858 +
850 name: '', 859 name: '',
851 color: '黄色', 860 color: '黄色',
852 size: 'L', 861 size: 'L',
@@ -50,6 +50,10 @@ if ($('.cart-nav').length > 0) { @@ -50,6 +50,10 @@ if ($('.cart-nav').length > 0) {
50 //trigger lazyload 50 //trigger lazyload
51 $(window).trigger('scroll'); 51 $(window).trigger('scroll');
52 }); 52 });
  53 +
  54 + setTimeout(function() {
  55 + $('#presell-tip').addClass('hide');
  56 + }, 3000);
53 } 57 }
54 58
55 $('.btn-balance').on('touchend', function() { 59 $('.btn-balance').on('touchend', function() {
@@ -25,7 +25,7 @@ function getProductInfo(skn, promotionId) { @@ -25,7 +25,7 @@ function getProductInfo(skn, promotionId) {
25 return; 25 return;
26 } 26 }
27 chosePanel.show(html); 27 chosePanel.show(html);
28 - }).fail(function() { 28 + }, function() {
29 tip.show('网络错误'); 29 tip.show('网络错误');
30 }).always(function() { 30 }).always(function() {
31 loading.hideLoadingMask(); 31 loading.hideLoadingMask();
@@ -107,12 +107,11 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -107,12 +107,11 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
107 fast: true 107 fast: true
108 }); 108 });
109 history.go(0); 109 history.go(0);
  110 + } else {
  111 + tip.show(data.message);
110 } 112 }
111 }, function() { 113 }, function() {
112 - dialog.showDialog({  
113 - autoHide: true,  
114 - dialogText: '网络异常'  
115 - }); 114 + tip.show('网络异常');
116 }); 115 });
117 }); 116 });
118 117
@@ -78,7 +78,7 @@ function orderCompute() { @@ -78,7 +78,7 @@ function orderCompute() {
78 method: 'POST', 78 method: 'POST',
79 url: '/cart/index/orderCompute', 79 url: '/cart/index/orderCompute',
80 data: { 80 data: {
81 - cartType: orderInfo('cartType'), 81 + cartType: queryString.cartType || queryString.carttype || 'ordinary',
82 deliveryId: orderInfo('deliveryId'), 82 deliveryId: orderInfo('deliveryId'),
83 paymentTypeId: orderInfo('paymentTypeId'), 83 paymentTypeId: orderInfo('paymentTypeId'),
84 couponCode: orderInfo('couponCode'), 84 couponCode: orderInfo('couponCode'),
@@ -89,6 +89,7 @@ function orderCompute() { @@ -89,6 +89,7 @@ function orderCompute() {
89 89
90 if (!res) { 90 if (!res) {
91 tip.show('网络出错'); 91 tip.show('网络出错');
  92 + window.location.reload();
92 } else { 93 } else {
93 /*if (res.order_amount) { 94 /*if (res.order_amount) {
94 res.order_amount = (+res.order_amount).toFixed(2); 95 res.order_amount = (+res.order_amount).toFixed(2);
@@ -108,6 +109,7 @@ function orderCompute() { @@ -108,6 +109,7 @@ function orderCompute() {
108 } 109 }
109 }).fail(function() { 110 }).fail(function() {
110 tip.show('网络出错'); 111 tip.show('网络出错');
  112 + window.location.reload();
111 }); 113 });
112 } 114 }
113 115
@@ -7,9 +7,20 @@ @@ -7,9 +7,20 @@
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 orderInfo = require('./order-info').orderInfo; 8 orderInfo = require('./order-info').orderInfo;
9 9
  10 +var $confim = $('.confim-mask'),
  11 + deleteId;
  12 +
10 $('.address-item').on('touchend', function() { 13 $('.address-item').on('touchend', function() {
11 orderInfo('addressId', $(this).data('address-id')); 14 orderInfo('addressId', $(this).data('address-id'));
12 }).on('touchend', '.edit', function() { 15 }).on('touchend', '.edit', function() {
13 window.location.href = $(this).data('href'); 16 window.location.href = $(this).data('href');
14 return false; 17 return false;
  18 +}).on('touchend', '.del', function() {
  19 + deleteId = $(this).data('address-id');
  20 +});
  21 +
  22 +$confim.on('touchend', '.confim', function() {
  23 + if (orderInfo('addressId') === deleteId) {
  24 + orderInfo('addressId', null);
  25 + }
15 }); 26 });
@@ -36,6 +36,37 @@ @@ -36,6 +36,37 @@
36 li:first-child span { 36 li:first-child span {
37 border-right: 1px solid #e0e0e0; 37 border-right: 1px solid #e0e0e0;
38 } 38 }
  39 +
  40 + li:last-child {
  41 + position: relative;
  42 + }
  43 +
  44 + .presell-tip {
  45 + position: absolute;
  46 + z-index: 1;
  47 + left: -2rem;
  48 + top: 1.75rem;
  49 + }
  50 +
  51 + .triangle {
  52 + width: 0;
  53 + height: 0;
  54 + border-left: 8px solid transparent;
  55 + border-right: 8px solid transparent;
  56 + border-bottom: 12px solid #000;
  57 + margin-left: 6rem;
  58 + }
  59 +
  60 + .pt-content {
  61 + position: relative;
  62 + padding: 10px;
  63 + background: #000;
  64 + color: #fff;
  65 + font-size: 20px;
  66 + @include border-radius(5px);
  67 + text-align: center;
  68 + width: 7rem;
  69 + }
39 } 70 }
40 71
41 .login-info { 72 .login-info {
@@ -195,8 +226,6 @@ @@ -195,8 +226,6 @@
195 } 226 }
196 } 227 }
197 228
198 -}  
199 -.shopping-cart-zero{  
200 .cart-zero{ 229 .cart-zero{
201 width: 100%; 230 width: 100%;
202 height: auto; 231 height: auto;
1 {{> layout/header}} 1 {{> layout/header}}
2 - {{# shoppingCart}}  
3 - {{#if isEmptyCart}}  
4 - <div class="shopping-cart-zero yoho-page">  
5 - <div class="cart-zero">  
6 - <i class="iconfont">&#xe62c</i>  
7 - <p>您的购物车暂无商品</p>  
8 - <a href="/product/new">随便逛逛</a>  
9 - </div>  
10 - {{> product/recommend-for-you}}  
11 - </div>  
12 - {{^}}  
13 - <div id="mainCart" class="shopping-cart-page yoho-page">  
14 -  
15 -  
16 -  
17 - {{#if showLoginInfo}} 2 +<div id="mainCart" class="shopping-cart-page yoho-page">
  3 + {{# shoppingCart}}
  4 + {{#if showLoginInfo}}
18 <p class="login-info"> 5 <p class="login-info">
19 <span class="iconfont">&#xe628;</span> 6 <span class="iconfont">&#xe628;</span>
20 请您先 7 请您先
21 <a class="btn btn-login" href="{{signurl}}">登录</a> 8 <a class="btn btn-login" href="{{signurl}}">登录</a>
22 可以同步电脑和手机中的商品 9 可以同步电脑和手机中的商品
23 </p> 10 </p>
24 - {{^}}  
25 - {{#if cartNav}} 11 + {{/if}}
  12 + {{#if isEmptyCart}}
  13 + <div class="cart-zero">
  14 + <i class="iconfont">&#xe62c</i>
  15 + <p>您的购物车暂无商品</p>
  16 + <a href="/product/new">随便逛逛</a>
  17 + </div>
  18 + {{> product/recommend-for-you}}
  19 + {{^}}
  20 + {{#if cartNav}}
26 <ul class="cart-nav clearfix"> 21 <ul class="cart-nav clearfix">
27 <li class="active"> 22 <li class="active">
28 <span> 23 <span>
@@ -33,33 +28,33 @@ @@ -33,33 +28,33 @@
33 <span> 28 <span>
34 预售商品({{presellGoodsCount}}) 29 预售商品({{presellGoodsCount}})
35 </span> 30 </span>
  31 + <div id="presell-tip" class="presell-tip">
  32 + <div class="triangle"></div>
  33 + <p class="pt-content">预售商品点这里结算哦~</p>
  34 + </div>
36 </li> 35 </li>
37 </ul> 36 </ul>
38 - {{/if}}  
39 {{/if}} 37 {{/if}}
40 38
41 {{# commonCart}} 39 {{# commonCart}}
42 - <div class="cart-content common">  
43 - {{> cart/cart-content}}  
44 - </div> 40 + <div class="cart-content common">
  41 + {{> cart/cart-content}}
  42 + </div>
45 {{/ commonCart}} 43 {{/ commonCart}}
46 44
47 {{# preSellCart}} 45 {{# preSellCart}}
48 - <div class="cart-content presell hide">  
49 - <p class="presell-info">  
50 - <span class="iconfont">&#xe61a;</span>  
51 - <span class="txt">预售商品全场包邮,到货后立即发货</span>  
52 - <span class="txt">预售商品不参加活动,不可使用优惠券</span>  
53 - </p>  
54 - {{> cart/cart-content}}  
55 - </div> 46 + <div class="cart-content presell hide">
  47 + <p class="presell-info">
  48 + <span class="iconfont">&#xe61a;</span>
  49 + <span class="txt">预售商品全场包邮,到货后立即发货</span>
  50 + <span class="txt">预售商品不参加活动,不可使用优惠券</span>
  51 + </p>
  52 + {{> cart/cart-content}}
  53 + </div>
56 {{/ preSellCart}} 54 {{/ preSellCart}}
57 -  
58 - </div>  
59 {{/if}} 55 {{/if}}
60 56
61 <input id="cartType" type="hidden" value="{{cartType}}"> 57 <input id="cartType" type="hidden" value="{{cartType}}">
62 - {{/ shoppingCart}}  
63 -  
64 - {{> cart/chose-panel}} 58 + {{/ shoppingCart}}
  59 +</div>
65 {{> layout/footer}} 60 {{> layout/footer}}
@@ -65,11 +65,18 @@ @@ -65,11 +65,18 @@
65 </li> 65 </li>
66 <li class="coin" data-yoho-coin="{{yohoCoin}}"> 66 <li class="coin" data-yoho-coin="{{yohoCoin}}">
67 <span class="title">YOHO币</span> 67 <span class="title">YOHO币</span>
68 - <span class="desc">可抵¥{{yohoCoin}}</span>  
69 - <span class="coin-check">  
70 - <em>- ¥ {{yohoCoin}}</em>  
71 - <i class="iconfont checkbox icon-cb-checked"></i>  
72 - </span> 68 +
  69 + {{#if yohoCoin}}
  70 + <span class="desc">可抵¥{{yohoCoin}}</span>
  71 + <span class="coin-check">
  72 + <em>- ¥ {{yohoCoin}}</em>
  73 + <i class="iconfont checkbox icon-cb-checked"></i>
  74 + </span>
  75 + {{^}}
  76 + <span class="not-used coin-check">
  77 + 无YOHO币可用
  78 + </span>
  79 + {{/if}}
73 </li> 80 </li>
74 81
75 {{#if invoice}} 82 {{#if invoice}}
1 -<div class="shopping-cart-good clearfix" data-id={{id}}>  
2 - {{#if isSoldOut}} 1 +<div class="shopping-cart-good clearfix" data-id="{{id}}">
  2 + {{#if inValid}}
3 <span class="few-tag-expire">失效</span> 3 <span class="few-tag-expire">失效</span>
4 - {{^}}  
5 - {{#if isSelected}}  
6 - <span class="checkbox icon-cb-checked iconfont"></span>  
7 - {{^}}  
8 - <span class="checkbox icon-checkbox iconfont"></span>  
9 - {{/if}} 4 + {{/if}}
  5 +
  6 + {{#if showCheckbox}}
  7 + <span class="checkbox{{#if checked}} icon-cb-checked{{^}} icon-checkbox{{/if}}iconfont"></span>
10 {{/if}} 8 {{/if}}
11 9
12 <div class="info"> 10 <div class="info">
13 - <img class="thumb lazy" data-original={{thumb}}> 11 + <img class="thumb lazy" data-original="{{thumb}}">
14 {{#if isAdvanceBuy}} 12 {{#if isAdvanceBuy}}
15 <p class="few-tag plus-tag">加价购</p> 13 <p class="few-tag plus-tag">加价购</p>
16 - {{^}}  
17 - {{#if isGift}} 14 + {{/if}}
  15 + {{#if isGift}}
18 <p class="few-tag gift-tag">赠品</p> 16 <p class="few-tag gift-tag">赠品</p>
19 - {{/if}}  
20 {{/if}} 17 {{/if}}
21 - </a>  
22 18
23 <div class="deps show"> 19 <div class="deps show">
24 <p class="name row">{{name}}</p> 20 <p class="name row">{{name}}</p>
@@ -67,15 +63,5 @@ @@ -67,15 +63,5 @@
67 </p> 63 </p>
68 {{/if}} 64 {{/if}}
69 </div> 65 </div>
70 - <div class="calculate-num hide">  
71 - <div class="calculate">  
72 - <p><i class="iconfont cut">&#xe625;</i><span>{{count}}</span><i class="iconfont add">&#xe624;</i></p>  
73 - <p><span>颜色:{{color}}尺码:{{size}}{{name}}</span><i class="iconfont down">&#xe616;</i></p>  
74 - </div>  
75 - <p><span class="price"> ¥{{price}}</span></p>  
76 - <span class="count">  
77 - ×{{count}}  
78 - </span>  
79 - </div>  
80 </div> 66 </div>
81 </div> 67 </div>
@@ -271,7 +271,7 @@ class IndexController extends AbstractAction @@ -271,7 +271,7 @@ class IndexController extends AbstractAction
271 $this->auditJumpLogin(); 271 $this->auditJumpLogin();
272 272
273 $this->setTitle('确认订单'); 273 $this->setTitle('确认订单');
274 - $this->setNavHeader('确认订单'); 274 + $this->setNavHeader('确认订单', true, false); // 不显示右上角home按钮
275 275
276 // 购物车商品为空跳转到购物车页面 276 // 购物车商品为空跳转到购物车页面
277 $shoppingKey = Helpers::getShoppingKeyByCookie(); 277 $shoppingKey = Helpers::getShoppingKeyByCookie();