diff --git a/app/api/mobile/entities/blog_comment.rb b/app/api/mobile/entities/blog_comment.rb index 726949bb5..14bc9decb 100644 --- a/app/api/mobile/entities/blog_comment.rb +++ b/app/api/mobile/entities/blog_comment.rb @@ -85,7 +85,7 @@ module Mobile #取二级回复的底楼层 parents_reply = [] parents_reply = get_reply_parents_no_root(parents_reply, c) - if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom] + if parents_reply.count > 0 && !opt[:bottom] if opt[:type] == 1 # opt[:bottom] = true # parents_reply[opt[:page]..opt[:page]] @@ -104,9 +104,9 @@ module Mobile #取二级回复的顶楼层 parents_reply = [] parents_reply = get_reply_parents_no_root(parents_reply, c) - if parents_reply.count >= 2 && !opt[:top] + if parents_reply.count > 2 && !opt[:top] if opt[:type] == 1 - opt[:bottom] = true + opt[:top] = true tStart = (opt[:page]-1)*5+2 tEnd = (opt[:page])*5+2 - 1 @@ -125,6 +125,10 @@ module Mobile parents_reply = parents_reply.reverse[0..1] parents_reply.reverse end + elsif parents_reply.count == 2 && !opt[:top] + opt[:top] = true + parents_reply = parents_reply.reverse[0..0] + parents_reply.reverse else [] end diff --git a/app/api/mobile/entities/jours.rb b/app/api/mobile/entities/jours.rb index 0e4c699c2..6379e88e4 100644 --- a/app/api/mobile/entities/jours.rb +++ b/app/api/mobile/entities/jours.rb @@ -101,7 +101,7 @@ module Mobile elsif opt[:comment_type] == "homework" parents_reply = get_reply_parents(parents_reply, f) end - if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom] + if parents_reply.count > 0 && !opt[:bottom] if opt[:type] == 1 # opt[:bottom] = true # parents_reply[opt[:page]..opt[:page]] @@ -125,9 +125,9 @@ module Mobile elsif opt[:comment_type] == "homework" parents_reply = get_reply_parents(parents_reply, f) end - if parents_reply.count >= 2 && !opt[:top] + if parents_reply.count > 2 && !opt[:top] if opt[:type] == 1 - opt[:bottom] = true + opt[:top] = true tStart = (opt[:page]-1)*5+2 tEnd = (opt[:page])*5+2 - 1 @@ -146,6 +146,10 @@ module Mobile parents_reply = parents_reply.reverse[0..1] parents_reply.reverse end + elsif parents_reply.count == 2 && !opt[:top] + opt[:top] = true + parents_reply = parents_reply.reverse[0..0] + parents_reply.reverse else [] end diff --git a/app/api/mobile/entities/message.rb b/app/api/mobile/entities/message.rb index c2744f63a..4571dedfe 100644 --- a/app/api/mobile/entities/message.rb +++ b/app/api/mobile/entities/message.rb @@ -92,7 +92,7 @@ module Mobile #取二级回复的底楼层 parents_reply = [] parents_reply = get_reply_parents_no_root(parents_reply, c) - if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom] + if parents_reply.count > 0 && !opt[:bottom] if opt[:type] == 1 # opt[:bottom] = true # parents_reply[opt[:page]..opt[:page]] @@ -111,9 +111,9 @@ module Mobile #取二级回复的顶楼层 parents_reply = [] parents_reply = get_reply_parents_no_root(parents_reply, c) - if parents_reply.count >= 2 && !opt[:top] + if parents_reply.count > 2 && !opt[:top] if opt[:type] == 1 - opt[:bottom] = true + opt[:top] = true tStart = (opt[:page]-1)*5+2 tEnd = (opt[:page])*5+2 - 1 @@ -132,6 +132,10 @@ module Mobile parents_reply = parents_reply.reverse[0..1] parents_reply.reverse end + elsif parents_reply.count == 2 && !opt[:top] + opt[:top] = true + parents_reply = parents_reply.reverse[0..0] + parents_reply.reverse else [] end diff --git a/app/api/mobile/entities/project.rb b/app/api/mobile/entities/project.rb index 073f7cd0f..55ab67be2 100644 --- a/app/api/mobile/entities/project.rb +++ b/app/api/mobile/entities/project.rb @@ -5,7 +5,7 @@ module Mobile expose :id expose :user_id expose :invite_code - expose :qrcode + # expose :qrcode expose :can_setting, if: lambda { |instance, options| options[:user] } do |instance, options| current_user = options[:user] diff --git a/app/services/projects_service.rb b/app/services/projects_service.rb index 7358bc15c..2df36eb5e 100644 --- a/app/services/projects_service.rb +++ b/app/services/projects_service.rb @@ -17,7 +17,7 @@ class ProjectsService def show_project(params,current_user) project = Project.find(params[:id]) project.generate_invite_code - project.generate_qrcode + # project.generate_qrcode project end @@ -104,7 +104,7 @@ class ProjectsService class JoinProjectError < Errors define_error [ - 0, '加入成功', + 0, '您已成功加入项目', 1, '您的邀请码不正确', 2, '您还未登录', 3, '您已经是该项目的管理人员', @@ -131,7 +131,7 @@ class ProjectsService else if params[:invite_code].present? - if params[:role_id] == 5 + if params[:role] == 5 members = [] user_grades = [] project_info = [] diff --git a/public/assets/wechat/join_project.html b/public/assets/wechat/join_project.html index 1556dfe88..c2c0ec993 100644 --- a/public/assets/wechat/join_project.html +++ b/public/assets/wechat/join_project.html @@ -2,7 +2,7 @@
欢迎加入项目
-
项目邀请码
+
项目邀请码
角色
-
+
@@ -30,7 +30,7 @@
- +
{{act.praise_count}}
@@ -67,7 +67,7 @@
- +
{{act.praise_count}}
@@ -102,7 +102,7 @@
-
+
diff --git a/public/javascripts/wechat/controllers/edit_project_member.js b/public/javascripts/wechat/controllers/edit_project_member.js index 822913f60..3fd24f04e 100644 --- a/public/javascripts/wechat/controllers/edit_project_member.js +++ b/public/javascripts/wechat/controllers/edit_project_member.js @@ -61,6 +61,8 @@ app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'confi 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); // window.history.back(); $location.path("/project").search({id: project_id,tag:1}); @@ -68,7 +70,6 @@ app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'confi } }); - }; vm.selectRole = function(role_id){ diff --git a/public/javascripts/wechat/controllers/join_class.js b/public/javascripts/wechat/controllers/join_class.js index 1a50080ca..bbdaae7c5 100644 --- a/public/javascripts/wechat/controllers/join_class.js +++ b/public/javascripts/wechat/controllers/join_class.js @@ -45,8 +45,9 @@ app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'ale student_flag:vm.student }).then(function(response){ if(response.data.status == 0){ - vm.alertService.showMessage('提示', response.data.message); - $location.path("/class_list"); + vm.alertService.showMessage('提示', response.data.message,function(){ + $location.path("/class_list"); + }); } else { vm.alertService.showMessage('提示', response.data.message); } diff --git a/public/javascripts/wechat/controllers/join_project.js b/public/javascripts/wechat/controllers/join_project.js index 08b84fd23..2b167e04c 100644 --- a/public/javascripts/wechat/controllers/join_project.js +++ b/public/javascripts/wechat/controllers/join_project.js @@ -8,6 +8,7 @@ app.controller('JoinProjectController', ['$scope', '$http', 'auth', 'config', 'a vm.role_id = 0; vm.alertService = alertService.create(); + vm.invite_code = ""; vm.cancel = function(){ window.history.back(); @@ -37,8 +38,9 @@ app.controller('JoinProjectController', ['$scope', '$http', 'auth', 'config', 'a role_id:vm.role_id }).then(function(response){ if(response.data.status == 0){ - vm.alertService.showMessage('提示', response.data.message); - $location.path("/project_list"); + vm.alertService.showMessage('提示', response.data.message,function(){ + $location.path("/project_list"); + }); } else { vm.alertService.showMessage('提示', response.data.message); } diff --git a/public/javascripts/wechat/controllers/project_list.js b/public/javascripts/wechat/controllers/project_list.js index 7471ca803..2d0568f16 100644 --- a/public/javascripts/wechat/controllers/project_list.js +++ b/public/javascripts/wechat/controllers/project_list.js @@ -36,9 +36,12 @@ app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$ rms.save("project_activities",[]); rms.save("project_has_more",false); rms.save("project",null); - rms.save('project_members_page',0); - rms.save("project_members",[]); - rms.save("project_members_has_more",false); + 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); console.log(project_id); $location.path("/project").search({id: project_id});