소스 검색

修改细节

jiaxian_he 10 달 전
부모
커밋
925b854919

+ 5 - 9
TOKTOK/TOKTOK.xcodeproj/project.pbxproj

@@ -1824,7 +1824,7 @@
 				CODE_SIGN_ENTITLEMENTS = TOKTOK/TOKTOK.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 7;
+				CURRENT_PROJECT_VERSION = 8;
 				DEVELOPMENT_TEAM = BB92G3L793;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -1840,7 +1840,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)/TOKTOK/OtherFrameworks/wechat",
 				);
-				MARKETING_VERSION = 1.0.0;
+				MARKETING_VERSION = 1.0.1;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -1924,7 +1924,7 @@
 				CODE_SIGN_ENTITLEMENTS = TOKTOK/TOKTOK.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 7;
+				CURRENT_PROJECT_VERSION = 8;
 				DEVELOPMENT_TEAM = BB92G3L793;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -1940,7 +1940,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)/TOKTOK/OtherFrameworks/wechat",
 				);
-				MARKETING_VERSION = 1.0.0;
+				MARKETING_VERSION = 1.0.1;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2003,12 +2003,8 @@
 					"\"UserNotifications\"",
 					"-framework",
 					"\"WebKit\"",
-					"-framework",
-					"\"account_login_sdk_noui_core\"",
-					"-weak_framework",
-					"\"Network\"",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.xsbanruo.TOKTOK;
+				PRODUCT_BUNDLE_IDENTIFIER = com.xsbanruo.TOKTOK.debug;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

+ 2 - 1
TOKTOK/TOKTOK/BeerCentre/BeerDetailsView/XSTTBeerDetailsModel.h

@@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
 @interface XSTTBeerDetailsModel : XSTTBaseNetworkModel
 
 @property (nonatomic, strong) NSString *xstt_productId;
-@property (nonatomic, strong) NSArray<XSTTBannerModel *> *xstt_imgUrls;
+@property (nonatomic, strong) NSArray<NSString *> *xstt_imgUrls;
 @property (nonatomic, strong) XSTTBeerInformationModel *xstt_beerInfo;
 @property (nonatomic, strong) NSString *xstt_sp;
 @property (nonatomic, strong) NSString *xstt_exp;
@@ -70,6 +70,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *xstta_wantDrinkNum;
 @property (nonatomic, strong) NSString *xstta_commentNum;
+@property (nonatomic, strong) NSArray<XSTTBannerModel *> *xstta_imgModels;
 
 @end
 

+ 8 - 3
TOKTOK/TOKTOK/BeerCentre/BeerDetailsView/XSTTBeerDetailsModel.m

@@ -49,9 +49,7 @@
     NSMutableArray *resutl = NSMutableArray.new;
     for (id data in imageArray) {
         if (![data isKindOfClass:[NSString class]]) continue;
-        XSTTBannerModel *model = XSTTBannerModel.new;
-        model.xstt_imgUrl = data;
-        [resutl addObject:model];
+        [resutl addObject:data];
     }
     return resutl;
 }
@@ -73,6 +71,13 @@
     } else {
         _xstta_wantDrinkNum = _xstt_wantDrinkNum;
     }
+    NSMutableArray *resutl = NSMutableArray.new;
+    for (id url in _xstt_imgUrls) {
+        XSTTBannerModel *model = XSTTBannerModel.new;
+        model.xstt_imgUrl = url;
+        [resutl addObject:model];
+    }
+    _xstta_imgModels = resutl;
     return [super handleAdditionalProperty];
 }
 

+ 48 - 7
TOKTOK/TOKTOK/BeerCentre/BeerDetailsView/XSTTBeerDetailsViewController.m

@@ -21,6 +21,9 @@
 #import "XSTTBeerDetailsBuyTipsViewController.h"
 #import "XSTTRouteManager.h"
 #import "XSTTBeerDetailsRadarMapView.h"
+#import "XSTTPreviewViewController.h"
+#import "UIViewController+XSTTNavigationBar.h"
+#import "UIViewController+XSTTInitialization.h"
 
 @interface XSTTBeerDetailsViewController ()<XSTTBannerViewPorotocol> {
     JXHCenterButton *_likeButton;
@@ -38,6 +41,7 @@
     UILabel *_bannerCount;
     
     XSTTBeerDetailsModel *_data;
+    XSTTPreviewViewController *_previewVC;
 }
 
 @end
@@ -46,7 +50,9 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    self.title = @"详情";
+    self.xstt_isHiddenNavigationBar = true;
+    [self createNavigationBar];
+    self.xstt_titleLabel.text = @"详情";
     [self getData];
 }
 
@@ -99,7 +105,33 @@
 }
 
 - (void)bannerView:(XSTTBannerView *)bannerView choseIndex:(NSInteger)choseIndex currentImage:(nullable UIImage *)currentImage {
-    
+    if (nil == currentImage) return;
+    CGRect rect = bannerView.frame;
+    CGPoint point = [bannerView convertPoint:CGPointZero toView:xstt_keyWindow()];
+    rect = (CGRect){point, rect.size};
+    XSTTPreviewConfiguration *configuration = XSTTPreviewConfiguration.new;
+    configuration.xstt_images = _data.xstt_imgUrls;
+    configuration.xstt_cornerRadius = 0;
+    
+    _previewVC.xstt_getOriginalRect = ^CGRect(NSInteger index) {
+        if (choseIndex == index) {
+            CGFloat bannerScale = rect.size.width / rect.size.height;
+            CGFloat imageScale = currentImage.size.width / currentImage.size.height;
+            if (bannerScale > imageScale) {
+                CGFloat width = rect.size.height * imageScale;
+                CGFloat x = (rect.size.width - width) / 2;
+                return (CGRect){point.x + x, point.y, width, rect.size.height};
+            } else if (bannerScale < imageScale) {
+                CGFloat height = rect.size.width / imageScale;
+                CGFloat y = (rect.size.height - height) / 2;
+                return (CGRect){point.x, point.y + y, rect.size.width, height};
+            } else {
+                return rect;
+            }
+        }
+        return CGRectZero;
+    };
+    [_previewVC showWithConfiguration:configuration currentImage:currentImage index:choseIndex];
 }
 
 #pragma mark - Network Action
@@ -131,7 +163,7 @@
 
 #pragma mark - UI
 - (void)setupUI {
-    self.title = _data.xstt_beerInfo.xstt_beerName;
+    self.xstt_titleLabel.text = _data.xstt_beerInfo.xstt_beerName;
     [self createBottomView];
     [self createBgView];
     [self createBannerView];
@@ -140,6 +172,15 @@
     [self createBreweryView];
     [self createParameterView];
     [self createTipsView];
+    [self createPreview];
+}
+
+- (void)createPreview {
+    _previewVC = XSTTPreviewViewController.new;
+    _previewVC.xstt_maxPreview = 18;
+    _previewVC.xstt_cancelDismissAnimation = true;
+    [self addChildViewController:_previewVC];
+    [self.view addSubview:_previewVC.view];
 }
 
 #define xstt_beerDetailsViewBottomViewHeight 56
@@ -429,7 +470,7 @@
     _bgView = [UIScrollView convenienceWithBackgroundColor:xstt_F7F7F7_color()];
     [self.view addSubview:_bgView];
     [_bgView makeConstraints:^(JXHConstraintMaker *make) {
-        make.top.equalTo(self.view.safetop);
+        make.top.equalTo(self.xstt_navigationBar.bottom);
         make.leading.and.trailing.equalTo(0);
         make.bottom.equalTo(self.view.safebottom).offset(-xstt_beerDetailsViewBottomViewHeight);
     }];
@@ -449,13 +490,13 @@
         make.top.and.leading.and.trailing.equalTo(0);
         make.size.equalTo((CGSize){bannerWidth, bannerHeight});
     }];
-    _banner.xstt_modelData = _data.xstt_imgUrls;
+    _banner.xstt_modelData = _data.xstta_imgModels;
     
     [self createBannerCountView];
 }
 
 - (void)createBannerCountView {
-    if (_data.xstt_imgUrls.count > 1) {
+    if (_data.xstta_imgModels.count > 1) {
         UIView *countView = UIView.new;
         countView.backgroundColor = xstt_000000_color(0.6);
         [countView setLayerCornerRadius:9 clipToBounds:false];
@@ -478,7 +519,7 @@
 }
 
 - (void)reloadBannerCountView:(NSInteger)index {
-    _bannerCount.text = [NSString stringWithFormat:@"%ld/%ld", index + 1, _data.xstt_imgUrls.count];
+    _bannerCount.text = [NSString stringWithFormat:@"%ld/%ld", index + 1, _data.xstta_imgModels.count];
 }
 
 - (void)createBottomView {

+ 2 - 2
TOKTOK/TOKTOK/Home/BlindBox/DetailsView/XSTTBlindBoxDetailsViewController.m

@@ -95,10 +95,10 @@
     }];
     
     UIView *tips = [self createTipsViewWithTitle:@"温馨提示" tips:
-                    @[@"订购活动提示每月低价惊喜, 周期较长, 若想直接购买酒, 可移至“TOKTOK精酿商城”小程序选购哦",
+                    @[@"鲜啤罐装后,不能回桶,故不支持7天无理由退换,非质量问题不给予退换",
                       @"未成年人和孕妇不得饮酒",
                       @"酒后不能驾驶车辆",
-                      @"小酌怡情, 与新友共饮更欢乐"] line:false];
+                      @"小酌怡情,亲朋好友共饮更欢乐"] line:false];
     [_bgView addSubview:tips];
     [tips makeConstraints:^(JXHConstraintMaker *make) {
         make.leading.and.trailing.equalTo(0);

+ 2 - 1
TOKTOK/TOKTOK/Public/Controller/XSTTPreviewViewController.h

@@ -18,7 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface XSTTPreviewViewController : UIViewController
 
-@property (nonatomic, assign) bool xstt_previewing;
+@property (nonatomic, assign, readonly) bool xstt_previewing;
+@property (nonatomic, assign) bool xstt_cancelDismissAnimation;
 @property (nonatomic, assign) NSUInteger xstt_maxPreview;
 @property (nonatomic, strong) CGRect(^xstt_getOriginalRect)(NSInteger index);
 

+ 2 - 2
TOKTOK/TOKTOK/Public/Controller/XSTTPreviewViewController.m

@@ -137,7 +137,7 @@
     CGRect rect = [self getAnimationImageViewRect];
     _animationView.frame = rect;
     
-    CGRect newRect = [self getImageOriginalRect];
+    CGRect newRect = _xstt_cancelDismissAnimation ? CGRectZero : [self getImageOriginalRect];
     
 //    if (_playLayer) {
 //        [_player playOperate:XSTTVideoOperateStop];
@@ -164,7 +164,7 @@
 //        _animationView.frame = _playView.frame;
 //    }
     
-    CGRect newRect = [self getImageOriginalRect];
+    CGRect newRect = _xstt_cancelDismissAnimation ? CGRectZero : [self getImageOriginalRect];
     
 //    if (_playLayer) {
 //        [_player playOperate:XSTTVideoOperateStop];