Przeglądaj źródła

✨ feat(goods-list): 新增商品列表排序功能
- 添加sortBy和sortOrder参数,实现按sort字段倒序排列商品

🐛 fix(carousel): 修复轮播图显示问题
- 将imageMode默认值从aspectFill改为aspectFit
- 修改图片宽度样式从w-auto改为w-full,确保图片正确显示

♻️ refactor(index): 移除调试日志
- 注释掉首页分页和触底加载的console.debug调试信息

📝 docs(profile): 更新版本号
- 将版本信息从v0.0.3更新为v0.0.4

💄 style(category): 调整分类页面样式
- 将右侧容器宽度从500rpx调整为510rpx

yourname 1 miesiąc temu
rodzic
commit
b95b08466b

+ 2 - 2
mini/src/components/ui/carousel.tsx

@@ -67,7 +67,7 @@ export function Carousel({
   showIndicators = true,
   indicatorPosition = 'bottom',
   circular = true,
-  imageMode = 'aspectFill',
+  imageMode = 'aspectFit',
   height = 200,
   rounded = 'md',
   onItemClick,
@@ -176,7 +176,7 @@ export function Carousel({
               <Image
                 src={item.src}
                 mode={imageMode}
-                className="w-auto h-full"
+                className="w-full h-full"
                 lazyLoad
                 showLoading
                 showError

+ 1 - 1
mini/src/pages/category/index.css

@@ -106,7 +106,7 @@
   bottom: 10%;
   right: 1%;
   z-index: 100;
-  width: 500rpx;
+  width: 510rpx;
   height: 700rpx;
   display: flex;
   justify-content: center;

+ 3 - 1
mini/src/pages/goods-list/index.tsx

@@ -49,7 +49,9 @@ export default function GoodsListPage() {
           page: pageParam,
           pageSize: 10,
           keyword: searchKeyword,
-          filters: JSON.stringify(filters)
+          filters: JSON.stringify(filters),
+          sortBy: 'sort', // 按sort字段排序
+          sortOrder: 'DESC' // 倒序排列
         }
       })
       if (response.status !== 200) {

+ 22 - 19
mini/src/pages/index/index.tsx

@@ -83,16 +83,16 @@ const HomePage: React.FC = () => {
       const { pagination } = lastPage
       const totalPages = Math.ceil(pagination.total / pagination.pageSize)
 
-      // 调试信息
-      console.debug('分页信息:', {
-        current: pagination.current,
-        pageSize: pagination.pageSize,
-        total: pagination.total,
-        totalPages,
-        hasNext: pagination.current < totalPages,
-        allPagesCount: allPages.length,
-        allGoodsCount: allPages.flatMap(page => page.data).length
-      })
+      // // 调试信息
+      // console.debug('分页信息:', {
+      //   current: pagination.current,
+      //   pageSize: pagination.pageSize,
+      //   total: pagination.total,
+      //   totalPages,
+      //   hasNext: pagination.current < totalPages,
+      //   allPagesCount: allPages.length,
+      //   allGoodsCount: allPages.flatMap(page => page.data).length
+      // })
 
       return pagination.current < totalPages ? pagination.current + 1 : undefined
     },
@@ -135,13 +135,13 @@ const HomePage: React.FC = () => {
 
   // 触底加载更多
   const handleScrollToLower = () => {
-    console.debug('触底加载更多:', {
-      hasNextPage,
-      isFetchingNextPage,
-      allGoodsCount: allGoods.length,
-      pagesCount: data?.pages?.length || 0,
-      currentPage: data?.pages?.[data.pages.length - 1]?.pagination?.current || 0
-    })
+    // console.debug('触底加载更多:', {
+    //   hasNextPage,
+    //   isFetchingNextPage,
+    //   allGoodsCount: allGoods.length,
+    //   pagesCount: data?.pages?.length || 0,
+    //   currentPage: data?.pages?.[data.pages.length - 1]?.pagination?.current || 0
+    // })
     fetchNextPage();
     // if (hasNextPage && isFetchingNextPage) {
     //   console.debug('开始加载下一页...')
@@ -240,6 +240,7 @@ const HomePage: React.FC = () => {
                 <Text className="error-text">广告加载失败</Text>
               </View>
             ) : finalImgSrcs && finalImgSrcs.length > 0 ? (
+            
               <Carousel
                 items={finalImgSrcs.filter(item => item.imageFile?.fullUrl).map(item => ({
                   src: item.imageFile!.fullUrl,
@@ -250,9 +251,11 @@ const HomePage: React.FC = () => {
                 autoplay={true}
                 interval={4000}
                 circular={true}
-                imageMode="heightFix"
+                imageMode="aspectFit"
               />
-            ) : (
+            
+            )
+            : (
               <View className="empty-container">
                 <Text className="empty-text">暂无广告</Text>
               </View>

+ 1 - 2
mini/src/pages/profile/index.tsx

@@ -278,11 +278,10 @@ const ProfilePage: React.FC = () => {
         {/* 版本信息 */}
         <View className="pb-8">
           <Text className="text-center text-xs text-gray-400">
-            v0.0.3 - 小程序版
+            v0.0.4 - 小程序版
           </Text>
         </View>
       </ScrollView>
-
       {/* 客服弹窗 */}
       <TDesignPopup
         visible={showCustomerService}