style: cleaner register UI with email+code on same line
This commit is contained in:
@@ -8,39 +8,45 @@ const RegisterPage = {
|
|||||||
<div class="pub-card wide">
|
<div class="pub-card wide">
|
||||||
<div class="logo"><i class="fas fa-user-plus"></i><h2>创建账号</h2><p>加入MC举报系统</p></div>
|
<div class="logo"><i class="fas fa-user-plus"></i><h2>创建账号</h2><p>加入MC举报系统</p></div>
|
||||||
<form id="reg-form">
|
<form id="reg-form">
|
||||||
|
|
||||||
|
<div class="form-group"><label>站点用户名</label><input id="ru" required placeholder="用于登录"></div>
|
||||||
|
|
||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
<div class="form-group"><label>站点用户名 *</label><input id="ru" required placeholder="登录用"></div>
|
<div class="form-group"><label>登录密码</label><input type="password" id="rp" required placeholder="至少6位"></div>
|
||||||
<div class="form-group"><label>邮箱 *</label><input type="email" id="re" required placeholder="接收验证码"></div>
|
<div class="form-group"><label>邮箱</label><div style="display:flex;gap:8px">
|
||||||
|
<input type="email" id="re" required placeholder="接收验证码" style="flex:1">
|
||||||
|
<button type="button" class="btn btn-o btn-sm" id="send-code-btn" style="white-space:nowrap">发送验证码</button>
|
||||||
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group"><label>账号来源</label><select id="rs" onchange="RegisterPage.toggleSource()">
|
|
||||||
|
<div class="form-group"><label>帐号来源</label><select id="rs" onchange="RegisterPage.toggleSource()">
|
||||||
<option value="netease">网易端</option><option value="skin">皮肤站</option>
|
<option value="netease">网易端</option><option value="skin">皮肤站</option>
|
||||||
</select></div>
|
</select></div>
|
||||||
<div class="grid-2">
|
|
||||||
<div class="form-group"><label id="rs-label1">游戏名称 *</label><input id="rgn" required placeholder="Minecraft ID"></div>
|
<div class="form-group"><label id="rs-label1">游戏名称</label><input id="rgn" required placeholder="Minecraft ID"></div>
|
||||||
<div class="form-group" id="uid-group"><label id="rs-label2">UID</label><input id="rgu" placeholder="UID"></div>
|
<div class="form-group" id="uid-group"><label id="rs-label2">网易UID</label><input id="rgu" placeholder="仅网易端必填"></div>
|
||||||
|
|
||||||
|
<div class="form-group" id="verify-section">
|
||||||
|
<label>邮箱验证码</label>
|
||||||
|
<div style="display:flex;gap:8px">
|
||||||
|
<input id="vf-code" placeholder="6位数字" maxlength="6" pattern="[0-9]{6}" style="max-width:120px">
|
||||||
|
<span class="help" style="align-self:center">点击上方发送按钮获取</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group"><label>密码 *</label><input type="password" id="rp" required placeholder="至少6位"></div>
|
</div>
|
||||||
|
|
||||||
${this.captcha ? `
|
${this.captcha ? `
|
||||||
<div class="form-group"><label>验证码</label>
|
<div class="form-group"><label>人机验证</label>
|
||||||
<div style="display:flex;align-items:center;gap:10px">
|
<div style="display:flex;align-items:center;gap:10px">
|
||||||
<div id="captcha-img" style="flex-shrink:0;border:1px solid var(--g200);border-radius:var(--r);overflow:hidden;cursor:pointer" onclick="RegisterPage.refreshCaptcha()" title="点击刷新">${this.captcha.svg}</div>
|
<div id="captcha-img" style="flex-shrink:0;border:1px solid var(--g200);border-radius:var(--r);overflow:hidden;cursor:pointer" onclick="RegisterPage.refreshCaptcha()" title="点击刷新">${this.captcha.svg}</div>
|
||||||
<input type="text" id="captcha-a" placeholder="输入图片字符" required style="max-width:100px">
|
<input type="text" id="captcha-a" placeholder="输入图片字符" required style="max-width:100px">
|
||||||
<input type="hidden" id="captcha-id" value="${this.captcha.id}">
|
<input type="hidden" id="captcha-id" value="${this.captcha.id}">
|
||||||
</div>
|
</div>
|
||||||
<div class="help">点击图片刷新验证码</div>
|
<div class="help">点击图片刷新</div>
|
||||||
</div>` : ''}
|
</div>` : ''}
|
||||||
|
|
||||||
<div id="verify-section">
|
|
||||||
<div class="form-group"><label>邮箱验证码</label>
|
|
||||||
<div style="display:flex;gap:8px">
|
|
||||||
<input id="vf-code" placeholder="6位验证码" maxlength="6" pattern="[0-9]{6}" style="flex:1">
|
|
||||||
<button type="button" class="btn btn-o btn-sm" id="send-code-btn" style="white-space:nowrap">发送验证码</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="regerr" class="alert alert-e hidden"></div>
|
<div id="regerr" class="alert alert-e hidden"></div>
|
||||||
<div id="regok" class="alert alert-s hidden"></div>
|
<div id="regok" class="alert alert-s hidden"></div>
|
||||||
<button type="submit" class="btn btn-p btn-lg w-full"><i class="fas fa-user-plus"></i> 完成注册</button>
|
<button type="submit" class="btn btn-p btn-lg w-full"><i class="fas fa-check"></i> 完成注册</button>
|
||||||
</form>
|
</form>
|
||||||
<div style="margin-top:14px;text-align:center;font-size:13px">
|
<div style="margin-top:14px;text-align:center;font-size:13px">
|
||||||
<a href="#/login" style="color:var(--p);text-decoration:none;font-weight:600">已有账号?登录</a>
|
<a href="#/login" style="color:var(--p);text-decoration:none;font-weight:600">已有账号?登录</a>
|
||||||
@@ -52,8 +58,8 @@ const RegisterPage = {
|
|||||||
|
|
||||||
toggleSource() {
|
toggleSource() {
|
||||||
const src = document.getElementById('rs').value;
|
const src = document.getElementById('rs').value;
|
||||||
const labels = { netease:['游戏名称','网易UID'], skin:['游戏名称','皮肤站UUID'] };
|
const labels = { netease:['游戏名称','网易UID'], skin:['游戏名称','皮肤站UUID(自动获取)'] };
|
||||||
document.getElementById('rs-label1').textContent = labels[src][0] + ' *';
|
document.getElementById('rs-label1').textContent = labels[src][0];
|
||||||
document.getElementById('rs-label2').textContent = labels[src][1];
|
document.getElementById('rs-label2').textContent = labels[src][1];
|
||||||
const uidGroup = document.getElementById('uid-group');
|
const uidGroup = document.getElementById('uid-group');
|
||||||
uidGroup.style.display = src === 'netease' ? '' : 'none';
|
uidGroup.style.display = src === 'netease' ? '' : 'none';
|
||||||
@@ -76,7 +82,7 @@ const RegisterPage = {
|
|||||||
const r = await API.post('/auth/send-verify-code', { email });
|
const r = await API.post('/auth/send-verify-code', { email });
|
||||||
this.codeId = r.code_id;
|
this.codeId = r.code_id;
|
||||||
if (r.dev) alert('开发模式,验证码: ' + r.code);
|
if (r.dev) alert('开发模式,验证码: ' + r.code);
|
||||||
btn.textContent = '已发送';
|
btn.textContent = '\u2713 已发送';
|
||||||
document.getElementById('vf-code').focus();
|
document.getElementById('vf-code').focus();
|
||||||
} catch(ex) { alert(ex.message); btn.disabled = false; btn.textContent = '发送验证码'; }
|
} catch(ex) { alert(ex.message); btn.disabled = false; btn.textContent = '发送验证码'; }
|
||||||
});
|
});
|
||||||
@@ -107,7 +113,7 @@ const RegisterPage = {
|
|||||||
setTimeout(() => location.hash = '#/login', 2000);
|
setTimeout(() => location.hash = '#/login', 2000);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
err.textContent = ex.message; err.classList.remove('hidden');
|
err.textContent = ex.message; err.classList.remove('hidden');
|
||||||
btn.disabled = false; btn.innerHTML = '<i class="fas fa-user-plus"></i> 完成注册';
|
btn.disabled = false; btn.innerHTML = '<i class="fas fa-check"></i> 完成注册';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user