<repo_name>webrenee7/col-activityshare<file_sep>/README.md
## 使用方法
- 加入以下代码
```html
<!--分享标题-->
<input class="actitle" type="hidden" value="分享标题" />
<!--分享描述-->
<input class="actsummary" type="hidden" value="分享描述！" />
<!--分享图标-->
<input class="actlink" type="hidden" value="http://image.kuaikuaidai.com/h5/static/images/lendimgwx.png" />
<!--分享链接地址-->
<input class="linkpage" type="hidden" value="" />
<!--以下隐藏域的值都是从后台代入的-->
<input id="appId" name="appId" type="hidden" value="${appId}"/>
<input id="timestamp" name="timestamp" type="hidden" value="${timestamp}"/>
<input id="nonceStr" name="nonceStr" type="hidden" value="${nonceStr}"/>
<input id="signature" name="signature" type="hidden" value="${signature}"/>
```

- 引入js
```javascript
<script src="../projectusual/static/js/activityshare.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/qzact/common/share/share.js"></script>
```

## 微信分享敏感词汇
目前发现的：
红包、现金、现金红包、福利

之后再做补充

<file_sep>/js/activityshare.js
$(document).ready(function() {
    var actitle = $(".actitle").val();
    var actsummary = $(".actsummary").val();
    var actlink = $(".actlink").val();
    var linkpage = $(".linkpage").val();
    var appId = $("#appId").val();
    var timestamp = $("#timestamp").val();
    var nonceStr = $("#nonceStr").val();
    var signature = $("#signature").val();
    wx.config({
        debug: false,
        appId: appId,
        timestamp: timestamp,
        nonceStr: nonceStr,
        signature: signature,
        jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareWeibo", "onMenuShareQZone"]
    });
    wx.ready(function() {
        wx.onMenuShareTimeline({
            title: actitle,
            link: linkpage,
            imgUrl: actlink,
            success: function() {},
            cancel: function() {}
        });
        wx.onMenuShareAppMessage({
            title: actitle,
            desc: actsummary,
            link: linkpage,
            imgUrl: actlink,
            type: "",
            dataUrl: "",
            success: function() {},
            cancel: function() {}
        });
        wx.onMenuShareQQ({
            title: actitle,
            desc: actsummary,
            link: linkpage,
            imgUrl: actlink,
            success: function() {},
            cancel: function() {}
        });
        wx.onMenuShareWeibo({
            title: actitle,
            desc: actsummary,
            link: linkpage,
            imgUrl: actlink,
            success: function() {},
            cancel: function() {}
        });
        wx.onMenuShareQZone({
            title: actitle,
            desc: actsummary,
            link: linkpage,
            imgUrl: actlink,
            success: function() {},
            cancel: function() {}
        })
    });
    wx.error(function(res) {});
    setShareInfo({
        title: actitle,
        summary: actsummary,
        pic: actlink,
        url: linkpage,
        WXconfig: {
            swapTitleInWX: true,
            appId: appId,
            timestamp: timestamp,
            nonceStr: nonceStr,
            signature: signature
        }
    });
});




