初步完成登录、注册、修改账号、主页内容
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user