第一:在app.js中定义分享函数如下:
appShare: function() {
return {
title: "这里是我的标题",
path: "/pages/index/index",
imageUrl: "../../images/share.jpg",
success: function(a) {}
};
},在其他地方就可以通过getApp().appShare()调用了 ,具体代码如下:
onShareAppMessage: function() {
return getApp().appShare();
}如果本文对你有帮助,欢迎打赏本站

支付宝扫码打赏
微信扫码打赏
