whlives
<script>
    document.addEventListener(\'WeixinJSBridgeReady\', function onBridgeReady() {
    window.shareData = {"sendFriendLink": "http://nianshao.uuzee.com/","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.sendFriendLink,
                "desc": window.shareData.fContent,
                "title": window.shareData.fTitle
            }, function (res) {
                _report(\'timeline\', res.err_msg);//回调
            });
        });
        // 分享到微博

    }, false)
</script>

 

分类:

技术点:

相关文章: