diff --git a/src/components/join-group-hint/index.tsx b/src/components/join-group-hint/index.tsx index f80a654..b5664ee 100644 --- a/src/components/join-group-hint/index.tsx +++ b/src/components/join-group-hint/index.tsx @@ -17,22 +17,25 @@ import './index.less'; const PREFIX = 'join-group-hint'; +const DEFAULT_GROUP = { + name: '播络主播招聘群', + serviceUrl: 'https://work.weixin.qq.com/kfid/kfcc60ac7b6420787a8', +}; + export function JoinGroupHint() { const cityCode = getCurrentCityCode(); const roleType = getRoleTypeWithDefault(); const group = GROUPS.find(g => String(g.cityCode) === cityCode); const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED)); const handleClick = useCallback(() => { - if (!checkCityCode(cityCode)) { + if (group && !checkCityCode(cityCode)) { return; } - if (group) { - openCustomerServiceChat(group.serviceUrl); - Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true); - setClicked(true); - } + openCustomerServiceChat(group ? group.serviceUrl : DEFAULT_GROUP.serviceUrl); + Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true); + setClicked(true); }, [cityCode, group]); - if (!group || !validCityCode(cityCode) || clicked) { + if (!validCityCode(cityCode) || clicked) { return null; } @@ -44,7 +47,9 @@ export function JoinGroupHint() { mode="aspectFit" />