diff --git a/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj b/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj index 83c060d..493439d 100644 --- a/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj +++ b/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ 57232BB7F95997E2D46B9CF8 /* Pods_TreeHole.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A36C0BF581F207BA348D1A2 /* Pods_TreeHole.framework */; }; 5FF295EA8835717BF58B93F6 /* Pods_HoleNotification.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74C6371F8879CD5C14B77D4D /* Pods_HoleNotification.framework */; }; + 8110E00B2A724EEC0050F3E0 /* THLVTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8110E00A2A724EEC0050F3E0 /* THLVTipView.m */; }; + 8110E00D2A724EF80050F3E0 /* THLVTipView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8110E00C2A724EF80050F3E0 /* THLVTipView.xib */; }; 8117270729D67CAB00259C1B /* THLanternAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8117255729D67CAA00259C1B /* THLanternAnimationController.m */; }; 8117270829D67CAB00259C1B /* THHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8117255A29D67CAA00259C1B /* THHomeViewController.m */; }; 8117270929D67CAB00259C1B /* THBottleModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8117255D29D67CAA00259C1B /* THBottleModel.m */; }; @@ -462,6 +464,9 @@ 49AB12FA477E4D65042A4720 /* Pods-TreeHole.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TreeHole.debug.xcconfig"; path = "Target Support Files/Pods-TreeHole/Pods-TreeHole.debug.xcconfig"; sourceTree = ""; }; 6A3613F5F0C387980F724DC6 /* Pods-HoleNotification.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HoleNotification.release.xcconfig"; path = "Target Support Files/Pods-HoleNotification/Pods-HoleNotification.release.xcconfig"; sourceTree = ""; }; 74C6371F8879CD5C14B77D4D /* Pods_HoleNotification.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HoleNotification.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8110E0092A724EEC0050F3E0 /* THLVTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = THLVTipView.h; sourceTree = ""; }; + 8110E00A2A724EEC0050F3E0 /* THLVTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = THLVTipView.m; sourceTree = ""; }; + 8110E00C2A724EF80050F3E0 /* THLVTipView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = THLVTipView.xib; sourceTree = ""; }; 8117255729D67CAA00259C1B /* THLanternAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THLanternAnimationController.m; sourceTree = ""; }; 8117255829D67CAA00259C1B /* THHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THHomeViewController.h; sourceTree = ""; }; 8117255929D67CAA00259C1B /* THLanternAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THLanternAnimationController.h; sourceTree = ""; }; @@ -3302,6 +3307,9 @@ D9AC772128F05B45004C54BF /* BottleUserNearbyShaiXuanAlertView.m */, D9AC772728F0640F004C54BF /* BottleShaiXuanCellView.h */, D9AC772828F0640F004C54BF /* BottleShaiXuanCellView.m */, + 8110E0092A724EEC0050F3E0 /* THLVTipView.h */, + 8110E00A2A724EEC0050F3E0 /* THLVTipView.m */, + 8110E00C2A724EF80050F3E0 /* THLVTipView.xib */, ); path = View; sourceTree = ""; @@ -3515,6 +3523,7 @@ 8117271429D67CAB00259C1B /* ProvinceCityArea.geojson in Resources */, B0DB7A8D28293A15002A5170 /* TH_login_enter.png in Resources */, B012AA6D282CF37500BBACA2 /* LaunchScreen.storyboard in Resources */, + 8110E00D2A724EF80050F3E0 /* THLVTipView.xib in Resources */, B07834BA284A41DC0031FB16 /* README.md in Resources */, 8117271B29D67CAB00259C1B /* Images.xcassets in Resources */, B038497E28141AD200F47C18 /* province.json in Resources */, @@ -3905,6 +3914,7 @@ B03849A528141AD200F47C18 /* UIBarButtonItem+PYExtension.m in Sources */, B038494828141AD200F47C18 /* UIImage+JHUD.m in Sources */, B038493C28141AD200F47C18 /* PYInputView.m in Sources */, + 8110E00B2A724EEC0050F3E0 /* THLVTipView.m in Sources */, 8117272829D67CAB00259C1B /* QMUICellHeightCache.m in Sources */, B09AB3CD281D64B80007C5EB /* MessageNotificationCell.m in Sources */, D9AC772928F0640F004C54BF /* BottleShaiXuanCellView.m in Sources */, @@ -4258,7 +4268,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 15; + CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = Y797QLF5AW; @@ -4291,7 +4301,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.3.4; + MARKETING_VERSION = 2.4.0; PRODUCT_BUNDLE_IDENTIFIER = com.zncdts.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4318,7 +4328,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 15; + CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = Y797QLF5AW; @@ -4352,7 +4362,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.3.4; + MARKETING_VERSION = 2.4.0; PRODUCT_BUNDLE_IDENTIFIER = com.zncdts.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/xdts-ios 3/TreeHole/Code/Base/PYHTTPManager.h b/xdts-ios 3/TreeHole/Code/Base/PYHTTPManager.h index 415ee57..ccc9e69 100755 --- a/xdts-ios 3/TreeHole/Code/Base/PYHTTPManager.h +++ b/xdts-ios 3/TreeHole/Code/Base/PYHTTPManager.h @@ -22,18 +22,18 @@ typedef enum : NSUInteger { #if IS_DEBUG -//#define PYHttpBaseUrl @"http://192.168.3.55:8890/v1/" +#define PYHttpBaseUrl @"http://192.168.3.55:8890/v1/" ///正式 -#define PYHttpBaseUrl @"https://xidi.iquanpai.com/app-service/v1/" +//#define PYHttpBaseUrl @"https://xidi.iquanpai.com/app-service/v1/" #else //本地 -//#define PYHttpBaseUrl @"http://192.168.3.55:8890/v1/" +#define PYHttpBaseUrl @"http://192.168.3.55:8890/v1/" ///正式 -#define PYHttpBaseUrl @"https://xidi.iquanpai.com/app-service/v1/" +//#define PYHttpBaseUrl @"https://xidi.iquanpai.com/app-service/v1/" #endif diff --git a/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleReadView.m b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleReadView.m index ad936dc..afbb2ad 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleReadView.m +++ b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleReadView.m @@ -1207,8 +1207,13 @@ [readView.alertView dismiss]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) { - config.message = @"您关注的朋友最近发布的瓶子已经被您看完啦,\n过段时间再来看吧~"; - config.otherTitle = @"OK"; + config.message = @"您关注的人最近发布的瓶子被看完了,您可以多关注一些同好哦~"; + config.otherTitle = @"前往关注附近同好"; + + config.otherHandler = ^(MTAlertButton *button) { + [readView.alertView dismiss]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"changeToNearPage" object:nil]; + }; }]; }); @@ -1324,8 +1329,13 @@ [readView.alertView dismiss]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) { - config.message = @"您关注的朋友最近发布的瓶子已经被您看完啦,\n过段时间再来看吧~"; - config.otherTitle = @"OK"; + config.message = @"您关注的人最近发布的瓶子被看完了,您可以多关注一些同好哦~"; + config.otherTitle = @"前往关注附近同好"; + + config.otherHandler = ^(MTAlertButton *button) { + [readView.alertView dismiss]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"changeToNearPage" object:nil]; + }; }]; }); @@ -1441,8 +1451,13 @@ [readView.alertView dismiss]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) { - config.message = @"您关注的朋友最近发布的瓶子已经被您看完啦,\n过段时间再来看吧~"; - config.otherTitle = @"OK"; + config.message = @"您关注的人最近发布的瓶子被看完了,您可以多关注一些同好哦~"; + config.otherTitle = @"前往关注附近同好"; + + config.otherHandler = ^(MTAlertButton *button) { + [readView.alertView dismiss]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"changeToNearPage" object:nil]; + }; }]; }); @@ -1633,6 +1648,7 @@ if ([weakreadView isExchangeBottle]) { // 聊天 // 还有个有点麻烦的问题:交换声音和照片成功后,进入1对1页面 // 偶尔不显示交换的声音和照片(或者漏了),服务器发了消息是成功的。 延迟0.5秒观察下 + [weakreadView.alertView dismiss]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [SVProgressHUD dismiss]; User *user = [[User alloc] init]; @@ -1642,6 +1658,8 @@ [PYAppService chatWithUser:user]; [ToastUtil showToast:@"彼此交换成功,请查收"]; [weakreadView removeFromSuperview]; + + }); return; } diff --git a/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.h b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.h new file mode 100644 index 0000000..a3b19c0 --- /dev/null +++ b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.h @@ -0,0 +1,19 @@ +// +// THLVTipView.h +// TreeHole +// +// Created by iOS on 2023/7/27. +// Copyright © 2023 CYH. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface THLVTipView : UIView +@property (weak, nonatomic) IBOutlet UILabel *descLbl; +@property (weak, nonatomic) IBOutlet UIButton *tipBtn; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.m b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.m new file mode 100644 index 0000000..a2b51d8 --- /dev/null +++ b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.m @@ -0,0 +1,35 @@ +// +// THLVTipView.m +// TreeHole +// +// Created by iOS on 2023/7/27. +// Copyright © 2023 CYH. All rights reserved. +// + +#import "THLVTipView.h" +#import "ProfileCardViewController.h" +#import "BottleDetialController.h" +#import "UserService.h" + + +@implementation THLVTipView + +- (void)layoutSubviews { + [super layoutSubviews]; + self.tipBtn.layer.cornerRadius = self.tipBtn.size.height/2; + self.tipBtn.superview.layer.cornerRadius = 10; + [self.tipBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside]; +} + +- (void)btnClick:(UIButton *)btn { + if ([btn.titleLabel.text isEqualToString:@"更新形象照"]) { + [PYAppService pushViewControllerAnimated:[[ProfileCardViewController alloc] initWithUserID:[UserService currentUserID]]]; + } else if ([btn.titleLabel.text isEqualToString:@"查看瓶子"]) { + BottleDetialController *deDetial = [[BottleDetialController alloc]init]; + [PYAppService pushViewControllerAnimated:deDetial]; + } else { + [PYAppService showVipVC:@"vip_page"]; + } +} + +@end diff --git a/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.xib b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.xib new file mode 100644 index 0000000..ed772b9 --- /dev/null +++ b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/THLVTipView.xib @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleDetialController.m b/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleDetialController.m index 65906db..13c105a 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleDetialController.m +++ b/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleDetialController.m @@ -29,6 +29,8 @@ @property (nonatomic, strong) UIButton *getBottleButton; @property (nonatomic, assign) NSTimeInterval disappearTime; +@property (nonatomic, strong) UIButton *navBottleBtn; + @end @@ -68,7 +70,7 @@ navBottleBtn.frame = CGRectMake(0, 0, FIX_SIZE(24), FIX_SIZE(24)); [navBottleBtn setImage:ImageNamed(@"TH_bottle_refresh_icon") forState:UIControlStateNormal]; [navBottleBtn addTarget:self action:@selector(refreshHomeBottleData) forControlEvents:UIControlEventTouchUpInside]; - + self.navBottleBtn = navBottleBtn; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:navBottleBtn]; #pragma mark -- 为啥这里也要请求?viewwillapper已经有了 @@ -379,6 +381,14 @@ } - (void)refreshHomeBottleData { + CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; + rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI * 2.0]; + rotationAnimation.duration = 1.0; + rotationAnimation.cumulative = YES; + rotationAnimation.repeatCount = 1; + + [self.navBottleBtn.imageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"]; + [SVProgressHUD showWithStatus:nil]; [BottleService getHomeBottleInfoWithCompletion:^(HomeBottleInfo * _Nullable info) { [self endLoading:nil]; diff --git a/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleNerbyViewController.m b/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleNerbyViewController.m index 3574f65..39d8030 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleNerbyViewController.m +++ b/xdts-ios 3/TreeHole/Code/Features/Bottle/ViewController/BottleNerbyViewController.m @@ -15,14 +15,17 @@ #import #import #import "MTPickerView.h" +#import "THLVTipView.h" #import "BRPickerView.h" @interface BottleNerbyViewController () @property (nonatomic, assign) NSInteger nextPage; @property (nonatomic, strong) UIView* topHeaderView; @property (nonatomic, strong) NSMutableArray* tableMDataArray; +@property (nonatomic, strong) NSMutableArray* photosM; @property (nonatomic, strong) SDCycleScrollView* cycleScrollView; @property (nonatomic, strong) UIView* openVipAlertView; +@property (nonatomic, strong) THLVTipView* lvTipView; @property (nonatomic, strong) NSMutableDictionary* nearbyParamDict; @property (nonatomic, strong) CLLocationManager *cLLocationManager; @property (nonatomic, strong) NSDictionary* shaiXuanDict; @@ -44,21 +47,17 @@ - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; if ([UserService currentUser].isVIP) { - _contentTableView.scrollEnabled = YES; - _openVipAlertView.hidden = YES; + _contentTableView.mj_footer.hidden = NO; + [self loadPhotosData]; + }else{ - _contentTableView.scrollEnabled = NO; - _openVipAlertView.hidden = NO; + + _contentTableView.mj_footer.hidden = YES; + self.lvTipView.descLbl.text = @"开通年VIP提升您的账号权重进而提升排名哦~"; + [self.lvTipView.tipBtn setTitle:@"开年VIP" forState:UIControlStateNormal]; } [self loadBannerData]; -// self.nextPage = 1; -// [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:@"nearCity"]; -// -// [[NSUserDefaults standardUserDefaults] synchronize]; - -// [self reloadDataTableViewNT:self.nextPage withCity:@"" isRecommend:@""]; - } - (void)loadBannerData { @@ -76,6 +75,22 @@ }]; } +- (void)loadPhotosData { + + [UserService getUserPhotosWithUserID:[UserService currentUserID] completion:^(NSArray * _Nonnull photos) { + self.photosM = [photos mutableCopy]; + [self endLoading:nil]; + if (self.photosM.count < 3) { + [self.lvTipView.tipBtn setTitle:@"更新形象照" forState:UIControlStateNormal]; + self.lvTipView.descLbl.text = @"更新形象照完善您的个人形象进而提升排名哦~"; + } else { + [self.lvTipView.tipBtn setTitle:@"查看瓶子" forState:UIControlStateNormal]; + self.lvTipView.descLbl.text = @"多查看瓶子并回应增加互动值进而提升排名哦~"; + } + }]; +} + + - (void)viewDidLoad { [super viewDidLoad]; @@ -181,7 +196,7 @@ // [[NSUserDefaults standardUserDefaults]setObject:weakself.nearbyParamDict forKey:@"UserNearbyShaiXuanParamDict"]; WeakSelf(self); [self.view addSubview:self.contentTableView]; - [self.contentTableView addSubview:self.openVipAlertView]; +// [self.contentTableView addSubview:self.openVipAlertView]; //因为原图的TabBar是圆角要设置VC颜色就要超过原有高度. // _contentTableView.sd_layout.leftSpaceToView(self.view, 0).bottomSpaceToView(self.view, 0).rightSpaceToView(self.view, 0).topSpaceToView(self.view, 0); _contentTableView.tableHeaderView = self.topHeaderView; @@ -213,12 +228,18 @@ NSString *ud = [[NSUserDefaults standardUserDefaults] objectForKey:@"isRecommend"]; + MJWeakSelf _contentTableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - -#pragma mark -- 之前这个地方city传空 - [self reloadDataTableViewNT:weakself.nextPage withCity:self.city isRecommend:ud]; - }); + if ([UserService currentUser].isVIP) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + + #pragma mark -- 之前这个地方city传空 + [self reloadDataTableViewNT:weakself.nextPage withCity:self.city isRecommend:ud]; + }); + } else { +// [weakself.contentTableView.mj_footer endRefreshing]; + } + }]; [_contentTableView.mj_header beginRefreshing]; @@ -414,6 +435,7 @@ _nearbyParamDict[@"city"] = city ?: @"全国"; } _nearbyParamDict[@"page"] = [NSNumber numberWithInteger:nextPage]; + _nearbyParamDict[@"perpage"] = @(10); NSLog(@"_nearbyParamDict : %@",_nearbyParamDict); // NSData *data = [NSJSONSerialization dataWithJSONObject:_nearbyParamDict options:NSJSONWritingPrettyPrinted error:nil]; // [SVProgressHUD showSuccessWithStatus:[NSString stringWithFormat:@"_nearbyParamDict : %@ \n data.length : %lu",_nearbyParamDict,(unsigned long)data.length]]; @@ -553,7 +575,7 @@ _contentTableView.showsHorizontalScrollIndicator = NO; _contentTableView.separatorStyle = UITableViewCellSeparatorStyleNone; _contentTableView.contentInset = UIEdgeInsetsZero; - _contentTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; +// _contentTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; if (@available(iOS 11.0, *)) { } else { @@ -569,7 +591,7 @@ if (!_cycleScrollView) { _cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(17, 10, SCREEN_WIDTH - 34, (SCREEN_WIDTH - 34)*0.45-5) imageNamesGroup:@[@"TH_nearbyBanner00", @"TH_nearbyBanner01", @"TH_nearbyBanner02", @"TH_nearbyBanner03"]]; _cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter; - _cycleScrollView.autoScrollTimeInterval = 3; + _cycleScrollView.autoScrollTimeInterval = 6; _cycleScrollView.currentPageDotColor = COLOR_WITH_RGB(0xFFFFFF); _cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill; _cycleScrollView.pageDotColor =COLOR_WITH_RGB_A(0x000000, 0.7); @@ -597,8 +619,8 @@ -(UIView *)openVipAlertView{ if (!_openVipAlertView) { - float tabBarHeight = isIphoneX?83:48 + 44 - 44; - _openVipAlertView = [[UIView alloc]initWithFrame:CGRectMake(0, _contentTableView.height - tabBarHeight - 200, SCREEN_WIDTH, 200)]; +// float tabBarHeight = isIphoneX?83:48 + 44 - 44; + _openVipAlertView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200)]; _openVipAlertView.backgroundColor = COLOR_WITH_RGB_A(0x000000, 0.8); UILabel* titleLab = [[UILabel alloc]initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, 28)]; titleLab.text = @"数十万同好等您查看"; @@ -627,6 +649,16 @@ return _openVipAlertView; } +- (THLVTipView *)lvTipView { + if (_lvTipView == nil) { + NSArray * xibArray = [[NSBundle mainBundle]loadNibNamed:NSStringFromClass(THLVTipView.class) owner:nil options:nil] ; + _lvTipView = xibArray[0]; + _lvTipView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 60); + + } + return _lvTipView; +} + -(void)openVipBtnClick:(UIButton*)sender{ [PYAppService showVipVC:@"vip_page"]; } @@ -642,19 +674,31 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ + if (section == 0) { + return 60; + } return 5; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ + if (section == 0) { + return self.lvTipView; + } return [UIView new]; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ - return 0.01; + if ([UserService currentUser].isVIP) { + return 0.01; + } + return 200; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ + if (![UserService currentUser].isVIP) { + return self.openVipAlertView; + } return [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 20)]; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ diff --git a/xdts-ios 3/TreeHole/Code/Features/Chat/UIPatch/TUITool+TUIPatch.m b/xdts-ios 3/TreeHole/Code/Features/Chat/UIPatch/TUITool+TUIPatch.m index d0d7a11..371a058 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Chat/UIPatch/TUITool+TUIPatch.m +++ b/xdts-ios 3/TreeHole/Code/Features/Chat/UIPatch/TUITool+TUIPatch.m @@ -63,7 +63,12 @@ }else if (error >= 120100 && error <= 120199) { [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) { config.title = @"聊天提示"; - config.message = msg; + if ([msg containsString:@"需要互关/VIP才能聊天才能发送图片和语音"]) { + config.message = [msg stringByReplacingOccurrencesOfString:@"互关/" withString:@""]; + } else { + config.message = msg; + } + config.otherTitle = @"OK"; }]; }else{ diff --git a/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/MsgListViewController.m b/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/MsgListViewController.m index 8a36191..3433534 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/MsgListViewController.m +++ b/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/MsgListViewController.m @@ -7,6 +7,7 @@ #import "MsgListViewController.h" #import "TUIConversationListController.h" +#import "EditProfileViewController.h" #import "AvatarView.h" #import "ChatViewController.h" #import "BottleReadView.h" @@ -174,18 +175,30 @@ receiveNewMsgButton.right = self.view.width - FIX_SIZE(15); receiveNewMsgButton.bottom = self.view.height - TabBar_Height - FIX_SIZE(60); [receiveNewMsgButton addTouchUpInsideWithAction:^(UIButton * _Nullable button) { - [SVProgressHUD showWithStatus:nil]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [PYHTTPManager postWithPath:@"getnewchatmessage" params:nil callback:^(id _Nullable rsp, NSError * _Nullable error) { - if (!error) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [SVProgressHUD dismiss]; - }); - return; - } - - }]; - }); + int userid = [UserService currentUserID]; + NSString *userIdStr = [NSString stringWithFormat:@"%@",@(userid)]; + NSUserDefaults *udf = [NSUserDefaults standardUserDefaults]; + if ([udf objectForKey:userIdStr]) { + [SVProgressHUD showWithStatus:nil]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [PYHTTPManager postWithPath:@"getnewchatmessage" params:nil callback:^(id _Nullable rsp, NSError * _Nullable error) { + if (!error) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [SVProgressHUD dismiss]; + }); + return; + } + + }]; + }); + } else { + [udf setValue:userIdStr forKey:userIdStr]; + [udf synchronize]; + [self showTip]; + } + + + }]; self.receiveNewMsgButton = receiveNewMsgButton; receiveNewMsgButton.hidden = YES; @@ -208,6 +221,21 @@ }]; } +- (void)showTip { + MJWeakSelf + [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) { + config.message = @"准确选择想认识的人,才能相应匹配哦。"; + config.otherTitle = @"前往选择想认识的人"; + + config.otherHandler = ^(MTAlertButton *button) { + EditProfileViewController *VC = [EditProfileViewController new]; + VC.isShowSexTip = true; + [weakSelf.navigationController pushViewController:VC animated:true]; + + }; + }]; +} + - (void)reloadMsgBadge { WeakSelf(self); [LoginService launchAppToHomeWithCompletion:^(id _Nullable rsp, NSError * _Nullable error) { diff --git a/xdts-ios 3/TreeHole/Code/Features/NearAndLantern/THNearAndLanternViewController.m b/xdts-ios 3/TreeHole/Code/Features/NearAndLantern/THNearAndLanternViewController.m index 5c77b53..2396b97 100644 --- a/xdts-ios 3/TreeHole/Code/Features/NearAndLantern/THNearAndLanternViewController.m +++ b/xdts-ios 3/TreeHole/Code/Features/NearAndLantern/THNearAndLanternViewController.m @@ -16,6 +16,7 @@ @property (nonatomic, strong)THLanternAnimationController *THLanternAnimationVC; @property (nonatomic, strong)UIScrollView* scrollView; @property (nonatomic, strong)UIView* titleView; +@property (nonatomic, strong)NSMutableArray *photosM; @end @implementation THNearAndLanternViewController @@ -29,10 +30,13 @@ return YES; } - +- (void)delloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} - (void)viewDidLoad { [super viewDidLoad]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeToNearPage) name:@"changeToNearPage" object:nil]; // Do any additional setup after loading the view. self.navigationItem.titleView = self.titleView; UIImageView *bgImgView = [UIImageView new]; @@ -54,6 +58,11 @@ self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightItemBtn]; } +- (void)changeToNearPage { + [self titleBtnClick:self.titleView.subviews.lastObject]; +} + + -(UIView *)titleView{ if(!_titleView){ _titleView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 110, 44)]; diff --git a/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.h b/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.h index cf02b7f..6987c48 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.h +++ b/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @interface EditProfileViewController : MTCommonListTableViewController - +@property (nonatomic, assign) bool isShowSexTip; @end NS_ASSUME_NONNULL_END diff --git a/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.m b/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.m index 6f30815..9f450bc 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.m +++ b/xdts-ios 3/TreeHole/Code/Features/Profile/ViewController/EditProfileViewController.m @@ -22,7 +22,7 @@ @property (nonatomic, strong) PYImageView *bgView; @property (nonatomic, strong) GenderPickerView *genderPickerView; - +@property (nonatomic, strong) UITextField *wantGenderTextField; @end @implementation EditProfileViewController @@ -129,6 +129,25 @@ [self reloadData]; } +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + if (self.isShowSexTip) { + User *user = [UserService currentUser]; + [self.wantGenderTextField becomeFirstResponder]; + + NSMutableArray *defaultIndexs = [NSMutableArray array]; + for (NSString *gender in user.want_genders) { + NSInteger index = [self.genderPickerView.originalModels indexOfObject:gender]; + if (index >= 0 && index < self.genderPickerView.originalModels.count) { + [defaultIndexs addObject:@(index)]; + } + } + [self.genderPickerView selectItemAtIndexs:defaultIndexs]; + + + } +} + - (MTCommonListTableConfig *)tableConfigForTableViewContorller { WeakSelf(self); @@ -183,6 +202,7 @@ }]; UITextField *wantGenderTextField = [[UITextField alloc] init]; [self.view addSubview:wantGenderTextField]; + self.wantGenderTextField = wantGenderTextField; wantGenderTextField.delegate = self; GenderPickerView *genderPickerView = [GenderPickerView pickerViewWithMultiple:YES]; self.genderPickerView = genderPickerView;