This commit is contained in:
chashaobao
2025-10-15 20:44:20 +08:00
parent 7ba04b27ff
commit 3d2b121b92
23 changed files with 724 additions and 65 deletions

View File

@ -7,12 +7,11 @@ import { useCallback, useState } from 'react';
import { RoleType } from '@/constants/app';
import { CacheKey } from '@/constants/cache-key';
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
import { GROUPS } from '@/constants/group';
import useServiceUrls from '@/hooks/use-service-urls';
import { getRoleTypeWithDefault } from '@/utils/app';
import { openCustomerServiceChat } from '@/utils/common';
import { getCurrentCityCode } from '@/utils/location';
import { checkCityCode, validCityCode } from '@/utils/user';
import './index.less';
const PREFIX = 'join-group-hint';
@ -25,7 +24,8 @@ const DEFAULT_GROUP = {
export function JoinGroupHint() {
const cityCode = getCurrentCityCode();
const roleType = getRoleTypeWithDefault();
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
const serviceUrls = useServiceUrls();
const group = serviceUrls.find(g => String(g.cityCode) === cityCode);
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
const handleClick = useCallback(() => {
if (group && !checkCityCode(cityCode)) {