From 0d24de7198c0e70b4ddf1ac268d4c5289d463a7b Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 1 Apr 2016 22:35:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/activity.rb | 2 +- app/api/mobile/entities/issue.rb | 2 +- public/assets/wechat/activities.html | 10 +++++----- public/javascripts/wechat/homework_detail.js | 8 ++++---- public/javascripts/wechat/issue_detail.js | 16 ++++++++-------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index d58057b62..82d021248 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -27,7 +27,7 @@ module Mobile elsif ac.act_type == "Message" || ac.act_type == "BlogComment" || ac.act_type == "JournalsForMessage" ac.nil? || ac.act.nil? ? 0 : ac.act.children.count elsif ac.act_type == "Issue" - ac.nil? || ac.act.nil? ? 0 : ac.act.journals.count + ac.nil? || ac.act.nil? ? 0 : ac.act.journals.where("notes != null").count end when :subject if ac.act_type == "HomeworkCommon" diff --git a/app/api/mobile/entities/issue.rb b/app/api/mobile/entities/issue.rb index de60adddf..777bb1ce8 100644 --- a/app/api/mobile/entities/issue.rb +++ b/app/api/mobile/entities/issue.rb @@ -23,7 +23,7 @@ module Mobile when :issue_status IssueStatus.find(issue.status_id).name when :journals_count - issue.journals.count + issue.journals.where("notes != null").count when :project_name issue.project.name end diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index e114a7173..68e8519aa 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -66,7 +66,7 @@
-
回复 ()
+
class="c-grey">回复 ()
赞 ()
@@ -88,7 +88,7 @@
-
回复 ()
+
class="c-grey">回复 ()
赞 ()
@@ -148,7 +148,7 @@
-
回复 ()
+
class="c-grey"> 回复 ()
赞 ()
@@ -182,7 +182,7 @@
-
回复 ()
+
class="c-grey"> 回复 ()
赞 ()
@@ -205,7 +205,7 @@
-
回复 ()
+
class="c-grey"> 回复 ()
赞 ()
diff --git a/public/javascripts/wechat/homework_detail.js b/public/javascripts/wechat/homework_detail.js index 92796cf3f..f6202cdd0 100644 --- a/public/javascripts/wechat/homework_detail.js +++ b/public/javascripts/wechat/homework_detail.js @@ -17,9 +17,9 @@ $(document).ready(function(){ $('.post-reply-submit').click(function(){ replyInsert(); }); - $('post-interactive-praise').click(function(){ + /*$('post-interactive-praise').click(function(){ praiseClick(); - }); + });*/ }; var loadDataFromServer = function(id){ @@ -85,11 +85,11 @@ $(document).ready(function(){ }; //点赞效果 - var praiseClick = function(){ + /*var praiseClick = function(){ var praiseNum = $(".post-interactive-praise").text().match(/\d+/g); praiseNum++; $(".praise-num").text("(" + praiseNum + ")"); - }; + };*/ }); \ No newline at end of file diff --git a/public/javascripts/wechat/issue_detail.js b/public/javascripts/wechat/issue_detail.js index fe2f4531f..dcd5ae723 100644 --- a/public/javascripts/wechat/issue_detail.js +++ b/public/javascripts/wechat/issue_detail.js @@ -20,9 +20,9 @@ $(document).ready(function(){ $('.post-reply-submit').click(function(){ replyInsert(); }); - $('post-interactive-praise').click(function(){ + /*$('post-interactive-praise').click(function(){ praiseClick(); - }); + });*/ }; var loadDataFromServer = function(id){ @@ -67,14 +67,14 @@ $(document).ready(function(){ //获取并传送回复用户数据 var userInfo = { - "replyType" : "homework_assignment", - "replyContent" : postInput + "Type" : "Issue", + "Content" : postInput }; $.ajax({ type: "POST", //提交方式 dataType: "json", //类型 - url: "前台地址/后台方法", //提交的页面,方法名 + url: apiUrl + 'new_comment/' + homeworkID, //提交的页面,方法名 data: userInfo, //参数,如果没有,可以为null success: function (data) { //如果执行成功,那么执行此方法 alert(data.result); //用data.d来获取后台传过来的json语句,或者是单纯的语句 @@ -85,14 +85,14 @@ $(document).ready(function(){ }); } - } + }; //点赞效果 - var praiseClick = function(){ + /*var praiseClick = function(){ var praiseNum = $(".post-interactive-praise").text().match(/\d+/g); praiseNum++; $(".praise-num").text("(" + praiseNum + ")"); - } + }*/ }); \ No newline at end of file