feat:
This commit is contained in:
@ -5,8 +5,8 @@ import { useCallback } from 'react';
|
||||
import HomePage from '@/components/home-page';
|
||||
import SearchCity from '@/components/search-city';
|
||||
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||
import { GROUPS } from '@/constants/group';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useServiceUrls from '@/hooks/use-service-urls';
|
||||
import { switchRoleType } from '@/utils/app';
|
||||
import { openCustomerServiceChat } from '@/utils/common';
|
||||
import { getCurrentCityCode } from '@/utils/location';
|
||||
@ -20,6 +20,7 @@ const PREFIX = 'group-v2-page';
|
||||
|
||||
export default function GroupV2() {
|
||||
const inviteCode = useInviteCode();
|
||||
const serviceUrls = useServiceUrls();
|
||||
|
||||
useLoad(() => {
|
||||
switchRoleType(RoleType.Anchor);
|
||||
@ -32,15 +33,18 @@ export default function GroupV2() {
|
||||
getCommonShareMessage({ inviteCode, title: '邀请你加入本地主播求职招聘群', path: PageUrl.GroupV2 })
|
||||
);
|
||||
|
||||
const handleSelectCity = useCallback(cityCode => {
|
||||
if (!checkCityCode(cityCode)) {
|
||||
return;
|
||||
}
|
||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
||||
if (group) {
|
||||
openCustomerServiceChat(group.serviceUrl);
|
||||
}
|
||||
}, []);
|
||||
const handleSelectCity = useCallback(
|
||||
cityCode => {
|
||||
if (!checkCityCode(cityCode)) {
|
||||
return;
|
||||
}
|
||||
const group = serviceUrls.find(g => String(g.cityCode) === cityCode);
|
||||
if (group) {
|
||||
openCustomerServiceChat(group.serviceUrl);
|
||||
}
|
||||
},
|
||||
[serviceUrls]
|
||||
);
|
||||
|
||||
return (
|
||||
<HomePage type={PageType.GroupV2}>
|
||||
|
||||
Reference in New Issue
Block a user