Authored by Lynnic

Merge branch 'feature/cart' of git.dev.yoho.cn:web/yohobuy into feature/cart

... ... @@ -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}}
... ...
... ... @@ -2,7 +2,11 @@
{{#if isSoldOut}}
<span class="few-tag-expire">失效</span>
{{^}}
<span class="checkbox icon-cb-checked iconfont"></span>
{{#if isSelected}}
<span class="checkbox icon-cb-checked iconfont"></span>
{{^}}
<span class="checkbox icon-checkbox iconfont"></span>
{{/if}}
{{/if}}
<div class="info">
... ... @@ -76,16 +80,4 @@
</span>
</div>
</div>
<!--<div class="opt-panel hide">
<div class="put-in-favorite">
<span class="iconfont">&#xe622;</span>
<span>移入</span>
收藏夹
</div>
<div class="del">
<span class="iconfont">&#xe626;</span>
删除
</div>
</div>-->
</div>
... ...
... ... @@ -718,7 +718,7 @@ class CartModel
// 结算数据
$result['price'] = Helpers::transPrice($data['shopping_cart_data']['order_amount']);
$result['activityPrice'] = Helpers::transPrice($data['shopping_cart_data']['discount_amount']);
$result['count'] = $data['shopping_cart_data']['goods_count'];
$result['count'] = $data['shopping_cart_data']['selected_goods_count'];
$result['sumPrice'] = Helpers::transPrice($data['shopping_cart_data']['order_amount']);
}while(0);
... ...
... ... @@ -45,11 +45,10 @@ class IndexController extends AbstractAction
'shoppingCartPage' => true,
'shoppingCart' => CartModel::getCartData($uid, $shoppingKey)
);
// 渲染模板
$this->_view->display('index', $data);
}
/*
* 异步获取购物车数据
*/
... ... @@ -359,7 +358,7 @@ class IndexController extends AbstractAction
}
if (empty($result)) {
echo ' ';
echo '[]';
} else {
$this->echoJson($result);
}
... ...