Showing
4 changed files
with
31 additions
and
11 deletions
@@ -8490,7 +8490,8 @@ var $subNav = $('.home-sub-nav'), | @@ -8490,7 +8490,8 @@ var $subNav = $('.home-sub-nav'), | ||
8490 | $pgc = $($goodsChildren.get(1)), | 8490 | $pgc = $($goodsChildren.get(1)), |
8491 | $dgc = $($goodsChildren.get(2)), | 8491 | $dgc = $($goodsChildren.get(2)), |
8492 | shopId = $('input[name="shop_id"]').val(), | 8492 | shopId = $('input[name="shop_id"]').val(), |
8493 | - appVersion = $('input[name="app_version"]').val(); | 8493 | + appVersion = $('input[name="app_version"]').val(), |
8494 | + brand = $('input[name="brand"]').val(); | ||
8494 | 8495 | ||
8495 | var winH = $(window).height(), | 8496 | var winH = $(window).height(), |
8496 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; | 8497 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; |
@@ -8602,6 +8603,16 @@ function getPageGoods(info) { | @@ -8602,6 +8603,16 @@ function getPageGoods(info) { | ||
8602 | }); | 8603 | }); |
8603 | } | 8604 | } |
8604 | 8605 | ||
8606 | +function getParam(req) { | ||
8607 | + if (shopId) { | ||
8608 | + req.data.shop_id = shopId; | ||
8609 | + } | ||
8610 | + | ||
8611 | + if (brand) { | ||
8612 | + req.data.brand = brand; | ||
8613 | + } | ||
8614 | +} | ||
8615 | + | ||
8605 | function newData(callback) { | 8616 | function newData(callback) { |
8606 | var req = {}; | 8617 | var req = {}; |
8607 | 8618 | ||
@@ -8609,9 +8620,11 @@ function newData(callback) { | @@ -8609,9 +8620,11 @@ function newData(callback) { | ||
8609 | req.data = { | 8620 | req.data = { |
8610 | type: 'newest', | 8621 | type: 'newest', |
8611 | order: '1', | 8622 | order: '1', |
8612 | - page: navInfo.new.page, | ||
8613 | - shop_id: shopId | 8623 | + page: navInfo.new.page |
8614 | }; | 8624 | }; |
8625 | + | ||
8626 | + getParam(req); | ||
8627 | + | ||
8615 | req.callBack = function(data) { | 8628 | req.callBack = function(data) { |
8616 | $('#new-arrival').append(data); | 8629 | $('#new-arrival').append(data); |
8617 | navInfo.new.page++; | 8630 | navInfo.new.page++; |
@@ -8631,9 +8644,11 @@ function hotData(callback) { | @@ -8631,9 +8644,11 @@ function hotData(callback) { | ||
8631 | req.data = { | 8644 | req.data = { |
8632 | type: 'hot', | 8645 | type: 'hot', |
8633 | order: '1', | 8646 | order: '1', |
8634 | - page: navInfo.hot.page, | ||
8635 | - shop_id: shopId | 8647 | + page: navInfo.hot.page |
8636 | }; | 8648 | }; |
8649 | + | ||
8650 | + getParam(req); | ||
8651 | + | ||
8637 | req.callBack = function(data) { | 8652 | req.callBack = function(data) { |
8638 | $('#popularity').append(data); | 8653 | $('#popularity').append(data); |
8639 | navInfo.hot.page++; | 8654 | navInfo.hot.page++; |
@@ -8773,15 +8788,15 @@ myScroll.on('scroll', function() { | @@ -8773,15 +8788,15 @@ myScroll.on('scroll', function() { | ||
8773 | } | 8788 | } |
8774 | 8789 | ||
8775 | if (sTop < scH) { | 8790 | if (sTop < scH) { |
8776 | - if (!$nav2.hasClass('fixed-top')) { | ||
8777 | - $nav2.addClass('fixed-top') | ||
8778 | - .removeClass('absolute') | ||
8779 | - .css({ | 8791 | + if (!$nav2.hasClass('absolute')) { |
8792 | + $nav2.addClass('absolute') | ||
8793 | + .removeClass('fixed-top'); | ||
8794 | + } | ||
8795 | + $nav2.css({ | ||
8780 | transform: 'translate(0, ' + (-scH) + 'px)' | 8796 | transform: 'translate(0, ' + (-scH) + 'px)' |
8781 | }); | 8797 | }); |
8782 | } | 8798 | } |
8783 | } | 8799 | } |
8784 | - } | ||
8785 | $('#scroller').trigger('scroll'); | 8800 | $('#scroller').trigger('scroll'); |
8786 | }); | 8801 | }); |
8787 | 8802 | ||
@@ -8904,6 +8919,7 @@ function search(opt) { | @@ -8904,6 +8919,7 @@ function search(opt) { | ||
8904 | page: page | 8919 | page: page |
8905 | }); | 8920 | }); |
8906 | 8921 | ||
8922 | + | ||
8907 | searching = true; | 8923 | searching = true; |
8908 | loading.showLoadingMask(); | 8924 | loading.showLoadingMask(); |
8909 | 8925 | ||
@@ -8971,7 +8987,8 @@ $.ajax({ | @@ -8971,7 +8987,8 @@ $.ajax({ | ||
8971 | type: 'GET', | 8987 | type: 'GET', |
8972 | url: '/search/filter', | 8988 | url: '/search/filter', |
8973 | data: { | 8989 | data: { |
8974 | - shop_id: shopId | 8990 | + shop_id: shopId, |
8991 | + brand: brand | ||
8975 | }, | 8992 | }, |
8976 | success: function(data) { | 8993 | success: function(data) { |
8977 | $goodsContainer.append(data); | 8994 | $goodsContainer.append(data); |
@@ -9117,6 +9134,7 @@ $subNav.on('touchend touchcancel', function(e) { | @@ -9117,6 +9134,7 @@ $subNav.on('touchend touchcancel', function(e) { | ||
9117 | search({ | 9134 | search({ |
9118 | type: 'shop_id', | 9135 | type: 'shop_id', |
9119 | id: shopId, | 9136 | id: shopId, |
9137 | + brand: brand, | ||
9120 | url: '/index/search/search', | 9138 | url: '/index/search/search', |
9121 | nextPage: false | 9139 | nextPage: false |
9122 | }); | 9140 | }); |
@@ -9137,6 +9155,7 @@ function scrollHandler() { | @@ -9137,6 +9155,7 @@ function scrollHandler() { | ||
9137 | search({ | 9155 | search({ |
9138 | type: 'shop_id', | 9156 | type: 'shop_id', |
9139 | id: shopId, | 9157 | id: shopId, |
9158 | + brand: brand, | ||
9140 | url: '/index/search/search', | 9159 | url: '/index/search/search', |
9141 | nextPage: true | 9160 | nextPage: true |
9142 | }); | 9161 | }); |
@@ -9154,6 +9173,7 @@ $(window).scroll(function() { | @@ -9154,6 +9173,7 @@ $(window).scroll(function() { | ||
9154 | search({ | 9173 | search({ |
9155 | type: 'shop_id', | 9174 | type: 'shop_id', |
9156 | id: shopId, | 9175 | id: shopId, |
9176 | + brand: brand, | ||
9157 | url: '/index/search/search', | 9177 | url: '/index/search/search', |
9158 | nextPage: false | 9178 | nextPage: false |
9159 | }); | 9179 | }); |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
-
Please register or login to post a comment