Authored by 毕凯

优惠券显示优惠券名称

... ... @@ -108,7 +108,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
fast: true
});
orderInfo('couponCode', null);
orderInfo('couponValue', null);
orderInfo('couponName', null);
history.go(0);
} else {
tip.show(data.message);
... ...
... ... @@ -28,9 +28,9 @@ if (window.getUid() !== orderInfo('uid')) {
order.init();
}
if ($couponUse.data('value') !== orderInfo('couponValue')) {
if ($couponUse.data('name') !== orderInfo('couponName')) {
orderInfo('couponCode', null);
orderInfo('couponValue', null);
orderInfo('couponName', null);
}
function dispacthTapEvt(e) {
... ...
... ... @@ -15,7 +15,7 @@ function init() {
yohoCoin: $('.coin').data('yoho-coin') || 0,
addressId: null,
couponCode: null,
couponValue: null,
couponName: null,
invoice: null,
invoiceText: null,
invoiceType: null,
... ...
... ... @@ -37,7 +37,7 @@ $newCoupon.on('submit', function() {
if (res.code === 200) {
tip.show('优惠券可用');
orderInfo('couponCode', res.data.coupon_code);
orderInfo('couponValue', res.data.coupon_value);
orderInfo('couponName', res.data.coupon_name);
window.location.href = '/cart/index/orderEnsure';
} else {
tip.show(res.message || '网络错误');
... ... @@ -52,12 +52,12 @@ $('#coupon-list').on('touchend', '.employ-main', function() {
var $this = $(this);
orderInfo('couponCode', $this.data('coupon-code'));
orderInfo('couponValue', $this.data('coupon-value'));
orderInfo('couponName', $this.data('coupon-name'));
});
$('body').on('touchend', '.not-use', function() {
orderInfo('couponCode', null);
orderInfo('couponValue', null);
orderInfo('couponName', null);
});
... ...
... ... @@ -118,14 +118,14 @@
margin-left: 20rem / $pxConvertRem;
}
.coupon-use,
.coin-check {
.coupon-use {
float: right;
color: #999;
&.used {
color: #f00;
}
text-align: right;
width: 360rem / $pxConvertRem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
.iconfont {
color: #999;
... ... @@ -141,6 +141,10 @@
color: #000;
}
&.used {
color: #f00;
}
em {
color: #f00;
}
... ...
... ... @@ -49,9 +49,9 @@
{{count}}张可用
</span>
{{#if value}}
<span class="used coupon-use" data-value="{{value}}">
{{value}}
{{#if name}}
<span class="used coupon-use" data-name="{{name}}">
{{name}}
<i class="iconfont">&#xe614;</i>
</span>
{{^}}
... ...
... ... @@ -13,7 +13,7 @@
<script id="tmpl-coupon" type="text/tmpl">
\{{#coupons}}
\{{^ notAvailable}}
<a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-value="\{{ couponValue}}" href="/cart/index/orderEnsure">
<a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-name="\{{ couponDetailInfomation}}" href="/cart/index/orderEnsure">
<span>\{{ couponValue}}</span>
<p class="coupon-name">\{{ couponDetailInfomation}}</p>
<p>有效期:\{{ couponValidity}}</p>
... ...
... ... @@ -498,7 +498,7 @@ class CartModel
// 优惠券数据
$coupons = array();
!empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue'];
!empty($orderCompute['coupon_amount']) && $coupons['name'] = $orderInfo['couponName'];
$coupons += self::getCouponList($uid, true);
$result['coupon'] = $coupons;
}
... ...