提交 a0fd8fe1 编写于 作者: M mehaotian

fix(stat): 修复发行打包后,小程序端默认开启分享的bug #792

上级 4ab37763
......@@ -836,7 +836,15 @@ const lifecycle = {
stat.ready(this);
},
onLoad(options) {
stat.load(options, this);
stat.load(options, this);
// 重写分享,获取分享上报事件
if (this.$scope && this.$scope.onShareAppMessage) {
let oldShareAppMessage = this.$scope.onShareAppMessage;
this.$scope.onShareAppMessage = function(options) {
stat.interceptShare(false);
return oldShareAppMessage.call(this, options)
};
}
},
onShow() {
isHide = false;
......@@ -855,9 +863,6 @@ const lifecycle = {
},
onError(e) {
stat.error(e);
},
onShareAppMessage() {
stat.interceptShare(false);
}
};
......
......@@ -9,7 +9,15 @@ const lifecycle = {
stat.ready(this);
},
onLoad(options) {
stat.load(options, this);
stat.load(options, this);
// 重写分享,获取分享上报事件
if (this.$scope && this.$scope.onShareAppMessage) {
let oldShareAppMessage = this.$scope.onShareAppMessage;
this.$scope.onShareAppMessage = function(options) {
stat.interceptShare(false);
return oldShareAppMessage.call(this, options)
}
}
},
onShow() {
isHide = false
......@@ -28,9 +36,6 @@ const lifecycle = {
},
onError(e) {
stat.error(e)
},
onShareAppMessage() {
stat.interceptShare(false)
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册