Authored by 毕凯

修复优惠券为空时的 bug

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