...
|
...
|
@@ -6,8 +6,8 @@ |
|
|
<div class="item-bottom">
|
|
|
<div class="item-price">
|
|
|
<span>{{product.skup_price && '¥'}}</span><span>{{product.skup_price || ' '}}</span>
|
|
|
<div v-if="product.pre_sale_flag" class="sale_flag">
|
|
|
<p>{{product.pre_sale_flag === 5 ? '全新瑕疵' : '二手'}}</p>
|
|
|
<div v-if="product.secondhandTypeName" class="sale_flag">
|
|
|
<p>{{product.secondhandTypeName}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="size-flag">{{product.size_name}}码</div>
|
...
|
...
|
@@ -21,21 +21,92 @@ import ImgSize from '../../../components/img-size'; |
|
|
|
|
|
export default {
|
|
|
props: {
|
|
|
list: Array
|
|
|
list: Array,
|
|
|
yasParams: Object,
|
|
|
yasEventName: {
|
|
|
type: String,
|
|
|
default: 'XY_UFO_PRD_LIST_C'
|
|
|
},
|
|
|
},
|
|
|
components: {
|
|
|
ImgSize,
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
|
|
yasFirstId: 0,
|
|
|
itemHeight: 0
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
goDetail(product, index) {
|
|
|
if (this.yasParams && Object.keys(this.yasParams).length) {
|
|
|
this.yasDetail(product.id, index);
|
|
|
}
|
|
|
|
|
|
this.$router.push({
|
|
|
name: 'SecondProductDetail',
|
|
|
params: {
|
|
|
skup: product.skup
|
|
|
skup: product.skup,
|
|
|
yasParams: this.yasParams,
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
yasShowEvent: function(height) {
|
|
|
if (!this.itemHeight) {
|
|
|
let item = document.querySelector('.second-list-item');
|
|
|
|
|
|
this.itemHeight = item && item.offsetHeight || 0;
|
|
|
}
|
|
|
|
|
|
if (!this.itemHeight) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 获取列表单个元素高度
|
|
|
let index = 0;
|
|
|
|
|
|
if (Number(height) > 0) {
|
|
|
// 获取第一个曝光元素
|
|
|
|
|
|
let row = parseInt((height - 12) / this.itemHeight) + 1;
|
|
|
|
|
|
index = row * 2 - 2;
|
|
|
}
|
|
|
|
|
|
// 获取曝光列表
|
|
|
let list = [];
|
|
|
|
|
|
for (let i = 0; i < 6; i++) {
|
|
|
if (this.list[i + index]) {
|
|
|
list.push(this.list[i + index]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 判断是否是重复曝光
|
|
|
if (list.length && list[0].id !== this.yasFirstId) {
|
|
|
this.yasFirstId = list[0].id;
|
|
|
let DATA = [];
|
|
|
|
|
|
list.map((value, i) => {
|
|
|
const prdType = value.pre_sale_flag === 5 ? 2 : 1; //flag=5全新瑕疵,6二手
|
|
|
DATA.push({...this.yasParams, I_INDEX: i + index + 1, PRD_ID: value.product_id, PRD_TYPE: prdType});
|
|
|
});
|
|
|
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
param: {DATA},
|
|
|
appop: 'XY_UFO_SHOW_EVENT'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
|
|
yasDetail(id, index) {
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
param: {...this.yasParams, I_INDEX: index + 1, PRD_ID: id },
|
|
|
appop: this.yasEventName
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -88,7 +159,8 @@ export default { |
|
|
|
|
|
p {
|
|
|
color: #fff;
|
|
|
font-size: 9px;
|
|
|
line-height: 30px;
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|