Authored by 毕凯

优惠券显示优惠券名称

@@ -108,7 +108,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -108,7 +108,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
108 fast: true 108 fast: true
109 }); 109 });
110 orderInfo('couponCode', null); 110 orderInfo('couponCode', null);
111 - orderInfo('couponValue', null); 111 + orderInfo('couponName', null);
112 history.go(0); 112 history.go(0);
113 } else { 113 } else {
114 tip.show(data.message); 114 tip.show(data.message);
@@ -28,9 +28,9 @@ if (window.getUid() !== orderInfo('uid')) { @@ -28,9 +28,9 @@ if (window.getUid() !== orderInfo('uid')) {
28 order.init(); 28 order.init();
29 } 29 }
30 30
31 -if ($couponUse.data('value') !== orderInfo('couponValue')) { 31 +if ($couponUse.data('name') !== orderInfo('couponName')) {
32 orderInfo('couponCode', null); 32 orderInfo('couponCode', null);
33 - orderInfo('couponValue', null); 33 + orderInfo('couponName', null);
34 } 34 }
35 35
36 function dispacthTapEvt(e) { 36 function dispacthTapEvt(e) {
@@ -15,7 +15,7 @@ function init() { @@ -15,7 +15,7 @@ function init() {
15 yohoCoin: $('.coin').data('yoho-coin') || 0, 15 yohoCoin: $('.coin').data('yoho-coin') || 0,
16 addressId: null, 16 addressId: null,
17 couponCode: null, 17 couponCode: null,
18 - couponValue: null, 18 + couponName: null,
19 invoice: null, 19 invoice: null,
20 invoiceText: null, 20 invoiceText: null,
21 invoiceType: null, 21 invoiceType: null,
@@ -37,7 +37,7 @@ $newCoupon.on('submit', function() { @@ -37,7 +37,7 @@ $newCoupon.on('submit', function() {
37 if (res.code === 200) { 37 if (res.code === 200) {
38 tip.show('优惠券可用'); 38 tip.show('优惠券可用');
39 orderInfo('couponCode', res.data.coupon_code); 39 orderInfo('couponCode', res.data.coupon_code);
40 - orderInfo('couponValue', res.data.coupon_value); 40 + orderInfo('couponName', res.data.coupon_name);
41 window.location.href = '/cart/index/orderEnsure'; 41 window.location.href = '/cart/index/orderEnsure';
42 } else { 42 } else {
43 tip.show(res.message || '网络错误'); 43 tip.show(res.message || '网络错误');
@@ -52,12 +52,12 @@ $('#coupon-list').on('touchend', '.employ-main', function() { @@ -52,12 +52,12 @@ $('#coupon-list').on('touchend', '.employ-main', function() {
52 var $this = $(this); 52 var $this = $(this);
53 53
54 orderInfo('couponCode', $this.data('coupon-code')); 54 orderInfo('couponCode', $this.data('coupon-code'));
55 - orderInfo('couponValue', $this.data('coupon-value')); 55 + orderInfo('couponName', $this.data('coupon-name'));
56 }); 56 });
57 57
58 $('body').on('touchend', '.not-use', function() { 58 $('body').on('touchend', '.not-use', function() {
59 orderInfo('couponCode', null); 59 orderInfo('couponCode', null);
60 - orderInfo('couponValue', null); 60 + orderInfo('couponName', null);
61 }); 61 });
62 62
63 63
@@ -118,14 +118,14 @@ @@ -118,14 +118,14 @@
118 margin-left: 20rem / $pxConvertRem; 118 margin-left: 20rem / $pxConvertRem;
119 } 119 }
120 120
121 - .coupon-use,  
122 - .coin-check { 121 + .coupon-use {
123 float: right; 122 float: right;
124 color: #999; 123 color: #999;
125 -  
126 - &.used {  
127 - color: #f00;  
128 - } 124 + text-align: right;
  125 + width: 360rem / $pxConvertRem;
  126 + white-space: nowrap;
  127 + text-overflow: ellipsis;
  128 + overflow: hidden;
129 129
130 .iconfont { 130 .iconfont {
131 color: #999; 131 color: #999;
@@ -141,6 +141,10 @@ @@ -141,6 +141,10 @@
141 color: #000; 141 color: #000;
142 } 142 }
143 143
  144 + &.used {
  145 + color: #f00;
  146 + }
  147 +
144 em { 148 em {
145 color: #f00; 149 color: #f00;
146 } 150 }
@@ -49,9 +49,9 @@ @@ -49,9 +49,9 @@
49 {{count}}张可用 49 {{count}}张可用
50 </span> 50 </span>
51 51
52 - {{#if value}}  
53 - <span class="used coupon-use" data-value="{{value}}">  
54 - {{value}} 52 + {{#if name}}
  53 + <span class="used coupon-use" data-name="{{name}}">
  54 + {{name}}
55 <i class="iconfont">&#xe614;</i> 55 <i class="iconfont">&#xe614;</i>
56 </span> 56 </span>
57 {{^}} 57 {{^}}
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <script id="tmpl-coupon" type="text/tmpl"> 13 <script id="tmpl-coupon" type="text/tmpl">
14 \{{#coupons}} 14 \{{#coupons}}
15 \{{^ notAvailable}} 15 \{{^ notAvailable}}
16 - <a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-value="\{{ couponValue}}" href="/cart/index/orderEnsure"> 16 + <a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-name="\{{ couponDetailInfomation}}" href="/cart/index/orderEnsure">
17 <span>\{{ couponValue}}</span> 17 <span>\{{ couponValue}}</span>
18 <p class="coupon-name">\{{ couponDetailInfomation}}</p> 18 <p class="coupon-name">\{{ couponDetailInfomation}}</p>
19 <p>有效期:\{{ couponValidity}}</p> 19 <p>有效期:\{{ couponValidity}}</p>
@@ -498,7 +498,7 @@ class CartModel @@ -498,7 +498,7 @@ class CartModel
498 498
499 // 优惠券数据 499 // 优惠券数据
500 $coupons = array(); 500 $coupons = array();
501 - !empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue']; 501 + !empty($orderCompute['coupon_amount']) && $coupons['name'] = $orderInfo['couponName'];
502 $coupons += self::getCouponList($uid, true); 502 $coupons += self::getCouponList($uid, true);
503 $result['coupon'] = $coupons; 503 $result['coupon'] = $coupons;
504 } 504 }