Authored by 刘传洋

Merge branch 'feature/shoppingCart' of http://git.yoho.cn/fe/yohobuy-node into feature/shoppingCart

... ... @@ -3,7 +3,7 @@
<p class="prompt">\{{title}}、电话为选填项,其他均为必填项</p>
<ul class="info-wrap">
<li>
<span class="left-rd"><i class="red">*</i>收人:</span>
<span class="left-rd"><i class="red">*</i>收<i class="mg">货</i>人:</span>
<input type="text" name="consignee" value="\{{info.consignee}}" placeholder="请输入您的姓名">
<p class="caveat-tip"></p>
</li>
... ...
... ... @@ -243,6 +243,7 @@ payWay = {
}
};
// 配送方式
deliveryWay = {
$deliveryType: $('.delivery-way-wrap .check-btn'),
$deliveryTime: $('.delivery-time-wrap .check-btn'),
... ... @@ -350,6 +351,7 @@ deliveryWay = {
}
};
// jit拆单
multiPackage = {
$el: $('.multi-package-row'),
init: function() {
... ... @@ -426,6 +428,7 @@ multiPackage = {
}
};
// 优惠券
coupon = {
$el: $('#use-coupons'),
init: function() {
... ... @@ -537,6 +540,7 @@ coupon = {
}
};
// 有货币
yohoCoin = {
$el: $('#yoho-coin-box'),
init: function() {
... ... @@ -559,18 +563,21 @@ yohoCoin = {
var that = this;
this.$el.on('click', '.coin-use-btn', function() {
if (order.coin * 1 === this.maxCoin * 1) {
return;
if (order.coin * 1 !== this.maxCoin * 1) {
compute(that.maxCoin);
}
compute(that.maxCoin);
that.close();
}).on('click', '.coin-cancel-btn', function() {
if (order.coin * 1 === 0) {
return;
if (order.coin * 1 !== 0) {
compute();
}
compute();
that.close();
});
},
close: function() {
this.$el.prev().children('.locker-switch').trigger('click');
}
};
... ...
... ... @@ -26,6 +26,7 @@ var addrList = {},
var addrSelect;
// 获取地址数据
$('.addr-item').each(function() {
var data = $(this).data();
... ... @@ -66,6 +67,16 @@ Dialog.prototype.packageInfo = function() {
return data;
};
function syncShowMoreBtn() {
setTimeout(function() {
if ($addrWrap.children().length > 4) {
$addrWrap.addClass('more');
} else {
$addrWrap.removeClass('more');
}
}, 0);
}
// 地址校验,支持单个字段与多字段
function validateAddress(data) {
var regx = {
... ... @@ -235,6 +246,8 @@ function handelAddrInfo(data, reqData, $el) {
$items.first().before($dom);
$dom.trigger('click');
syncShowMoreBtn();
if (reqData.setDefault) {
$dom.find('.set-default').trigger('click');
}
... ... @@ -370,6 +383,7 @@ $addrWrap.on('click', '.addr-item', function() {
if (data.code === 200) {
$item.remove();
diaCf.close();
syncShowMoreBtn();
}
});
}
... ... @@ -393,6 +407,7 @@ $('.addr-opt').on('click', 'span', function() {
$this.toggleClass('open');
});
syncShowMoreBtn();
setShowDeliveryAddr();
// 获取地址信息
... ...
... ... @@ -234,8 +234,7 @@ var areaSelect = {
className += ' on';
}
_h += '<span class="' + className + '" data-id="' + data[i][j].id +
'" data-text="' + data[i][j].caption + '">' +
(data[i][j].is_support_express === 'Y' ? '*' : '') + data[i][j].caption + '</span>';
'" data-text="' + data[i][j].caption + '">' + data[i][j].caption + '</span>';
}
_h += '</p>';
}
... ... @@ -254,8 +253,7 @@ var areaSelect = {
className += ' on';
}
_h += '<span class="' + className + '" data-id="' + data[j].id +
'" data-text="' + data[j].caption + '">' +
(data[j].is_support_express === 'Y' ? '*' : '') + data[j].caption + '</span>';
'" data-text="' + data[j].caption + '">' + data[j].caption + '</span>';
}
if (type === 'city') {
... ...
... ... @@ -336,20 +336,21 @@
> * {
cursor: pointer;
}
.hide-more-btn {
display: none;
}
}
.addr-opt.open {
.more + .addr-opt {
.more-addr-btn {
display: inline;
}
&.open > .more-addr-btn {
display: none;
}
.hide-more-btn {
&.open > .hide-more-btn {
display: inline;
}
}
... ... @@ -1032,7 +1033,6 @@
}
.balance-wrap {
font-size: 13px;
line-height: 2;
... ... @@ -1094,9 +1094,11 @@
font-weight: 700;
background: #d90025;
border: none;
outline: none;
padding: 0;
margin-left: 10px;
vertical-align: super;
cursor: pointer;
}
}
}
... ... @@ -1200,6 +1202,10 @@
color: #ce0b24;
margin-right: 10px;
}
.mg {
padding: 0 7px;
}
}
.caveat-tip {
... ...