feat: uppdate
This commit is contained in:
@ -256,6 +256,7 @@ export default function ProfileViewFragment(props: IProps) {
|
||||
</div>
|
||||
<DevDiv className={`${PREFIX}__basic-info__content`} OnDev={onDev}>
|
||||
<div>{getBasicInfo(profile)}</div>
|
||||
<div>{profile.workedSecCategoryStr ? `播过:${profile.workedSecCategoryStr}` : ''}</div>
|
||||
</DevDiv>
|
||||
<div className={`${PREFIX}__divider`} />
|
||||
</div>
|
||||
|
||||
@ -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<string>(location.cityCode);
|
||||
const cityValuesChangedRef = useRef(false);
|
||||
const [cityCode, setCityCode] = useState<string>();
|
||||
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<StaffInfo | null>(null);
|
||||
useEffect(() => {
|
||||
if (!cityCode) return;
|
||||
|
||||
getStaffInfo(cityCode)
|
||||
.then(data => {
|
||||
setStaffInfo(data);
|
||||
@ -92,7 +86,7 @@ export default function GroupOwnerCertification() {
|
||||
<div className={`${PREFIX}__lined-title`}>选择城市,添加运营</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__city-select`} onClick={handleClickCityMenu}>
|
||||
{CITY_CODE_TO_NAME_MAP.get(cityCode) || '请选择城市'}
|
||||
{cityCode ? CITY_CODE_TO_NAME_MAP.get(cityCode) : '请选择城市'}
|
||||
<Arrow size={16} />
|
||||
</div>
|
||||
{staffInfo && (
|
||||
|
||||
Reference in New Issue
Block a user