diff --git a/app/api/mobile/entities/issue.rb b/app/api/mobile/entities/issue.rb index dc4fd0567..9cbeb3459 100644 --- a/app/api/mobile/entities/issue.rb +++ b/app/api/mobile/entities/issue.rb @@ -34,6 +34,8 @@ module Mobile 'Issue' when :act_id issue.id + when :title + issue.subject end end end @@ -43,6 +45,7 @@ module Mobile expose :description expose :author, using: Mobile::Entities::User expose :done_ratio + issue_expose :title issue_expose :act_type issue_expose :act_id issue_expose :created_on diff --git a/app/api/mobile/entities/message.rb b/app/api/mobile/entities/message.rb index 4571dedfe..07c560a1f 100644 --- a/app/api/mobile/entities/message.rb +++ b/app/api/mobile/entities/message.rb @@ -33,6 +33,8 @@ module Mobile when :comment_count all_comments = [] get_all_children(all_comments, u).count + when :title + u.subject end end end @@ -50,6 +52,7 @@ module Mobile message_expose :course_project_name message_expose :board_id message_expose :subject + message_expose :title message_expose :content message_expose :comment_count message_expose :praise_count diff --git a/app/api/mobile/entities/whomework.rb b/app/api/mobile/entities/whomework.rb index 7178ff67d..9d141552a 100644 --- a/app/api/mobile/entities/whomework.rb +++ b/app/api/mobile/entities/whomework.rb @@ -34,6 +34,8 @@ module Mobile 'HomeworkCommon' when :act_id wh.id + when :title + wh.name end end end @@ -59,6 +61,7 @@ module Mobile expose :quotes expose :is_open expose :id + whomework_expose :title whomework_expose :act_type whomework_expose :act_id whomework_expose :course_name diff --git a/public/javascripts/wechat/controllers/homework.js b/public/javascripts/wechat/controllers/homework.js index d1547a091..2898fc27f 100644 --- a/public/javascripts/wechat/controllers/homework.js +++ b/public/javascripts/wechat/controllers/homework.js @@ -12,7 +12,7 @@ app.controller('HomeworkController', ['$scope', '$http', '$routeParams', 'auth', replytype = data.type; page = data.page; - if (replytype == 0){f + if (replytype == 0){ if (page == 0){ $scope.homework = data.data; $scope.page = 0; diff --git a/public/javascripts/wechat/controllers/invite_code.js b/public/javascripts/wechat/controllers/invite_code.js index 5b144cafd..ad74ef5d1 100644 --- a/public/javascripts/wechat/controllers/invite_code.js +++ b/public/javascripts/wechat/controllers/invite_code.js @@ -33,6 +33,7 @@ app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config desc: desc, // 分享描述 // link: '', // 分享链接 // imgUrl: '', // 分享图标 + imgUrl: 'http://www.trustie.net/images/logo2.png', // 分享图标 // type: '', // 分享类型,music、video或link,不填默认为link // dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 success: function () { diff --git a/public/javascripts/wechat/controllers/project_invite_code.js b/public/javascripts/wechat/controllers/project_invite_code.js index 6586c7f24..8e31a139e 100644 --- a/public/javascripts/wechat/controllers/project_invite_code.js +++ b/public/javascripts/wechat/controllers/project_invite_code.js @@ -33,6 +33,7 @@ app.controller('ProjectInviteCodeController', ['$scope','$http', '$routeParams', desc: desc, // 分享描述 // link: '', // 分享链接 // imgUrl: '', // 分享图标 + imgUrl: 'http://www.trustie.net/images/logo2.png', // 分享图标 // type: '', // 分享类型,music、video或link,不填默认为link // dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 success: function () { diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js index 3c2b6ca45..db7a4837d 100644 --- a/public/javascripts/wechat/others/factory.js +++ b/public/javascripts/wechat/others/factory.js @@ -200,7 +200,26 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx', func args.scope.formData = {comment: ''}; var loadData = function(id,replytype,page){ loadCommonData(id, args.type,replytype,page).then(function successCallback(response) { - var desc = response.data.user.realname+":"+response.data.title; + console.log(response.data); + + var tmptile = "动态"; + + if(response.data.data.title){ + tmptile = response.data.data.title; + } + + var tmpname = "匿名用户"; + + if(response.data.data.user){ + tmpname = response.data.data.user.realname; + } + + if(response.data.data.author){ + tmpname = response.data.data.author.realname; + } + + var desc = tmpname+":"+tmptile; + console.log("desc = "+desc); wx.ready(function(){ wx.onMenuShareTimeline({ title: 'Trustie创新实践平台', // 分享标题 @@ -219,6 +238,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx', func desc: desc, // 分享描述 // link: '', // 分享链接 // imgUrl: '', // 分享图标 + imgUrl: 'http://www.trustie.net/images/logo2.png', // 分享图标 // type: '', // 分享类型,music、video或link,不填默认为link // dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 success: function () {