微信注册后跳入编辑资料界面,进入别的页面无姓名则跳入编辑资料界面

This commit is contained in:
yuanke 2016-09-13 13:44:26 +08:00
parent 168a47fabb
commit 22da03a1e0
3 changed files with 29 additions and 11 deletions

View File

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

View File

@ -11,7 +11,7 @@
<form name="regFrm" novalidate>
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">姓名</span><input class="new-class-input ml25" ng-model="lastname" placeholder="请输入您的姓名全称" maxlength="30" /></div>
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">姓名</span><input class="new-class-input ml25" ng-model="lastname" placeholder="请输入您的真实姓名" maxlength="30" /></div>
<div class="course-list-row f13 c-grey3 mt10" style="height:auto;">
<div class="mt5" style="line-height:20px">
<span class="ml15 c-grey3">性别</span>
@ -33,6 +33,12 @@
<span class="f12 c-red fl ml15" ng-show="regFrm.email.$error.email">电子邮箱地址不合法</span>
</div>
</div>
<div ng-show="lastname == '' " class="f12 c-grey6 mt10 ml15">
<span class="f13 c-grey3">提示</span>
<ul class="mb15 mt5 ml10 new-tip">
<li><span class="project-intro-dot"></span>您尚未完善您的基本资料,完善后可使用更多功能</li>
</ul>
</div>
<div class="bottom-tab-wrap mt10">
<a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
<a ng-click="confirm(regFrm)" ng-class="[{'btn-disabled':!regFrm.$valid} ]" class="weixin-tab link-blue2 border-top">确定</a>

View File

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