Authored by ccbikai(👎🏻🍜)

Merge branch 'release/5.4.1' of git.yoho.cn:fe/yohobuywap-node into release/5.4.1

... ... @@ -5,20 +5,24 @@
<a href="/product/new">随便逛逛</a>
</div>
{{^}}
{{#if cartNav}}
<ul class="cart-nav clearfix">
<li class="{{#if ordinaryCart}}active{{/if}}" id="common-cart-nav" data-type="ordinary">
<div class="cart-nav clearfix{{#if cartNav}} more{{/if}}">
{{#if commonGoodsCount}}
<div class="nav-item{{#if ordinaryCart}} active{{/if}}" id="common-cart-nav" data-type="ordinary">
<span>普通商品({{commonGoodsCount}})</span>
</li>
<li class="{{#if advanceCart}}active{{/if}}" id="presell-cart-nav" data-type="advance">
</div>
{{/if}}
{{#if presellGoodsCount}}
<div class="nav-item{{#if advanceCart}} active{{/if}}" id="presell-cart-nav" data-type="advance">
<span >预售商品({{presellGoodsCount}})</span>
<div id="presell-tip" class="presell-tip hide">
<div class="triangle"></div>
<p class="pt-content">预售商品点这里结算哦~</p>
</div>
</li>
</ul>
</div>
{{/if}}
<button class="btn-edit">编辑</button>
</div>
{{#if ordinaryCart}}
<div class="cart-content normal-good active">
{{#commonCart}}
... ...
... ... @@ -61,7 +61,11 @@ let indexObj = {
if (referrer && referrer !== window.location.href) {
cookie.remove('_cartReferrer');
if (referrer === document.referrer || referrer === window.queryString.referrer) {
window.history.go(-1);
} else {
window.location.href = referrer;
}
} else {
window.location.href = '/?go=1';
}
... ... @@ -89,8 +93,7 @@ let indexObj = {
let self = this;
if ((!data || (!data.commonCart && !data.preSellCart)) && no_try !== true) {
self.refreshPage();
return;
return self.refreshPage();
}
let cartType = cookie.get('_cartType') || 'ordinary';
... ... @@ -120,6 +123,9 @@ let indexObj = {
$('.cart-box').html(hbsTemplate(data));
require('./index/cart').init(self);
require('./index/good').init(self);
$('.btn-edit').on('click', () => {
self.navBtnClick();
});
lazyLoad($('img.lazy'));
return Promise.resolve();
}
... ...
... ... @@ -17,7 +17,7 @@ let cartObj = {
self.handle = handle;
$('.cart-nav').on('click', 'li', function(e) {
$('.cart-nav').on('click', '.nav-item', function(e) {
self.cartNavClick(e);
});
$('.more-box>.down-arrow').on('click', function(e) {
... ...
... ... @@ -48,19 +48,46 @@
color: #c6c6c6;
border-bottom: 1PX solid #e0e0e0;
background: #fff;
display: none;
li {
float: left;
width: 50%;
&.more {
display: flex;
}
.nav-item {
padding: 35px 0;
height: 35px;
box-sizing: content-box;
flex: 1;
}
li.active {
.nav-item.active {
color: #000;
}
&.more {
.btn-edit {
position: relative;
margin-top: 24px;
margin-right: 30px;
top: initial;
right: initial;
}
}
.btn-edit {
display: none;
width: 100px;
height: 60px;
border-radius: 5PX;
background-color: #efefef;
color: #808080;
position: absolute;
top: 24px;
right: 30px;
font-size: 30px;
}
span {
display: block;
box-sizing: border-box;
... ... @@ -69,13 +96,14 @@
line-height: 35px;
font-size: 35px;
text-align: center;
border-left: 1PX solid #e0e0e0;
}
li:first-child span {
border-right: 1PX solid #e0e0e0;
.nav-item:first-child span {
border: none;
}
li:last-child {
.nav-item:last-child {
position: relative;
}
... ... @@ -130,6 +158,16 @@
}
}
.wechat-body {
.cart-nav {
display: flex;
.btn-edit {
display: block;
}
}
}
.more-box {
transition: all 0.2s;
}
... ...