You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

join_classgroup.js 2.8 kB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx,common){
  2. var vm = $scope;
  3. var course_id = $routeParams.id;
  4. vm.alertService = alertService.create();
  5. vm.selectid = null;
  6. $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
  7. function(response) {
  8. console.log(response.data);
  9. if (response.data.status == 0){
  10. vm.current_course = response.data.data;
  11. console.log("courses=");
  12. console.log(response.data.data);
  13. if(vm.current_course){
  14. $http.get(config.apiUrl + 'courses/course_groups/'+course_id+'?token='+auth.token()).then(
  15. function(response) {
  16. console.log("groups=");
  17. console.log(response);
  18. if(response.data.status == 0) {
  19. vm.groups = response.data.data;
  20. }
  21. else{
  22. vm.groups = [];
  23. }
  24. });
  25. }
  26. }
  27. else{
  28. vm.alertService.showMessage('提示', response.data.message);
  29. }
  30. if(!vm.current_course){
  31. vm.tip_1 = "该班级不存在或已被删除";
  32. }
  33. }
  34. );
  35. vm.selectGroup = function(id){
  36. vm.selectid = id;
  37. };
  38. vm.cancel = function(){
  39. rms.save('syllabuses',[]);
  40. $location.path("/class_list");
  41. };
  42. vm.confirm = function(){
  43. if(vm.selectid == null){
  44. vm.alertService.showMessage('提示', "请选择分班!");
  45. return;
  46. }
  47. if(vm.selectid == 0){
  48. rms.save('syllabuses',[]);
  49. $location.path("/class_list");
  50. return;
  51. }
  52. //加入分班
  53. $http.post(config.apiUrl+'courses/user_join_coursegroup', {
  54. token: auth.token(),
  55. id: course_id,
  56. course_group_id:vm.selectid
  57. }).then(function(response){
  58. console.log(response);
  59. if(response.data.status == 0){
  60. vm.alertService.showMessage('提示', "选择分班成功!",function(){
  61. rms.save('syllabuses',[]);
  62. $location.path("/class_list");
  63. });
  64. } else {
  65. vm.alertService.showMessage('提示', response.data.message,function(){
  66. rms.save('syllabuses',[]);
  67. $location.path("/class_list");
  68. });
  69. }
  70. });
  71. };
  72. }] );

软件技术创新是当今国家整体创新能力的重要基础和发展引擎。近年来,大众参与的软件创新与创业活动已经成为网络时代软件开发和应用的新形态,正在快速改变着全球软件创新模式和软件产业格局。 ...