|
[插件使用]
谁有关于微信分享的完整代码,分享一下,我的总是出问题
[复制链接]
本帖最后由 dubin061 于 2015-11-24 11:45 编辑
我在微信开发者平台上已经申请到appkey了,但用文档的代码做的时候总是出问题,谁有完整的微信分享的代码麻烦分享一下,我可以参考一下,谢谢了打开闪退
我的代码:
function wx(){
var wx = api.require('wx');
wx.isInstalled(function(ret, err) {
if (ret.installed) {
//分享网页
wx.shareWebpage({
apiKey: 'wx78c6c259a040fd6b',
scene: 'timeline',
title: '测试标题',
description: '分享内容的描述',
thumb: 'widget://res/1.1.4datu.jpg',
contentUrl: 'http://apicloud.com'
}, function(ret, err){
if(ret.status){
alert('分享成功');
}else{
alert(err.code);
}
});
} else {
alert('当前设备未安装微信客户端');
}
});
}
|
|