fix(search): 修复搜索页商品状态筛选条件错误
- 将搜索页商品筛选条件由 isShow: 1 修改为 status: 0,统一与商城主页规则 - 确认收藏列表和浏览历史不受影响,维护数据一致性 feat(price): 全站商品价格登录后可见脱敏实现 - 将所有硬编码价格替换为支持游客脱敏的 <Price loginMask> 组件 - 覆盖首页热销、收藏列表、秒杀列表、秒杀详情、拼团列表和拼团详情多个页面 - 秒杀详情价格组件支持白色字体,保持视觉效果一致
This commit is contained in:
@@ -9,6 +9,7 @@ import { pageShopGoods } from '@/api/shop/shopGoods'
|
||||
import type { CmsAd } from '@/api/cms/cmsAd/model'
|
||||
import type { CmsArticle } from '@/api/cms/cmsArticle/model'
|
||||
import type { ShopGoods } from '@/api/shop/shopGoods/model'
|
||||
import Price from '@/components/common/Price'
|
||||
|
||||
definePageConfig({
|
||||
navigationBarTitleText: '首页',
|
||||
@@ -241,10 +242,12 @@ const IndexPage: React.FC = () => {
|
||||
<View className='p-2'>
|
||||
<Text className='text-sm text-gray-700 truncate block'>{item.goodsName || item.name}</Text>
|
||||
<View className='flex items-center mt-1'>
|
||||
<Text className='text-sm font-bold text-red-500 mr-1'>¥{item.price || '0'}</Text>
|
||||
{item.salePrice && item.salePrice !== item.price && (
|
||||
<Text className='text-xs text-gray-400 line-through'>¥{item.salePrice}</Text>
|
||||
)}
|
||||
<Price
|
||||
price={item.price || '0'}
|
||||
original={item.salePrice && item.salePrice !== item.price ? item.salePrice : undefined}
|
||||
size='small'
|
||||
loginMask
|
||||
/>
|
||||
</View>
|
||||
{item.sales !== undefined && item.sales > 0 && (
|
||||
<Text className='text-xs text-gray-400 mt-1'>已售 {item.sales}</Text>
|
||||
|
||||
@@ -31,7 +31,7 @@ const SearchPage: React.FC = () => {
|
||||
if (!q.trim()) return
|
||||
setLoading(true)
|
||||
try {
|
||||
const params: ShopGoodsParam = { keywords: q, isShow: 1, page: 1, limit: 20 }
|
||||
const params: ShopGoodsParam = { keywords: q, status: 0, page: 1, limit: 20 }
|
||||
const res = await pageShopGoods(params)
|
||||
setList(res?.list || [])
|
||||
// 保存搜索历史
|
||||
|
||||
Reference in New Issue
Block a user