Authored by 王水玲

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

... ... @@ -381,7 +381,7 @@ const getCancelOrderReason = () => {
*/
const getExpressInfo = (uid, code) => {
return api.get('', {
method: 'app.express.get',
method: 'app.express.li',
uid: uid,
order_code: code
});
... ... @@ -543,6 +543,10 @@ const getOrderDetail = (uid, code) => {
} else {
detail.statusStr = statusMap[st].valueStr;
}
//取消不显示物流信息
detail.expressInfo = express;
detail.expressInfo.addressList = _convertAddress(express.express_detail, detail.create_time);
}
... ... @@ -557,9 +561,6 @@ const getOrderDetail = (uid, code) => {
detail.allAddress = detail.area + detail.address;
detail.expressInfo = express;
detail.expressInfo.addressList = _convertAddress(express.express_detail, detail.create_time);
return {
orderDetail: Object.assign(basicData, detail)
};
... ...
... ... @@ -264,7 +264,7 @@
<input value="{{invoice_mobile}}" class='input invoice-mobile' type="text" maxlength="11" placeholder="请填写收票人手机">
<span class="input-tip invoice-mobile-tip blue hide">
<span class="iconfont">&#xe60c;</span>
请输入正确的手机号
<em>手机号码不正确</em>
</span>
</div>
</div>
... ...
... ... @@ -107,6 +107,9 @@ $(function() {
});
}
return false;
}).delegate('#remove_invalid', 'click', function() {
// 清除失效商品
Cart.removeInvalid();
});
// 商品删除模块
... ... @@ -143,10 +146,6 @@ $(function() {
});
});
$('#remove_invalid').off().on('click', function() {
Cart.removeInvalid();
});
// 变动商品数量
Stepper.init();
... ...
... ... @@ -581,32 +581,33 @@ Cart = {
* 清除失效商品
*/
removeInvalid: function() {
var invalidEles;
var invalidEles = $('.invalid-pros ul li.chk');
var products = [];
var dialog = new _confirm({
var dialog;
if (invalidEles.length <= 0) {
new _alert('购物袋中没有失效商品!').show();
return false;
}
dialog = new _confirm({
content: '<p style="font-size:25px;margin-bottom:20px;">清除失效商品</p><p>确定要清除失效商品吗?</p>',
cb: function() {
dialog.close();
invalidEles = $('.invalid-pros ul li.chk');
if (invalidEles.length > 0) {
$(invalidEles).each(function() {
products.push(JSON.parse($(this).attr('data-product_info')));
});
$(invalidEles).each(function() {
products.push(JSON.parse($(this).attr('data-product_info')));
});
Util.ajax({
url: '/shopping/cart/product/remove',
data: {skuList: JSON.stringify(products)},
type: 'DELETE',
success: function(res) {
Util.refreshCart(res, function() {
});
}
});
} else {
new _alert('购物袋中没有失效商品!').show();
}
Util.ajax({
url: '/shopping/cart/product/remove',
data: {skuList: JSON.stringify(products)},
type: 'DELETE',
success: function(res) {
Util.refreshCart(res, function() {
});
}
});
}
}).show();
}
... ...
... ... @@ -22,16 +22,23 @@ function validateInvoice($el) {
var name = $.trim($el.find('.invoice-title-input').val());
var mobile = $.trim($invoiceMobile.val());
//隐藏所有错误提示
$el.find('.input-tip').addClass('hide');
// 发票抬头为单位
if ($el.invoiceTitleType === 2 && name === '') {
pass = false;
$el.find('.invoice-title-tip').removeClass('hide');
}
if ($el.invoiceType === 2 && $('#address-list li.address.focus').data('mobile') !== mobile) {
if (!/[1][34578][0-9]{9}/.test(mobile)) {
if ($el.invoiceType === 2 && (mobile === '' ||
$('#address-list li.address.focus').data('mobile') !== mobile)) {
if (mobile === '') {
pass = false;
$el.find('.invoice-mobile-tip').removeClass('hide').find('em').html('请填写手机号码');
} else if (!/[1][34578][0-9]{9}/.test(mobile)) {
pass = false;
$el.find('.invoice-mobile-tip').removeClass('hide');
$el.find('.invoice-mobile-tip').removeClass('hide').find('em').html('手机号码不正确');
}
}
... ... @@ -152,7 +159,9 @@ function showInvoiceDialog() {
}
// 设置默认收货地址手机号
$invoiceMobile.val(mobile.toString().substr(0, 3) + '****' + mobile.toString().substr(7));
if (mobile) {
$invoiceMobile.val(mobile.toString().substr(0, 3) + '****' + mobile.toString().substr(7));
}
// 设置radio选中
$('[data-value=' + invoiceTitleType + '].invoice-title-radio').find('.radio').addClass('checked');
... ...
... ... @@ -4,8 +4,8 @@
text-align: center;
.pay-fail-bg {
background: resolve("layout/pay-fail.svg") no-repeat center center;
width: 115px;
background: resolve("layout/pay-fail.png") no-repeat center center;
width: 130px;
height: 130px;
margin: 0 auto 30px;
}
... ...
... ... @@ -221,7 +221,7 @@
</div>
<div id="remove_selected" class="action hoverable">删除选中的商品</div>
<div id="send_favorite" class="action hoverable">移入收藏夹</div>
<div id="clear_invalid_all" class="action hoverable">清除失效商品</div>
<div id="remove_invalid" class="action hoverable">清除失效商品</div>
<div class="selected-num">已选<span>{{selectedNum}}</span></div>
<div class="checkout-total">
<div class="total-title">商品金额:</div>
... ...