bug(ECX-7309):

This commit is contained in:
zhangjing1
2025-09-17 11:40:02 +08:00
parent a5aab8c405
commit a86f5500a1
2 changed files with 16 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import S from '@/spx'
function withPageWrapper(Component) { function withPageWrapper(Component) {
return function EnhancedComponent(props) { return function EnhancedComponent(props) {
console.log('withPageWrapper', props)
const dispatch = useDispatch() const dispatch = useDispatch()
const { initState, entryStoreRules, entryStoreByLBS, entryDefalutStore, guidderTemplateId } = const { initState, entryStoreRules, entryStoreByLBS, entryDefalutStore, guidderTemplateId } =
useSelector((state) => state.sys) useSelector((state) => state.sys)
@@ -39,6 +40,19 @@ function withPageWrapper(Component) {
} }
}, [shopInfo]) }, [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 () => { const resolveInStoreRule = async () => {
// 启动时(冷启动+热启动)执行云店进店规则 // 启动时(冷启动+热启动)执行云店进店规则
if (VERSION_STANDARD && Taro.getStorageSync(SG_CHECK_STORE_RULE) == 0) { if (VERSION_STANDARD && Taro.getStorageSync(SG_CHECK_STORE_RULE) == 0) {

View File

@@ -5,6 +5,7 @@ import { AtButton } from 'taro-ui'
import { SpPage, SpCell, SpFloatLayout, SpCheckbox } from '@/components' import { SpPage, SpCell, SpFloatLayout, SpCheckbox } from '@/components'
import { isWeb } from '@/utils' import { isWeb } from '@/utils'
import { View } from '@tarojs/components' import { View } from '@tarojs/components'
import withPageWrapper from '@/hocs/withPageWrapper'
import i18n from '@/lang/consts' import i18n from '@/lang/consts'
import './settings.scss' import './settings.scss'
@@ -98,4 +99,4 @@ const Settings = () => {
) )
} }
export default Settings export default withPageWrapper(Settings)