Authored by Rock Zhang

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

@@ -18,6 +18,8 @@ var dispatchModeHammer, @@ -18,6 +18,8 @@ var dispatchModeHammer,
18 $price = $('.price-cal'), 18 $price = $('.price-cal'),
19 $couponUse = $('.coupon-use.used'), 19 $couponUse = $('.coupon-use.used'),
20 $addressWrap = $('.address-wrap'), 20 $addressWrap = $('.address-wrap'),
  21 + $coinCheck = $('.coin-check'),
  22 + $coinUsed = $('.coin .used'),
21 payType, 23 payType,
22 priceTmpl = Handlebars.compile($('#tmpl-price').html()), 24 priceTmpl = Handlebars.compile($('#tmpl-price').html()),
23 queryString = $.queryString(), 25 queryString = $.queryString(),
@@ -104,6 +106,8 @@ function orderCompute() { @@ -104,6 +106,8 @@ function orderCompute() {
104 if (res.last_order_amount) { 106 if (res.last_order_amount) {
105 res.last_order_amount = (+res.last_order_amount).toFixed(2); 107 res.last_order_amount = (+res.last_order_amount).toFixed(2);
106 } 108 }
  109 + $coinCheck.find('em').html('- ¥ ' + res.use_yoho_coin);
  110 + $coinUsed.html('已抵¥' + res.use_yoho_coin);
107 priceHtml = priceTmpl({ 111 priceHtml = priceTmpl({
108 cartPayData: res.promotion_formula_list, 112 cartPayData: res.promotion_formula_list,
109 price: res.last_order_amount 113 price: res.last_order_amount
@@ -212,9 +216,13 @@ $('.coin').on('touchend', function() { @@ -212,9 +216,13 @@ $('.coin').on('touchend', function() {
212 if ($this.find('.checkbox').hasClass('icon-cb-checked')) { 216 if ($this.find('.checkbox').hasClass('icon-cb-checked')) {
213 orderInfo('yohoCoin', $this.data('yoho-coin')); 217 orderInfo('yohoCoin', $this.data('yoho-coin'));
214 $this.find('.coin-check em').show(); 218 $this.find('.coin-check em').show();
  219 + $this.find('.can-use').hide();
  220 + $this.find('.used').show();
215 } else { 221 } else {
216 orderInfo('yohoCoin', 0); 222 orderInfo('yohoCoin', 0);
217 $this.find('.coin-check em').hide(); 223 $this.find('.coin-check em').hide();
  224 + $this.find('.can-use').show();
  225 + $this.find('.used').hide();
218 } 226 }
219 orderCompute(); 227 orderCompute();
220 }); 228 });
@@ -69,7 +69,9 @@ @@ -69,7 +69,9 @@
69 <span class="title">YOHO币</span> 69 <span class="title">YOHO币</span>
70 70
71 {{#if yohoCoin}} 71 {{#if yohoCoin}}
72 - <span class="desc">可抵¥{{yohoCoin}}</span> 72 + <span class="desc used {{#unless useYohoCoin}}hide{{/if}}">已抵¥{{yohoCoin}}</span>
  73 + <span class="desc can-use {{#if useYohoCoin}}hide{{/if}}">可抵¥{{yohoCoin}}</span>
  74 +
73 {{#if useYohoCoin}} 75 {{#if useYohoCoin}}
74 <span class="coin-check"> 76 <span class="coin-check">
75 <em>- ¥ {{yohoCoin}}</em> 77 <em>- ¥ {{yohoCoin}}</em>