Authored by hf

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

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