From a86f5500a17561a2f7650a12152f0f100827352e Mon Sep 17 00:00:00 2001 From: zhangjing1 Date: Wed, 17 Sep 2025 11:40:02 +0800 Subject: [PATCH] bug(ECX-7309): --- src/hocs/withPageWrapper.js | 14 ++++++++++++++ src/subpages/member/settings.jsx | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/hocs/withPageWrapper.js b/src/hocs/withPageWrapper.js index fc992c8a9..7cafacee1 100644 --- a/src/hocs/withPageWrapper.js +++ b/src/hocs/withPageWrapper.js @@ -13,6 +13,7 @@ import S from '@/spx' function withPageWrapper(Component) { return function EnhancedComponent(props) { + console.log('withPageWrapper', props) const dispatch = useDispatch() const { initState, entryStoreRules, entryStoreByLBS, entryDefalutStore, guidderTemplateId } = useSelector((state) => state.sys) @@ -39,6 +40,19 @@ function withPageWrapper(Component) { } }, [shopInfo]) + // 监听语言切换,刷新店铺信息 + useEffect(() => { + const onLangChanged = async () => { + try { + await checkStoreWhiteList(shopInfo?.distributor_id) + } catch (e) {} + } + Taro.eventCenter && Taro.eventCenter.on('languageChanged', onLangChanged) + return () => { + Taro.eventCenter && Taro.eventCenter.off('languageChanged', onLangChanged) + } + }, []) + const resolveInStoreRule = async () => { // 启动时(冷启动+热启动)执行云店进店规则 if (VERSION_STANDARD && Taro.getStorageSync(SG_CHECK_STORE_RULE) == 0) { diff --git a/src/subpages/member/settings.jsx b/src/subpages/member/settings.jsx index cce6406cd..1aabee61f 100644 --- a/src/subpages/member/settings.jsx +++ b/src/subpages/member/settings.jsx @@ -5,6 +5,7 @@ import { AtButton } from 'taro-ui' import { SpPage, SpCell, SpFloatLayout, SpCheckbox } from '@/components' import { isWeb } from '@/utils' import { View } from '@tarojs/components' +import withPageWrapper from '@/hocs/withPageWrapper' import i18n from '@/lang/consts' import './settings.scss' @@ -98,4 +99,4 @@ const Settings = () => { ) } -export default Settings +export default withPageWrapper(Settings)