|
|
@@ -73,12 +73,18 @@ const imageViewerVisible = ref(false);
|
|
|
const imageViewerUrlList = ref<string[]>([]);
|
|
|
const imageViewerInitialIndex = ref(0);
|
|
|
|
|
|
+/** 与 ToolBarRight 右上角用户名一致:优先 name,否则 nickName */
|
|
|
+function displayNameLikeHeader(data: Record<string, any> | null | undefined): string {
|
|
|
+ if (!data) return "";
|
|
|
+ return data.name != null ? String(data.name) : String(data.nickName ?? "");
|
|
|
+}
|
|
|
+
|
|
|
const getUserInfo = async () => {
|
|
|
const res: any = await getMerchantByPhone({ phone: userInfo.phone });
|
|
|
if (res.code == 200) {
|
|
|
// 保存用户ID
|
|
|
userId.value = res.data.id || res.data.userId || "";
|
|
|
- form.nickname = res.data.nickName || "";
|
|
|
+ form.nickname = displayNameLikeHeader(res.data);
|
|
|
form.intro = res.data.accountBlurb || "";
|
|
|
// 设置头像
|
|
|
const headImg = res.data.headImg;
|
|
|
@@ -158,6 +164,7 @@ const getSaveUserInfo = async () => {
|
|
|
|
|
|
const res: any = await updateMerchantUserInfo({
|
|
|
id: userId.value,
|
|
|
+ name: form.nickname,
|
|
|
nickName: form.nickname,
|
|
|
headImg: avatarUrl || "",
|
|
|
accountBlurb: form.intro
|