微信分享自定义标题和图片的js

<script>
    document.addEventListener(‘WeixinJSBridgeReady‘, function onBridgeReady() {
    window.shareData = {
            "timeLineLink": "http://nianshao.uuzee.com/",
            "sendFriendLink": "http://nianshao.uuzee.com/",
            "weiboLink": "http://nianshao.uuzee.com/",
            "tTitle": "欢迎访问阳光灿烂的日子",
            "tContent": "往事总在忘却时被人提起,记忆里的阳光充斥着淡淡的干草的味道,我们在怀念中老去",
            "fTitle": "欢迎访问阳光灿烂的日子",
            "fContent": "往事总在忘却时被人提起,记忆里的阳光充斥着淡淡的干草的味道,我们在怀念中老去",
            "wContent": "往事总在忘却时被人提起,记忆里的阳光充斥着淡淡的干草的味道,我们在怀念中老去"
        };
        // 发送给好友
        WeixinJSBridge.on(‘menu:share:appmessage‘, function (argv) {
            WeixinJSBridge.invoke(‘sendAppMessage‘, {
                "img_url": "http://nianshao.uuzee.com/images/weiba.png",
                "img_width": "401",
                "img_height": "275",
                "link": window.shareData.sendFriendLink,
                "desc": window.shareData.fContent,
                "title": window.shareData.fTitle
            }, function (res) {
                _report(‘send_msg‘, res.err_msg);//回调
            })
        });
        // 分享到朋友圈
        WeixinJSBridge.on(‘menu:share:timeline‘, function (argv) {
            WeixinJSBridge.invoke(‘shareTimeline‘, {
                "img_url": "http://nianshao.uuzee.com/images/weiba.png",
                "img_width": "401",
                "img_height": "275",
                "link": window.shareData.timeLineLink,
                "desc": window.shareData.tContent,
                "title": window.shareData.tTitle
            }, function (res) {
                _report(‘timeline‘, res.err_msg);//回调
            });
        });
        // 分享到微博

    }, false)
</script>

 

微信分享自定义标题和图片的js,布布扣,bubuko.com

微信分享自定义标题和图片的js

上一篇:微信公开课上关于广告主10万粉丝要求的回应


下一篇:R 语言 因素分析(Factor Analysis, FA)