Merge branch 'release/5.4.1' into gray
Showing
9 changed files
with
87 additions
and
40 deletions
@@ -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 | - {{/if}} | 21 | + </div> |
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 | - window.location.href = referrer; | 64 | + if (referrer === document.referrer || referrer === window.queryString.referrer) { |
65 | + window.history.go(-1); | ||
66 | + } else { | ||
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) { |
@@ -8,7 +8,6 @@ var $ = require('yoho-jquery'); | @@ -8,7 +8,6 @@ var $ = require('yoho-jquery'); | ||
8 | var FastClick = require('yoho-fastclick'); | 8 | var FastClick = require('yoho-fastclick'); |
9 | 9 | ||
10 | var $nav = $('.category-nav'), | 10 | var $nav = $('.category-nav'), |
11 | - $search = $('#search-input'), | ||
12 | $categoryContainer = $('.category-container'), | 11 | $categoryContainer = $('.category-container'), |
13 | $contents = $categoryContainer.children('.content'), | 12 | $contents = $categoryContainer.children('.content'), |
14 | $subLevelItem = $categoryContainer.find('.sub-level li'); | 13 | $subLevelItem = $categoryContainer.find('.sub-level li'); |
@@ -19,15 +18,12 @@ $(function() { | @@ -19,15 +18,12 @@ $(function() { | ||
19 | }); | 18 | }); |
20 | 19 | ||
21 | function resetHeight() { | 20 | function resetHeight() { |
22 | - var h = document.body.scrollHeight - $search.outerHeight() - $nav.outerHeight(); | 21 | + var h = document.body.scrollHeight - $nav.outerHeight(); |
23 | 22 | ||
24 | $contents.height(h); | 23 | $contents.height(h); |
25 | } | 24 | } |
26 | resetHeight(); | 25 | resetHeight(); |
27 | 26 | ||
28 | -$search.focus(function() { | ||
29 | - $(this).blur(); | ||
30 | -}); | ||
31 | $nav.on('contextmenu', function() { | 27 | $nav.on('contextmenu', function() { |
32 | return false; | 28 | return false; |
33 | }); | 29 | }); |
@@ -4,9 +4,7 @@ var $ = require('yoho-jquery'), | @@ -4,9 +4,7 @@ var $ = require('yoho-jquery'), | ||
4 | var categoryHeight = $('.tab-box').height(), | 4 | var categoryHeight = $('.tab-box').height(), |
5 | gender; | 5 | gender; |
6 | 6 | ||
7 | -var $intercept = $('.no-intercept'), | ||
8 | - $list = $('.brand-list-box'), | ||
9 | - $listBox = $('.list-box'), | 7 | +var $listBox = $('.list-box'), |
10 | $brandContent = $('.brand-content'), | 8 | $brandContent = $('.brand-content'), |
11 | $tabBox = $('.tab-box'), | 9 | $tabBox = $('.tab-box'), |
12 | $contentIndex = $('.content-index'), | 10 | $contentIndex = $('.content-index'), |
@@ -28,6 +26,19 @@ function channels(key) { | @@ -28,6 +26,19 @@ function channels(key) { | ||
28 | return channel[key]; | 26 | return channel[key]; |
29 | } | 27 | } |
30 | 28 | ||
29 | +// 点击字母,页面滚动到相关区域 | ||
30 | +function reference() { | ||
31 | + $('.no-intercept').click(function() { | ||
32 | + var name = $(this).attr('href').split('#')[1] === '0_9' ? '0~9' : $(this).attr('href').split('#')[1], | ||
33 | + targetTop = $('.brand-list-box').find('[name="' + name + '"]').offset().top - categoryHeight; | ||
34 | + | ||
35 | + $('html,body').animate({ | ||
36 | + scrollTop: targetTop | ||
37 | + }, 200); | ||
38 | + return false; | ||
39 | + }); | ||
40 | +} | ||
41 | + | ||
31 | function initialize() { | 42 | function initialize() { |
32 | $('.banner-swiper').each(function() { | 43 | $('.banner-swiper').each(function() { |
33 | if (!$(this).parents('.content').hasClass('hide') && $(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) { | 44 | if (!$(this).parents('.content').hasClass('hide') && $(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) { |
@@ -65,6 +76,8 @@ function loadData(channel) { | @@ -65,6 +76,8 @@ function loadData(channel) { | ||
65 | $tabBox.removeClass('fastening'); | 76 | $tabBox.removeClass('fastening'); |
66 | $contentIndex.removeClass('distance'); | 77 | $contentIndex.removeClass('distance'); |
67 | }); | 78 | }); |
79 | + | ||
80 | + reference(); | ||
68 | } | 81 | } |
69 | }); | 82 | }); |
70 | } | 83 | } |
@@ -77,16 +90,7 @@ $brandCha.find('li').click(function() { | @@ -77,16 +90,7 @@ $brandCha.find('li').click(function() { | ||
77 | loadData(channels(gender)); | 90 | loadData(channels(gender)); |
78 | }); | 91 | }); |
79 | 92 | ||
80 | -// 点击字母,页面滚动到相关区域 | ||
81 | -$intercept.click(function() { | ||
82 | - var name = $(this).attr('href').split('#')[1] === '0_9' ? '0~9' : $(this).attr('href').split('#')[1], | ||
83 | - targetTop = $list.find('[name="' + name + '"]').offset().top - categoryHeight; | ||
84 | - | ||
85 | - $('html,body').animate({ | ||
86 | - scrollTop: targetTop | ||
87 | - }, 200); | ||
88 | - return false; | ||
89 | -}); | 93 | +reference(); |
90 | 94 | ||
91 | $('.brand-tab').find('li').click(function() { | 95 | $('.brand-tab').find('li').click(function() { |
92 | 96 |
@@ -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; | ||
52 | + | ||
53 | + &.more { | ||
54 | + display: flex; | ||
55 | + } | ||
51 | 56 | ||
52 | - li { | ||
53 | - float: left; | ||
54 | - width: 50%; | 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 | } |
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | text-align: center; | 20 | text-align: center; |
21 | z-index: 10; | 21 | z-index: 10; |
22 | background-color: #fff; | 22 | background-color: #fff; |
23 | - padding: 0 200px 84px; | 23 | + padding: 0 222px 84px; |
24 | border-bottom: 5px solid #e0e0e0; | 24 | border-bottom: 5px solid #e0e0e0; |
25 | width: 100%; | 25 | width: 100%; |
26 | 26 |
@@ -55,7 +55,6 @@ $border_color_light: #eee; | @@ -55,7 +55,6 @@ $border_color_light: #eee; | ||
55 | height: 112px; | 55 | height: 112px; |
56 | line-height: 112px; | 56 | line-height: 112px; |
57 | background-color: #fff; | 57 | background-color: #fff; |
58 | - padding-left: 40px; | ||
59 | font-size: 40px; | 58 | font-size: 40px; |
60 | } | 59 | } |
61 | 60 |
-
Please register or login to post a comment