Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
5 changed files
with
13 additions
and
15 deletions
@@ -93,7 +93,7 @@ $addressForm.on('submit', function() { | @@ -93,7 +93,7 @@ $addressForm.on('submit', function() { | ||
93 | loading.hideLoadingMask(); | 93 | loading.hideLoadingMask(); |
94 | } else { | 94 | } else { |
95 | if (queryString.refer === 'shopping') { | 95 | if (queryString.refer === 'shopping') { |
96 | - window.location.href = '/shoppingCart/selectAddress'; | 96 | + window.location.href = '/cart/index/selectAddress'; |
97 | } else { | 97 | } else { |
98 | window.location.href = '/home/address'; | 98 | window.location.href = '/home/address'; |
99 | } | 99 | } |
@@ -43,6 +43,7 @@ optHammer.on('tap', function(e) { | @@ -43,6 +43,7 @@ optHammer.on('tap', function(e) { | ||
43 | $('#dialog-wrapper').hide(); | 43 | $('#dialog-wrapper').hide(); |
44 | if (!res) { | 44 | if (!res) { |
45 | tip.show('网络错误'); | 45 | tip.show('网络错误'); |
46 | + return; | ||
46 | } | 47 | } |
47 | if (res.code === 200) { | 48 | if (res.code === 200) { |
48 | tip.show('删除成功'); | 49 | tip.show('删除成功'); |
@@ -74,6 +75,7 @@ optHammer.on('tap', function(e) { | @@ -74,6 +75,7 @@ optHammer.on('tap', function(e) { | ||
74 | $('#dialog-wrapper').hide(); | 75 | $('#dialog-wrapper').hide(); |
75 | if (!res) { | 76 | if (!res) { |
76 | tip.show('网络错误'); | 77 | tip.show('网络错误'); |
78 | + return; | ||
77 | } | 79 | } |
78 | if (res.code === 200) { | 80 | if (res.code === 200) { |
79 | tip.show('取消成功'); | 81 | tip.show('取消成功'); |
@@ -6,13 +6,9 @@ | @@ -6,13 +6,9 @@ | ||
6 | <div class="deps"> | 6 | <div class="deps"> |
7 | <p class="name row">{{name}}</p> | 7 | <p class="name row">{{name}}</p> |
8 | <p class="row"> | 8 | <p class="row"> |
9 | - <span class="price"> | ||
10 | - ¥{{#if price}}{{price}}{{else}}{{marketPrice}}{{/if}} | ||
11 | - </span> | 9 | + <span class="price">¥{{#if price}}{{price}}{{else}}{{marketPrice}}{{/if}}</span> |
12 | {{#if price}} | 10 | {{#if price}} |
13 | - <span class="price market-price"> | ||
14 | - ¥{{marketPrice}} | ||
15 | - </span> | 11 | + <span class="price market-price">¥{{marketPrice}}</span> |
16 | {{/if}} | 12 | {{/if}} |
17 | <span class="count"> | 13 | <span class="count"> |
18 | ×{{count}} | 14 | ×{{count}} |
@@ -50,7 +50,7 @@ class CartModel | @@ -50,7 +50,7 @@ class CartModel | ||
50 | */ | 50 | */ |
51 | public static function getCartData($uid, $shoppingKey, $cartType = 'all', $onlyGift = false, $onlyAdvanceBuy = false) | 51 | public static function getCartData($uid, $shoppingKey, $cartType = 'all', $onlyGift = false, $onlyAdvanceBuy = false) |
52 | { | 52 | { |
53 | - $result = array('cartNav' => true); | 53 | + $result = array('cartNav' => true, 'commonGoodsCount' => '0', 'presellGoodsCount' => '0'); |
54 | 54 | ||
55 | // 用户是否登录 | 55 | // 用户是否登录 |
56 | if (empty($uid)) { | 56 | if (empty($uid)) { |
@@ -73,10 +73,10 @@ class CartModel | @@ -73,10 +73,10 @@ class CartModel | ||
73 | break; | 73 | break; |
74 | } | 74 | } |
75 | 75 | ||
76 | - $ordinaryCount = intval($cart['ordinary_cart_data']['shopping_cart_data']['goods_count']); | ||
77 | - $advanceCount = intval($cart['advance_cart_data']['shopping_cart_data']['goods_count']); | 76 | + $ordinaryCount = strval($cart['ordinary_cart_data']['shopping_cart_data']['goods_count']); |
77 | + $advanceCount = strval($cart['advance_cart_data']['shopping_cart_data']['goods_count']); | ||
78 | // 普通购物车和预售购物车都为空 | 78 | // 普通购物车和预售购物车都为空 |
79 | - if ($ordinaryCount === 0 && $advanceCount === 0) { | 79 | + if ($ordinaryCount === '0' && $advanceCount === '0') { |
80 | $result['isEmptyCart'] = true; | 80 | $result['isEmptyCart'] = true; |
81 | break; | 81 | break; |
82 | } | 82 | } |
@@ -87,7 +87,7 @@ class CartModel | @@ -87,7 +87,7 @@ class CartModel | ||
87 | /* 预售购物车 */ | 87 | /* 预售购物车 */ |
88 | $result['presellGoodsCount'] = $advanceCount; | 88 | $result['presellGoodsCount'] = $advanceCount; |
89 | $result['preSellCart'] = self::procCartData($cart['advance_cart_data'], $onlyGift, $onlyAdvanceBuy); | 89 | $result['preSellCart'] = self::procCartData($cart['advance_cart_data'], $onlyGift, $onlyAdvanceBuy); |
90 | - }while(0); | 90 | + } while(false); |
91 | 91 | ||
92 | return $result; | 92 | return $result; |
93 | } | 93 | } |
@@ -156,8 +156,8 @@ class CartModel | @@ -156,8 +156,8 @@ class CartModel | ||
156 | 156 | ||
157 | if (empty($uid)) { | 157 | if (empty($uid)) { |
158 | $result['code'] = 300; | 158 | $result['code'] = 300; |
159 | - $reult['message'] = '请先登录'; | ||
160 | - $result['data'] = '/signin.html'; | 159 | + $result['message'] = '请先登录'; |
160 | + $result['data'] = Helpers::url('/signin.html'); | ||
161 | 161 | ||
162 | return $result; | 162 | return $result; |
163 | } | 163 | } |
-
Please register or login to post a comment