From 4b32a2adabfb0e9e52acb9a5b7caf2bc969e3577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E6=98=BE=E6=96=87?= Date: Thu, 22 Nov 2018 17:35:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E7=AB=AF=E4=BD=BF=E7=94=A8onMenuShareWechat=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=AD=A3=E5=B8=B8=E4=BD=BF=E7=94=A8BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 虽然企业微信官方文档有该方法,但是代码中却没有相关代码段,开发项目刚好遇到,故增加该功能代码段,本人已测试通过 --- index.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d156394..e2e2d8f 100644 --- a/index.js +++ b/index.js @@ -147,6 +147,7 @@ var h = { config: "preVerifyJSAPI", onMenuShareTimeline: "menu:share:timeline", + onMenuShareWechat: "menu:share:wechat", onMenuShareAppMessage: "menu:share:appmessage", onMenuShareQQ: "menu:share:qq", onMenuShareWeibo: "menu:share:weiboApp", @@ -298,6 +299,22 @@ }, e) }, + onMenuShareWechat: function(e) { + t(h.onMenuShareWechat, { + complete: function() { + i("shareWechat", { + title: e.title || I, + desc: e.title || I, + img_url: e.imgUrl || "", + link: e.link || location.href, + type: e.type || "link", + data_url: e.dataUrl || "" + }, + e) + } + }, + e) + }, onMenuShareAppMessage: function(e) { t(h.onMenuShareAppMessage, { complete: function(n) { @@ -816,4 +833,4 @@ n && (e.wx = e.jWeixin = N), N } -}); \ No newline at end of file +});