|
var qq = api.require('qq');
if(type=='QZone'){
$thb='core2x/ui/images/icon/nyappicon.png';
}else{
$thb='core2x/ui/images/icon/appicon.png';
}
qq.installed(function(ret,err){
if(ret.status){
var imgUrl = "widget://"+$thb;
if(type == 'QZone'){
//分享qq空间,那么只支持网络图片地址
imgUrl = "https://agz**.**/love_share/img/share.png";
}
qq.shareNews({
url:pageParam.url,
title:pageParam.title,
description:pageParam.description,
imgUrl:imgUrl,
type:type
},function (ret,err){
if(ret.status){
api.toast({
msg:'分享成功'
});
api.closeFrame({});
}else{
api.toast({
msg:'分享失败'
});
api.closeFrame({});
}
api.sendEvent({
name : pageParam.event || 'UIShareEvent',
extra : {
status : ret.status
}
});
});
}else{
api.alert({msg: "没有安装qq客户端"});
}
}); |
|