From c7329a730b819020d836260315c7c39eab79bf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Fri, 5 Dec 2025 09:15:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9formatUserType=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E7=A1=AE=E4=BF=9Dboth=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=BA=E4=B9=B0=E5=8D=96=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/profile/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/profile/index.js b/pages/profile/index.js index 3895419..0e5d1bf 100644 --- a/pages/profile/index.js +++ b/pages/profile/index.js @@ -221,9 +221,15 @@ Page({ this.updateUserTags(userId, serverType) }, - // 格式化用户类型显示 - 直接返回数据库中的type字段值 + // 格式化用户类型显示 formatUserType(type) { - return type || 'not_set' + switch (type) { + case 'buyer': return '买家'; + case 'seller': return '卖家'; + case 'both': return '买卖家'; + case 'buyer+seller': return '买卖家'; + default: return type || 'not_set'; + } }, // 设置为买家