Authored by Rock Zhang

修复选择和全选按钮报错的bug,以及选择状态不能保存的bug

Code Review By Rock Zhang
@@ -242,7 +242,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { @@ -242,7 +242,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
242 } 242 }
243 243
244 goodInfo.goods_type = type; 244 goodInfo.goods_type = type;
245 - goodInfo.selected = isSelected ? 'Y' : 'N'; 245 + goodInfo.selected = isSelected ? 'N' : 'Y';
246 246
247 $goods.each(function(idx, good) { 247 $goods.each(function(idx, good) {
248 $good = $(good); 248 $good = $(good);
@@ -259,9 +259,8 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { @@ -259,9 +259,8 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
259 259
260 260
261 //是否要全选 261 //是否要全选
262 -function willBeSelected() { 262 +function willBeSelected($this) {
263 var isSelected = true; 263 var isSelected = true;
264 - var $this = $(this);  
265 264
266 if ($this.hasClass('icon-cb-checked')) { 265 if ($this.hasClass('icon-cb-checked')) {
267 isSelected = true; 266 isSelected = true;
@@ -274,7 +273,8 @@ function willBeSelected() { @@ -274,7 +273,8 @@ function willBeSelected() {
274 273
275 //全选按钮点击事件 274 //全选按钮点击事件
276 $selectAllBtn.on('touchend', function() { 275 $selectAllBtn.on('touchend', function() {
277 - bottomCheckBoxHandeler(willBeSelected(), getCartType(), didUpdateAllGoodsCheckStatus); 276 + var $this = $(this);
  277 + bottomCheckBoxHandeler(willBeSelected($this), getCartType(), didUpdateAllGoodsCheckStatus);
278 }); 278 });
279 279
280 $('.down').on('touchend', function() { 280 $('.down').on('touchend', function() {
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <li class="freebie"> 15 <li class="freebie">
16 <span class="iconfont">&#xe620;</span> 16 <span class="iconfont">&#xe620;</span>
17 赠品 17 赠品
18 - <a href={{url}}> 18 + <a href="/cart/index/gift">
19 <span class="count">{{count}}</span> 19 <span class="count">{{count}}</span>
20 <span class="iconfont icon-right-arrow">&#xe614;</span> 20 <span class="iconfont icon-right-arrow">&#xe614;</span>
21 </a> 21 </a>
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <li class="advance-buy"> 25 <li class="advance-buy">
26 <span class="iconfont">&#xe61b;</span> 26 <span class="iconfont">&#xe61b;</span>
27 加价购 27 加价购
28 - <a> 28 + <a href="/cart/index/advanceBuy">
29 <span class="count">{{advanceBuyCount}}</span> 29 <span class="count">{{advanceBuyCount}}</span>
30 <span class="iconfont icon-right-arrow">&#xe614;</span> 30 <span class="iconfont icon-right-arrow">&#xe614;</span>
31 </a> 31 </a>