diff --git a/public/assets/wechat/class_list.html b/public/assets/wechat/class_list.html
index 919eb1364..7c0af4a1a 100644
--- a/public/assets/wechat/class_list.html
+++ b/public/assets/wechat/class_list.html
@@ -3,8 +3,8 @@
课程列表
-
-
+
+
-
{{course.name}}
diff --git a/public/assets/wechat/send_class_list.html b/public/assets/wechat/send_class_list.html
index 4b8b8a27f..699d6c34f 100644
--- a/public/assets/wechat/send_class_list.html
+++ b/public/assets/wechat/send_class_list.html
@@ -3,10 +3,21 @@
发送课程列表
- 
未命名课程
-
-
{{course.name}}
-
+
+
+
+

{{syllabus.title}}
+
+
{{course.name}}
+
+
+
+
+
+
+
+
+
发送
diff --git a/public/javascripts/wechat/controllers/send_class_list.js b/public/javascripts/wechat/controllers/send_class_list.js
index 1a9be3f5c..caca3cd6a 100644
--- a/public/javascripts/wechat/controllers/send_class_list.js
+++ b/public/javascripts/wechat/controllers/send_class_list.js
@@ -1,15 +1,23 @@
-app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService){
+app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService,rms){
var vm = $scope;
var send_id = $routeParams.id;
vm.alertService = alertService.create();
- vm.courses = [];
+// vm.courses = [];
+ vm.syllabuses = [];
var loadClassList = function () {
- $http.get(config.apiUrl + "courses?token=" + auth.token() + "&per_page_count=10&page=1").then(
+// $http.get(config.apiUrl + "courses?token=" + auth.token() + "&per_page_count=10&page=1").then(
+// function (response) {
+// console.log(response.data);
+// vm.courses = response.data.data;
+// }
+// );
+ $http.get(config.apiUrl + "syllabuses?token=" + auth.token()).then(
function (response) {
console.log(response.data);
- vm.courses = response.data.data;
+ vm.syllabuses = response.data.data;
+ rms.save('syllabuses', vm.syllabuses);
}
);
};
@@ -24,9 +32,11 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co
vm.sendToCourses = function(){
var course_ids = [];
- for(var i in vm.courses){
- if(vm.courses[i].checked){
- course_ids.push(vm.courses[i].id);
+ for(var i in vm.syllabuses) {
+ for (var j in vm.syllabuses[i].courses) {
+ if (vm.syllabuses[i].courses[j].checked) {
+ course_ids.push(vm.syllabuses[i].courses[j].id);
+ }
}
}