diff --git a/.workbuddy/memory/2026-07-11.md b/.workbuddy/memory/2026-07-11.md new file mode 100644 index 0000000..58069c2 --- /dev/null +++ b/.workbuddy/memory/2026-07-11.md @@ -0,0 +1,8 @@ +# 2026-07-11 + +## 商品列表布局改为一排两个方格 +- 文件:`src/pages/shop/index.tsx` 商品列表区域 +- 改动:从「一排一个横向卡片(左小图+右信息)」改为「一排两个竖向方格卡片」 +- 实现:容器 `flex flex-wrap`,每项 `w-1/2 p-1`;卡片竖向结构:图片(`h-36`, `mode=aspectFill`)在上,商品信息在下 +- 顶部搜索栏、左侧分类栏、排序栏保持不变 +- 注:`tsc --noEmit` 报 TS2688(@tarojs/taro 类型缺失) 为改动前既有问题,非本次引入 diff --git a/src/pages/shop/index.tsx b/src/pages/shop/index.tsx index 839447e..5951908 100644 --- a/src/pages/shop/index.tsx +++ b/src/pages/shop/index.tsx @@ -259,73 +259,75 @@ const ShopPage: React.FC = () => { > {goodsList.length > 0 ? ( - + {goodsList.map(item => ( goDetail(item)} > - {/* 商品图片 */} - - - - - {/* 商品信息 */} - - {/* 标题 + 积分标签 */} - - - {item.name || item.goodsName} - - {item.gainIntegral && item.gainIntegral > 0 ? ( - - - +{item.gainIntegral}积分 - - - ) : null} + + {/* 商品图片 */} + + - {/* 价格 + 销量 + 加购 */} - - - - ¥{getDisplayPrice(item)} + {/* 商品信息 */} + + {/* 标题 + 积分标签 */} + + + {item.name || item.goodsName} - {item.unitName ? ( - /{item.unitName} - ) : null} - {/* VIP 划掉原价 */} - {isVipMember() && item.dealerPrice ? ( - - ¥{item.price} - - ) : item.salePrice && item.salePrice !== item.price ? ( - isGuest() ? null : ( - - ¥{item.salePrice} + {item.gainIntegral && item.gainIntegral > 0 ? ( + + + +{item.gainIntegral}积分 - ) + ) : null} - {/* 销量 */} - {item.sales !== undefined && item.sales > 0 && ( - - 已售{item.sales} - - )} - {/* 加购按钮 */} - handleAddToCart(e, item)} - > - + + + {/* 价格 + 销量 + 加购 */} + + + + ¥{getDisplayPrice(item)} + + {item.unitName ? ( + /{item.unitName} + ) : null} + {/* VIP 划掉原价 */} + {isVipMember() && item.dealerPrice ? ( + + ¥{item.price} + + ) : item.salePrice && item.salePrice !== item.price ? ( + isGuest() ? null : ( + + ¥{item.salePrice} + + ) + ) : null} + {/* 销量 */} + {item.sales !== undefined && item.sales > 0 && ( + + 已售{item.sales} + + )} + + {/* 加购按钮 */} + handleAddToCart(e, item)} + > + + +