Pārlūkot izejas kodu

修复一番赏赏品详情跳转

zbb 3 mēneši atpakaļ
vecāks
revīzija
abfdb0689b
2 mainītis faili ar 15 papildinājumiem un 0 dzēšanām
  1. 13 0
      app/award-detail-yfs/index.tsx
  2. 2 0
      app/award-detail/swipe.tsx

+ 13 - 0
app/award-detail-yfs/index.tsx

@@ -315,6 +315,19 @@ export default function AwardDetailYfsScreen() {
                     products={data?.luckGoodsList || []}
                     poolId={getSafePoolId()}
                     box={currentBox}
+                    onProductClick={(product) => {
+                        const list = data?.luckGoodsList || [];
+                        const getPId = (p: any) => String(p.id || p.spu?.id || p.spuId || '');
+                        const targetId = getPId(product);
+                        const index = list.findIndex((p: any) => getPId(p) === targetId);
+                        console.log(`[DEBUG-NAV] Clicked ${targetId} (${product.name}). Found index: ${index}`);
+                        if (index !== -1) {
+                            router.push({
+                                pathname: '/award-detail/swipe',
+                                params: { poolId: getSafePoolId(), index }
+                            });
+                        }
+                    }}
                 />
 
                 {/* Floating Buttons */}

+ 2 - 0
app/award-detail/swipe.tsx

@@ -53,6 +53,8 @@ export default function AwardDetailSwipeScreen() {
   const [data, setData] = useState<PoolData | null>(null);
   const [products, setProducts] = useState<ProductItem[]>([]);
   const [currentIndex, setCurrentIndex] = useState(parseInt(index || '0', 10));
+  
+  console.log(`[DEBUG-SWIPE] Init. PoolId: ${poolId}, ParamIndex: ${index}, StateIndex: ${currentIndex}`);
 
   const loadData = useCallback(async () => {
     if (!poolId) return;