Authored by TaoHuang

feat(second): add report

... ... @@ -211,6 +211,20 @@ export default {
type: 4
};
}
case 'second': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 5
};
}
case 'newSecond': {
return {
pay: 'XY_UFO_SALE_PAY',
result: 'XY_UFO_SALE_PAY_RES',
type: 6
};
}
default: {
// PASS
return {
... ...
... ... @@ -80,7 +80,8 @@ export default {
colorName: get(state.second.info, 'colorName', ''),
sizeName: get(state.second.info, 'sizeName', ''),
goodPrice: get(state.second.info, 'price', ''),
skup: this.skup
skup: this.skup,
type: get(state.second.info, 'sechondHandTypeName', '') === '二手' ? 5 : 6,
};
} else {
return {
... ... @@ -235,7 +236,7 @@ export default {
desc: '金额',
extra: JSON.stringify({
type: UserType.buy,
reportType: 'buy',
reportType: this.getType(this.productDetail.type),
back: {
name: 'buyOrderDetail',
params: {
... ... @@ -257,14 +258,24 @@ export default {
}).show();
//数据埋点
this.reportYas('XY_UFO_SC_ORD', {
ORD_NUM: result.data.orderCode,
PRD_ID: this.productId,
PRD_SKU: this.productDetail.skup,
PRD_SIZE: this.productDetail.sizeName,
ORD_AMOUNT: this.orderDetail.amount,
PRD_PRICE: this.productDetail.goodPrice,
});
if (this.productDetail.type) {
// 二手
this.reportYas('XY_UFO_RESALE_ORD', {
ORD_NUM: result.data.orderCode,
PRD_ID: this.productId,
PRD_SKU: this.productDetail.skup,
ORD_TYPE: this.productDetail.type
});
} else {
this.reportYas('XY_UFO_SC_ORD', {
ORD_NUM: result.data.orderCode,
PRD_ID: this.productId,
PRD_SKU: this.productDetail.skup,
PRD_SIZE: this.productDetail.sizeName,
ORD_AMOUNT: this.orderDetail.amount,
PRD_PRICE: this.productDetail.goodPrice,
});
}
},
onClose(orderCode) {
this.$router.replace({
... ... @@ -329,6 +340,16 @@ export default {
param: params
}
});
},
getType(type) {
switch (type) {
case 5:
return 'second';
case 6:
return 'newSecond';
default:
return 'buy';
}
}
}
};
... ...
... ... @@ -307,6 +307,18 @@ export default {
const { data: count } = await this.fetchStorageCount({ storageId });
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_DT_BUY_SEL_C',
param: {
PRD_ID: this.product.product_id,
PRD_SKU: get(this.selectedSize, 'second_hand_skup', 0),
PRD_SIZE: get(this.selectedSize, 'size_id', 0),
ORD_TYPE: 5,
},
},
});
if (count === 1) {
// 跳转详情
this.$router.push({
... ...
... ... @@ -141,6 +141,18 @@ export default {
skup: this.skup
}
});
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_SECOND_PRD_DT_BUY_C',
param: {
PRD_ID: this.info.productId,
PRD_SKU: this.skup,
PRD_SIZE: this.info.size_name,
ORD_TYPE: this.info.sechondHandTypeName === '二手' ? 5 : 6,
},
},
});
}
},
computed: {
... ...
... ... @@ -70,6 +70,7 @@ module.exports = (req, res, next) => {
axios.post('https://analytics.m.yohobuy.com/yas_mobile', data, {
headers: {
referer: 'https://xianyu.yohobuy.com/',
'content-type': 'application/x-www-form-urlencoded'
}
});
... ...