改进 Alert 组件

This commit is contained in:
iVampireSP.com 2023-01-15 07:45:44 +08:00
parent 429b25afee
commit f544759fba
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 8 additions and 11 deletions

View File

@ -113,6 +113,11 @@ private function getBirthdayFromIdCard(): string
return $year . '-' . $month . '-' . $day;
}
public function isAdult(): bool
{
return $this->birthday_at->diffInYears(now()) >= 18;
}
public function user_group(): BelongsTo
{
return $this->belongsTo(UserGroup::class);

View File

@ -5,17 +5,9 @@
@php($user = auth('web')->user())
@if ($user->real_name_verified_at)
<div class="alert alert-success d-flex align-items-center alert-dismissible fade show" role="alert">
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Success:">
<use xlink:href="#check-circle-fill"/>
</svg>
<div>
<div>
您已经完成实人认证。
</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>
<x-alert-success>
您已经完成实人认证。
</x-alert-success>
@else
@if ($user->balance < 1)
您的余额不足 1 元,无法完成实人认证。