Authored by lore-w

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

... ... @@ -28,7 +28,6 @@ var $action = $('.action'),
// 清除返回按钮原有链接
$backBtn.attr('href', 'javascript:void(0);');
window.rePosFooter();
// 自定义返回按钮事件
... ... @@ -39,6 +38,7 @@ $backBtn.on('touchend', function(e) {
e.preventDefault();
currentPage = 'address';
$navTitle.html('地址管理');
window.rePosFooter();
} else if (currentPage === 'list') {
$pageWrap.hide();
$editAddressPage.show();
... ... @@ -60,9 +60,10 @@ function editAddress(data) {
$addressForm.find('[name="address"]').val(data.address || '');
currentPage = 'edit';
$footer.hide();
$pageWrap.hide();
$editAddressPage.show();
$footer.addClass('bottom');
}
$confim.on('touchend', '.cancel', function() {
... ... @@ -94,30 +95,7 @@ $confim.on('touchend', '.cancel', function() {
});
});
// 添加地址
$addAddress.on('touchend', function() {
if ($addressItem.length >= 5) {
tip.show('您最多添加5个收货地址');
return false;
}
editAddress();
$navTitle.html('添加新地址');
});
// 编辑或删除
$action.on('touchend', '.edit', function() {
editAddress($(this).data());
$navTitle.html('修改地址');
}).on('touchend', '.del', function() {
deleteId = $(this).data('id');
$confim.show();
});
$submit.on('touchend', function() {
$addressForm.submit();
return false;
});
// 提交表单请求
$addressForm.on('submit', function() {
if (isSubmiting) {
return false;
... ... @@ -126,12 +104,14 @@ $addressForm.on('submit', function() {
// 简单的表单校验
if (!$(this).find('[name="consignee"]').val()) {
tip.show('收件人不能为空');
$(this).find('[name="consignee"]').focus();
// $(this).find('[name="consignee"]').focus();
return false;
}
if (!$(this).find('[name="mobile"]').val()) {
tip.show('手机号不能为空');
$(this).find('[name="mobile"]').focus();
// $(this).find('[name="mobile"]').focus();
return false;
}
if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val()) {
... ... @@ -140,7 +120,8 @@ $addressForm.on('submit', function() {
}
if (!$(this).find('[name="address"]').val()) {
tip.show('地址不能为空');
$(this).find('[name="address"]').focus();
// $(this).find('[name="address"]').focus();
return false;
}
... ... @@ -168,6 +149,34 @@ $addressForm.on('submit', function() {
return false;
});
// 添加地址
$addAddress.on('touchend', function() {
if ($addressItem.length >= 5) {
tip.show('您最多添加5个收货地址');
return false;
}
editAddress();
$navTitle.html('添加新地址');
});
// 编辑或删除
$action.on('touchend', '.edit', function() {
editAddress($(this).data());
$navTitle.html('修改地址');
}).on('touchend', '.del', function() {
deleteId = $(this).data('id');
$confim.show();
});
$submit.on('touchend', function() {
$addressForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
// 省市区
$area.on('touchend', function() {
$footer.hide();
... ... @@ -176,10 +185,9 @@ $area.on('touchend', function() {
currentPage = 'list';
});
// 省市区联动
$addressListPage.on('touchend', '.address', function() {
var caption = $(this).children('.caption').text();
newArea.push(caption);
newArea.push($(this).children('.caption').text());
$(this).siblings().hide();
$(this).children('ul').show();
return false;
... ... @@ -193,6 +201,7 @@ $addressListPage.on('touchend', '.address', function() {
$editAddressPage.show();
currentPage = 'edit';
$navTitle.html('修改地址');
$footer.show();
// 恢复默认的三级选择
$addressListPage.hide();
... ... @@ -201,3 +210,17 @@ $addressListPage.on('touchend', '.address', function() {
newArea = [];
return false;
});
$($editAddressPage, $addressListPage).css('min-height', function() {
return $(window).height() - $('#yoho-header').height();
});
$pageWrap.first().css('min-height', function() {
return $(window).height() - $('#yoho-header').height() - $footer.height();
});
$('input, textarea').on('focus', function() {
$footer.hide();
}).on('blur', function() {
$footer.show();
});
\ No newline at end of file
... ...
... ... @@ -18,3 +18,10 @@ $questionTab.on('touchend', function() {
$('.question-list').removeClass('current');
$(clickTab).addClass('current');
});
$('.yoho-page').on('touchstart', '.connect-item, .question-item', function() {
$(this).siblings().removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', '.connect-item, .question-item', function() {
$(this).removeClass('highlight');
});
... ...
.my-address-page {
width: 100%;
background: #f0f0f0;
padding-bottom: pxToRem(20px);
.page-wrap:first-child {
padding-bottom: pxToRem(10px);
}
.address-item {
padding: pxToRem(20px) pxToRem(30px);
... ... @@ -169,6 +172,10 @@
text-align: center;
font-size: pxToRem(32px);
line-height: pxToRem(88px);
&.highlight {
background: rgba(0, 0, 0, 0.6);
}
}
}
... ...
... ... @@ -31,6 +31,7 @@
margin: 0 rem(32);
border-left: 1px solid #b0b0b0;
}
}
.question-list {
... ... @@ -43,15 +44,15 @@
}
li {
margin-left: rem(30);
width: rem(610);
font-size: rem(28);
line-height: rem(90);
border-bottom: 1px solid #ccc;
a {
display: block;
color: #444;
width: rem(610);
margin-left: rem(30);
border-bottom: 1px solid #ccc;
}
.iconfont {
... ... @@ -64,6 +65,10 @@
&:last-child {
border-bottom: none;
}
&.highlight {
background: #eee;
}
}
}
... ... @@ -112,6 +117,9 @@
content: none;
}
}
&.highlight {
background: #eee;
}
}
.icon {
display: inline-block;
... ... @@ -132,6 +140,7 @@
border-bottom: 1px solid #c8c7cc;
color: #444;
background: #fff;
&:last-child {
margin-bottom: 0;
}
... ... @@ -146,6 +155,7 @@
.question {
@extend %qa;
position: relative;
color: #000;
&:after {
content: '';
position: absolute;
... ...
... ... @@ -256,6 +256,13 @@
}
}
}
&.no-item{
height: pxToRem(200px);
line-height: pxToRem(200px);
color: #e0e0e0;
text-align: center;
}
}
}
... ...
... ... @@ -100,8 +100,8 @@ $basicBtnC:#eb0313;
margin-left: .5px;
font-size: pxToRem(23px);
text-align: center;
line-height: pxToRem(35px);
padding: 0 8px;
line-height: pxToRem(33px);
padding: 0 5px;
}
.new-tag {
background-color: #78dc7e;
... ... @@ -121,6 +121,7 @@ $basicBtnC:#eb0313;
}
.limit-tag {
border: 1px solid #000;
background-color: #fff;
color: #000;
}
.soonSoldOut-tag {
... ... @@ -219,6 +220,7 @@ $basicBtnC:#eb0313;
.periodOfMarket {
font-size: pxToRem(24px);
float: right;
color: #d0021b;
h1 {
display: inline-block;
line-height: pxToRem(88px);
... ... @@ -316,7 +318,7 @@ $basicBtnC:#eb0313;
.store-logo {
// padding-right: 35rem/$pxConvertRem;
img {
width: pxToRem(109px);
width: auto;
height: pxToRem(68px);
margin-left: 0;
margin-right: pxToRem(-25px);
... ... @@ -390,9 +392,11 @@ $basicBtnC:#eb0313;
}
}
.recommend-for-you {
margin-bottom: pxToRem(120px);
margin-bottom: pxToRem(30px);
}
}
.bottom-blank{
height: pxToRem(120px);
}
@import "comments-consults";
@import "product-description";
... ...
{{> layout/header}}
<div class="iHelp">
<div class="helpSearch">
<input type="text">
<input type="text" placeholder="查找关键字">
<i class="iconfont">&#xe60f;</i>
</div>
<ul>
... ...
... ... @@ -2,7 +2,7 @@
<div class="good-detail-page yoho-page">
<div class="banner-container">
<div class="tag-container">
<!-- <p class="good-tag soonSoldOut-tag">即将售罄</p> -->
<!-- <p class="good-tag new-tag">NEW</p> -->
{{# tags}}
{{# is_new}}
<p class="good-tag new-tag">NEW</p>
... ... @@ -44,12 +44,12 @@
</div>
{{/ goodsPrice}}
{{# periodOfMarket}}
{{#if periodOfMarket}}
<div class="periodOfMarket">
<h1>上市期:</h1>
<h1 >{{.}}</h1>
<h1 >{{peridOfMarket}}</h1>
</div>
{{/ periodOfMarket}}
{{/if}}
</div>
{{# vipLevel}}
... ... @@ -140,4 +140,5 @@
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
<div class="bottom-blank"></div>
\ No newline at end of file
... ...
... ... @@ -55,7 +55,7 @@
<span class="iconfont">&#xe604;</span></a>
</div>
{{else}}
<div class="comment-content-main content-main no-item">
<div class="consult-content-main content-main no-item">
<span class="iconfont">&#xe63c;</span>暂无咨询
</div>
<div class="consult-content-footer">
... ...