-
-
-
+
+
{{discussion.subject}}
+
-
+
{{discussion.created_on}}
-
回复 ()
-
赞 (())
+
回复 ({{discussion.replies_count}})
+
赞 ({{discussion.message_praise_count}})
- = 0; --j){ !>
-
+
-
+
-
-
-
+
{{journal.user.realname}}
+
+
{{journal.lasted_comment}}
回复
-
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html
index 2e8caf15a..b8e468701 100644
--- a/public/assets/wechat/course_notice.html
+++ b/public/assets/wechat/course_notice.html
@@ -24,7 +24,7 @@
{{comments.author.realname}}
-
{{comments.comments}}
+
{{comments.created_on}}
回复
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html
index 45c84c822..be9ee8328 100644
--- a/public/assets/wechat/project_discussion.html
+++ b/public/assets/wechat/project_discussion.html
@@ -1,89 +1,44 @@
-
-
-
-
项目讨论区
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js
index b465dfcf6..05fc16c0a 100644
--- a/public/javascripts/wechat/app.js
+++ b/public/javascripts/wechat/app.js
@@ -6,7 +6,7 @@ app.factory('auth', function($http,$routeParams, $cookies){
var _openid = '';
if(debug===true){
- _openid = "2";
+ _openid = "1";
}
var getOpenId = function(cb) {
@@ -177,7 +177,7 @@ app.controller('CourseNoticeController', function($scope, $http, $routeParams, a
}, function errorCallback(response) {
});
- }
+ };
loadData($routeParams.id);
@@ -208,6 +208,50 @@ app.controller('CourseNoticeController', function($scope, $http, $routeParams, a
}
});
+app.controller('CourseDiscussionController', function($scope, $http, $routeParams, auth){
+ $scope.formData = {comment: ''};
+
+ var loadData = function(id){
+ $http({
+ method: 'GET',
+ url: apiUrl+ "messages/"+id,
+ }).then(function successCallback(response) {
+ console.log(response.data);
+ $scope.discussion = response.data.data;
+
+ }, function errorCallback(response) {
+ });
+ };
+
+ loadData($routeParams.id);
+
+
+ $scope.addIssueReply = function(data){
+ console.log(data.comment);
+
+ if(!data.comment || data.comment.length<=0){
+ return;
+ }
+
+ var userInfo = {
+ type: "Message",
+ content: data.comment,
+ openid: auth.openid(),
+ };
+
+ $http({
+ method: 'POST',
+ url: apiUrl+ "new_comment/"+$routeParams.id,
+ data: userInfo,
+ }).then(function successCallback(response) {
+ alert("提交成功");
+ $scope.formData = {comment: ''};
+ loadData($routeParams.id);
+ }, function errorCallback(response) {
+ });
+ }
+});
+
app.filter('safeHtml', function ($sce) {
return function (input) {
return $sce.trustAsHtml(input);
@@ -232,6 +276,14 @@ app.config(['$routeProvider',function ($routeProvider) {
templateUrl: 'course_notice.html',
controller: 'CourseNoticeController'
})
+ .when('/course_discussion/:id', {
+ templateUrl: 'course_discussion.html',
+ controller: 'CourseDiscussionController'
+ })
+ .when('/project_discussion/:id', {
+ templateUrl: 'project_discussion.html',
+ controller: 'CourseDiscussionController'
+ })
.otherwise({
redirectTo: '/activities'
});