Browse Source

首页展示优化

Abel 1 year ago
parent
commit
a313e8859f

+ 9 - 0
Asteria/Fuction/Home/ASHomeViewController.m

@@ -210,6 +210,9 @@
             cell.productClick = ^(NSInteger i, ASProductBaseModel * _Nonnull m) {
                 [weakSelf goto_WKM_GoodsDetailsC:m.Id];
             };
+            cell.moreClick = ^(ASHomeMainListModel * _Nonnull m) {
+                [weakSelf pushToProductList:m.title typeid:m.typeId];
+            };
             cell.model = m;
             return cell;
         }
@@ -221,6 +224,9 @@
             cell.addCartBlock = ^(NSInteger i, ASProductBaseModel * _Nonnull model) {
                 [weakSelf action_GoodsSizeC: model.Id];
             };
+            cell.moreClick = ^(ASHomeMainListModel * _Nonnull m) {
+                [weakSelf pushToProductList:m.title typeid:m.typeId];
+            };
             [cell setData:m];
             return cell;
         }
@@ -256,6 +262,9 @@
             cell.proAddCartClick = ^(NSInteger i, ASProductBaseModel * _Nonnull model) {
                 [weakSelf action_GoodsSizeC:model.Id];
             };
+            cell.moreClick = ^(ASHomeMainListModel * _Nonnull m) {
+                [weakSelf pushToProductList:m.title typeid:m.typeId];
+            };
             cell.model = m;
             return cell;
         }

+ 2 - 0
Asteria/Fuction/Home/Views/ASHomeBestSellCell.h

@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, copy) void(^productClick)(NSInteger i, ASProductBaseModel *m);
 
+@property (nonatomic, copy) void(^moreClick)(ASHomeMainListModel *m);
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 7 - 0
Asteria/Fuction/Home/Views/ASHomeBestSellCell.m

@@ -34,6 +34,12 @@
     
 }
 
+- (void)moreBtAction:(UIButton *)bt {
+    if (self.moreClick) {
+        self.moreClick(self.model);
+    }
+}
+
 
 - (void)awakeFromNib {
     [super awakeFromNib];
@@ -203,6 +209,7 @@
         bt.layer.borderColor = Col_000.CGColor;
         bt.layer.borderWidth = 1;
         bt.layer.masksToBounds = true;
+        [bt addTarget:self action:@selector(moreBtAction:) forControlEvents:UIControlEventTouchUpInside];
         _moreBt = bt;
     }
     return _moreBt;

+ 1 - 0
Asteria/Fuction/Home/Views/ASHomeFlashDealCell.h

@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, copy) void(^proAddCartClick)(NSInteger i, ASProductBaseModel *m);
 
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 1 - 0
Asteria/Fuction/Home/Views/ASHomeNewInCellTableViewCell.h

@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, copy) void(^productClick)(NSInteger i, ASProductBaseModel *m);
 @property (nonatomic, copy) void(^addCartBlock)(NSInteger i, ASProductBaseModel *m);
+@property (nonatomic, copy) void(^moreClick)(ASHomeMainListModel *m);
 
 //
 -(void)setData:(ASHomeMainListModel *)model;

+ 7 - 0
Asteria/Fuction/Home/Views/ASHomeNewInCellTableViewCell.m

@@ -38,6 +38,12 @@
 }
 
 
+- (void)moreBtAction:(UIButton *)bt {
+    if (self.moreClick) {
+        self.moreClick(self.model);
+    }
+}
+
 - (void)awakeFromNib {
     [super awakeFromNib];
     // Initialization code
@@ -256,6 +262,7 @@
         bt.layer.borderColor = Col_FFF.CGColor;
         bt.layer.borderWidth = 1;
         bt.layer.masksToBounds = true;
+        [bt addTarget:self action:@selector(moreBtAction:) forControlEvents:UIControlEventTouchUpInside];
         _moreBt = bt;
     }
     return _moreBt;