Merge branch 'weixin_guange' into develop
This commit is contained in:
commit
735e6d1b71
|
@ -208,9 +208,10 @@ module Mobile
|
|||
authenticate!
|
||||
|
||||
cs = CoursesService.new
|
||||
reviewer = cs.get_reviewer_info(params)
|
||||
present :data, reviewer, with: Mobile::Entities::User
|
||||
present :status, 0
|
||||
result = cs.get_reviewer_info(params)
|
||||
|
||||
present :data, result[:reviewer], with: Mobile::Entities::User
|
||||
present :status,result[:status]
|
||||
end
|
||||
|
||||
desc "处理教师或助教的身份申请"
|
||||
|
|
|
@ -207,9 +207,9 @@ module Mobile
|
|||
authenticate!
|
||||
|
||||
ps = ProjectsService.new
|
||||
reviewer = ps.get_reviewer_info params
|
||||
present :data, reviewer, with: Mobile::Entities::User
|
||||
present :status, 0
|
||||
result = ps.get_reviewer_info(params,current_user)
|
||||
present :data, result[:reviewer], with: Mobile::Entities::User
|
||||
present :status, result[:status]
|
||||
end
|
||||
|
||||
desc "处理管理或开发的身份申请"
|
||||
|
|
|
@ -152,12 +152,14 @@ class CoursesService
|
|||
end
|
||||
|
||||
def get_reviewer_info params
|
||||
status = -1
|
||||
info = nil
|
||||
c = Course.find(params[:course_id])
|
||||
if c
|
||||
messages = CourseMessage.where("course_id=? and course_message_id = ? and course_message_type = 'JoinCourseRequest' and status = 0 ",params[:course_id],params[:user_id]).first
|
||||
|
||||
messages = CourseMessage.where("course_id=? and course_message_id = ? and course_message_type = 'JoinCourseRequest' ",params[:course_id],params[:user_id]).last
|
||||
if messages
|
||||
#status 0未处理 1同意 2 通过
|
||||
status = messages.status
|
||||
user = User.find(params[:user_id])
|
||||
if user
|
||||
img_url = url_to_avatar(user)
|
||||
|
@ -175,7 +177,7 @@ class CoursesService
|
|||
end
|
||||
end
|
||||
|
||||
info
|
||||
{status:status,reviewer:info}
|
||||
end
|
||||
|
||||
def deal_join_apply params,current_user
|
||||
|
|
|
@ -198,12 +198,16 @@ class ProjectsService
|
|||
review_members
|
||||
end
|
||||
|
||||
def get_reviewer_info params
|
||||
def get_reviewer_info params,current_user
|
||||
status = -1
|
||||
info = nil
|
||||
project = Project.find(params[:project_id])
|
||||
if project
|
||||
messages = AppliedProject.where(:project_id=> project.id, :user_id=>params[:user_id]).first
|
||||
if messages
|
||||
# messages = AppliedProject.where(:project_id=> project.id, :user_id=>params[:user_id]).first
|
||||
#status 1未处理 5拒绝 7同意
|
||||
applied_message = AppliedMessage.where(:user_id => current_user.id, :project_id => project.id, :applied_user_id=>params[:user_id],:applied_type => "AppliedProject").last
|
||||
if applied_message
|
||||
status = applied_message.status
|
||||
user = User.find(params[:user_id])
|
||||
if user
|
||||
img_url = url_to_avatar(user)
|
||||
|
@ -214,13 +218,13 @@ class ProjectsService
|
|||
:work_unit => work_unit, :mail => user.mail, :location => location,
|
||||
role_name: "",
|
||||
name: user.show_name,
|
||||
roles_id: messages.role,
|
||||
roles_id: applied_message.role,
|
||||
:brief_introduction => user.user_extensions.brief_introduction,:realname=>user.realname}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
info
|
||||
{status:status,reviewer:info}
|
||||
end
|
||||
|
||||
def deal_join_apply params,current_user
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</ul>
|
||||
|
||||
<div class="f12 c-grey6 mt10 ml15">
|
||||
<span class="f13 fb c-grey3">提示</span>
|
||||
<span class="f13 c-grey3">提示</span>
|
||||
<ul class="mb15 mt5 ml10 new-tip">
|
||||
<li><span class="project-intro-dot">•</span>教师、助教角色需要班级管理员审批</li>
|
||||
<li><span class="project-intro-dot">•</span>学生角色无需管理员审批</li>
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">项目名称</span><input class="new-class-input ml25" ng-model="project.name" required placeholder="如:团队协作方法与机制研究" /></div>
|
||||
<a ng-click="newProject(classForm, project)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a>
|
||||
<div class="f12 c-grey6 tac">
|
||||
<span class="f13 fb c-grey3">项目功能特性(微信版)</span>
|
||||
<span class="f13 c-grey3">项目功能特性(微信版)</span>
|
||||
<ul class="project-intro mb15 mt5">
|
||||
<li><span class="project-intro-dot">•</span>创建项目、加入项目</li>
|
||||
<li><span class="project-intro-dot">•</span>邀请成员、修改角色</li>
|
||||
<li><span class="project-intro-dot">•</span>浏览、回复项目动态</li>
|
||||
<li><span class="project-intro-dot">•</span>点赞、分享项目动态</li>
|
||||
</ul>
|
||||
<span class="f13 fb c-grey3">更多项目特性(浏览器版)</span>
|
||||
<span class="f13 c-grey3">更多项目特性(浏览器版)</span>
|
||||
<ul class="project-intro mt5">
|
||||
<li><span class="project-intro-dot">•</span>发布任务、问题跟踪</li>
|
||||
<li><span class="project-intro-dot">•</span>代码托管、质量分析</li>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="current_course && current_review_member " class="post-container" style="padding-bottom:50px;">
|
||||
<div ng-show="status==0">
|
||||
<div class="blue-title">{{current_course.name}}</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</span><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
|
@ -13,6 +14,19 @@
|
|||
<a href="javascript:void(0);" ng-click="deal(0)" class="weixin-tab link-blue2 border-top">同意</a>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="status==1 || status==2">
|
||||
<div class="blue-title">审批结果</div>
|
||||
<div class="f12 c-grey6" style="width:200px; margin:40px auto;"> <span class="f13 c-grey3">该申请已被处理,处理情况如下:</span>
|
||||
<ul class="mb15 mt5 ml10 new-tip">
|
||||
<li><span class="project-intro-dot">•</span>申请用户: {{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</li>
|
||||
<li><span class="project-intro-dot">•</span>申请角色: {{current_review_member.roles_id == 7 ? "助教" : "教师" }}</li>
|
||||
<li><span class="project-intro-dot">•</span>班级名称: {{current_course.name}}</li>
|
||||
<li><span class="project-intro-dot">•</span>处理结果: {{status == 1 ? "同意" : "拒绝"}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div ng-click="goClassMemberList();" class="btn2 bg-blue">知道了</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="current_course && !current_review_member ">
|
||||
<div class="blue-title">{{current_course.name}}</div>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="current_project && current_review_member" class="post-container" style="padding-bottom:50px;">
|
||||
<div ng-show="status==1">
|
||||
<div class="blue-title">{{current_project.name}}</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</span><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
|
@ -14,6 +15,20 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="status==5 || status==7">
|
||||
<div class="blue-title">审批结果</div>
|
||||
<div class="f12 c-grey6" style="width:200px; margin:40px auto;"> <span class="f13 c-grey3">该申请已被处理,处理情况如下:</span>
|
||||
<ul class="mb15 mt5 ml10 new-tip">
|
||||
<li><span class="project-intro-dot">•</span>申请用户: {{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</li>
|
||||
<li><span class="project-intro-dot">•</span>申请角色: {{current_review_member.roles_id == 3 ? "管理人员" : "开发人员" }}</li>
|
||||
<li><span class="project-intro-dot">•</span>项目名称: {{current_project.name}}</li>
|
||||
<li><span class="project-intro-dot">•</span>处理结果: {{status == 7 ? "同意" : "拒绝"}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div ng-click="goProjectMemberList()" class="btn2 bg-blue">知道了</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="current_project && !current_review_member ">
|
||||
<div class="blue-title">{{current_project.name}}</div>
|
||||
<div class="tac sn-font-grey2" style="margin-top:50px;">{{tip_2}}</div>
|
||||
|
|
|
@ -143,7 +143,7 @@ app.controller('ActivityController',
|
|||
rms.save("course_activities",$scope.course_activities);
|
||||
rms.save("project_activities",$scope.project_activities);
|
||||
$location.path('/'+type+'/'+act_id);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.addPraise = function(act){
|
||||
for(var i in $scope.activities){
|
||||
|
|
|
@ -111,11 +111,12 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
|
|||
|
||||
//跳到详情页
|
||||
vm.goDetail = function(type, act_id,id){
|
||||
rms.save("yoffset", document.documentElement.scrollTop);
|
||||
rms.save("yoffset", document.documentElement.scrollTop || document.body.scrollTop);
|
||||
rms.save("project_activities",vm.project_activities);
|
||||
rms.save('project_has_more', vm.project_has_more);
|
||||
rms.save("project",vm.project);
|
||||
$location.path('/'+type+'/'+act_id);
|
||||
}
|
||||
};
|
||||
|
||||
//切换 按钮
|
||||
vm.tab = function(index){
|
||||
|
|
|
@ -15,6 +15,7 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
|
|||
|
||||
var course_id = $routeParams.id;
|
||||
var user_id = $routeParams.user_id;
|
||||
vm.status = 0;
|
||||
|
||||
if(!vm.current_course){
|
||||
$http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
|
||||
|
@ -42,20 +43,20 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
|
|||
course_id: course_id,
|
||||
user_id:user_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
if(response.data.status==-1){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.current_review_member = response.data.data;
|
||||
vm.status = response.data.status;
|
||||
console.log("review_member_info");
|
||||
console.log(response.data.data);
|
||||
}
|
||||
|
||||
if(!vm.current_review_member){
|
||||
vm.tip_2 = "该申请不存在或已被处理";
|
||||
vm.tip_2 = "该申请不存在";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
vm.deal = function(result){
|
||||
|
@ -75,4 +76,8 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
vm.goClassMemberList = function(){
|
||||
$location.path("/class").search({id: course_id,tag: 1});
|
||||
};
|
||||
}] );
|
|
@ -15,6 +15,7 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con
|
|||
|
||||
var project_id = $routeParams.id;
|
||||
var user_id = $routeParams.user_id;
|
||||
vm.status = 1;
|
||||
|
||||
if(!vm.current_project){
|
||||
$http.get(config.apiUrl+ 'projects/'+project_id+"?token="+auth.token()).then(
|
||||
|
@ -43,16 +44,17 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con
|
|||
project_id: project_id,
|
||||
user_id:user_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
if(response.data.status==-1){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.status = response.data.status;
|
||||
vm.current_review_member = response.data.data;
|
||||
console.log("review_member_info");
|
||||
console.log(response.data.data);
|
||||
}
|
||||
|
||||
if(!vm.current_review_member){
|
||||
vm.tip_2 = "该申请不存在或已被处理";
|
||||
vm.tip_2 = "该申请不存在";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -80,4 +82,14 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
vm.goProjectMemberList = function(){
|
||||
rms.save("project_master_members",[]);
|
||||
rms.save("project_develop_members",[]);
|
||||
rms.save("project_report_members",[]);
|
||||
rms.save("review_master_members",[]);
|
||||
rms.save("review_develop_members",[]);
|
||||
rms.save("tab_num",null);
|
||||
$location.path("/project").search({id: project_id,tag: 1});
|
||||
};
|
||||
}] );
|
Loading…
Reference in New Issue