微信分享
window.SaafJsSdk = {}
// msg {nativeType,data}
SaafJsSdk.postMessage = function (msg) {
window.postMessage(JSON.stringify(msg?msg:{}))
}
SaafJsSdk.WeChat = function (api,data) {
SaafJsSdk.postMessage({
nativeType: 'WeChat',
data:data,
api: api
})
}
|
// 分享朋友圈 |
|
| function shareToTimelineImage() { | |
| SaafJsSdk.WeChat('shareToTimeline',{ | |
| type: 'imageUrl', | |
| title: '分享', | |
| description: '分享描述', | |
| imageUrl: 'http://www.XXXX.com/web/template/themes/default/skins/images/logo.png' | |
| }) | |
| } | |
| function shareToTimelineNew() { | |
| SaafJsSdk.WeChat('shareToTimeline',{ | |
| title:'微信测试链接', | |
| description:'分享', | |
| thumbImage:'http://www.XXXX.com/web/template/themes/default/skins/images/logo.png', | |
| type:'news', | |
| webpageUrl:'http://www.XXXX.com' | |
| }) | |
| } | |
| function shareToSessionImage() { | |
| SaafJsSdk.WeChat('shareToSession',{ | |
| type: 'imageUrl', | |
| title: '分享', | |
| description: '分享描述', | |
| imageUrl: 'http://www.XXXX.com/web/template/themes/default/skins/images/logo.png' | |
| }) | |
| } | |
| function shareToSessionNew() { | |
| SaafJsSdk.WeChat('shareToSession',{ | |
| title:'微信测试链接', | |
| description:'分享描述', | |
| thumbImage:'http://www.XXXX.com/web/template/themes/default/skins/images/logo.png', | |
| type:'news', | |
| webpageUrl:'http://www.XXXX.com' | |
| }) | |
| } |

浙公网安备 33010602011771号