设为首页 加入收藏

TOP

微信分享功能实现
2017-10-12 10:01:32 】 浏览:5454
Tags:分享 功能 实现

 

使用微信插件  

cordova plugin add cordova-plugin-wechat --variable wechatappid=YOUR_WECHAT_APPID;

 

$scope.sharechat=function(scene,title, desc, url, thumb){
// console.log(scene);
Wechat.share({
message: {
title: "你所不知道的",
description: "This is description",
thumb: "https://www.cppentry.com/upload_files/article/98/1_dnoym__.jpg",
// url: url ?url : "http://baidu.com"
media: {
type: Wechat.Type.WEBPAGE,
webpageUrl: "http://www.cnblogs.com/gongdy/"
}
},
scene:scene // share to Timeline
}, function () {
alert("Success");
}, function (reason) {
alert("Failed: " + reason);
});
};
$scope.shareLink = function(title, desc, url, thumb){
var hideSheet = $ionicActionSheet.show({
buttons:[{
'text':'分享给好友'},
{'text':'分享到朋友圈'}],
cancelText: '取消',
buttonClicked: function(index) {
if(index == 0) {
$scope.sharechat(0,title, desc, url, thumb);
} else if(index == 1) {
$scope.sharechat(1,title, desc, url, thumb);
}
// return true;
}

});
$timeout(function() {
hideSheet();
}, 2000);
};

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇CAR_TUNE_VALUE 校準 下一篇微信分享功能实现

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目