初步完成登录、注册、修改账号、主页内容

This commit is contained in:
2024-06-13 13:53:54 +08:00
parent e48e752b91
commit ad767a806b
31 changed files with 1291 additions and 488 deletions

View File

@@ -1,28 +1,31 @@
var modify = {}
var modify = {};
modify.showModifyPassword = function() {
let modifyType = document.getElementById('modifyType').value
let modifyType = document.querySelector('.tablinks.active').textContent;
let info = {
modifyPasswordLis: document.getElementsByClassName('modifyPassword'),
modifymobileNoLis: document.getElementsByClassName('modifymobileNo'),
modifyUsernameLis: document.getElementsByClassName('modifyUsername'),
}
// 遍历隐藏所有元素
for (let key in info) {
let elements = info[key];
for (let item of elements) {
item.style.display = 'none'; // 确保所有相关元素被隐藏
item.style.display = 'none';
}
}
// 根据 modifyType 显示相关元素
if (modifyType === "2") {
if (modifyType === "修改密码") {
for (let item of info.modifyPasswordLis) {
item.style.display = 'block';
}
} else if (modifyType === "3") {
} else if (modifyType === "修改手机号") {
for (let item of info.modifymobileNoLis) {
item.style.display = 'block';
}
} else if (modifyType === "修改用户名") {
for (let item of info.modifyUsernameLis) {
item.style.display = 'block';
}
}
}
}