|
|
|
@ -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) {
|
|
|
|
|