From 55afb84aef17846ad9ebb7e886aed0518fb29f87 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 4 Aug 2016 15:32:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=89=88=E6=B6=88=E6=81=AF=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=8A=A0=E4=B8=8A=E5=8F=A5=E5=8F=B7=EF=BC=8C=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=A8=A1=E7=89=88=E6=B6=88=E6=81=AF=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/applied_project.rb | 2 +- app/services/courses_service.rb | 2 +- public/assets/wechat/review_class_member.html | 8 ++++++++ public/assets/wechat/review_project_member.html | 10 ++++++++-- .../wechat/controllers/review_class_member.js | 10 ++++++++++ .../wechat/controllers/review_project_member.js | 11 +++++++++++ 6 files changed, 39 insertions(+), 4 deletions(-) diff --git a/app/models/applied_project.rb b/app/models/applied_project.rb index abab2ab6f..a6eef8417 100644 --- a/app/models/applied_project.rb +++ b/app/models/applied_project.rb @@ -17,7 +17,7 @@ class AppliedProject < ActiveRecord::Base count = ShieldWechatMessage.where("container_type='User' and container_id=#{member.user_id} and shield_type='Project' and shield_id=#{self.project_id}").count if count == 0 ws = WechatService.new - ws.project_review_notice member.user_id, "review_project_member", self.project_id, "项目成员审批通知", self.project.name, self.user.show_name, format_time(Time.now),"点击查看申请详情。",self.user.id + ws.project_review_notice member.user_id, "review_project_member", self.project_id, "项目成员审批通知。", self.project.name, self.user.show_name, format_time(Time.now),"点击查看申请详情。",self.user.id end #-------------------------------------------- end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 9ed6faaa6..2f5745892 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -615,7 +615,7 @@ class CoursesService rolename = role_ids.include?("7") ? "助教" : "教师" content = current_user.show_name + "申请以"+rolename+"身份加入班级,等待您的审批。" ws = WechatService.new - ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知", course.name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id + ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知。", course.name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id end end #-------------------------------------------- diff --git a/public/assets/wechat/review_class_member.html b/public/assets/wechat/review_class_member.html index c13571e4c..85d16fb64 100644 --- a/public/assets/wechat/review_class_member.html +++ b/public/assets/wechat/review_class_member.html @@ -14,5 +14,13 @@ +
+
{{current_course.name}}
+
{{tip_2}}
+
+ +
{{tip_1}}
+ + diff --git a/public/assets/wechat/review_project_member.html b/public/assets/wechat/review_project_member.html index 5b8113eb4..e7c1dd6bf 100644 --- a/public/assets/wechat/review_project_member.html +++ b/public/assets/wechat/review_project_member.html @@ -1,7 +1,7 @@
-
-
{{project.name}}
+
+
{{current_project.name}}
{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}
角色
    @@ -14,6 +14,12 @@
+
+
{{current_project.name}}
+
{{tip_2}}
+
+ +
{{tip_1}}
diff --git a/public/javascripts/wechat/controllers/review_class_member.js b/public/javascripts/wechat/controllers/review_class_member.js index 6e8cb16eb..ab44b9572 100644 --- a/public/javascripts/wechat/controllers/review_class_member.js +++ b/public/javascripts/wechat/controllers/review_class_member.js @@ -10,6 +10,9 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi vm.alertService = alertService.create(); + vm.tip_1 = ""; + vm.tip_2 = ""; + var course_id = $routeParams.id; var user_id = $routeParams.user_id; @@ -25,6 +28,9 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi else{ vm.alertService.showMessage('提示', response.data.message); } + if(!vm.current_course){ + vm.tip_1 = "该班级不存在或已被删除"; + } } ); @@ -43,6 +49,10 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi console.log("review_member_info"); console.log(response.data.data); } + + if(!vm.current_review_member){ + vm.tip_2 = "该申请不存在或已被处理"; + } }); diff --git a/public/javascripts/wechat/controllers/review_project_member.js b/public/javascripts/wechat/controllers/review_project_member.js index 113aa426b..e6998a9d8 100644 --- a/public/javascripts/wechat/controllers/review_project_member.js +++ b/public/javascripts/wechat/controllers/review_project_member.js @@ -10,6 +10,9 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con vm.alertService = alertService.create(); + vm.tip_1 = ""; + vm.tip_2 = ""; + var project_id = $routeParams.id; var user_id = $routeParams.user_id; @@ -26,6 +29,10 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con vm.alertService.showMessage('提示', response.data.message); } + if(!vm.current_project){ + vm.tip_1 = "该项目不存在或已被删除"; + } + } ); } @@ -43,6 +50,10 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con console.log("review_member_info"); console.log(response.data.data); } + + if(!vm.current_review_member){ + vm.tip_2 = "该申请不存在或已被处理"; + } }); }