Authored by 王水玲

Merge branch 'release/2.0' of git.yoho.cn:fe/yoho-blk into release/2.0

@@ -381,7 +381,7 @@ const getCancelOrderReason = () => { @@ -381,7 +381,7 @@ const getCancelOrderReason = () => {
381 */ 381 */
382 const getExpressInfo = (uid, code) => { 382 const getExpressInfo = (uid, code) => {
383 return api.get('', { 383 return api.get('', {
384 - method: 'app.express.get', 384 + method: 'app.express.li',
385 uid: uid, 385 uid: uid,
386 order_code: code 386 order_code: code
387 }); 387 });
@@ -543,6 +543,10 @@ const getOrderDetail = (uid, code) => { @@ -543,6 +543,10 @@ const getOrderDetail = (uid, code) => {
543 } else { 543 } else {
544 detail.statusStr = statusMap[st].valueStr; 544 detail.statusStr = statusMap[st].valueStr;
545 } 545 }
  546 +
  547 + //取消不显示物流信息
  548 + detail.expressInfo = express;
  549 + detail.expressInfo.addressList = _convertAddress(express.express_detail, detail.create_time);
546 } 550 }
547 551
548 552
@@ -557,9 +561,6 @@ const getOrderDetail = (uid, code) => { @@ -557,9 +561,6 @@ const getOrderDetail = (uid, code) => {
557 561
558 detail.allAddress = detail.area + detail.address; 562 detail.allAddress = detail.area + detail.address;
559 563
560 - detail.expressInfo = express;  
561 - detail.expressInfo.addressList = _convertAddress(express.express_detail, detail.create_time);  
562 -  
563 return { 564 return {
564 orderDetail: Object.assign(basicData, detail) 565 orderDetail: Object.assign(basicData, detail)
565 }; 566 };
@@ -264,7 +264,7 @@ @@ -264,7 +264,7 @@
264 <input value="{{invoice_mobile}}" class='input invoice-mobile' type="text" maxlength="11" placeholder="请填写收票人手机"> 264 <input value="{{invoice_mobile}}" class='input invoice-mobile' type="text" maxlength="11" placeholder="请填写收票人手机">
265 <span class="input-tip invoice-mobile-tip blue hide"> 265 <span class="input-tip invoice-mobile-tip blue hide">
266 <span class="iconfont">&#xe60c;</span> 266 <span class="iconfont">&#xe60c;</span>
267 - 请输入正确的手机号 267 + <em>手机号码不正确</em>
268 </span> 268 </span>
269 </div> 269 </div>
270 </div> 270 </div>
@@ -107,6 +107,9 @@ $(function() { @@ -107,6 +107,9 @@ $(function() {
107 }); 107 });
108 } 108 }
109 return false; 109 return false;
  110 + }).delegate('#remove_invalid', 'click', function() {
  111 + // 清除失效商品
  112 + Cart.removeInvalid();
110 }); 113 });
111 114
112 // 商品删除模块 115 // 商品删除模块
@@ -143,10 +146,6 @@ $(function() { @@ -143,10 +146,6 @@ $(function() {
143 }); 146 });
144 }); 147 });
145 148
146 - $('#remove_invalid').off().on('click', function() {  
147 - Cart.removeInvalid();  
148 - });  
149 -  
150 // 变动商品数量 149 // 变动商品数量
151 Stepper.init(); 150 Stepper.init();
152 151
@@ -581,32 +581,33 @@ Cart = { @@ -581,32 +581,33 @@ Cart = {
581 * 清除失效商品 581 * 清除失效商品
582 */ 582 */
583 removeInvalid: function() { 583 removeInvalid: function() {
584 - var invalidEles; 584 + var invalidEles = $('.invalid-pros ul li.chk');
585 var products = []; 585 var products = [];
586 - var dialog = new _confirm({ 586 + var dialog;
  587 +
  588 + if (invalidEles.length <= 0) {
  589 + new _alert('购物袋中没有失效商品!').show();
  590 + return false;
  591 + }
  592 +
  593 + dialog = new _confirm({
587 content: '<p style="font-size:25px;margin-bottom:20px;">清除失效商品</p><p>确定要清除失效商品吗?</p>', 594 content: '<p style="font-size:25px;margin-bottom:20px;">清除失效商品</p><p>确定要清除失效商品吗?</p>',
588 cb: function() { 595 cb: function() {
589 dialog.close(); 596 dialog.close();
590 597
591 - invalidEles = $('.invalid-pros ul li.chk');  
592 -  
593 - if (invalidEles.length > 0) {  
594 - $(invalidEles).each(function() {  
595 - products.push(JSON.parse($(this).attr('data-product_info')));  
596 - }); 598 + $(invalidEles).each(function() {
  599 + products.push(JSON.parse($(this).attr('data-product_info')));
  600 + });
597 601
598 - Util.ajax({  
599 - url: '/shopping/cart/product/remove',  
600 - data: {skuList: JSON.stringify(products)},  
601 - type: 'DELETE',  
602 - success: function(res) {  
603 - Util.refreshCart(res, function() {  
604 - });  
605 - }  
606 - });  
607 - } else {  
608 - new _alert('购物袋中没有失效商品!').show();  
609 - } 602 + Util.ajax({
  603 + url: '/shopping/cart/product/remove',
  604 + data: {skuList: JSON.stringify(products)},
  605 + type: 'DELETE',
  606 + success: function(res) {
  607 + Util.refreshCart(res, function() {
  608 + });
  609 + }
  610 + });
610 } 611 }
611 }).show(); 612 }).show();
612 } 613 }
@@ -22,16 +22,23 @@ function validateInvoice($el) { @@ -22,16 +22,23 @@ function validateInvoice($el) {
22 var name = $.trim($el.find('.invoice-title-input').val()); 22 var name = $.trim($el.find('.invoice-title-input').val());
23 var mobile = $.trim($invoiceMobile.val()); 23 var mobile = $.trim($invoiceMobile.val());
24 24
  25 + //隐藏所有错误提示
  26 + $el.find('.input-tip').addClass('hide');
  27 +
25 // 发票抬头为单位 28 // 发票抬头为单位
26 if ($el.invoiceTitleType === 2 && name === '') { 29 if ($el.invoiceTitleType === 2 && name === '') {
27 pass = false; 30 pass = false;
28 $el.find('.invoice-title-tip').removeClass('hide'); 31 $el.find('.invoice-title-tip').removeClass('hide');
29 } 32 }
30 33
31 - if ($el.invoiceType === 2 && $('#address-list li.address.focus').data('mobile') !== mobile) {  
32 - if (!/[1][34578][0-9]{9}/.test(mobile)) { 34 + if ($el.invoiceType === 2 && (mobile === '' ||
  35 + $('#address-list li.address.focus').data('mobile') !== mobile)) {
  36 + if (mobile === '') {
  37 + pass = false;
  38 + $el.find('.invoice-mobile-tip').removeClass('hide').find('em').html('请填写手机号码');
  39 + } else if (!/[1][34578][0-9]{9}/.test(mobile)) {
33 pass = false; 40 pass = false;
34 - $el.find('.invoice-mobile-tip').removeClass('hide'); 41 + $el.find('.invoice-mobile-tip').removeClass('hide').find('em').html('手机号码不正确');
35 } 42 }
36 } 43 }
37 44
@@ -152,7 +159,9 @@ function showInvoiceDialog() { @@ -152,7 +159,9 @@ function showInvoiceDialog() {
152 } 159 }
153 160
154 // 设置默认收货地址手机号 161 // 设置默认收货地址手机号
155 - $invoiceMobile.val(mobile.toString().substr(0, 3) + '****' + mobile.toString().substr(7)); 162 + if (mobile) {
  163 + $invoiceMobile.val(mobile.toString().substr(0, 3) + '****' + mobile.toString().substr(7));
  164 + }
156 165
157 // 设置radio选中 166 // 设置radio选中
158 $('[data-value=' + invoiceTitleType + '].invoice-title-radio').find('.radio').addClass('checked'); 167 $('[data-value=' + invoiceTitleType + '].invoice-title-radio').find('.radio').addClass('checked');
@@ -4,8 +4,8 @@ @@ -4,8 +4,8 @@
4 text-align: center; 4 text-align: center;
5 5
6 .pay-fail-bg { 6 .pay-fail-bg {
7 - background: resolve("layout/pay-fail.svg") no-repeat center center;  
8 - width: 115px; 7 + background: resolve("layout/pay-fail.png") no-repeat center center;
  8 + width: 130px;
9 height: 130px; 9 height: 130px;
10 margin: 0 auto 30px; 10 margin: 0 auto 30px;
11 } 11 }
@@ -221,7 +221,7 @@ @@ -221,7 +221,7 @@
221 </div> 221 </div>
222 <div id="remove_selected" class="action hoverable">删除选中的商品</div> 222 <div id="remove_selected" class="action hoverable">删除选中的商品</div>
223 <div id="send_favorite" class="action hoverable">移入收藏夹</div> 223 <div id="send_favorite" class="action hoverable">移入收藏夹</div>
224 - <div id="clear_invalid_all" class="action hoverable">清除失效商品</div> 224 + <div id="remove_invalid" class="action hoverable">清除失效商品</div>
225 <div class="selected-num">已选<span>{{selectedNum}}</span></div> 225 <div class="selected-num">已选<span>{{selectedNum}}</span></div>
226 <div class="checkout-total"> 226 <div class="checkout-total">
227 <div class="total-title">商品金额:</div> 227 <div class="total-title">商品金额:</div>