微信点击已审批模版消息进入界面显示修改

This commit is contained in:
yuanke 2016-08-04 18:09:54 +08:00
parent d5df45e8fb
commit bb46aa4745
8 changed files with 93 additions and 40 deletions

View File

@ -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 "处理教师或助教的身份申请"

View File

@ -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 "处理管理或开发的身份申请"

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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){
@ -67,7 +68,7 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
}).then(function(response) {
if (response.data.status == 0) {
vm.alertService.showMessage('提示', response.data.message, function () {
$location.path("/class").search({id: course_id,tag:1});
$location.path("/class").search({id: course_id,tag: 1});
});
}
else{
@ -75,4 +76,8 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
}
});
};
vm.goClassMemberList = function(){
$location.path("/class").search({id: course_id,tag: 1});
};
}] );

View File

@ -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});
};
}] );