This commit is contained in:
parent
047903ddff
commit
e9f280b4aa
|
@ -4,7 +4,7 @@ app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtm
|
|||
app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(a,t,e,o,i,c,n,r,s){e.replaceUrl=function(a){return a},e.alertService=s.create(),console.log("ActivityController load"),e.page=n.get("page")||0,e.activities=n.get("activities")||[],e.has_more=n.get("has_more"),e.loadActData=function(a){e.page=a,o({method:"POST",url:apiUrl+"activities",data:{token:c.token(),page:a}}).then(function(a){a.data.page>0?e.activities=e.activities.concat(a.data.data):e.activities=a.data.data,n.save("activities",e.activities),e.has_more=a.data.count+10*a.data.page<a.data.all_count,n.save("has_more",e.has_more),n.save("page",a.data.page),console.log(a.data)},function(a){})},e.activities.length<=0?e.loadActData(0):i(function(){window.scrollTo(0,n.get("yoffset"))}),e.goDetail=function(a,e,o){n.save("yoffset",window.document.body.scrollTop),t.path("/"+a+"/"+e)},e.addPraise=function(a){r.addCommonPraise(a)},e.decreasePraise=function(a){r.decreaseCommonPraise(a)}}]);
|
||||
app.controller("BlogController",["$scope","$http","$routeParams","auth","common",function(o,l,t,n,a){a.init({id:t.id,scope:o,type:"blog_comments",replyType:"BlogComment",loadCallback:function(l){o.blog=l.data},replyCallback:function(){}})}]);
|
||||
app.controller("ClassController",["$scope","config","$http","auth","$location","$routeParams",function(e,t,s,o,a,n){var c=e,r=n.id,u=function(){c.teachers.length<=0&&s.get(t.apiUrl+"courses/teachers?token="+o.token()+"&course_id="+r).then(function(e){console.log(e.data),c.teachers=e.data.data}),c.students.length<=0&&s.get(t.apiUrl+"courses/students?token="+o.token()+"&course_id="+r).then(function(e){console.log(e.data),c.students=e.data.data})},h=function(){c.resources.length<=0&&s.post(t.apiUrl+"courses/"+r+"/attachments",{token:o.token(),name:""}).then(function(e){c.resources=e.data.data})},i=function(){c.homeworks.length<=0&&s.get(t.apiUrl+"courses/homeworks/"+r+"?token="+o.token()).then(function(e){c.homeworks=e.data.data,console.log(e.data)})},l=function(){c.exercises.length<=0&&s.get(t.apiUrl+"courses/"+r+"/exercises?token="+o.token()).then(function(e){c.exercises=e.data.data,console.log(e.data)})};c.isTeacher=!1,c.currentTab=1,c.tab=function(e){c.currentTab=e,c.searchText="",c.showClassMate=!1,c.showResources=!1,c.showHomework=!1,c.showTestcase=!1,c.isTeacher?1==e?(h(),c.showResources=!0):2==e?(i(),c.showHomework=!0):3==e?(l(),c.showTestcase=!0):4==e&&(u(),c.showClassMate=!0):2==e?(u(),c.showClassMate=!0):1==e&&(h(),c.showResources=!0)},c.course={},c.students=[],c.teachers=[],c.resources=[],c.homeworks=[],c.exercises=[],c.invite=function(){a.path("/invite_code").search({id:r})},s.get(t.apiUrl+"courses/"+r+"?token="+o.token()).then(function(e){console.log(e.data),c.course=e.data.data,d(c.course.current_user_is_teacher),c.tab(1)});var d=function(e){c.isTeacher=e,e?c.menus=["课件","作业","小测验","学生管理"]:c.menus=["课堂资源","我的同学"]}}]);
|
||||
app.controller("ClassListController",["$scope","config","auth","$http","$location",function(o,s,t,a,e){var n=o;n.courses=[],a.get(s.apiUrl+"courses?token="+t.token()+"&per_page_count=10&page=1").then(function(o){console.log(o.data),n.courses=o.data.data}),n.goClass=function(o){console.log(o),e.path("/myclass").search({id:o})},n.newClass=function(){e.path("/new_class")},n.goResource=function(){e.path("/myresource")}}]);
|
||||
app.controller("ClassListController",["$scope","config","auth","$http","$location",function(o,s,t,a,e){var n=o;n.courses=[],a.get(s.apiUrl+"courses?token="+t.token()+"&per_page_count=10&page=1").then(function(o){console.log(o.data),n.courses=o.data.data}),n.goClass=function(o){console.log(o),e.path("/class").search({id:o})},n.newClass=function(){e.path("/new_class")},n.goResource=function(){e.path("/myresource")}}]);
|
||||
app.controller("CourseNoticeController",["$scope","$http","$routeParams","auth","common",function(o,e,t,n,a){a.init({id:t.id,scope:o,type:"newss",replyType:"News",loadCallback:function(e){o.news=e.data},replyCallback:function(){}})}]);
|
||||
app.controller("DiscussionController",["$scope","$http","$routeParams","auth","common",function(o,s,a,e,n){n.init({id:a.id,scope:o,type:"messages",replyType:"Message",loadCallback:function(s){o.discussion=s.data},replyCallback:function(){}})}]);
|
||||
app.controller("HomeworkController",["$scope","$http","$routeParams","auth","common",function(o,e,l,n,r){r.init({id:l.id,scope:o,type:"whomeworks",replyType:"HomeworkCommon",loadCallback:function(e){console.log(e),o.homework=e.data},replyCallback:function(){}})}]);
|
||||
|
|
|
@ -16,7 +16,7 @@ app.controller('ClassListController', ['$scope','config','auth','$http','$locati
|
|||
|
||||
vm.goClass = function(course_id){
|
||||
console.log(course_id);
|
||||
$location.path("/myclass").search({id: course_id});
|
||||
$location.path("/class").search({id: course_id});
|
||||
}
|
||||
|
||||
vm.newClass = function(){
|
||||
|
|
Loading…
Reference in New Issue