Merge branch 'release/newSearch'
Showing
4 changed files
with
29 additions
and
3 deletions
@@ -748,14 +748,28 @@ const getShopCategory = (params) => { | @@ -748,14 +748,28 @@ const getShopCategory = (params) => { | ||
748 | _.forEach(value.sub, (subValue, subKey) => { | 748 | _.forEach(value.sub, (subValue, subKey) => { |
749 | value.sub[subKey].url = helpers.urlFormat('/product/search/list', { | 749 | value.sub[subKey].url = helpers.urlFormat('/product/search/list', { |
750 | shop_id: params.shopId, | 750 | shop_id: params.shopId, |
751 | - sort: _.get(value, 'relation_parameter.sort', ''), | 751 | + sort: _.get(subValue, 'relation_parameter.sort', ''), |
752 | title: subValue.category_name, | 752 | title: subValue.category_name, |
753 | query: subValue.category_name | 753 | query: subValue.category_name |
754 | }); | 754 | }); |
755 | }); | 755 | }); |
756 | 756 | ||
757 | + let subCategory = [ | ||
758 | + { | ||
759 | + category_name: '全部' + value.category_name, | ||
760 | + url: helpers.urlFormat('/product/search/list', { | ||
761 | + shop_id: params.shopId, | ||
762 | + sort: _.get(value, 'relation_parameter.sort', ''), | ||
763 | + title: '全部' + value.category_name, | ||
764 | + query: value.category_name | ||
765 | + }) | ||
766 | + } | ||
767 | + ]; | ||
768 | + | ||
769 | + subCategory = subCategory.concat(value.sub); | ||
770 | + | ||
757 | finalResult.category.push({ | 771 | finalResult.category.push({ |
758 | - subcategory: value.sub | 772 | + subcategory: subCategory |
759 | }); | 773 | }); |
760 | }); | 774 | }); |
761 | 775 |
@@ -58,6 +58,12 @@ $categoryContainer.on('touchend', function(e) { | @@ -58,6 +58,12 @@ $categoryContainer.on('touchend', function(e) { | ||
58 | $cur, index; | 58 | $cur, index; |
59 | 59 | ||
60 | $cur = $this.closest('.p-level-item'); | 60 | $cur = $this.closest('.p-level-item'); |
61 | + | ||
62 | + // 第一次单击右则空白处,出现冒泡 | ||
63 | + if ($(e.target).closest('.sub-level').length <= 0) { | ||
64 | + e.preventDefault(); | ||
65 | + } | ||
66 | + | ||
61 | if ($cur.length > 0) { | 67 | if ($cur.length > 0) { |
62 | index = $cur.index(); | 68 | index = $cur.index(); |
63 | $subLevel = $this.closest('.content').find('.sub-level'); | 69 | $subLevel = $this.closest('.content').find('.sub-level'); |
@@ -135,7 +135,8 @@ function initFilter(opt) { | @@ -135,7 +135,8 @@ function initFilter(opt) { | ||
135 | var $this = $(e.target), | 135 | var $this = $(e.target), |
136 | $cur; | 136 | $cur; |
137 | 137 | ||
138 | - // e.preventDefault();//防止透点 | 138 | + //这行不能注释,iphone下会出现穿透 |
139 | + e.preventDefault();//防止透点 | ||
139 | 140 | ||
140 | if ($this.closest('.filter-body').length > 0) { | 141 | if ($this.closest('.filter-body').length > 0) { |
141 | $cur = $this.closest('.sub-item'); | 142 | $cur = $this.closest('.sub-item'); |
@@ -34,6 +34,11 @@ $categoryContainer.on('touchend', function(e) { | @@ -34,6 +34,11 @@ $categoryContainer.on('touchend', function(e) { | ||
34 | 34 | ||
35 | $cur = $this.closest('.p-level-item'); | 35 | $cur = $this.closest('.p-level-item'); |
36 | 36 | ||
37 | + // 第一次单击右则空白处,出现冒泡 | ||
38 | + if ($(e.target).closest('.sub-level').length <= 0) { | ||
39 | + e.preventDefault(); | ||
40 | + } | ||
41 | + | ||
37 | $subLevelContainer = $this.closest('.content').find('.sub-level-container'); | 42 | $subLevelContainer = $this.closest('.content').find('.sub-level-container'); |
38 | $subLevelContainer.removeClass('hide'); | 43 | $subLevelContainer.removeClass('hide'); |
39 | 44 |
-
Please register or login to post a comment