From 0e24ed9b774e48ab7d2bdbe165c2f18645db0a86 Mon Sep 17 00:00:00 2001 From: Ultrame <1019265060@qq.com> Date: Mon, 10 Nov 2025 17:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UserInfo/index.scss | 61 ++++++++++++++---------------- src/components/UserInfo/index.tsx | 53 +++++++++++++++++--------- src/user_pages/edit/index.scss | 12 +++--- src/user_pages/edit/index.tsx | 11 ++++-- src/user_pages/myself/index.scss | 17 +++++---- 5 files changed, 86 insertions(+), 68 deletions(-) diff --git a/src/components/UserInfo/index.scss b/src/components/UserInfo/index.scss index 91a350e..11c94d2 100644 --- a/src/components/UserInfo/index.scss +++ b/src/components/UserInfo/index.scss @@ -1,4 +1,4 @@ -@use '../../scss/common.scss' as *; +@use "../../scss/common.scss" as *; // 用户信息卡片样式 .user_info_card { @@ -38,7 +38,6 @@ } .tag_icon { - /* Auto layout */ display: flex; flex-direction: row; @@ -49,7 +48,6 @@ width: 40px; height: 40px; - /* Inside auto layout */ flex: none; order: 2; @@ -75,7 +73,7 @@ align-items: center; .stat_number { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 600; font-size: 18px; line-height: 1.4em; @@ -84,7 +82,7 @@ } .stat_label { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 500; font-size: 12px; line-height: 1.4em; @@ -139,7 +137,7 @@ transition: all 0.3s ease; &.following { - background: #FFFFFF; + background: #ffffff; color: #000000; .button_text { @@ -157,11 +155,11 @@ } .button_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 600; font-size: 14px; line-height: 1.4em; - color: #FFFFFF; + color: #ffffff; } } @@ -169,7 +167,7 @@ width: 40px; height: 40px; padding: unset; - background: #FFFFFF; + background: #ffffff; border: 0.5px solid rgba(0, 0, 0, 0.12); border-radius: 50%; display: flex; @@ -187,7 +185,7 @@ .edit_button { min-width: 60px; height: 40px; - background: #FFFFFF; + background: #ffffff; border: 0.5px solid rgba(0, 0, 0, 0.12); border-radius: 999px; display: flex; @@ -198,7 +196,7 @@ padding: 0 12px; .button_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 500; font-size: 14px; line-height: 1.4em; @@ -209,7 +207,7 @@ .share_button { min-width: 60px; height: 40px; - background: #FFFFFF; + background: #ffffff; border: 0.5px solid rgba(0, 0, 0, 0.12); border-radius: 999px; display: flex; @@ -221,7 +219,7 @@ margin: 0px !important; .button_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 500; font-size: 14px; line-height: 1.4em; @@ -249,7 +247,7 @@ gap: 4px; padding: 6px 8px; height: 20px; - background: #FFFFFF; + background: #ffffff; border: 0.5px solid rgba(0, 0, 0, 0.16); border-radius: 999px; box-sizing: border-box; @@ -261,7 +259,7 @@ } .tag_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 500; font-size: 11px; line-height: 1.8em; @@ -271,7 +269,7 @@ } .button_edit { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 500; font-size: 11px; line-height: 1.8em; @@ -284,7 +282,7 @@ &::before, &::after { - content: ''; + content: ""; width: 6px; height: 1px; display: inline-block; @@ -316,14 +314,13 @@ } .bio_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 400; font-size: 14px; line-height: 1.571em; color: rgba(0, 0, 0, 0.65); white-space: pre-line; } - } } } @@ -343,7 +340,7 @@ transition: all 0.3s ease; .tab_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 600; font-size: 20px; line-height: 1.4em; @@ -369,7 +366,7 @@ // 球局卡片样式 .game_card { - background: #FFFFFF; + background: #ffffff; border: 0.5px solid rgba(0, 0, 0, 0.08); border-radius: 20px; padding: 0 0 12px; @@ -391,7 +388,7 @@ padding: 12px 15px 0; .game_title { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 600; font-size: 16px; line-height: 1.5em; @@ -414,7 +411,7 @@ padding: 6px 15px 0; .time_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 400; font-size: 12px; line-height: 1.5em; @@ -432,7 +429,7 @@ .location_text, .type_text, .distance_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 400; font-size: 12px; line-height: 1.5em; @@ -440,7 +437,7 @@ } .separator { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 400; font-size: 14px; line-height: 1.3em; @@ -462,7 +459,7 @@ width: 56.44px; height: 56.44px; border-radius: 9px; - border: 1.5px solid #FFFFFF; + border: 1.5px solid #ffffff; &:nth-child(1) { top: 4.18px; @@ -505,7 +502,7 @@ width: 20px; height: 20px; border-radius: 50%; - border: 1px solid #FFFFFF; + border: 1px solid #ffffff; cursor: pointer; transition: transform 0.2s ease; @@ -516,7 +513,7 @@ } .participants_count { - background: #FFFFFF; + background: #ffffff; border: 0.5px solid rgba(0, 0, 0, 0.16); border-radius: 999px; padding: 6px; @@ -526,7 +523,7 @@ justify-content: center; .count_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 500; font-size: 11px; line-height: 1.8em; @@ -541,7 +538,7 @@ gap: 4px; .info_tag { - background: #FFFFFF; + background: #ffffff; border: 0.5px solid rgba(0, 0, 0, 0.16); border-radius: 999px; padding: 6px 8px; @@ -551,7 +548,7 @@ justify-content: center; .tag_text { - font-family: 'PingFang SC'; + font-family: "PingFang SC"; font-weight: 500; font-size: 11px; line-height: 1.8em; @@ -561,4 +558,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index 5a94a09..65b3432 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -41,7 +41,7 @@ import { useCities, useProfessions } from "@/store/pickerOptionsStore"; // 用户信息卡片组件属性 interface UserInfoCardProps { - editable: boolean, + editable: boolean; user_info: Partial; is_current_user: boolean; is_following?: boolean; @@ -85,8 +85,8 @@ export const UserInfoCard: React.FC = ({ const [form_data, set_form_data] = useState>({}); useDidShow(() => { - set_form_data({ ...user_info }) - }) + set_form_data({ ...user_info }); + }); // 职业数据 const professions = useProfessions(); @@ -188,8 +188,8 @@ export const UserInfoCard: React.FC = ({ ) { await updateUserInfo({ ...field }); set_form_data((prev) => { - return { ...prev, ...field } - }) + return { ...prev, ...field }; + }); // 更新本地状态 // setFormData((prev) => ({ ...prev, ...field })); // setUserInfo((prev) => ({ ...prev, ...field })); @@ -198,8 +198,8 @@ export const UserInfoCard: React.FC = ({ const update_data = { [field as string]: value }; await updateUserInfo(update_data); set_form_data((prev) => { - return { ...prev, ...update_data } - }) + return { ...prev, ...update_data }; + }); // 更新本地状态 // setFormData((prev) => ({ ...prev, [field as string]: value })); // setUserInfo((prev) => ({ ...prev, [field as string]: value })); @@ -287,7 +287,7 @@ export const UserInfoCard: React.FC = ({ } return defaultOptions; - } + }; return ( @@ -308,6 +308,7 @@ export const UserInfoCard: React.FC = ({ @@ -335,7 +336,8 @@ export const UserInfoCard: React.FC = ({ 粉丝 - onTab?.("hosted")} > @@ -343,7 +345,8 @@ export const UserInfoCard: React.FC = ({ 主办 - onTab?.("participated")} > @@ -430,7 +433,8 @@ export const UserInfoCard: React.FC = ({ className="tag_item" onClick={() => { editable && handle_open_edit_modal("ntrp_level"); - }}> + }} + > {`NTRP ${user_info.ntrp_level}`} ) : is_current_user ? ( @@ -448,7 +452,8 @@ export const UserInfoCard: React.FC = ({ className="tag_item" onClick={() => { editable && handle_open_edit_modal("occupation"); - }}> + }} + > {user_info.occupation.split(" ")[2]} @@ -466,7 +471,8 @@ export const UserInfoCard: React.FC = ({ {user_info.country || user_info.province || user_info.city ? ( editable && handle_open_edit_modal("location")}> + onClick={() => editable && handle_open_edit_modal("location")} + > {`${user_info.province}${user_info.city}`} ) : is_current_user ? ( @@ -534,7 +540,11 @@ export const UserInfoCard: React.FC = ({ options={cities} visible={location_picker_visible} setvisible={setLocationPickerVisible} - value={form_data.country ? [form_data.country, form_data.province, form_data.city] : getDefaultOption(cities)} + value={ + form_data.country + ? [form_data.country, form_data.province, form_data.city] + : getDefaultOption(cities) + } onChange={handle_location_change} /> )} @@ -558,7 +568,9 @@ export const UserInfoCard: React.FC = ({ img={user_info.avatar_url || ""} visible={ntrp_picker_visible} setvisible={setNtrpPickerVisible} - value={form_data.ntrp_level === "0" ? ["3.0"] : [form_data.ntrp_level]} + value={ + form_data.ntrp_level === "0" ? ["3.0"] : [form_data.ntrp_level] + } onChange={handle_ntrp_level_change} /> )} @@ -570,7 +582,11 @@ export const UserInfoCard: React.FC = ({ options={professions} visible={occupation_picker_visible} setvisible={setOccupationPickerVisible} - value={form_data.occupation ? [...form_data.occupation.split(" ")] : getDefaultOption(professions)} + value={ + form_data.occupation + ? [...form_data.occupation.split(" ")] + : getDefaultOption(professions) + } onChange={handle_occupation_change} /> )} @@ -711,8 +727,9 @@ export const GameTabs: React.FC = ({ {hosted_text} on_tab_change("participated")} > {participated_text} diff --git a/src/user_pages/edit/index.scss b/src/user_pages/edit/index.scss index cd95889..25a36cf 100644 --- a/src/user_pages/edit/index.scss +++ b/src/user_pages/edit/index.scss @@ -5,8 +5,8 @@ circle at 50% 0, /* 光晕圆心在顶部中间 */ rgba(191, 255, 239, 0.9) 0px, /* 中间更深的浅蓝 */ rgba(191, 255, 239, 0.5) 200px, - /* 100px 处开始淡化 */ #FAFAFA 300px, - /* 到 200px 变成白色 */ #FAFAFA 100% /* 200px 以下全白 */ + /* 100px 处开始淡化 */ #fafafa 300px, + /* 到 200px 变成白色 */ #fafafa 100% /* 200px 以下全白 */ ); position: relative; // overflow: hidden; @@ -306,15 +306,15 @@ position: absolute; left: 36px; right: 12px; - height: 0.5px; - background: rgba(0, 0, 0, 0.08); + height: 0.5pt; + background: rgba(0, 0, 0, 0.06); border-radius: 99px; } } .divider { - height: 0.5px; - background-color: rgba(0, 0, 0, 0.08); + height: 0.5pt; + background-color: rgba(0, 0, 0, 0.06); margin-left: 35px; box-sizing: border-box; } diff --git a/src/user_pages/edit/index.tsx b/src/user_pages/edit/index.tsx index 313b06a..bc86a2c 100644 --- a/src/user_pages/edit/index.tsx +++ b/src/user_pages/edit/index.tsx @@ -451,7 +451,10 @@ const EditProfilePage: React.FC = () => { /> - + {/* 生日 */} @@ -603,9 +606,9 @@ const EditProfilePage: React.FC = () => { > {form_data.phone ? form_data.phone.replace( - /(\d{3})(\d{4})(\d{4})/, - "$1 $2 $3" - ) + /(\d{3})(\d{4})(\d{4})/, + "$1 $2 $3" + ) : "未绑定"}