wx_share.html 1.1 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<h1>分享主题</h1>
<button data-mshare="0">点击弹出原生分享面板</button>
<button data-mshare="1">点击触发朋友圈分享</button>
<button data-mshare="2">点击触发发送给微信朋友</button>
</body>
</html>
<script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
<script src="__TMPL__/public/assets/js/mshare.js"></script>
<script>
    var mshare = new mShare({
        title: 'Lorem ipsum dolor sit.',
        url: 'http://m.ly.com',
        desc: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat inventore minima voluptates.',
        img: 'http://placehold.it/150x150'
    });
    $('button').click(function () {
        // 1 ==> 朋友圈  2 ==> 朋友  0 ==> 直接弹出原生
        mshare.init(+$(this).data('mshare'));
    });
</script>