mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-08 13:25:31 +08:00
fix(home): 导航栏城市优先展示 LBS 定位
- nearbyText 改为先取 location 市/省,再退回收货地址城市,避免默认北京盖住当前定位 - home-header 去掉硬编码昌平默认文案,改为详细地址或省市区拼接 Made-with: Cursor
This commit is contained in:
@@ -43,7 +43,8 @@ function CustomPage(props) {
|
||||
const loginRef = useRef()
|
||||
const router = useRouter()
|
||||
const { location, address } = useSelector((state) => state.user)
|
||||
const nearbyText = address?.city || location?.city || ''
|
||||
const nearbyText =
|
||||
location?.city || location?.province || address?.city || ''
|
||||
|
||||
useEffect(() => {
|
||||
fetch()
|
||||
|
||||
@@ -46,7 +46,11 @@ function WgtHomeHeader(props) {
|
||||
}
|
||||
}}
|
||||
>
|
||||
<View className='address'>{location?.address || '北京市北京市昌平区'}</View>
|
||||
<View className='address'>
|
||||
{location?.address ||
|
||||
[location?.province, location?.city, location?.district].filter(Boolean).join('') ||
|
||||
'选择地区'}
|
||||
</View>
|
||||
<Text className='iconfont icon-qianwang-01'></Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
@@ -90,7 +90,9 @@ function Home() {
|
||||
|
||||
const showAdv = useSelector((member) => member.user.showAdv)
|
||||
const { location, address } = useSelector((state) => state.user)
|
||||
const nearbyText = address?.city || location?.city || ''
|
||||
/** 导航栏城市:优先跟随 LBS 定位,与「选择商家」页一致;勿用收货地址盖住当前定位 */
|
||||
const nearbyText =
|
||||
location?.city || location?.province || address?.city || ''
|
||||
const { setNavigationBarTitle } = useNavigation()
|
||||
const { updateAddress } = useLocation()
|
||||
const locationKeyRef = useRef('')
|
||||
|
||||
Reference in New Issue
Block a user