|
23 | 23 | <div class="login-container"> |
24 | 24 | <div class="login-box animate-fade-in"> |
25 | 25 | <div class="header-row"> |
26 | | - @if (isEmailEntered) |
| 26 | + @if (!isAuth) |
27 | 27 | { |
28 | | - <button @onclick="GoBack" aria-label="返回" class="back-button"> |
29 | | - <span> |
30 | | - <i class="fa-solid fa-arrow-left"></i> |
31 | | - </span> |
32 | | - </button> |
| 28 | + if (isEmailEntered) |
| 29 | + { |
| 30 | + <button @onclick="GoBack" aria-label="返回" class="back-button"> |
| 31 | + <span> |
| 32 | + <i class="fa-solid fa-arrow-left"></i> |
| 33 | + </span> |
| 34 | + </button> |
| 35 | + } |
| 36 | + |
| 37 | + <div class="logo-container"> |
| 38 | + <h1 class="blazor-text">BootstrapBlazor</h1> |
| 39 | + </div> |
| 40 | + } |
| 41 | + else |
| 42 | + { |
| 43 | + <div class="logo-container"> |
| 44 | + <h1 class="blazor-text">BootstrapBlazor</h1> |
| 45 | + </div> |
33 | 46 | } |
34 | | - <div class="logo-container"> |
35 | | - <h1 class="blazor-text">BootstrapBlazor</h1> |
36 | | - </div> |
37 | 47 | </div> |
38 | 48 | @if (!isEmailEntered) |
39 | 49 | { |
40 | | - <h2>登录</h2> |
| 50 | + <h3>登录</h3> |
41 | 51 | <p class="subtitle">使用你的 BootstrapBlazor 帐户。</p> |
42 | | - <BootstrapInput type="email" class="input" placeholder="电子邮件或电话号码" @bind-Value="email" /> |
| 52 | + <BootstrapInput type="email" class="input" placeholder="电子邮件或电话号码" @bind-Value="email"></BootstrapInput> |
43 | 53 | <div class="error" hidden="@(!showEmailError)">请输入有效的电子邮件地址或电话号码</div> |
44 | 54 | <Button class="button" Color="Color.Primary" OnClick="OnEmailSubmit">下一步</Button> |
45 | 55 | <div class="links"> |
46 | | - <a href="#">忘记用户名?</a> |
| 56 | + <a href="#" @onclick:preventDefault>忘记用户名?</a> |
47 | 57 | </div> |
48 | 58 | <div class="small"> |
49 | 59 | 不熟悉 BootstrapBlazor?<a href="/">去看文档</a> |
50 | 60 | </div> |
51 | 61 | } |
52 | | - else |
| 62 | + else if (!isAuth) |
53 | 63 | { |
54 | | - <h2>输入你的密码</h2> |
| 64 | + <h3>输入你的密码</h3> |
55 | 65 | <p class="email-display">@email</p> |
56 | | - <BootstrapInput type="password" class="input" placeholder="密码" @bind-Value="password" /> |
| 66 | + <BootstrapInput type="password" class="input" placeholder="密码" @bind-Value="password"></BootstrapInput> |
57 | 67 | <div class="links"> |
58 | | - <a href="#">忘记了密码?</a> |
| 68 | + <a href="#" @onclick:preventDefault>忘记了密码?</a> |
59 | 69 | </div> |
60 | | - <Button class="button" Color="Color.Primary">下一步</Button> |
| 70 | + <Button class="button" Color="Color.Primary" OnClick="OnPasswordSubmit">下一步</Button> |
61 | 71 | <div class="links"> |
62 | | - <a href="#">其他登录方法</a> |
| 72 | + <a href="#" @onclick:preventDefault>其他登录方法</a> |
| 73 | + </div> |
| 74 | + } |
| 75 | + else |
| 76 | + { |
| 77 | + <div class="email-display2"><span>@email</span></div> |
| 78 | + <h5 class="text-center mt-3 mb-0">欢迎,您已成功登录</h5> |
| 79 | + <div class="login-video-wrap"> |
| 80 | + <video class="login-video" autoplay="autoplay" playsinline="playsinline" disablepictureinpicture=""> |
| 81 | + <source src="samples/login5/loading1.mp4" type="video/mp4; codecs=av01.0.05M.08"> |
| 82 | + <source src="samples/login5/loading.mov" type="video/quicktime; codecs=hvc1.1.6.H120.b0"> |
| 83 | + <source src="samples/login5/loading.webm" type="video/webm; codecs=vp9"> |
| 84 | + <source src="samples/login5/loading.mp4" type="video/mp4; codecs=avc1.42E01E"> |
| 85 | + <img src="samples/login5/loading.png" alt="" role="presentation"> |
| 86 | + </video> |
63 | 87 | </div> |
| 88 | + <p class="text-center text-muted" style="font-size: 0.75rem;">此登录高仿微软登录 UI</p> |
| 89 | + <Button class="button" Color="Color.Primary" OnClick="OnEnterSubmit">进入</Button> |
64 | 90 | } |
65 | 91 | </div> |
66 | 92 | </div> |
67 | 93 | </div> |
68 | 94 |
|
69 | 95 | @code { |
70 | 96 | private bool isEmailEntered = false; |
71 | | - private string email = ""; |
72 | | - private string password = ""; |
| 97 | + private bool isAuth = false; |
| 98 | + private string email = "[email protected]"; |
| 99 | + private string password = "123456"; |
73 | 100 | private bool showEmailError = false; |
74 | 101 |
|
75 | 102 | private void OnEmailSubmit() |
|
85 | 112 | } |
86 | 113 | } |
87 | 114 |
|
| 115 | + private void OnPasswordSubmit() |
| 116 | + { |
| 117 | + // 数据库检查密码逻辑可以在这里实现 |
| 118 | + // 演示代码一律通过 |
| 119 | + isAuth = true; |
| 120 | + } |
| 121 | + |
| 122 | + private void OnEnterSubmit() |
| 123 | + { |
| 124 | + |
| 125 | + } |
| 126 | + |
88 | 127 | private void GoBack() |
89 | 128 | { |
90 | 129 | isEmailEntered = false; |
|
0 commit comments