|
|
|
@ -203,6 +203,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx', func
|
|
|
|
|
console.log(response.data);
|
|
|
|
|
|
|
|
|
|
var tmptile = "动态";
|
|
|
|
|
var imgUrl = "";
|
|
|
|
|
|
|
|
|
|
if(response.data.data.title){
|
|
|
|
|
tmptile = response.data.data.title;
|
|
|
|
@ -212,43 +213,19 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx', func
|
|
|
|
|
|
|
|
|
|
if(response.data.data.user){
|
|
|
|
|
tmpname = response.data.data.user.realname;
|
|
|
|
|
imgUrl = response.data.data.user.img_url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(response.data.data.author){
|
|
|
|
|
tmpname = response.data.data.author.realname;
|
|
|
|
|
imgUrl = response.data.data.author.img_url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
imgUrl = window.g_localhost+imgUrl;
|
|
|
|
|
var desc = tmpname+":"+tmptile;
|
|
|
|
|
console.log("desc = "+desc);
|
|
|
|
|
wx.ready(function(){
|
|
|
|
|
wx.onMenuShareTimeline({
|
|
|
|
|
title: 'Trustie创新实践平台', // 分享标题
|
|
|
|
|
// link: 'http://www.trustie.net/', // 分享链接
|
|
|
|
|
imgUrl: 'http://www.trustie.net/images/logo2.png', // 分享图标
|
|
|
|
|
success: function () {
|
|
|
|
|
console.log("share successed.");
|
|
|
|
|
},
|
|
|
|
|
cancel: function () {
|
|
|
|
|
console.log("share canceled.");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
wx.onMenuShareAppMessage({
|
|
|
|
|
title: 'Trustie创新实践平台', // 分享标题
|
|
|
|
|
desc: desc, // 分享描述
|
|
|
|
|
// link: '', // 分享链接
|
|
|
|
|
// imgUrl: '', // 分享图标
|
|
|
|
|
imgUrl: 'http://www.trustie.net/images/logo2.png', // 分享图标
|
|
|
|
|
// type: '', // 分享类型,music、video或link,不填默认为link
|
|
|
|
|
// dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
|
|
|
|
|
success: function () {
|
|
|
|
|
// 用户确认分享后执行的回调函数
|
|
|
|
|
},
|
|
|
|
|
cancel: function () {
|
|
|
|
|
// 用户取消分享后执行的回调函数
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
console.log("imgUrl= "+imgUrl);
|
|
|
|
|
wxConfig(desc);
|
|
|
|
|
|
|
|
|
|
args.loadCallback(response.data);
|
|
|
|
|
}, function errorCallback(response) {
|
|
|
|
@ -352,7 +329,44 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx', func
|
|
|
|
|
|
|
|
|
|
args.scope.commentreply_path = config.rootPath+ 'templates/comment_reply.html';
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var wxConfig = function(desc,imgUrl){
|
|
|
|
|
|
|
|
|
|
if(imgUrl == null || imgUrl == ""){
|
|
|
|
|
imgUrl = 'http://www.trustie.net/images/logo2.png';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wx.ready(function(){
|
|
|
|
|
wx.onMenuShareTimeline({
|
|
|
|
|
title: 'Trustie创新实践平台', // 分享标题
|
|
|
|
|
// link: 'http://www.trustie.net/', // 分享链接
|
|
|
|
|
imgUrl: imgUrl, // 分享图标
|
|
|
|
|
success: function () {
|
|
|
|
|
console.log("share successed.");
|
|
|
|
|
},
|
|
|
|
|
cancel: function () {
|
|
|
|
|
console.log("share canceled.");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
wx.onMenuShareAppMessage({
|
|
|
|
|
title: 'Trustie创新实践平台', // 分享标题
|
|
|
|
|
desc: desc, // 分享描述
|
|
|
|
|
// link: '', // 分享链接
|
|
|
|
|
// imgUrl: '', // 分享图标
|
|
|
|
|
imgUrl: imgUrl, // 分享图标
|
|
|
|
|
// type: '', // 分享类型,music、video或link,不填默认为link
|
|
|
|
|
// dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
|
|
|
|
|
success: function () {
|
|
|
|
|
// 用户确认分享后执行的回调函数
|
|
|
|
|
},
|
|
|
|
|
cancel: function () {
|
|
|
|
|
// 用户取消分享后执行的回调函数
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {init: init, addCommonReply: addCommonReply, loadCommonData: loadCommonData, addCommonPraise: addCommonPraise, decreaseCommonPraise: decreaseCommonPraise};
|
|
|
|
|
return {init: init, addCommonReply: addCommonReply, loadCommonData: loadCommonData, addCommonPraise: addCommonPraise, decreaseCommonPraise: decreaseCommonPraise, wxConfig: wxConfig};
|
|
|
|
|
}]);
|
|
|
|
|