erge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange
This commit is contained in:
commit
a177c48a29
|
@ -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;
|
var vm = $scope;
|
||||||
vm.menus = ['课件', '作业', '测验'];
|
vm.menus = ['课件', '作业', '测验'];
|
||||||
|
|
||||||
|
@ -6,14 +6,17 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
|
||||||
vm.homeworks = [];
|
vm.homeworks = [];
|
||||||
vm.exercise = [];
|
vm.exercise = [];
|
||||||
|
|
||||||
vm.has_more = false;
|
vm.page = rms.get('page') || 0;
|
||||||
vm.page = 0;
|
vm.resources = rms.get("resources") || [];
|
||||||
|
vm.has_more = rms.get("has_more");
|
||||||
|
|
||||||
vm.homework_has_more = false;
|
vm.homework_page = rms.get('homework_page') || 0;
|
||||||
vm.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 = rms.get('exercise_page') || 0;
|
||||||
vm.exercise_page = 0;
|
vm.exercise = rms.get("exercise") || [];
|
||||||
|
vm.exercise_has_more = rms.get("exercise_has_more");
|
||||||
|
|
||||||
vm.searchText = "";
|
vm.searchText = "";
|
||||||
|
|
||||||
|
@ -35,10 +38,10 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
|
||||||
vm.resources = response.data.data;
|
vm.resources = response.data.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rms.save("resources", vm.resources);
|
rms.save("resources", vm.resources);
|
||||||
vm.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
|
vm.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
|
||||||
// rms.save('homework_has_more', vm.has_more);
|
rms.save('has_more', vm.has_more);
|
||||||
// rms.save('homework_page', vm.data.page);
|
rms.save('page', response.data.page);
|
||||||
|
|
||||||
console.log(response.data);
|
console.log(response.data);
|
||||||
|
|
||||||
|
@ -59,10 +62,10 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
|
||||||
vm.homeworks = response.data.data;
|
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;
|
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_has_more', vm.has_more);
|
||||||
// rms.save('homework_page', vm.data.page);
|
rms.save('homework_page', response.data.page);
|
||||||
|
|
||||||
console.log(response.data);
|
console.log(response.data);
|
||||||
|
|
||||||
|
@ -82,10 +85,10 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
|
||||||
vm.exercise = response.data.data;
|
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;
|
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('exercise_has_more', vm.exercise_has_more);
|
||||||
// rms.save('homework_page', vm.data.page);
|
rms.save('exercise_page', response.data.page);
|
||||||
|
|
||||||
console.log(response.data);
|
console.log(response.data);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue