Authored by 毕凯

修复优惠券为空时的 bug

@@ -92,7 +92,7 @@ function getCouponHandle(coupons) { @@ -92,7 +92,7 @@ function getCouponHandle(coupons) {
92 92
93 // 第一页张数为 0 ,显示优惠券为空 93 // 第一页张数为 0 ,显示优惠券为空
94 if (!coupons.length && page === 2) { 94 if (!coupons.length && page === 2) {
95 - $('.select-coupon-page').html($('#tmpl-no-coupon').html()); 95 + $('.coupin-wrap').html($('#tmpl-no-coupon').html());
96 return; 96 return;
97 } 97 }
98 98
@@ -4,9 +4,11 @@ @@ -4,9 +4,11 @@
4 <input type="text" name="couponCode" value="" placeholder="输入优惠券码"> 4 <input type="text" name="couponCode" value="" placeholder="输入优惠券码">
5 <button type="submit" class="submit">确定</button> 5 <button type="submit" class="submit">确定</button>
6 </form> 6 </form>
7 - <div id="coupon-list" class="coupon-list"></div>  
8 - <div class="not-avaliable-coupon-line hide">不可使用的优惠券</div>  
9 - <div id="coupon-list-not" class="coupon-list"></div> 7 + <div class="coupin-wrap">
  8 + <div id="coupon-list" class="coupon-list"></div>
  9 + <div class="not-avaliable-coupon-line hide">不可使用的优惠券</div>
  10 + <div id="coupon-list-not" class="coupon-list"></div>
  11 + </div>
10 </div> 12 </div>
11 <script id="tmpl-coupon" type="text/tmpl"> 13 <script id="tmpl-coupon" type="text/tmpl">
12 \{{#coupons}} 14 \{{#coupons}}
@@ -49,7 +49,7 @@ class IndexController extends AbstractAction @@ -49,7 +49,7 @@ class IndexController extends AbstractAction
49 // 渲染模板 49 // 渲染模板
50 $this->_view->display('index', $data); 50 $this->_view->display('index', $data);
51 } 51 }
52 - 52 +
53 /* 53 /*
54 * 异步获取购物车数据 54 * 异步获取购物车数据
55 */ 55 */
@@ -359,7 +359,7 @@ class IndexController extends AbstractAction @@ -359,7 +359,7 @@ class IndexController extends AbstractAction
359 } 359 }
360 360
361 if (empty($result)) { 361 if (empty($result)) {
362 - echo ' '; 362 + echo '[]';
363 } else { 363 } else {
364 $this->echoJson($result); 364 $this->echoJson($result);
365 } 365 }