refactor(user): 禁用 loginByOpenId 静默登录并优化登录状态控制
- 移除 UserContext 和 useUser 中的 loginByOpenId 调用及相关降级逻辑 - 无本地 token 时保持未登录状态,不再自动触发静默登录 - 清理无用导入 TenantId 和 loginByOpenId - 订单列表页增加登录校验,未登录用户跳转登录页并阻止渲染订单 - 商城首页价格改为 Price 组件,未登录游客显示登录遮罩,单位仅登录后可见
This commit is contained in:
@@ -13,6 +13,7 @@ import { requireLogin } from '@/utils/login-guard'
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
import EmptyState from '@/components/common/EmptyState'
|
||||
import LoadMore from '@/components/common/LoadMore'
|
||||
import Price from '@/components/common/Price'
|
||||
|
||||
definePageConfig({
|
||||
navigationBarTitleText: '商品分类',
|
||||
@@ -305,24 +306,21 @@ const ShopPage: React.FC = () => {
|
||||
{/* 价格 + 销量 + 加购 */}
|
||||
<View className='flex items-end justify-between'>
|
||||
<View className='flex-1 min-w-0'>
|
||||
<Text className='text-sm text-red-500 font-medium'>
|
||||
¥{getDisplayPrice(item)}
|
||||
</Text>
|
||||
{item.unitName ? (
|
||||
<Price
|
||||
price={getDisplayPrice(item)}
|
||||
original={
|
||||
isVipMember() && item.dealerPrice
|
||||
? item.price
|
||||
: item.salePrice && item.salePrice !== item.price
|
||||
? item.salePrice
|
||||
: undefined
|
||||
}
|
||||
size='small'
|
||||
loginMask
|
||||
/>
|
||||
{item.unitName && !isGuest() ? (
|
||||
<Text className='text-xs text-gray-400'>/{item.unitName}</Text>
|
||||
) : null}
|
||||
{/* VIP 划掉原价 */}
|
||||
{isVipMember() && item.dealerPrice ? (
|
||||
<Text className='text-xs text-gray-400 line-through ml-1'>
|
||||
¥{item.price}
|
||||
</Text>
|
||||
) : item.salePrice && item.salePrice !== item.price ? (
|
||||
isGuest() ? null : (
|
||||
<Text className='text-xs text-gray-400 line-through ml-1'>
|
||||
¥{item.salePrice}
|
||||
</Text>
|
||||
)
|
||||
) : null}
|
||||
{/* 销量 */}
|
||||
{item.sales !== undefined && item.sales > 0 && (
|
||||
<Text className='text-xs text-gray-400 block mt-0.5'>
|
||||
|
||||
Reference in New Issue
Block a user