Authored by hf

Merge branch 'develop' into test

@@ -310,7 +310,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { @@ -310,7 +310,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
310 310
311 if (2 === $chosed.length && 0 === $chosed.closest('.zero-stock').length) { 311 if (2 === $chosed.length && 0 === $chosed.closest('.zero-stock').length) {
312 productSku = $curSizeBlock.data('skuid'); 312 productSku = $curSizeBlock.data('skuid');
313 - promotionId = $('[data-id="' + productSku + '"]').closest('.advance-block').data('promotion-id'); 313 + promotionId = $('#promotionId').val();
314 if (confirming) { 314 if (confirming) {
315 return false; 315 return false;
316 } 316 }
@@ -17,6 +17,7 @@ var dispatchModeHammer, @@ -17,6 +17,7 @@ var dispatchModeHammer,
17 $invoice = $('.invoice'), 17 $invoice = $('.invoice'),
18 $price = $('.price-cal'), 18 $price = $('.price-cal'),
19 $couponUse = $('.coupon-use.used'), 19 $couponUse = $('.coupon-use.used'),
  20 + $addressWrap = $('.address-wrap'),
20 payType, 21 payType,
21 priceTmpl = Handlebars.compile($('#tmpl-price').html()), 22 priceTmpl = Handlebars.compile($('#tmpl-price').html()),
22 queryString = $.queryString(), 23 queryString = $.queryString(),
@@ -26,6 +27,7 @@ lazyLoad(); @@ -26,6 +27,7 @@ lazyLoad();
26 27
27 if (window.getUid() !== orderInfo('uid')) { 28 if (window.getUid() !== orderInfo('uid')) {
28 order.init(); 29 order.init();
  30 + window.location.reload();
29 } 31 }
30 32
31 if ($couponUse.data('name') !== orderInfo('couponName')) { 33 if ($couponUse.data('name') !== orderInfo('couponName')) {
@@ -183,12 +185,21 @@ function submitOrder() { @@ -183,12 +185,21 @@ function submitOrder() {
183 185
184 // 界面点击,状态存 cookie 186 // 界面点击,状态存 cookie
185 if (!orderInfo('addressId')) { 187 if (!orderInfo('addressId')) {
186 - orderInfo('addressId', $('.address-wrap').data('id')); 188 + orderInfo('addressId', $addressWrap.data('id'));
187 } 189 }
188 190
189 -$('.dispatch-mode').on('touchend', 'li', function() {  
190 - orderInfo('deliveryId', $(this).data('id'));  
191 - orderCompute(); 191 +$('.dispatch-mode').on('touchstart', 'li', function() {
  192 + var $defaultMode = $('.dispatch-mode [data-id="1"]');
  193 +
  194 + if (!$addressWrap.data('support') && $(this).data('id') === 2) {
  195 + dispacthTapEvt({
  196 + target: $defaultMode
  197 + });
  198 + tip.show('当前地址不支持顺丰快递');
  199 + } else {
  200 + orderInfo('deliveryId', $(this).data('id'));
  201 + orderCompute();
  202 + }
192 }); 203 });
193 204
194 $('.dispatch-time').on('touchend', 'li', function() { 205 $('.dispatch-time').on('touchend', 'li', function() {
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="order-ensure-page yoho-page"> 2 <div class="order-ensure-page yoho-page">
3 {{# orderEnsure}} 3 {{# orderEnsure}}
4 - <a class="address-wrap block" data-id="{{addressId}}" href="/cart/index/selectAddress"> 4 + <a class="address-wrap block" data-id="{{addressId}}" data-support="{{isSupport}}" href="/cart/index/selectAddress">
5 <p class="infos"> 5 <p class="infos">
6 收货地址 6 收货地址
7 <span class="per-info">{{name}} {{phoneNum}}</span> 7 <span class="per-info">{{name}} {{phoneNum}}</span>
@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 41
42 <section class="block"> 42 <section class="block">
43 <ul class="sale-invoice"> 43 <ul class="sale-invoice">
  44 + {{#if isOrdinaryCart}}
44 <li class="coupon"> 45 <li class="coupon">
45 <a href="/cart/index/selectCoupon"> 46 <a href="/cart/index/selectCoupon">
46 <span class="title">优惠券</span> 47 <span class="title">优惠券</span>
@@ -63,6 +64,7 @@ @@ -63,6 +64,7 @@
63 {{/coupon}} 64 {{/coupon}}
64 </a> 65 </a>
65 </li> 66 </li>
  67 + {{/if}}
66 <li class="coin" data-yoho-coin="{{yohoCoin}}"> 68 <li class="coin" data-yoho-coin="{{yohoCoin}}">
67 <span class="title">YOHO币</span> 69 <span class="title">YOHO币</span>
68 70
@@ -67,4 +67,5 @@ @@ -67,4 +67,5 @@
67 </div> 67 </div>
68 </div> 68 </div>
69 </div> 69 </div>
70 -{{/cartInfo}}  
  70 +{{/cartInfo}}
  71 +<input id="promotionId" type="hidden" value="{{promotionId}}">
@@ -243,7 +243,6 @@ class CartModel @@ -243,7 +243,6 @@ class CartModel
243 243
244 $product = CartData::giftProductData($skn, $promotionId); 244 $product = CartData::giftProductData($skn, $promotionId);
245 if (isset($product['code']) && $product['code'] === 200) { 245 if (isset($product['code']) && $product['code'] === 200) {
246 - $result['code'] = 200;  
247 $result['data'] = self::procGoodsDetail($product['data']); 246 $result['data'] = self::procGoodsDetail($product['data']);
248 } 247 }
249 248
@@ -79,7 +79,7 @@ class IndexController extends AbstractAction @@ -79,7 +79,7 @@ class IndexController extends AbstractAction
79 $result = array(); 79 $result = array();
80 80
81 if ($this->isAjax()) { 81 if ($this->isAjax()) {
82 - $uid = $this->getUid(false); 82 + $uid = $this->getUid(true);
83 $shoppingKey = Helpers::getShoppingKeyByCookie(); 83 $shoppingKey = Helpers::getShoppingKeyByCookie();
84 $result = CartModel::getCartCount($uid, $shoppingKey); 84 $result = CartModel::getCartCount($uid, $shoppingKey);
85 } 85 }
@@ -216,6 +216,7 @@ class IndexController extends AbstractAction @@ -216,6 +216,7 @@ class IndexController extends AbstractAction
216 } 216 }
217 217
218 $this->_view->display('gift-info', array( 218 $this->_view->display('gift-info', array(
  219 + 'promotionId' => $promotionId,
219 'cartInfo' => $result['data'] 220 'cartInfo' => $result['data']
220 )); 221 ));
221 } 222 }
@@ -286,6 +287,7 @@ class IndexController extends AbstractAction @@ -286,6 +287,7 @@ class IndexController extends AbstractAction
286 $uid = $this->getUid(true); 287 $uid = $this->getUid(true);
287 $data = array( 288 $data = array(
288 'orderEnsurePage' => true, 289 'orderEnsurePage' => true,
  290 + 'isOrdinaryCart' => ($cartType !== 'advance'),
289 'orderEnsure' => CartModel::cartPay($uid, $cartType, $cookieData) 291 'orderEnsure' => CartModel::cartPay($uid, $cartType, $cookieData)
290 ); 292 );
291 293