修复已知问题

This commit is contained in:
2025-07-18 18:23:58 +08:00
parent cf1c69b6d6
commit c6d8cac29e
43 changed files with 332 additions and 2061 deletions

View File

@@ -1,6 +1,6 @@
import {useEffect, useState} from "react";
import {Image, Space, Tag, Divider} from '@nutui/nutui-react-taro'
import {Cart} from '@nutui/icons-react-taro'
import {Image} from '@nutui/nutui-react-taro'
import {Share} from '@nutui/icons-react-taro'
import Taro from '@tarojs/taro'
import {ShopGoods} from "@/api/shop/shopGoods/model";
import {pageShopGoods} from "@/api/shop/shopGoods";
@@ -9,11 +9,11 @@ import './BestSellers.scss'
const BestSellers = () => {
const [list, setList] = useState<ShopGoods[]>([])
const reload = () => {
pageShopGoods({}).then(res => {
setList(res?.list || []);
})
console.log(list)
}
useEffect(() => {
@@ -21,48 +21,45 @@ const BestSellers = () => {
}, [])
return (
<div className={'py-0'}>
<div className={'flex flex-col justify-between items-center rounded-lg px-2'}>
{list?.map((item, index) => {
return (
<div key={index} className={'flex flex-col rounded-lg bg-white shadow-sm w-full mb-5'}
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}>
<Image src={item.image} mode={'scaleToFill'}
radius="10px 10px 0 0" height="180"/>
<div className={'flex flex-col p-2 rounded-lg'}>
<div>
<div className={'car-no text-sm'}>{item.name} #{item.goodsId}</div>
<div className={'flex justify-between text-xs py-1'}>
<span className={'text-orange-500'}>Q弹爽口</span>
<span className={'text-gray-400'}> {item.sales}</span>
</div>
<Space>
<Tag plain round background={'#ff0000'}><Divider direction={'vertical'} style={{
borderStyle: 'dashed', padding: '0',
borderColor: '#fd8989', margin: '0 5px'
}}/>210</Tag>
<Tag plain round background={'#ff0000'}><Divider direction={'vertical'} style={{
borderStyle: 'dashed', padding: '0',
borderColor: '#fd8989', margin: '0 5px'
}}/>13</Tag>
</Space>
<div className={'flex justify-between items-center py-2'}>
<div className={'flex text-red-500 text-xl items-baseline'}>
<span className={'text-xs'}></span>
<span className={'font-bold text-2xl'}>19.9</span>
<>
<div className={'py-3'}>
<div className={'flex flex-col justify-between items-center rounded-lg px-2'}>
{list?.map((item, index) => {
return (
<div key={index} className={'flex flex-col rounded-lg bg-white shadow-sm w-full mb-5'}>
<Image src={item.image} mode={'scaleToFill'}
radius="10px 10px 0 0" height="180"
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
<div className={'flex flex-col p-2 rounded-lg'}>
<div>
<div className={'car-no text-sm'}>{item.name}</div>
<div className={'flex justify-between text-xs py-1'}>
<span className={'text-orange-500'}>{item.comments}</span>
<span className={'text-gray-400'}> {item.sales}</span>
</div>
<div className={'buy-btn'}>
<div className={'cart-icon'}><Cart size={20} className={'mx-4 mt-2'} /></div>
<div className={'text-white pl-4 pr-5'}></div>
<div className={'flex justify-between items-center py-2'}>
<div className={'flex text-red-500 text-xl items-baseline'}>
<span className={'text-xs'}></span>
<span className={'font-bold text-2xl'}>{item.price}</span>
</div>
<div className={'buy-btn'}>
<div className={'cart-icon'}>
<Share size={20} className={'mx-4 mt-2'}
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
</div>
<div className={'text-white pl-4 pr-5'}
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
)
})}
)
})}
</div>
</div>
</div>
</>
)
}
export default BestSellers