From 9d46040f7a7b353df1c517f8cf6f3fa887650064 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 6 Jul 2016 17:08:22 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=20+=20-=20?=
=?UTF-8?q?=E6=8C=89=E9=92=AE=E5=A2=9E=E5=8A=A0=E6=95=88=E6=9E=9C=EF=BC=8C?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8F=91=E9=80=81=E7=95=8C=E9=9D=A2=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=92=8C=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E5=88=97=E8=A1=A8=E7=95=8C=E9=9D=A2=E4=BF=9D=E6=8C=81?=
=?UTF-8?q?=E4=B8=80=E7=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/wechat/class_list.html | 4 ++--
public/assets/wechat/send_class_list.html | 19 +++++++++++----
.../wechat/controllers/send_class_list.js | 24 +++++++++++++------
3 files changed, 34 insertions(+), 13 deletions(-)
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);
+ }
}
}