Merge branch 'develop' into test
Showing
9 changed files
with
48 additions
and
13 deletions
@@ -191,7 +191,7 @@ class Helpers | @@ -191,7 +191,7 @@ class Helpers | ||
191 | */ | 191 | */ |
192 | public static function transPrice($price) | 192 | public static function transPrice($price) |
193 | { | 193 | { |
194 | - return (!empty($price) && !is_float($price)) ? $price . '.00' : number_format($price, 2, '.', ''); | 194 | + return number_format($price, 2, '.', ''); |
195 | } | 195 | } |
196 | 196 | ||
197 | /** | 197 | /** |
@@ -133,15 +133,16 @@ if ($('.freebie').length > 0) { | @@ -133,15 +133,16 @@ if ($('.freebie').length > 0) { | ||
133 | } | 133 | } |
134 | 134 | ||
135 | $('.btn-balance').on('touchend', function() { | 135 | $('.btn-balance').on('touchend', function() { |
136 | - if (shouldSelectGift()) { | ||
137 | - showChooseGifDialog(); | ||
138 | - return false; | ||
139 | - } | ||
140 | if (shouldLowStocks()) { | 136 | if (shouldLowStocks()) { |
141 | tip.show('库存不足无法结算'); | 137 | tip.show('库存不足无法结算'); |
142 | return false; | 138 | return false; |
143 | } | 139 | } |
144 | 140 | ||
141 | + if (shouldSelectGift()) { | ||
142 | + showChooseGifDialog(); | ||
143 | + return false; | ||
144 | + } | ||
145 | + | ||
145 | if (hasChecked) { | 146 | if (hasChecked) { |
146 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; | 147 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; |
147 | } else { | 148 | } else { |
@@ -32,6 +32,7 @@ var $chosePanel = $('#chose-panel'), | @@ -32,6 +32,7 @@ var $chosePanel = $('#chose-panel'), | ||
32 | queryString, | 32 | queryString, |
33 | $yohoPage = $('.yoho-page'); | 33 | $yohoPage = $('.yoho-page'); |
34 | 34 | ||
35 | + | ||
35 | //初始化购物车面板显示 | 36 | //初始化购物车面板显示 |
36 | function init() { | 37 | function init() { |
37 | hasChooseColor = false; | 38 | hasChooseColor = false; |
@@ -60,7 +61,19 @@ function checkColorSizeNum() { | @@ -60,7 +61,19 @@ function checkColorSizeNum() { | ||
60 | return true; | 61 | return true; |
61 | } | 62 | } |
62 | 63 | ||
64 | + | ||
63 | function show(html, cb) { | 65 | function show(html, cb) { |
66 | + var scrollPosition = [ | ||
67 | + document.documentElement.scrollLeft || document.body.scrollLeft, | ||
68 | + document.documentElement.scrollTop || document.body.scrollTop | ||
69 | + ], | ||
70 | + $html = $('html'); // it would make more sense to apply this to body, but IE7 won't have that | ||
71 | + | ||
72 | + $html.data('scroll-position', scrollPosition); | ||
73 | + $html.data('previous-overflow', $html.css('overflow')); | ||
74 | + $html.css('overflow', 'hidden'); | ||
75 | + window.scrollTo(scrollPosition[0], scrollPosition[1]); | ||
76 | + | ||
64 | if (html) { | 77 | if (html) { |
65 | $chosePanel.html(html); | 78 | $chosePanel.html(html); |
66 | if ($('#promotionId').val() !== '') { | 79 | if ($('#promotionId').val() !== '') { |
@@ -76,6 +89,12 @@ function show(html, cb) { | @@ -76,6 +89,12 @@ function show(html, cb) { | ||
76 | 89 | ||
77 | //隐藏当前Panel | 90 | //隐藏当前Panel |
78 | function hide() { | 91 | function hide() { |
92 | + var $html = $('html'), | ||
93 | + scrollPosition = $html.data('scroll-position'); | ||
94 | + | ||
95 | + // un-lock scroll position | ||
96 | + $html.css('overflow', $html.data('previous-overflow')); | ||
97 | + window.scrollTo(scrollPosition[0], scrollPosition[1]); | ||
79 | $('.chose-panel').hide(); | 98 | $('.chose-panel').hide(); |
80 | } | 99 | } |
81 | 100 |
@@ -190,6 +190,10 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { | @@ -190,6 +190,10 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { | ||
190 | 190 | ||
191 | //全选按钮点击事件 | 191 | //全选按钮点击事件 |
192 | $selectAllBtn.on('touchend', function() { | 192 | $selectAllBtn.on('touchend', function() { |
193 | + if ($('.low-stocks').length > 0) { | ||
194 | + tip.show('所选商品中含有库存不足的商品'); | ||
195 | + return false; | ||
196 | + } | ||
193 | bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), $('#cartType').val(), didUpdateAllGoodsCheckStatus); | 197 | bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), $('#cartType').val(), didUpdateAllGoodsCheckStatus); |
194 | }); | 198 | }); |
195 | 199 |
@@ -41,7 +41,7 @@ optHammer.on('tap', function(e) { | @@ -41,7 +41,7 @@ optHammer.on('tap', function(e) { | ||
41 | } | 41 | } |
42 | }).then(function(res) { | 42 | }).then(function(res) { |
43 | $('#dialog-wrapper').hide(); | 43 | $('#dialog-wrapper').hide(); |
44 | - if (!res) { | 44 | + if ($.type(res) !== 'object') { |
45 | return; | 45 | return; |
46 | } | 46 | } |
47 | if (res.message) { | 47 | if (res.message) { |
@@ -70,7 +70,7 @@ optHammer.on('tap', function(e) { | @@ -70,7 +70,7 @@ optHammer.on('tap', function(e) { | ||
70 | } | 70 | } |
71 | }).then(function(res) { | 71 | }).then(function(res) { |
72 | $('#dialog-wrapper').hide(); | 72 | $('#dialog-wrapper').hide(); |
73 | - if (!res) { | 73 | + if ($.type(res) !== 'object') { |
74 | return; | 74 | return; |
75 | } | 75 | } |
76 | if (res.message) { | 76 | if (res.message) { |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | position: absolute; | 15 | position: absolute; |
16 | top: 50%; | 16 | top: 50%; |
17 | margin-top: -14rem / $pxConvertRem; | 17 | margin-top: -14rem / $pxConvertRem; |
18 | - margin-left: 20rem / $pxConvertRem; | 18 | + margin-left: 8rem / $pxConvertRem; |
19 | font-size: 28rem / $pxConvertRem; | 19 | font-size: 28rem / $pxConvertRem; |
20 | 20 | ||
21 | &.icon-cb-checked { | 21 | &.icon-cb-checked { |
@@ -28,9 +28,9 @@ | @@ -28,9 +28,9 @@ | ||
28 | } | 28 | } |
29 | 29 | ||
30 | .few-tag{ | 30 | .few-tag{ |
31 | - width: 132rem / $pxConvertRem; | 31 | + width: 148rem / $pxConvertRem; |
32 | position: absolute; | 32 | position: absolute; |
33 | - left: 100rem / $pxConvertRem; | 33 | + left: 92rem / $pxConvertRem; |
34 | text-align: center; | 34 | text-align: center; |
35 | top: 75%; | 35 | top: 75%; |
36 | color: #fff; | 36 | color: #fff; |
@@ -170,7 +170,7 @@ | @@ -170,7 +170,7 @@ | ||
170 | } | 170 | } |
171 | 171 | ||
172 | .icon-del { | 172 | .icon-del { |
173 | - right: 14rem / $pxConvertRem; | 173 | + right: 20rem / $pxConvertRem; |
174 | } | 174 | } |
175 | 175 | ||
176 | .icon-edit { | 176 | .icon-edit { |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | .icon-cb-checked:before { content: "\e61d"; } | 5 | .icon-cb-checked:before { content: "\e61d"; } |
6 | 6 | ||
7 | .shopping-cart-page { | 7 | .shopping-cart-page { |
8 | - padding-bottom: 120rem / $pxConvertRem; | 8 | + margin-bottom: 120rem / $pxConvertRem; |
9 | overflow-x: hidden; | 9 | overflow-x: hidden; |
10 | background: #f0f0f0; | 10 | background: #f0f0f0; |
11 | 11 |
@@ -138,6 +138,13 @@ | @@ -138,6 +138,13 @@ | ||
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | + .checkbox { | ||
142 | + display: inline-block; | ||
143 | + width: 80rem / $pxConvertRem; | ||
144 | + text-align: center; | ||
145 | + margin-right: -20rem / $pxConvertRem; | ||
146 | + } | ||
147 | + | ||
141 | .coin-check { | 148 | .coin-check { |
142 | float: right; | 149 | float: right; |
143 | color: #999; | 150 | color: #999; |
@@ -63,6 +63,10 @@ class CartModel | @@ -63,6 +63,10 @@ class CartModel | ||
63 | 63 | ||
64 | // 调用接口获取购物车的数据 | 64 | // 调用接口获取购物车的数据 |
65 | $cartData = CartData::cartData($uid, $shoppingKey); | 65 | $cartData = CartData::cartData($uid, $shoppingKey); |
66 | + // 当购物车为空时,用户也已经登录过, 再取一次 | ||
67 | + if (empty($cartData['data']) && is_numeric($uid) && !empty($shoppingKey)) { | ||
68 | + $cartData = CartData::cartData(0, $shoppingKey); | ||
69 | + } | ||
66 | 70 | ||
67 | // 处理普通购物车和预售购物车的数据 | 71 | // 处理普通购物车和预售购物车的数据 |
68 | do { | 72 | do { |
@@ -408,7 +412,7 @@ class CartModel | @@ -408,7 +412,7 @@ class CartModel | ||
408 | $oneGoods['name'] = $single['product_name']; | 412 | $oneGoods['name'] = $single['product_name']; |
409 | $oneGoods['color'] = $single['color_name']; | 413 | $oneGoods['color'] = $single['color_name']; |
410 | $oneGoods['size'] = $single['size_name']; | 414 | $oneGoods['size'] = $single['size_name']; |
411 | - $oneGoods['price'] = Helpers::transPrice($single['sales_price']); | 415 | + $oneGoods['price'] = Helpers::transPrice($single['last_price']); |
412 | $oneGoods['count'] = $single['buy_number']; | 416 | $oneGoods['count'] = $single['buy_number']; |
413 | 417 | ||
414 | //gift=>是否赠品,advanceBuy=>是否加价购; | 418 | //gift=>是否赠品,advanceBuy=>是否加价购; |
-
Please register or login to post a comment