feat:
This commit is contained in:
@ -7,8 +7,8 @@ import { useCallback, useState } 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';
|
||||
@ -23,6 +23,7 @@ const EXAMPLE_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-examp
|
||||
const COMMENT_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-comments.png';
|
||||
export default function BizService() {
|
||||
const inviteCode = useInviteCode();
|
||||
const serviceUrls = useServiceUrls();
|
||||
const [value, setValue] = useState('0');
|
||||
|
||||
const handleClickDelegate = useCallback(() => {
|
||||
@ -37,15 +38,18 @@ export default function BizService() {
|
||||
const handleOpenService = useCallback(() => {
|
||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
||||
}, []);
|
||||
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]
|
||||
);
|
||||
const handleChange = useCallback(v => {
|
||||
setValue(v);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user