From 22da03a1e068405957f5d8cc99a533a108ae85cd Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 13 Sep 2016 13:44:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E5=85=A5=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=EF=BC=8C=E8=BF=9B=E5=85=A5=E5=88=AB=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=97=A0=E5=A7=93=E5=90=8D=E5=88=99=E8=B7=B3?= =?UTF-8?q?=E5=85=A5=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 29 ++++++++++++++------ public/assets/wechat/edit_userinfo.html | 8 +++++- public/javascripts/wechat/controllers/reg.js | 3 +- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 0c6eb0910..cd911bcd6 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -456,18 +456,29 @@ class WechatsController < ActionController::Base session[:wechat_openid] = open_id if params[:code] - # if params[:state].match("review_class_member") || params[:state].match("review_project_member") + if !(params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message") + uw = user_binded?(open_id) + if uw + user = uw.user + lastname = user.lastname + end + end + + if lastname && lastname == "" + @path = '/edit_userinfo' + else @path = params[:state].split('/')[0] useridstr = params[:state].split('/')[1] - # end - if useridstr - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&#{useridstr}" and return - elsif params[:id] - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return - else - redirect_to "/wechat/user_activities##{@path}" and return + + if useridstr + redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&#{useridstr}" and return + elsif params[:id] + redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return + else + redirect_to "/wechat/user_activities##{@path}" and return + end + # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end - # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end end render 'wechats/user_activities', layout: nil diff --git a/public/assets/wechat/edit_userinfo.html b/public/assets/wechat/edit_userinfo.html index e299b8feb..f4178fee4 100644 --- a/public/assets/wechat/edit_userinfo.html +++ b/public/assets/wechat/edit_userinfo.html @@ -11,7 +11,7 @@
-
姓名
+
姓名
性别 @@ -33,6 +33,12 @@ 电子邮箱地址不合法
+
+ 提示 + +
取消 确定 diff --git a/public/javascripts/wechat/controllers/reg.js b/public/javascripts/wechat/controllers/reg.js index 1247cd931..34ced26d5 100644 --- a/public/javascripts/wechat/controllers/reg.js +++ b/public/javascripts/wechat/controllers/reg.js @@ -36,7 +36,8 @@ app.controller('RegController', ['$scope', '$http', '$location', 'alertService', vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){ // $location.path("/activities"); // window.WeixinJSBridge.call('closeWindow'); - wx.closeWindow(); +// wx.closeWindow(); + $location.path("/edit_userinfo"); }); } }, function (response) { From f882c0e8c31c4522ce998107a62e3563d5841aed Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 13 Sep 2016 14:11:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A8=E6=80=81BUG?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/activities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/mobile/apis/activities.rb b/app/api/mobile/apis/activities.rb index 4d07c23f8..6ce01aac0 100644 --- a/app/api/mobile/apis/activities.rb +++ b/app/api/mobile/apis/activities.rb @@ -36,7 +36,7 @@ module Mobile principal_types = "JournalsForMessage" watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(',')) user_ids = "(" + user.id.to_s + watched_user_ids + ")" - watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") + watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? "-1" :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") blog_ids = "(" + watched_user_blog_ids + ")" if container_type == "Course" From 41700b1f37f769be8f1c368d5540996871b24e55 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 14 Sep 2016 09:20:22 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/login.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/wechat/login.html b/public/assets/wechat/login.html index 05d844ca8..5f8595c3e 100644 --- a/public/assets/wechat/login.html +++ b/public/assets/wechat/login.html @@ -4,13 +4,13 @@
绑定注册