个人页点击昵称弹出修改昵称弹窗
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user