Authored by QC-L

修复多余线条的问题,并添加滚动切换

@@ -35,7 +35,6 @@ @@ -35,7 +35,6 @@
35 </div> 35 </div>
36 {{/if}} 36 {{/if}}
37 {{> group/resources/filter-tab}} 37 {{> group/resources/filter-tab}}
38 -  
39 </div> 38 </div>
40 <div id="goodsContainer"> 39 <div id="goodsContainer">
41 {{#if filterList.length}} 40 {{#if filterList.length}}
@@ -3,12 +3,12 @@ @@ -3,12 +3,12 @@
3 <div class="guess-scroll"> 3 <div class="guess-scroll">
4 {{#each data}} 4 {{#each data}}
5 {{#ifcond @index '==' 0}} 5 {{#ifcond @index '==' 0}}
6 - <div class="guess-tab first" data-query="{{queryString}}"> 6 + <div id="tab-{{@index}}" class="guess-tab first" data-query="{{queryString}}">
7 <img class="guess-img" src="{{image2 src w=200 h=160 q=60 mode=3}}" /> 7 <img class="guess-img" src="{{image2 src w=200 h=160 q=60 mode=3}}" />
8 <div class=""></div> 8 <div class=""></div>
9 </div> 9 </div>
10 {{^}} 10 {{^}}
11 - <div class="guess-tab" data-query="{{queryString}}"> 11 + <div id="tab-{{@index}}" data-index="{{@index}}" class="guess-tab" data-query="{{queryString}}">
12 <img class="guess-img" src="{{image2 src w=200 h=160 q=60 mode=3}}" /> 12 <img class="guess-img" src="{{image2 src w=200 h=160 q=60 mode=3}}" />
13 <div></div> 13 <div></div>
14 </div> 14 </div>
@@ -231,6 +231,7 @@ class Group extends Page { @@ -231,6 +231,7 @@ class Group extends Page {
231 guessLikeTabChange(e) { 231 guessLikeTabChange(e) {
232 let $this = $(e.currentTarget); 232 let $this = $(e.currentTarget);
233 let query = $this.data('query'); 233 let query = $this.data('query');
  234 + let index = $this.data('index');
234 let queryObject = {}; 235 let queryObject = {};
235 let newNavType = this.judgeNavType(this.newFilterTab); 236 let newNavType = this.judgeNavType(this.newFilterTab);
236 let newNav = this.newNavInfo[newNavType]; 237 let newNav = this.newNavInfo[newNavType];
@@ -241,6 +242,9 @@ class Group extends Page { @@ -241,6 +242,9 @@ class Group extends Page {
241 queryObject.page = 1; 242 queryObject.page = 1;
242 newNav.page = 1; 243 newNav.page = 1;
243 newNav.query = queryObject; 244 newNav.query = queryObject;
  245 + let lastDom = document.getElementById(`tab-${index - 2}`);
  246 +
  247 + $('.wapper').animate({scrollLeft: lastDom && lastDom.offsetLeft || 0});
244 248
245 $.ajax({ 249 $.ajax({
246 type: 'GET', 250 type: 'GET',
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 overflow-x: scroll; 7 overflow-x: scroll;
8 -ms-overflow-style: none; 8 -ms-overflow-style: none;
9 overflow: -moz-scrollbars-none; 9 overflow: -moz-scrollbars-none;
  10 + -webkit-overflow-scrolling: touch;
  11 + height: 110px;
10 12
11 .guess-scroll { 13 .guess-scroll {
12 display: flex; 14 display: flex;
@@ -14,6 +16,7 @@ @@ -14,6 +16,7 @@
14 flex-wrap: nowrap; 16 flex-wrap: nowrap;
15 width: auto; 17 width: auto;
16 min-width: 100%; 18 min-width: 100%;
  19 + height: 88px;
17 20
18 .guess-tab { 21 .guess-tab {
19 min-width: 160px; 22 min-width: 160px;
@@ -33,12 +36,16 @@ @@ -33,12 +36,16 @@
33 } 36 }
34 37
35 .guess-tab-active { 38 .guess-tab-active {
36 - height: 4px; 39 + margin-top: -10px;
  40 + height: 2px;
37 width: 70%; 41 width: 70%;
38 background-color: #222; 42 background-color: #222;
39 } 43 }
40 44
41 - .wapper::-webkit-scrollbar { width: 0 !important; } 45 + .wapper::-webkit-scrollbar {
  46 + width: 0 !important;
  47 + display: none;
  48 + }
42 } 49 }
43 50
44 .guess-like.float { 51 .guess-like.float {