...
|
...
|
@@ -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;
|
|
|
}
|
...
|
...
|
|