Authored by huzhiming

feat(活动模版): 添加分享数据埋点代码 reviewed by tao.huang

{
"name": "yohobuywap-node-activity",
"version": "6.10.0-beta02",
"version": "6.10.0-beta03",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -1261,7 +1261,36 @@ function setXianyuShareInfo() {
text: '' // 分享描述
};
XianyuJSBridge.setNavRightItem(parames);
let yasReportHandler = {
// [数据上报]@hooks: 拉起分享弹窗触发
XY_SHARE_H5: () => {
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_SHARE_H5',
param: {
FROM: 'h5',
SHARE_URL: location.href
}
}
});
},
// [数据上报]@hooks: 点击对应分享平台触发
XY_SHARE_TYPE: (data) => {
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_SHARE_TYPE',
param: {
FROM: 'h5',
SHARE_TYPE: data.pluginKey,
SHARE_URL: location.href
}
}
});
}
};
XianyuJSBridge.setNavRightItem(parames, yasReportHandler);
}
}, 1000);
}
... ...
... ... @@ -28,11 +28,11 @@ const XianyuJSBridge = {
},
// 导航栏右侧自定义按钮 设为可见
setNavRightItem (shareParam = null) {
setNavRightItem (shareParam = null, handler) {
console.log('setNavRightItem', shareParam);
window._xianyuShare = () => {
this.setXianyuShare(shareParam);
this.setXianyuShare(shareParam, handler);
}
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'setNavigatorRightItem', {
... ... @@ -61,11 +61,14 @@ const XianyuJSBridge = {
link: '//xianyu.yohobuy.com/xianyu/index/channel?wxIsAvailable', // 和url保持
title: '闲鱼潮品首页', // 分享标题
text: '' // 分享描述
}) {
}, { XY_SHARE_H5, XY_SHARE_TYPE }) {
if (this.isAliApp && window.WindVane) {
XY_SHARE_H5.call(this);
window.WindVane.call('WVIdleFishApi', 'showShareMenu', param, (data) => {
console.log('success:', JSON.stringify(data), typeof data.isCancel);
// if (data.isCancel === 'false') {}
if (data.isCancel === 'false') {
XY_SHARE_TYPE.call(this, data);
}
}, function(e) {
console.log('fail:', JSON.stringify(e));
});
... ...