diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 88db4eeb5..63c9c0833 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -47,7 +47,7 @@
-
回复 ({{act.reply_count}})
+
回复 ({{act.reply_count}})
赞 ({{act.activity_praise_count}})
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index d5572b9f8..33bcf9471 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -1,24 +1,5 @@ - - - - 课程问答区 - - - - - - - - - - -
- - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 33ea6fe4b..2e8caf15a 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -1,91 +1,44 @@ - - - - 课程通知 - - - - - - - - - - -
- - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 1ab4301e3..b465dfcf6 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -120,50 +120,6 @@ app.controller('IssueController', function($scope, $http, $routeParams, auth){ } }); -app.controller('IssueController', function($scope, $http, $routeParams, auth){ - $scope.formData = {comment: ''}; - - var loadData = function(id){ - $http({ - method: 'GET', - url: apiUrl+ "issues/"+id, - }).then(function successCallback(response) { - console.log(response.data); - $scope.issue = 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: "Issue", - 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.controller('HomeworkController', function($scope, $http, $routeParams, auth){ $scope.formData = {comment: ''}; @@ -208,6 +164,50 @@ app.controller('HomeworkController', function($scope, $http, $routeParams, auth) } }); +app.controller('CourseNoticeController', function($scope, $http, $routeParams, auth){ + $scope.formData = {comment: ''}; + + var loadData = function(id){ + $http({ + method: 'GET', + url: apiUrl+ "newss/"+id, + }).then(function successCallback(response) { + console.log(response.data); + $scope.news = 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: "News", + 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); @@ -228,6 +228,10 @@ app.config(['$routeProvider',function ($routeProvider) { templateUrl: 'homework_detail.html', controller: 'HomeworkController' }) + .when('/course_notice/:id', { + templateUrl: 'course_notice.html', + controller: 'CourseNoticeController' + }) .otherwise({ redirectTo: '/activities' });