Authored by huzhiming

feat(second):添加详情页数据埋点 reviewed by tao.huang

... ... @@ -179,8 +179,10 @@ export default {
* @ version: v1.0.0
*/
submit() {
this.$emit('submit', this.selected);
this.$emit('update:visible', !this.visible);
if (Object.keys(this.selected).length!==0) {
this.$emit('update:visible', !this.visible);
this.$emit('submit', this.selected);
}
}
// yas (param) {
... ...
... ... @@ -14,10 +14,10 @@
<div class="filter">
<div class="filter-tab">
<div class="tab-item" :class="{'selected-tab': queryOptions.sort==null}"
@click="handleSortChange({ type: 'tuijian', sort: null})"
@click.stop="handleSortChange({ type: 'tuijian', sort: null})"
>推荐</div>
<div class="tab-item middle"
@click="handleSortChange({ type: 'price', sort: null })"
@click.stop="handleSortChange({ type: 'price', sort: null })"
>
<span :class="{'selected-tab': queryOptions.sort!=null}">价格</span>
<div class="price-arrow"
... ... @@ -29,7 +29,7 @@
</div>
</div>
<div class="middle">
<div class="screen middle" @click="filterModalVisible=true">
<div class="screen middle" @click="handleSortChange({ type: 'shaixuan', sort: null});filterModalVisible=true">
<div class="screen-img"></div>
筛选
</div>
... ... @@ -76,6 +76,7 @@ export default {
return {
filterModalVisible: false, // 筛选modal控件 显示/隐藏
currentTab: null,
queryOptions: {
second_type: null, // 种类排序:5:全新瑕疵 6:二手
sort: null // 价格升降序:p_asc or p_desc
... ... @@ -125,7 +126,8 @@ export default {
* @ version: v1.0.0
*/
handleSortChange({ type= null, sort = null }){
if (type===null) return false;
if (type===null || this.currentTab===type) return false;
this.currentTab = type; // tab锁,防止重复点击
let queryOptions = this.queryOptions
... ... @@ -133,11 +135,9 @@ export default {
queryOptions.sort = null
}
if (type==='price') {
queryOptions.sort = (queryOptions.sort===''||queryOptions.sort==='p_asc')?'p_desc':'p_asc'
// queryOptions.second_type = sort;
queryOptions.sort = (queryOptions.sort===null||queryOptions.sort==='p_asc')?'p_desc':'p_asc'
}
if (type==='shaixuan') {
if (type==='shaixuanConfirm') {
queryOptions.second_type = sort;
}
... ... @@ -153,29 +153,82 @@ export default {
二手商品列表页-顶部TAB切换按钮点击
新增二手、全新瑕疵商品列表页TAB点击:
1.P_NAME:页面名称,XY_UFO...
2.TYPE_ID:列表页入口类型,1-搜索结果页,2-系列,3-品牌,4-商品池;
2.TYPE_ID:列表页入口类型,1-搜索结果页,2-系列,3-品牌,4-商品池 5-商品详情
3.P_PARAM:条件值,搜索关键词,系列ID,品牌ID,商品池ID;
4.TAB_IreportYasD:tab切id,1-人气,2-价格,3-新品,4-筛选;5-推荐
4.TAB_ID:tab切id,1-人气,2-价格,3-新品,4-筛选;5-推荐
5.TAB_NAME:tab切名称,人气,价格,新品,筛选;推荐
*/
// TODO:zhiming 调整数据上报传参,与徐兰沟通
// this.$store.dispatch('reportYas', {
// params: {
// appop: 'XY_UFO_PRD_LIST_TAB_C',
// param:{
// P_NAME: `XY_UFO${this.$route.name}`,
// TYPE_ID: '商品详情页选尺码进二手',
// P_PARAM: `second_type=${queryOptions.second_type},sort=${queryOptions.sort},storage_id=${this.storage_id},productId=${this.$route.query.pid}`,
// TAB_ID: type,
// TAB_NAME: type,
// },
// }
// });
let yasParam = {
TAB_ID: null,
TAB_NAME: null,
}
switch (type) {
case 'price':
yasParam.TAB_ID = 2
yasParam.TAB_NAME = '价格'
break;
case 'shaixuan':
yasParam.TAB_ID = 4
yasParam.TAB_NAME = '筛选'
break;
default:
yasParam.TAB_ID = 5
yasParam.TAB_NAME = '推荐'
break;
}
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_LIST_TAB_C',
param:{
P_NAME: `XY_UFO${this.$route.name}`,
TYPE_ID: 5,
P_PARAM: this.$route.query.pid,
...yasParam
},
}
});
},
handleFilterSubmit(selected) {
const { second_type } = selected;
// console.log('hooks@selected', selected);
this.handleSortChange({ type: 'shaixuan', sort: second_type })
/*
新增二手、全新瑕疵商品列表页筛选点击:
1.TYPE_ID:列表类型,1-搜索结果页,2-系列,3-品牌,4-商品池;5-商品详情;
2.P_PARAM:条件值,搜索关键词,系列ID,品牌ID,商品池ID;
3.TAB_ID:tab切id,1-人气,2-价格,3-新品 4-筛选;5-推荐;
4.TAB_NAME:tab切名称,人气,价格,新品;
5.ENT_PARAMS:选中条件的集合,包含ENT_KEY,ENT_ID两个参数;
6.ENT_NAME:筛选条件的名称
7.ENT_ID:筛选条件的值;
*/
let yasParam = {
// P_NAME: `XY_UFO${this.$route.name}`,
TYPE_ID: 5,
P_PARAM: this.$route.query.pid,
TAB_ID: null,
TAB_NAME: null,
ENT_PARAMS: { 'second_type': second_type },
ENT_NAME: 'second_type',
ENT_ID: second_type,
}
if (this.queryOptions.sort===null) {
yasParam.TAB_ID = 5
yasParam.TAB_NAME = '推荐'
} else {
yasParam.TAB_ID = 2
yasParam.TAB_NAME = '价格'
}
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_LIST_SCREEN_C',
param: {...yasParam},
}
});
this.handleSortChange({ type: 'shaixuanConfirm', sort: second_type })
},
},
computed: {
... ...
... ... @@ -39,7 +39,7 @@ export default {
...item,
secondhand_image: item.image,
skup_price: item.price,
sechondHandTypeName: item.sechondHandTypeName,
secondhandTypeName: item.sechondHandTypeName, // 修复字段单词拼写错误
size_name: item.sizeName.replace('码', '')
}));
... ...