Showing
3 changed files
with
16 additions
and
12 deletions
@@ -89,16 +89,18 @@ const handleBrandCheckedData = (params, origin) => { | @@ -89,16 +89,18 @@ const handleBrandCheckedData = (params, origin) => { | ||
89 | // 分拆品牌参数 | 89 | // 分拆品牌参数 |
90 | let brands = _.split(params.brand, ','); | 90 | let brands = _.split(params.brand, ','); |
91 | let intBrands = []; | 91 | let intBrands = []; |
92 | - let brandTotalName = ''; | ||
93 | 92 | ||
94 | _.forEach(brands, value => { | 93 | _.forEach(brands, value => { |
95 | intBrands.push(parseInt(value, 10)); | 94 | intBrands.push(parseInt(value, 10)); |
96 | }); | 95 | }); |
97 | 96 | ||
98 | - let checkedCount = 0; | 97 | + let checkedCount = 0, |
98 | + brandsTotalName = ''; | ||
99 | 99 | ||
100 | // 遍历品牌数据,如果在参数中,那么加 checked,将此数据加入到 checked 数组中 | 100 | // 遍历品牌数据,如果在参数中,那么加 checked,将此数据加入到 checked 数组中 |
101 | if (!_.isEmpty(origin)) { | 101 | if (!_.isEmpty(origin)) { |
102 | + | ||
103 | + brandsTotalName = _.map(origin, 'name').join('、'); | ||
102 | _.forEach(origin, (value) => { | 104 | _.forEach(origin, (value) => { |
103 | if (typeof _.find(intBrands, o => { | 105 | if (typeof _.find(intBrands, o => { |
104 | return _.isEqual(o, +value.id); | 106 | return _.isEqual(o, +value.id); |
@@ -139,10 +141,10 @@ const handleBrandCheckedData = (params, origin) => { | @@ -139,10 +141,10 @@ const handleBrandCheckedData = (params, origin) => { | ||
139 | 141 | ||
140 | // 建议保留,需要品牌可以单个删除时放开注释即可 | 142 | // 建议保留,需要品牌可以单个删除时放开注释即可 |
141 | // dest.push(checked); | 143 | // dest.push(checked); |
142 | - brandTotalName += checked.name + '、'; | ||
143 | - dest[0].totalName = brandTotalName; | 144 | + dest[0].totalName = brandsTotalName; |
144 | } | 145 | } |
145 | }); | 146 | }); |
147 | + | ||
146 | } | 148 | } |
147 | return dest; | 149 | return dest; |
148 | }; | 150 | }; |
@@ -43,6 +43,13 @@ var $saleReturn = $('#saleReturn'); | @@ -43,6 +43,13 @@ var $saleReturn = $('#saleReturn'); | ||
43 | 43 | ||
44 | var dialogTpl = require('hbs/product/coupon-dialog.hbs'); | 44 | var dialogTpl = require('hbs/product/coupon-dialog.hbs'); |
45 | 45 | ||
46 | +var $goodsIdArr = [], | ||
47 | + loadYas = {}; | ||
48 | + | ||
49 | +$('.recommend-slider .img-item .goods-id').each(function() { | ||
50 | + $goodsIdArr.push($(this).html()); | ||
51 | +}); | ||
52 | + | ||
46 | function productUrl(s) { | 53 | function productUrl(s) { |
47 | return window.location.href + '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"' + s + '"}}'; | 54 | return window.location.href + '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"' + s + '"}}'; |
48 | } | 55 | } |
@@ -1042,12 +1049,7 @@ function randomString(len) { | @@ -1042,12 +1049,7 @@ function randomString(len) { | ||
1042 | * 页面加载完 | 1049 | * 页面加载完 |
1043 | */ | 1050 | */ |
1044 | function initPageYas() { | 1051 | function initPageYas() { |
1045 | - var $goodsIdArr = [], | ||
1046 | - loadYas = {}; | ||
1047 | - | ||
1048 | - $('.recommend-slider .img-item .goods-id').each(function() { | ||
1049 | - $goodsIdArr.push($(this).html()); | ||
1050 | - }); | 1052 | + var loadYas = {}; |
1051 | 1053 | ||
1052 | loadYas = { | 1054 | loadYas = { |
1053 | REC_POSE: 100013, | 1055 | REC_POSE: 100013, |
@@ -44,7 +44,7 @@ lazyLoad($('img.lazy'), { | @@ -44,7 +44,7 @@ lazyLoad($('img.lazy'), { | ||
44 | }); | 44 | }); |
45 | qs = window.queryString(); | 45 | qs = window.queryString(); |
46 | commonParams = { | 46 | commonParams = { |
47 | - PAGE_NUM: qs.pager || 1, | 47 | + PAGE_NUM: qs.page || 1, |
48 | FILTER_VALUE: filterValue, | 48 | FILTER_VALUE: filterValue, |
49 | L1_SORT: $leftLi.length > 0 ? $leftLi.parent().prev().attr('title') : '', | 49 | L1_SORT: $leftLi.length > 0 ? $leftLi.parent().prev().attr('title') : '', |
50 | L2_SORT: $leftLi.find('a').attr('title') || '', | 50 | L2_SORT: $leftLi.find('a').attr('title') || '', |
@@ -97,7 +97,7 @@ $('.good-item-wrapper').click(function() { | @@ -97,7 +97,7 @@ $('.good-item-wrapper').click(function() { | ||
97 | var $this = $(this), | 97 | var $this = $(this), |
98 | proId = $this.find('.product-id').html(), | 98 | proId = $this.find('.product-id').html(), |
99 | aIndex = $this.attr('activeIndex'), | 99 | aIndex = $this.attr('activeIndex'), |
100 | - pageNum = qs.pager || 1, | 100 | + pageNum = qs.page || 1, |
101 | limit = qs.limit || 60, | 101 | limit = qs.limit || 60, |
102 | proNum = (parseInt(pageNum, 10) - 1) * limit + parseInt(aIndex, 10), | 102 | proNum = (parseInt(pageNum, 10) - 1) * limit + parseInt(aIndex, 10), |
103 | shelveTime = $this.find('.shelve-time').html(); | 103 | shelveTime = $this.find('.shelve-time').html(); |
-
Please register or login to post a comment