Browse Source

商品列表跳转商品详情

Abel 1 year ago
parent
commit
d980668466
1 changed files with 11 additions and 1 deletions
  1. 11 1
      Asteria/Fuction/Home/ASProductListViewController.m

+ 11 - 1
Asteria/Fuction/Home/ASProductListViewController.m

@@ -182,8 +182,18 @@
 
 // MARK: - delegate datasource
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+    if (indexPath.section != 2) {
+        return;
+    }
+    NSInteger tempOff = self.vm.cateModel.image.length > 0 ? 1 : 0;
+    if (self.vm.productList.count <= indexPath.row-tempOff)
+    {
+        return;
+    }
     
-    
+    ASProductBaseModel *m = self.vm.productList[indexPath.row-tempOff];
+    UIViewController *viewController = [[CTMediator sharedInstance] Goods_GoodsDetailsC:@{@"entity_id":m.Id}];
+    [self.navigationController pushViewController:viewController animated:YES];
 }
 
 // MARK: - UICollectionViewDataSource