diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html
index 990055b56..cdc817941 100644
--- a/public/assets/wechat/jour_message_detail.html
+++ b/public/assets/wechat/jour_message_detail.html
@@ -13,8 +13,8 @@
回复 ({{message.reply_count}})
-
已赞 ({{message.message_praise_count}})
-
赞 ({{message.message_praise_count}})
+
已赞 ({{message.praise_count}})
+
赞 ({{message.praise_count}})
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html
index 6c06b95e9..3fa7b0949 100644
--- a/public/assets/wechat/project_discussion.html
+++ b/public/assets/wechat/project_discussion.html
@@ -16,8 +16,8 @@
回复 ({{discussion.replies_count}})
-
已赞 ({{discussion.message_praise_count}})
-
赞 ({{discussion.message_praise_count}})
+
已赞 ({{discussion.praise_count}})
+
赞 ({{discussion.praise_count}})
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js
index 0d79caaed..57003f9e1 100644
--- a/public/javascripts/wechat/app.js
+++ b/public/javascripts/wechat/app.js
@@ -96,12 +96,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
$scope.addPraise = function(act){
console.log(act);
common.addCommonPraise(act);
- }
+ };
$scope.decreasePraise = function(act){
console.log(act);
common.decreaseCommonPraise(act);
- }
+ };
});
@@ -140,7 +140,7 @@ app.factory('common', function($http, auth, $routeParams){
};
var addCommonPraise = function(act){
- act.activity_praise_count += 1;
+ act.praise_count += 1;
act.has_praise = true;
$http({
@@ -155,7 +155,7 @@ app.factory('common', function($http, auth, $routeParams){
};
var decreaseCommonPraise = function(act){
- act.activity_praise_count -= 1;
+ act.praise_count -= 1;
act.has_praise = false;
$http({
@@ -163,7 +163,7 @@ app.factory('common', function($http, auth, $routeParams){
url: apiUrl + "praise/" + act.act_id,
data:{openid:auth.openid(),type:act.act_type}
}).then(function successCallback(response) {
- console.log("取消赞成功");
+ console.log(response.data);
}, function errorCallback(response) {
});
};
@@ -192,6 +192,16 @@ app.controller('IssueController', function($scope, $http, $routeParams, auth, co
});
};
+
+ $scope.addPraise = function(act){
+ console.log(act);
+ common.addCommonPraise(act);
+ };
+
+ $scope.decreasePraise = function(act){
+ console.log(act);
+ common.decreaseCommonPraise(act);
+ };
});
app.controller('HomeworkController', function($scope, $http, $routeParams, auth, common){
@@ -214,6 +224,16 @@ app.controller('HomeworkController', function($scope, $http, $routeParams, auth,
loadData($routeParams.id);
});
};
+
+ $scope.addPraise = function(act){
+ console.log(act);
+ common.addCommonPraise(act);
+ };
+
+ $scope.decreasePraise = function(act){
+ console.log(act);
+ common.decreaseCommonPraise(act);
+ };
});
app.controller('CourseNoticeController', function($scope, $http, $routeParams, auth, common){
@@ -235,7 +255,17 @@ app.controller('CourseNoticeController', function($scope, $http, $routeParams, a
$scope.formData = {comment: ''};
loadData($routeParams.id);
});
- }
+ };
+
+ $scope.addPraise = function(act){
+ console.log(act);
+ common.addCommonPraise(act);
+ };
+
+ $scope.decreasePraise = function(act){
+ console.log(act);
+ common.decreaseCommonPraise(act);
+ };
});
app.controller('DiscussionController', function($scope, $http, $routeParams, auth, common){
@@ -257,7 +287,17 @@ app.controller('DiscussionController', function($scope, $http, $routeParams, aut
$scope.formData = {comment: ''};
loadData($routeParams.id);
});
- }
+ };
+
+ $scope.addPraise = function(act){
+ console.log(act);
+ common.addCommonPraise(act);
+ };
+
+ $scope.decreasePraise = function(act){
+ console.log(act);
+ common.decreaseCommonPraise(act);
+ };
});
app.controller('JournalsController', function($scope, $http, $routeParams, auth, common){
@@ -280,6 +320,16 @@ app.controller('JournalsController', function($scope, $http, $routeParams, auth,
loadData($routeParams.id);
});
};
+
+ $scope.addPraise = function(act){
+ console.log(act);
+ common.addCommonPraise(act);
+ };
+
+ $scope.decreasePraise = function(act){
+ console.log(act);
+ common.decreaseCommonPraise(act);
+ };
});
app.controller('BlogController', function($scope, $http, $routeParams, auth, common){
@@ -302,6 +352,16 @@ app.controller('BlogController', function($scope, $http, $routeParams, auth, com
loadData($routeParams.id);
});
};
+
+ $scope.addPraise = function(act){
+ console.log(act);
+ common.addCommonPraise(act);
+ };
+
+ $scope.decreasePraise = function(act){
+ console.log(act);
+ common.decreaseCommonPraise(act);
+ };
});
app.filter('safeHtml', function ($sce) {