个人页点击昵称弹出修改昵称弹窗

This commit is contained in:
2025-11-18 17:23:37 +08:00
parent c8cf22507c
commit 5ecb352d1b
2 changed files with 83 additions and 26 deletions

View File

@@ -316,7 +316,11 @@ const EditProfilePage: React.FC = () => {
// 处理地区选择
const handle_location_change = (e: any) => {
if (!Array.isArray(e) || e.length < 3 || e.some((v) => v === undefined || v === null)) {
if (
!Array.isArray(e) ||
e.length < 3 ||
e.some((v) => v === undefined || v === null)
) {
Taro.showToast({
title: "请完整选择地区",
icon: "none",
@@ -324,10 +328,10 @@ const EditProfilePage: React.FC = () => {
return;
}
const [country, province, city] = e;
handle_field_edit({
country: String(country ?? ""),
province: String(province ?? ""),
city: String(city ?? "")
handle_field_edit({
country: String(country ?? ""),
province: String(province ?? ""),
city: String(city ?? ""),
});
};
@@ -346,7 +350,11 @@ const EditProfilePage: React.FC = () => {
// 处理职业选择
const handle_occupation_change = (e: any) => {
if (!Array.isArray(e) || e.length === 0 || e.some((v) => v === undefined || v === null)) {
if (
!Array.isArray(e) ||
e.length === 0 ||
e.some((v) => v === undefined || v === null)
) {
Taro.showToast({
title: "请完整选择职业",
icon: "none",
@@ -354,7 +362,10 @@ const EditProfilePage: React.FC = () => {
return;
}
// 职业可能是多级联动,将所有选中的值用空格连接
const occupation_value = e.map((v) => String(v ?? "")).filter(Boolean).join(" ");
const occupation_value = e
.map((v) => String(v ?? ""))
.filter(Boolean)
.join(" ");
handle_field_edit("occupation", occupation_value);
};