From 11ee9b6eb0183dc1c0f2e3dd985527f11908a80e Mon Sep 17 00:00:00 2001 From: devil_gong Date: Wed, 12 Sep 2018 11:39:55 +0800 Subject: [PATCH] user --- service/Application/Common/Lang/zh-cn.php | 9 +- .../Home/Controller/UserController.class.php | 46 +++++++--- .../Home/View/Default/Index/Index.html | 17 ++-- .../View/Default/Public/HeaderTopNav.html | 8 +- .../Home/View/Default/User/EmailRegInfo.html | 2 +- .../Home/View/Default/User/RegInfo.html | 79 ++++-------------- .../Home/View/Default/User/SmsRegInfo.html | 83 +++++++++++++++++++ .../Temp/38432eb7369925b9a826f2b9f64e2262.php | 2 +- service/Public/Home/Default/Css/Common.css | 23 +++-- service/Public/Home/Default/Css/Index.css | 3 +- service/Public/Home/Default/Css/User.css | 3 +- 11 files changed, 179 insertions(+), 96 deletions(-) mode change 100755 => 100644 service/Application/Home/View/Default/User/RegInfo.html create mode 100755 service/Application/Home/View/Default/User/SmsRegInfo.html diff --git a/service/Application/Common/Lang/zh-cn.php b/service/Application/Common/Lang/zh-cn.php index d6be7f669..3b9f41338 100755 --- a/service/Application/Common/Lang/zh-cn.php +++ b/service/Application/Common/Lang/zh-cn.php @@ -71,14 +71,16 @@ return array( 'common_verify_expire' => '验证码已过期', 'common_verify_error' => '验证码错误', 'common_verify_tips' => '验证码格式 6 位数字', + 'common_close_sms_user_reg_text' => '短信注册', + 'common_close_email_user_reg_text' => '邮箱注册', 'common_close_user_reg_tips' => '暂时关闭用户注册', - 'common_close_sms_user_reg_tips' => '暂时关闭短信用户注册', - 'common_close_email_user_reg_tips' => '暂时关闭邮箱用户注册', + 'common_close_sms_user_reg_tips' => '暂时关闭短信注册', + 'common_close_email_user_reg_tips' => '暂时关闭邮箱注册', 'common_close_user_login_tips' => '暂时关闭用户登录', 'common_send_time_tips' => '还有 {time} 秒', 'common_get_verify_text' => '获取验证码', 'common_img_verify_text' => '图形验证码', - 'common_img_verify_tips' => '请输入图形验证码', + 'common_img_verify_tips' => '请输入有效的图形验证码', 'common_img_sms_verify_text' => '短信验证码', 'common_img_sms_verify_tips' => '请输入短信验证码', 'common_img_verify_submit_text' => '看不清换一张', @@ -262,6 +264,7 @@ return array( 'common_go_top_text' => '回到顶部', 'common_toview_home_text' => '查看首页', 'common_email_send_user_reg_title' => '用户注册', + 'common_email_send_user_forget_title'=> '密码找回', 'common_layout_slider_more_text' => '了解更多', 'common_pay_time_text' => '支付时间', 'common_not_pay_text' => '未支付', diff --git a/service/Application/Home/Controller/UserController.class.php b/service/Application/Home/Controller/UserController.class.php index 2f82d0094..b1055dceb 100755 --- a/service/Application/Home/Controller/UserController.class.php +++ b/service/Application/Home/Controller/UserController.class.php @@ -34,14 +34,11 @@ class UserController extends CommonController private function GetrefererUrl() { // 上一个页面, 空则用户中心 - if(empty($_SERVER['HTTP_REFERER'])) + $referer_url = U('Home/User/Index'); + if(!empty($_SERVER['HTTP_REFERER'])) { - $referer_url = U('Home/Bubble/Index'); - } else { - if(strpos($_SERVER['HTTP_REFERER'], 'RegInfo') !== false || strpos($_SERVER['HTTP_REFERER'], 'LoginInfo') !== false || strpos($_SERVER['HTTP_REFERER'], 'ForgetPwdInfo') !== false) + if(strpos($_SERVER['HTTP_REFERER'], 'RegInfo') === false && strpos($_SERVER['HTTP_REFERER'], 'LoginInfo') === false && strpos($_SERVER['HTTP_REFERER'], 'ForgetPwdInfo') === false) { - $referer_url = U('Home/Bubble/Index'); - } else { $referer_url = $_SERVER['HTTP_REFERER']; } } @@ -78,6 +75,31 @@ class UserController extends CommonController } } + /** + * [RegInfo 用户注册页面] + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2017-03-02T22:48:35+0800 + */ + public function RegInfo() + { + $reg_all = MyC('home_user_reg_state'); + if(!empty($reg_all)) + { + if(empty($this->user)) + { + $this->display('RegInfo'); + } else { + $this->assign('msg', L('common_reg_already_had_tips')); + $this->display('/Public/TipsError'); + } + } else { + $this->assign('msg', L('common_close_user_reg_tips')); + $this->display('/Public/TipsError'); + } + } + /** * [EmailRegInfo 用户注册页面-邮箱] * @author Devil @@ -104,20 +126,20 @@ class UserController extends CommonController } /** - * [RegInfo 用户注册页面-短信] + * [SmsRegInfo 用户注册页面-短信] * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2017-03-02T22:48:35+0800 */ - public function RegInfo() + public function SmsRegInfo() { if(in_array('sms', MyC('home_user_reg_state'))) { if(empty($this->user)) { $this->assign('referer_url', $this->GetrefererUrl()); - $this->display('RegInfo'); + $this->display('SmsRegInfo'); } else { $this->assign('msg', L('common_reg_already_had_tips')); $this->display('/Public/TipsError'); @@ -360,7 +382,7 @@ class UserController extends CommonController if(I('type') == 'sms') { $obj = new \Library\Sms($verify_param); - $state = $obj->SendText(I('accounts'), MyC('home_sms_user_reg'), $code); + $state = $obj->SendCode(I('accounts'), $code, MyC('home_sms_user_reg')); } else { $obj = new \Library\Email($verify_param); $email_param = array( @@ -477,7 +499,7 @@ class UserController extends CommonController if($type == 'mobile') { $obj = new \Library\Sms($verify_param); - $state = $obj->SendText($accounts, MyC('home_sms_user_forget_pwd'), $code); + $state = $obj->SendCode($accounts, $code, MyC('home_sms_user_forget_pwd')); // 邮箱 } else if($type == 'email') @@ -486,7 +508,7 @@ class UserController extends CommonController $email_param = array( 'email' => $accounts, 'content' => MyC('home_email_user_forget_pwd'), - 'title' => MyC('home_site_name').' - '.L('common_email_send_user_reg_title'), + 'title' => MyC('home_site_name').' - '.L('common_email_send_user_forget_title'), 'code' => $code, ); $state = $obj->SendHtml($email_param); diff --git a/service/Application/Home/View/Default/Index/Index.html b/service/Application/Home/View/Default/Index/Index.html index 4a4a759cb..3ec9f196c 100755 --- a/service/Application/Home/View/Default/Index/Index.html +++ b/service/Application/Home/View/Default/Index/Index.html @@ -43,7 +43,7 @@
- + {{:U('Home/User/LoginInfo')}}{{:U('Home/User/Index')}}"> @@ -64,7 +64,7 @@ Hi, {{$user.user_name_view}} - 您好 {{$user.user_name_view}},欢迎来到 {{:MyC('home_site_name')}} + 您好,欢迎来到 {{:MyC('home_site_name')}} @@ -72,12 +72,17 @@ 退出
- + - + +
0待收货 0待发货 diff --git a/service/Application/Home/View/Default/Public/HeaderTopNav.html b/service/Application/Home/View/Default/Public/HeaderTopNav.html index 2526110e6..60be330b4 100755 --- a/service/Application/Home/View/Default/Public/HeaderTopNav.html +++ b/service/Application/Home/View/Default/Public/HeaderTopNav.html @@ -6,8 +6,12 @@