diff --git a/project.config.json b/project.config.json index 839e034..15d90c1 100644 --- a/project.config.json +++ b/project.config.json @@ -2,7 +2,7 @@ "miniprogramRoot": "dist/", "projectname": "playBallTogether", "description": "playBallTogether", - "appid": "wx915ecf6c01bea4ec", + "appid": "wx815b533167eb7b53", "setting": { "urlCheck": true, "es6": true, diff --git a/src/components/Picker/PopupPicker.tsx b/src/components/Picker/PopupPicker.tsx index 85111cf..c9803fb 100644 --- a/src/components/Picker/PopupPicker.tsx +++ b/src/components/Picker/PopupPicker.tsx @@ -52,7 +52,7 @@ const PopupPicker = ({ ntrpTested, }: PickerProps) => { const [defaultValue, setDefaultValue] = useState<(string | number)[]>([]); - const [defaultOptions, setDefaultOptions] = useState([]); + const [defaultOptions, setDefaultOptions] = useState([...options]); const [pickerCurrentValue, setPickerCurrentValue] = useState<(string | number)[]>(value); diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index 788b945..0408782 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -10,6 +10,7 @@ import { useUserActions, useNicknameChangeStatus, useLastTestResult, + useUserInfo, } from "@/store/userStore"; import { UserInfoType } from "@/services/userService"; import { @@ -73,7 +74,6 @@ const on_edit = () => { // 用户信息卡片组件 const UserInfoCardComponent: React.FC = ({ editable = true, - user_info, is_current_user, is_following = false, collapseProfile, @@ -84,6 +84,8 @@ const UserInfoCardComponent: React.FC = ({ set_user_info, onTab, }) => { + + const user_info = useUserInfo(); const nickname_change_status = useNicknameChangeStatus(); const { setShowGuideBar } = useGlobalState(); const { updateUserInfo, updateNickname, fetchLastTestResult } = @@ -122,11 +124,15 @@ const UserInfoCardComponent: React.FC = ({ useState(false); // 表单状态 - const [form_data, set_form_data] = useState>({}); + const [form_data, set_form_data] = useState>({ ...user_info }); - useDidShow(() => { + // useDidShow(() => { + // set_form_data({ ...user_info }); + // }); + + useEffect(() => { set_form_data({ ...user_info }); - }); + }, [user_info]) useEffect(() => { const visibles = [ @@ -372,7 +378,6 @@ const UserInfoCardComponent: React.FC = ({ urls: [url], }); }; - return ( {/* 头像和基本信息 */} @@ -413,11 +418,11 @@ const UserInfoCardComponent: React.FC = ({ = ({ )} @@ -868,9 +873,8 @@ export const GameTabs: React.FC = ({ {hosted_text} on_tab_change("participated")} > {participated_text}