微信修改资源更多问题

This commit is contained in:
yuanke 2016-07-15 15:32:40 +08:00
parent ae0a4f8ce4
commit 2cc42a8f5a
1 changed files with 20 additions and 17 deletions

View File

@ -1,4 +1,4 @@
app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$location', function($scope, $http, auth, config, $location){
app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$location', 'rms', function($scope, $http, auth, config, $location,rms){
var vm = $scope;
vm.menus = ['课件', '作业', '测验'];
@ -6,14 +6,17 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
vm.homeworks = [];
vm.exercise = [];
vm.has_more = false;
vm.page = 0;
vm.page = rms.get('page') || 0;
vm.resources = rms.get("resources") || [];
vm.has_more = rms.get("has_more");
vm.homework_has_more = false;
vm.homework_page = 0;
vm.homework_page = rms.get('homework_page') || 0;
vm.homeworks = rms.get("homeworks") || [];
vm.homework_has_more = rms.get("homework_has_more");
vm.exercise_has_more = false;
vm.exercise_page = 0;
vm.exercise_page = rms.get('exercise_page') || 0;
vm.exercise = rms.get("exercise") || [];
vm.exercise_has_more = rms.get("exercise_has_more");
vm.searchText = "";
@ -35,10 +38,10 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
vm.resources = response.data.data;
}
// rms.save("resources", vm.resources);
vm.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
// rms.save('homework_has_more', vm.has_more);
// rms.save('homework_page', vm.data.page);
rms.save("resources", vm.resources);
vm.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('has_more', vm.has_more);
rms.save('page', response.data.page);
console.log(response.data);
@ -59,10 +62,10 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
vm.homeworks = response.data.data;
}
// rms.save("homeworks", vm.homeworks);
rms.save("homeworks", vm.homeworks);
vm.homework_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
// rms.save('homework_has_more', vm.has_more);
// rms.save('homework_page', vm.data.page);
rms.save('homework_has_more', vm.has_more);
rms.save('homework_page', response.data.page);
console.log(response.data);
@ -82,10 +85,10 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
vm.exercise = response.data.data;
}
// rms.save("homeworks", vm.homeworks);
rms.save("exercise", vm.exercise);
vm.exercise_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
// rms.save('homework_has_more', vm.has_more);
// rms.save('homework_page', vm.data.page);
rms.save('exercise_has_more', vm.exercise_has_more);
rms.save('exercise_page', response.data.page);
console.log(response.data);