瀏覽代碼

换图片

hjx 1 年之前
父節點
當前提交
5c31f90e79

+ 4 - 0
TOKTOK/TOKTOK/Home/BlindBox/DetailsView/XSTTBlindBoxDetailsGoodsTableViewController.m

@@ -9,6 +9,7 @@
 #import "XSTTUIGeneralHeader.h"
 #import "XSTTBlindBoxDetailsModel.h"
 #import <UIImageView+WebCache.h>
+#import "XSTTBeerDetailsViewController.h"
 
 @interface XSTTBlindBoxDetailsGoodsTableViewCell : UITableViewCell {
     UIImageView *_image;
@@ -186,6 +187,9 @@ static NSString * const reuseIdentifier = @"XSTTBlindBoxDetailsGoodsTableViewCel
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     [tableView deselectRowAtIndexPath:indexPath animated:false];
+    XSTTBeerDetailsViewController *vc = XSTTBeerDetailsViewController.new;
+    vc.xstt_productId = _xstt_dataArray[indexPath.row].xstt_productId;
+    [self.navigationController pushViewController:vc animated:true];
 }
 
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {

+ 1 - 0
TOKTOK/TOKTOK/Home/BlindBox/DetailsView/XSTTBlindBoxDetailsModel.h

@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, strong) NSString *xstt_plato;
 @property (nonatomic, strong) NSString *xstt_price;
 @property (nonatomic, strong) NSString *xstt_sp;
+@property (nonatomic, strong) NSString *xstt_productId;
 
 @end
 

+ 21 - 0
TOKTOK/TOKTOK/Home/Home.xcassets/HomeView/home精酿鲜啤.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "精酿鲜啤.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TOKTOK/TOKTOK/Home/Home.xcassets/HomeView/home精酿鲜啤.imageset/精酿鲜啤.png


+ 21 - 0
TOKTOK/TOKTOK/Home/Home.xcassets/HomeView/home酿酒厂.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "filename" : "酿酒厂.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
TOKTOK/TOKTOK/Home/Home.xcassets/HomeView/home酿酒厂.imageset/酿酒厂.png


+ 27 - 37
TOKTOK/TOKTOK/Home/HomeView/XSTTHomeViewController.m

@@ -82,14 +82,13 @@
             [XSTTRouteManager navigationBackAndRouteTo:[[XSTTRouter alloc] initWithClass:nil property:@{} tabBarType:XSTTTabBarTypeBeerCentre]];
             break;
         case 1:
-            [self.navigationController pushViewController:XSTTStoreListViewController.new animated:true];
+            [self.navigationController pushViewController:XSTTBreweryListViewController.new animated:true];
             break;
         case 2:
-            [self.navigationController pushViewController:XSTTBlindBoxToOrderTableViewController.new animated:true];
+            [self.navigationController pushViewController:XSTTStoreListViewController.new animated:true];
             break;
-        case 3: {
-            [self.navigationController pushViewController:XSTTBreweryListViewController.new animated:true];
-        }
+        case 3:
+            [self.navigationController pushViewController:XSTTBlindBoxToOrderTableViewController.new animated:true];
             
             break;
             
@@ -161,67 +160,58 @@
 }
 
 - (void)createFeatureView {
+    CGFloat height = (jxh_screenWidth() - XSTTMargin * 2) * 0.2;
+    
     UIView *featureView = UIView.new;
     [_bgView addSubview:featureView];
     [featureView makeConstraints:^(JXHConstraintMaker *make) {
         make.top.equalTo(self->_headerView.bottom);
         make.leading.and.trailing.equalTo(0);
-        make.height.equalTo(344);
+        make.height.equalTo(height * 4 + 8 * 3 + 16 * 2);
         make.bottom.equalTo(0);
     }];
     
-    NSArray *titles = @[@"精酿鲜啤", @"到店品鉴", @"盲盒订购", @"酿酒厂", @"酒厂直供,最新鲜的鲜啤原浆", @"数百款啤酒,类型丰富、免费试喝", @"亲自酿造一桶酒, 鲜啤定制很OK", @"纯粹好原料,才有鲜活好口感"];
-    CGFloat width = (jxh_screenWidth() - XSTTMargin * 3) / 2;
-    UIView *tempView = nil;
+    NSArray *titles = @[@"精酿鲜啤", @"酿酒厂", @"到店品鉴", @"盲盒订购", @"酒厂直供,最新鲜的鲜啤原浆", @"纯粹好原料,才有鲜活好口感", @"数百款啤酒,类型丰富、免费试喝", @"亲自酿造一桶酒, 鲜啤定制很OK"];
+    
+    UIButton *tempView = nil;
     for (NSInteger i = 0; i < 4; i ++) {
-        UIView *view = UIView.new;
-        [featureView addSubview:view];
-        [view makeConstraints:^(JXHConstraintMaker *make) {
-            if (i % 2 == 0) {
-                make.leading.equalTo(XSTTMargin);
-                if (tempView) {
-                    make.top.equalTo(tempView.bottom).offset(XSTTMargin);
-                } else {
-                    make.top.equalTo(21);
-                }
+        UIButton *button = [UIButton convenienceWithTarget:self action:@selector(featureAction:)];
+        [button setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"home%@", titles[i]]] state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
+        [featureView addSubview:button];
+        [button makeConstraints:^(JXHConstraintMaker *make) {
+            make.leading.equalTo(XSTTMargin);
+            if (tempView) {
+                make.top.equalTo(tempView.bottom).offset(8);
             } else {
-                make.top.equalTo(tempView);
-                make.trailing.equalTo(-XSTTMargin);
+                make.top.equalTo(16);
             }
-            make.size.equalTo((CGSize){width, 141});
+            make.size.equalTo((CGSize){jxh_screenWidth() - XSTTMargin * 2, height});
         }];
         
-        tempView = view;
-        [view.layer setShadowWithOffset:(CGSize){0, 6} alpha:0.1 blur:32 spread:0 color:xstt_A7DDD9_color() cornerRadius:8 pathRect:(CGRect){0, 0, width, 141}];
+        tempView = button;
+//        [view.layer setShadowWithOffset:(CGSize){0, 6} alpha:0.1 blur:32 spread:0 color:xstt_A7DDD9_color() cornerRadius:8 pathRect:(CGRect){0, 0, width, 141}];
         
-        UIButton *button = [UIButton convenienceWithTarget:self action:@selector(featureAction:)];
         button.tag = xstt_homeFeatureButtonTag + i;
-        [view addSubview:button];
-        [button makeConstraints:^(JXHConstraintMaker *make) {
-            make.edges.equalTo(view);
-        }];
-        button.backgroundColor = xstt_FFFFFF_color(1.f);
-        [button.layer setShadowWithOffset:(CGSize){0, 4} alpha:0.1 blur:8 spread:0 color:xstt_A7DDD9_color() cornerRadius:8 pathRect:(CGRect){0, 0, width, 141}];
+//        [button.layer setShadowWithOffset:(CGSize){0, 4} alpha:0.1 blur:8 spread:0 color:xstt_A7DDD9_color() cornerRadius:8 pathRect:(CGRect){0, 0, width, 141}];
         
-        UILabel *title = [UILabel convenienceWithFont:xstt_mediumFont(17) text:titles[i] textColor:xstt_000000_color(0.87) textAlignment:NSTextAlignmentLeft];
+        UILabel *title = [UILabel convenienceWithFont:xstt_semiboldFont(17) text:titles[i] textColor:xstt_FFFFFF_color(1.f) textAlignment:NSTextAlignmentLeft];
         [button addSubview:title];
         [title makeConstraints:^(JXHConstraintMaker *make) {
             make.leading.equalTo(XSTTMargin);
-            make.top.equalTo(65);
+            make.top.equalTo(14);
         }];
         
-        UILabel *content = [UILabel convenienceWithFont:xstt_font(13) textColor:xstt_000000_color(0.6) limitWidth:width - XSTTMargin * 2];
-        [content setAttributedStringWithText:titles[i + 4] lineSpacing:2];
+        UILabel *content = [UILabel convenienceWithFont:xstt_semiboldFont(12) text:titles[i + 4] textColor:xstt_FFFFFF_color(0.8) textAlignment:NSTextAlignmentLeft];
         [button addSubview:content];
         [content makeConstraints:^(JXHConstraintMaker *make) {
             make.leading.equalTo(XSTTMargin);
-            make.top.equalTo(title.bottom).offset(4);
+            make.bottom.equalTo(-13);
         }];
     }
 }
 
 - (void)createBgView {
-    _bgView = [UIScrollView convenienceWithBackgroundColor:xstt_FFFFFF_color(1.0)];
+    _bgView = [UIScrollView convenienceWithBackgroundColor:xstt_F7F7F7_color()];
     _bgView.delegate = self;
     [self.view addSubview:_bgView];
     [_bgView makeConstraints:^(JXHConstraintMaker *make) {