From 966c0782fcf3cf5027d41f12cfd82a0ddfe23582 Mon Sep 17 00:00:00 2001 From: chashaobao Date: Thu, 13 Nov 2025 01:37:53 +0800 Subject: [PATCH] feat: uppdate --- src/fragments/profile/view/index.tsx | 1 + src/pages/group-owner-certification/index.tsx | 20 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/fragments/profile/view/index.tsx b/src/fragments/profile/view/index.tsx index cbc42b2..409fb8a 100644 --- a/src/fragments/profile/view/index.tsx +++ b/src/fragments/profile/view/index.tsx @@ -256,6 +256,7 @@ export default function ProfileViewFragment(props: IProps) {
{getBasicInfo(profile)}
+
{profile.workedSecCategoryStr ? `播过:${profile.workedSecCategoryStr}` : ''}
diff --git a/src/pages/group-owner-certification/index.tsx b/src/pages/group-owner-certification/index.tsx index 24e4f9e..0644d5c 100644 --- a/src/pages/group-owner-certification/index.tsx +++ b/src/pages/group-owner-certification/index.tsx @@ -3,7 +3,7 @@ import Taro, { useShareAppMessage } from '@tarojs/taro'; import { Tabs } from '@taroify/core'; import { Arrow } from '@taroify/icons'; -import { Fragment, useCallback, useEffect, useRef, useState } from 'react'; +import { Fragment, useCallback, useEffect, useState } from 'react'; import GroupCertificationList from '@/components/group-certification-list'; import { EventName, OpenSource, PageUrl } from '@/constants/app'; @@ -21,8 +21,7 @@ const PREFIX = 'group-owner-certification'; export default function GroupOwnerCertification() { const location = useLocation(); const inviteCode = useInviteCode(); - const [cityCode, setCityCode] = useState(location.cityCode); - const cityValuesChangedRef = useRef(false); + const [cityCode, setCityCode] = useState(); Taro.showShareMenu({ withShareTicket: true, }); @@ -39,8 +38,8 @@ export default function GroupOwnerCertification() { }); const handleClickCityMenu = useCallback(() => { - navigateTo(PageUrl.CitySearch, { city: cityCode, source: OpenSource.GroupOwnerCertificate }); - }, [cityCode]); + navigateTo(PageUrl.CitySearch, { city: cityCode || location.cityCode, source: OpenSource.GroupOwnerCertificate }); + }, [cityCode, location.cityCode]); const handleCityChange = useCallback(data => { console.log('handleCityChange', data); @@ -48,16 +47,9 @@ export default function GroupOwnerCertification() { if (openSource !== OpenSource.GroupOwnerCertificate) { return; } - cityValuesChangedRef.current = true; setCityCode(cCode); }, []); - useEffect(() => { - if (cityValuesChangedRef.current) { - return; - } - setCityCode(location.cityCode); - }, [location]); useEffect(() => { Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange); return () => { @@ -67,6 +59,8 @@ export default function GroupOwnerCertification() { const [staffInfo, setStaffInfo] = useState(null); useEffect(() => { + if (!cityCode) return; + getStaffInfo(cityCode) .then(data => { setStaffInfo(data); @@ -92,7 +86,7 @@ export default function GroupOwnerCertification() {
选择城市,添加运营
- {CITY_CODE_TO_NAME_MAP.get(cityCode) || '请选择城市'} + {cityCode ? CITY_CODE_TO_NAME_MAP.get(cityCode) : '请选择城市'}
{staffInfo && (