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 @@ @@ -5,20 +5,24 @@
5 <a href="/product/new">随便逛逛</a> 5 <a href="/product/new">随便逛逛</a>
6 </div> 6 </div>
7 {{^}} 7 {{^}}
8 - {{#if cartNav}}  
9 - <ul class="cart-nav clearfix">  
10 - <li class="{{#if ordinaryCart}}active{{/if}}" id="common-cart-nav" data-type="ordinary"> 8 + <div class="cart-nav clearfix{{#if cartNav}} more{{/if}}">
  9 + {{#if commonGoodsCount}}
  10 + <div class="nav-item{{#if ordinaryCart}} active{{/if}}" id="common-cart-nav" data-type="ordinary">
11 <span>普通商品({{commonGoodsCount}})</span> 11 <span>普通商品({{commonGoodsCount}})</span>
12 - </li>  
13 - <li class="{{#if advanceCart}}active{{/if}}" id="presell-cart-nav" data-type="advance"> 12 + </div>
  13 + {{/if}}
  14 + {{#if presellGoodsCount}}
  15 + <div class="nav-item{{#if advanceCart}} active{{/if}}" id="presell-cart-nav" data-type="advance">
14 <span >预售商品({{presellGoodsCount}})</span> 16 <span >预售商品({{presellGoodsCount}})</span>
15 <div id="presell-tip" class="presell-tip hide"> 17 <div id="presell-tip" class="presell-tip hide">
16 <div class="triangle"></div> 18 <div class="triangle"></div>
17 <p class="pt-content">预售商品点这里结算哦~</p> 19 <p class="pt-content">预售商品点这里结算哦~</p>
18 </div> 20 </div>
19 - </li>  
20 - </ul> 21 + </div>
21 {{/if}} 22 {{/if}}
  23 + <button class="btn-edit">编辑</button>
  24 + </div>
  25 +
22 {{#if ordinaryCart}} 26 {{#if ordinaryCart}}
23 <div class="cart-content normal-good active"> 27 <div class="cart-content normal-good active">
24 {{#commonCart}} 28 {{#commonCart}}
@@ -61,7 +61,11 @@ let indexObj = { @@ -61,7 +61,11 @@ let indexObj = {
61 61
62 if (referrer && referrer !== window.location.href) { 62 if (referrer && referrer !== window.location.href) {
63 cookie.remove('_cartReferrer'); 63 cookie.remove('_cartReferrer');
  64 + if (referrer === document.referrer || referrer === window.queryString.referrer) {
  65 + window.history.go(-1);
  66 + } else {
64 window.location.href = referrer; 67 window.location.href = referrer;
  68 + }
65 } else { 69 } else {
66 window.location.href = '/?go=1'; 70 window.location.href = '/?go=1';
67 } 71 }
@@ -89,8 +93,7 @@ let indexObj = { @@ -89,8 +93,7 @@ let indexObj = {
89 let self = this; 93 let self = this;
90 94
91 if ((!data || (!data.commonCart && !data.preSellCart)) && no_try !== true) { 95 if ((!data || (!data.commonCart && !data.preSellCart)) && no_try !== true) {
92 - self.refreshPage();  
93 - return; 96 + return self.refreshPage();
94 } 97 }
95 let cartType = cookie.get('_cartType') || 'ordinary'; 98 let cartType = cookie.get('_cartType') || 'ordinary';
96 99
@@ -120,6 +123,9 @@ let indexObj = { @@ -120,6 +123,9 @@ let indexObj = {
120 $('.cart-box').html(hbsTemplate(data)); 123 $('.cart-box').html(hbsTemplate(data));
121 require('./index/cart').init(self); 124 require('./index/cart').init(self);
122 require('./index/good').init(self); 125 require('./index/good').init(self);
  126 + $('.btn-edit').on('click', () => {
  127 + self.navBtnClick();
  128 + });
123 lazyLoad($('img.lazy')); 129 lazyLoad($('img.lazy'));
124 return Promise.resolve(); 130 return Promise.resolve();
125 } 131 }
@@ -17,7 +17,7 @@ let cartObj = { @@ -17,7 +17,7 @@ let cartObj = {
17 17
18 self.handle = handle; 18 self.handle = handle;
19 19
20 - $('.cart-nav').on('click', 'li', function(e) { 20 + $('.cart-nav').on('click', '.nav-item', function(e) {
21 self.cartNavClick(e); 21 self.cartNavClick(e);
22 }); 22 });
23 $('.more-box>.down-arrow').on('click', function(e) { 23 $('.more-box>.down-arrow').on('click', function(e) {
@@ -48,19 +48,46 @@ @@ -48,19 +48,46 @@
48 color: #c6c6c6; 48 color: #c6c6c6;
49 border-bottom: 1PX solid #e0e0e0; 49 border-bottom: 1PX solid #e0e0e0;
50 background: #fff; 50 background: #fff;
  51 + display: none;
51 52
52 - li {  
53 - float: left;  
54 - width: 50%; 53 + &.more {
  54 + display: flex;
  55 + }
  56 +
  57 + .nav-item {
55 padding: 35px 0; 58 padding: 35px 0;
56 height: 35px; 59 height: 35px;
57 box-sizing: content-box; 60 box-sizing: content-box;
  61 + flex: 1;
58 } 62 }
59 63
60 - li.active { 64 + .nav-item.active {
61 color: #000; 65 color: #000;
62 } 66 }
63 67
  68 + &.more {
  69 + .btn-edit {
  70 + position: relative;
  71 + margin-top: 24px;
  72 + margin-right: 30px;
  73 + top: initial;
  74 + right: initial;
  75 + }
  76 + }
  77 +
  78 + .btn-edit {
  79 + display: none;
  80 + width: 100px;
  81 + height: 60px;
  82 + border-radius: 5PX;
  83 + background-color: #efefef;
  84 + color: #808080;
  85 + position: absolute;
  86 + top: 24px;
  87 + right: 30px;
  88 + font-size: 30px;
  89 + }
  90 +
64 span { 91 span {
65 display: block; 92 display: block;
66 box-sizing: border-box; 93 box-sizing: border-box;
@@ -69,13 +96,14 @@ @@ -69,13 +96,14 @@
69 line-height: 35px; 96 line-height: 35px;
70 font-size: 35px; 97 font-size: 35px;
71 text-align: center; 98 text-align: center;
  99 + border-left: 1PX solid #e0e0e0;
72 } 100 }
73 101
74 - li:first-child span {  
75 - border-right: 1PX solid #e0e0e0; 102 + .nav-item:first-child span {
  103 + border: none;
76 } 104 }
77 105
78 - li:last-child { 106 + .nav-item:last-child {
79 position: relative; 107 position: relative;
80 } 108 }
81 109
@@ -130,6 +158,16 @@ @@ -130,6 +158,16 @@
130 } 158 }
131 } 159 }
132 160
  161 +.wechat-body {
  162 + .cart-nav {
  163 + display: flex;
  164 +
  165 + .btn-edit {
  166 + display: block;
  167 + }
  168 + }
  169 +}
  170 +
133 .more-box { 171 .more-box {
134 transition: all 0.2s; 172 transition: all 0.2s;
135 } 173 }