Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
modify register complete note
  • Loading branch information
satouriko committed Sep 9, 2017
1 parent 74e647f commit 8f8d936
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 47 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Expand Up @@ -4,9 +4,6 @@ php:
- 5.6
- 7.0
- 7.1
matrix:
allow_failures:
- php: 7.0

sudo: required

Expand Down
22 changes: 14 additions & 8 deletions app/User.php
Expand Up @@ -18,15 +18,21 @@ public function user_infos()

public function registerCompletion($force = false)
{
if (!$force && ($this->nickname == null || !Storage::exists('avatar/' . $this->id))) {
return 2;
} else if ($this->email == null && $this->wechat_open_id == null) {
return 3;
} else if (!$force && count($this->user_infos) == 0) {
return 4;
if($force) {
if ($this->email == null && $this->wechat_open_id == null && $this->tel == null) {
return 3;
} else
return 0;
} else {
if ($this->nickname == null || !Storage::exists('avatar/' . $this->id)) {
return 2;
} else if ($this->wechat_open_id == null && $this->tel == null) {
return 3;
} // 4 will be never returned unless he skip 3
else
return 0;
}
else
return 0;

}

/* public function trans()
Expand Down
12 changes: 7 additions & 5 deletions resources/views/auth/register3.blade.php
Expand Up @@ -56,7 +56,7 @@ function WidthChange(mq) {
<div class="card-block">
@if(true || $user->email=='' && $user->wechat_open_id=='')
<div class="alert alert-warning" role="alert">
绑定邮箱或手机{{--或微信--}},系统将会在买家或卖家发来消息时利用它们来通知你!
绑定邮箱、微信或手机,系统将会在买家或卖家发来消息时利用它们来通知你!
</div>
@endif
<div class="col col-xs-12 col-md-6 col-centered">
Expand Down Expand Up @@ -89,13 +89,15 @@ function WidthChange(mq) {
@endif

@if($user->wechat_open_id=='')
{{--<div class="password-form">
<div class="password-form" style="padding-top: 1em;">
<div class="input-group">
<label>微信:请在东大小秘书中点击“闲置市场”链接来关联微信。</label>
<label>微信:扫描二维码或在东大小秘书中点击“更多/先锋市场”链接来关联微信。
</label>
<img src="/img/wxqr.png" height="72px" width="72px">
</div>
</div>--}}
</div>
@else
<div class="password-form">
<div class="password-form" style="padding-top: 1em;">
<div class="input-group">
<label>微信:已关联 <span class="nickname">{{$user->wechat->nick_name}}</span></label>
</div>
Expand Down
54 changes: 26 additions & 28 deletions resources/views/user/editUserAccount.blade.php
Expand Up @@ -10,22 +10,21 @@
</div>
<div class="row">
<div class="mx-auto">
@if($user->email=='' && $user->wechat_open_id=='')
@if($user->email=='' && $user->wechat_open_id=='' && $user->tel == '')
<div class="password-form">
<div class="input-group">
<div class="alert alert-danger" role="alert">
<span class="fa fa-exclamation-circle" aria-hidden="true"></span>
{{--既没有绑定邮箱也没有绑定微信--}}没有绑定邮箱,这将导致你无法及时收到消息!
你没有绑定邮箱、微信、手机,这将导致你无法及时收到消息!
</div>
</div>
</div>
@elseif($user->wechat_open_id=='' || true)
@elseif($user->wechat_open_id=='' && $user->tel == '')
<div class="password-form">
<div class="input-group">
<div class="alert alert-warning" role="alert">
<span class="fa fa-exclamation-circle" aria-hidden="true"></span>
{{--你没有绑定微信,这可能导致你无法及时收到消息!--}}
目前短信和微信通知接口尚未开发完成,可能导致你无法及时收到消息,请谅解!
你既没有绑定微信也没有绑定手机,这可能导致你无法及时收到消息!
</div>
</div>
</div>
Expand Down Expand Up @@ -59,6 +58,26 @@
</form>
@endif
</p>
<p>
@if($user->wechat_open_id=='')
<div class="password-form">
<div class="input-group">
<label>微信:扫描二维码或在东大小秘书中点击“更多/先锋市场”链接来关联微信。
</label>
<img src="/img/wxqr.png" height="72px" width="72px">
</div>
</div>
@else
<div class="password-form">
<div class="input-group">
<label>微信:已关联 <span class="nickname">{{$user->wechat->nick_name}}</span></label>
</div>
<div class="input-group">
<img class="head-img col-centered" src="{{$user->wechat->head_img_url}}" width="64px" height="64px">
</div>
</div>
@endif
</p>
<p>
<div id="tel-region" style=""
class="@if($user->tel != '') hide @endif">
Expand Down Expand Up @@ -92,8 +111,7 @@ class="@if($user->tel != '') hide @endif">
<div id="tel-form-toast" class="alert hide" role="alert"
style="margin-top: 0.3em;"></div>
</div>
<div id="tel-dis" class="input-group"
class="@if($user->tel == '') hide @endif">
<div id="tel-dis" class="input-group @if($user->tel == '') hide @endif">
<input type="tel" name="tel-dis" id="tel-dis" class="form-control"
value="{{ $user->tel }}" placeholder="手机" disabled>
<span class="input-group-btn">
Expand All @@ -102,32 +120,12 @@ class="@if($user->tel == '') hide @endif">
</span>
</div>
</p>
<p>
@if($user->wechat_open_id=='')
<div class="password-form">
<div class="input-group">
<label>微信:扫描二维码或在东大小秘书中点击“闲置市场”链接来关联微信。
</label>
<img src="/img/wxqr.png" height="72px" width="72px">
</div>
</div>
@else
<div class="password-form">
<div class="input-group">
<label>微信:已关联 <span class="nickname">{{$user->wechat->nick_name}}</span></label>
</div>
<div class="input-group">
<img class="head-img col-centered" src="{{$user->wechat->head_img_url}}" width="64px" height="64px">
</div>
</div>
@endif
</p>
</div>
</div>
<hr>
<div class="row">
<div class="mx-auto">
@if($user->username=='')
@if($user->username=='' || $user->stuid=='')
<div class="alert alert-info" role="alert">
<span class="fa fa-exclamation-circle" aria-hidden="true"></span>
为你的账户设置其他登录方式
Expand Down
6 changes: 3 additions & 3 deletions tests/AuthTest.php
Expand Up @@ -90,15 +90,15 @@ public function testAfterReg()
->type('0', 'crop_x')
->type('0', 'crop_y')
->press('下一步')
->seePageIs('/register/4');
->seePageIs('/register/3');

//test 3
$this->visit('logout')
->visit('/login')
->type('test@example.com', 'username')
->type('test@example.com', 'password')
->press('登录')
->seePageIs('/register/4');
->seePageIs('/register/3');

//test 0
$this->visit('logout');
Expand All @@ -110,7 +110,7 @@ public function testAfterReg()
->type('test@example.com', 'username')
->type('test@example.com', 'password')
->press('登录')
->seePageIs('/')
->seePageIs('/register/3')
->seeInSession('user_id');
}

Expand Down

0 comments on commit 8f8d936

Please sign in to comment.