diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js
index a0c575d92..cd6d57d34 100644
--- a/public/javascripts/wechat/controllers/class.js
+++ b/public/javascripts/wechat/controllers/class.js
@@ -5,29 +5,23 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
var courseid = $routeParams.id;
var tag = $routeParams.tag;
- vm.course_activities_page = rms.get('course_activities_page') || 0;
- vm.course_activities = rms.get("course_activities") || [];
- vm.course_has_more = rms.get("course_has_more");
-
- vm.course = rms.get("course") || null;
-
var getClassActivities = function(page){
$http({
method: 'POST',
- url: apiUrl + "courses/activities?id=" + courseid,
+ url: apiUrl + "projects/activities?id=" + projectid,
data:{token:auth.token(),page:page}
}).then(function successCallback(response) {
console.log(response.data);
if(response.data.status == 0){
- vm.class_activities_page = response.data.page;
+ vm.project_activities_page = response.data.page;
if(response.data.page > 0)
{
- vm.course_activities = vm.class_activities.concat(response.data.data);
+ vm.project_activities = vm.project_activities.concat(response.data.data);
}
else{
- vm.course_activities = response.data.data;
- vm.course_activities_page = 0;
- vm.course_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
+ vm.project_activities = response.data.data;
+ vm.project_activities_page = 0;
+ vm.project_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
}
}
else{
@@ -108,7 +102,6 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.currentTab = index;
vm.searchText = '';
- vm.showActivities = false;
vm.showClassMate = false;
vm.showResources = false;
vm.showHomework = false;
@@ -119,8 +112,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
if(vm.isTeacher){
if(index == 1){
- getClassActivities(0);
- vm.showActivities = true;
+ getClassActivities();
}
else if(index == 2){ //课件
getResources();
@@ -137,8 +129,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
} else {
if(index == 1){
- getClassActivities(0);
- vm.showActivities = true;
+ getClassActivities();
}
else if(index == 3){
getUsers();
@@ -154,7 +145,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.tabRecord = rms.get('tab_num') || 1;
-// vm.course = {};
+ vm.course = {};
vm.students = [];
vm.teachers = [];
vm.reviewers = []; //待审批
@@ -168,11 +159,6 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.alertService = alertService.create();
vm.invite = function(){
- rms.save('course_activities_page',vm.course_activities_page);
- rms.save("course_activities",vm.course_activities);
- rms.save("course_has_more",vm.course_has_more);
- rms.save("course",vm.course);
-
$location.path("/invite_code").search({id: courseid});
};
@@ -227,39 +213,5 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$location.path("/review_class_member").search({id: courseid,user_id: user.id});
};
- //跳到详情页
- vm.goDetail = function(type, act_id,id){
- rms.save("yoffset", document.documentElement.scrollTop || document.body.scrollTop);
- rms.save('course_activities_page',vm.course_activities_page);
- rms.save("course_activities",vm.course_activities);
- rms.save('course_has_more', vm.course_has_more);
- rms.save("course",vm.course);
-// $location.path('/'+type+'/'+act_id);
- $location.path("/"+type).search({id: act_id});
- };
-
- vm.addPraise = function(act){
- for(var i in vm.course_activities){
- if(vm.course_activities[i].act_id == act.act_id){
- vm.course_activities[i].praise_count += 1;
- vm.course_activities[i].has_praise = true;
- break;
- }
- }
-
- common.addCommonPraise(act);
- };
-
- vm.decreasePraise = function(act){
- for(var i in vm.course_activities){
- if(vm.course_activities[i].act_id == act.act_id){
- vm.course_activities[i].praise_count -= 1;
- vm.course_activities[i].has_praise = false;
- break;
- }
- }
-
- common.decreaseCommonPraise(act);
- };
}]);
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/project.js b/public/javascripts/wechat/controllers/project.js
index 826a16424..08987e491 100644
--- a/public/javascripts/wechat/controllers/project.js
+++ b/public/javascripts/wechat/controllers/project.js
@@ -114,7 +114,6 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
//跳到详情页
vm.goDetail = function(type, act_id,id){
rms.save("yoffset", document.documentElement.scrollTop || document.body.scrollTop);
- rms.save('project_activities_page',vm.project_activities_page);
rms.save("project_activities",vm.project_activities);
rms.save('project_has_more', vm.project_has_more);
rms.save("project",vm.project);