Authored by huangyCode
Committed by shuaiguo

列表上报获取高度修改,品牌图片修改,列表切换tab参数修改

... ... @@ -34,6 +34,7 @@ export default {
data: function() {
return {
yasFirstId: 0,
itemHeight: 0
};
},
methods: {
... ... @@ -59,14 +60,23 @@ export default {
});
},
yasShowEvent: function(height) {
if (!this.itemHeight) {
let item = document.querySelector('.product-list-item');
this.itemHeight = item && item.offsetHeight || 0;
}
if (!this.itemHeight) {
return;
}
// 获取列表单个元素高度
let index = 0;
if (Number(height) > 0) {
// 获取第一个曝光元素
let item = document.querySelector('.product-list-item');
let itemHeight = item.offsetHeight;
let row = parseInt((height - 12) / itemHeight) + 1;
let row = parseInt((height - 12) / this.itemHeight) + 1;
index = row * 2 - 2;
}
... ...
... ... @@ -11,7 +11,7 @@
:class="filterParams.brand.includes(item.itemId) && 'item-img-selected'"
v-for="(item,i) in filter.itemList" :style="i===0 && 'margin-left:1rem'"
@click="select({filterId:filter.filterId, itemId:item.itemId, row})">
<ImgSize class="item-img" :src="item.itemUrl" :width="140" :height="70"/>
<img class="item-img" :src="(item.itemUrl || '').replace('http://', '//').replace('{width}', 140).replace('{height}', 70)" />
<div class="item-img-text">{{item.itemName}}</div>
</div>
<div class="item-text item-size" v-if="filter.filterId === 'size'" :style="i===0 && 'margin-left:1rem'"
... ...
... ... @@ -219,6 +219,10 @@ export default {
size: filterParams.size.join(','), // 尺码id
};
for (let i in params) {
!params[i] && delete params[i];
}
this.selectedType = flag;
if (flag === 1) {
this.setYasParam({tab: {index: 2, name: '价格'}});
... ...