From b020b9c19696432bbe3df73d80f95372ccc14423 Mon Sep 17 00:00:00 2001 From: CYH <13923927013@163.com> Date: Mon, 31 Jul 2023 16:12:40 +0800 Subject: [PATCH] =?UTF-8?q?2.4.1=E4=BB=A3=E7=A0=81=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xdts-ios 3/Podfile | 4 +- xdts-ios 3/TreeHole.xcodeproj/project.pbxproj | 12 +- xdts-ios 3/TreeHole/Code/AppDelegate.m | 6 + xdts-ios 3/TreeHole/Code/AppSetup.m | 8 +- xdts-ios 3/TreeHole/Code/Base/PYAppService.h | 4 +- xdts-ios 3/TreeHole/Code/Base/PYAppService.m | 117 +++++++++++------- .../View/BottleUserNearbyTableViewCell.m | 2 +- .../Chat/ViewController/ChatViewController.m | 8 +- .../ViewController/SettingsViewController.m | 2 +- .../Code/Features/VIP/ApplePayService.m | 68 +++++----- .../Code/Features/VIP/VIPViewController.m | 11 +- .../Utility/MTGridSelect/MTGridSelectView.m | 13 +- xdts-ios 3/TreeHole/Info.plist | 2 +- xdts-ios 3/TreeHole/TreeHole.entitlements | 1 + 14 files changed, 156 insertions(+), 102 deletions(-) diff --git a/xdts-ios 3/Podfile b/xdts-ios 3/Podfile index 7880cf1..07d3f6d 100644 --- a/xdts-ios 3/Podfile +++ b/xdts-ios 3/Podfile @@ -39,7 +39,7 @@ target 'TreeHole' do # 手机一键登录 # pod 'CL_ShanYanSDK', '= 2.3.4.8' # 微信sdk -# pod 'WechatOpenSDK', '= 1.8.7.1' + # Toast pod 'Toast', '4.0.0' # 腾讯IMSDK @@ -93,6 +93,8 @@ target 'TreeHole' do pod 'TXLiteAVSDK_Professional' +# pod 'WechatOpenSDK', '1.8.7.1' + end target 'HoleNotification' do diff --git a/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj b/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj index c4d5ce5..5edd965 100644 --- a/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj +++ b/xdts-ios 3/TreeHole.xcodeproj/project.pbxproj @@ -4319,7 +4319,11 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.4.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/TreeHole/Code/WechatSDK/OpenSDK2.0.2", + ); + MARKETING_VERSION = 2.4.1; PRODUCT_BUNDLE_IDENTIFIER = com.zncdts.app123; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4377,7 +4381,11 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.4.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/TreeHole/Code/WechatSDK/OpenSDK2.0.2", + ); + MARKETING_VERSION = 2.4.1; PRODUCT_BUNDLE_IDENTIFIER = com.zncdts.app123; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/xdts-ios 3/TreeHole/Code/AppDelegate.m b/xdts-ios 3/TreeHole/Code/AppDelegate.m index 80c877a..883d88f 100644 --- a/xdts-ios 3/TreeHole/Code/AppDelegate.m +++ b/xdts-ios 3/TreeHole/Code/AppDelegate.m @@ -57,6 +57,12 @@ [TUILogin initWithSdkAppID:TIM_APPID]; // SDKAppID 可以在 即时通信 IM 控制台中获取 [Bugly startWithAppId:BUGLY_APPID]; + [WXApi startLogByLevel:WXLogLevelNormal logBlock:^(NSString *log) { + NSLog(@"weixin - log : %@", log); + }]; + // 配置微信支付 + [WXApi registerApp:@"wx6f74f7bdf0f9ea4f" universalLink:@"https://xidi.iquanpai.com/app/"]; + // apple pay 处理 [[ApplePayService sharedInstance] autoHandleUpdatedTransactions]; // 初始化 diff --git a/xdts-ios 3/TreeHole/Code/AppSetup.m b/xdts-ios 3/TreeHole/Code/AppSetup.m index b1d9477..b6a0c3e 100644 --- a/xdts-ios 3/TreeHole/Code/AppSetup.m +++ b/xdts-ios 3/TreeHole/Code/AppSetup.m @@ -69,10 +69,10 @@ [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) { NSLog(@"WeChatSDK: %@", log); }]; - - //向微信注册 - [WXApi registerApp:WEIXIN_APP_ID - universalLink:UNIVERSAL_LINK]; +// +// //向微信注册 +// [WXApi registerApp:WEIXIN_APP_ID +// universalLink:UNIVERSAL_LINK]; //// //调用自检函数 // [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) { // NSLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion); diff --git a/xdts-ios 3/TreeHole/Code/Base/PYAppService.h b/xdts-ios 3/TreeHole/Code/Base/PYAppService.h index 02c4bd6..375e5a0 100755 --- a/xdts-ios 3/TreeHole/Code/Base/PYAppService.h +++ b/xdts-ios 3/TreeHole/Code/Base/PYAppService.h @@ -91,7 +91,9 @@ typedef NS_ENUM(NSUInteger, AuthorizationType) { + (AppConfig *)appConfig; + (void)getAppConfigWithCompletion:(void(^)(AppConfig *config))completion; /// 发起微信支付 -//+ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo; ++ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo; + ++ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo userId:(NSString *)userId; /// 跳转用户资料卡页面 + (void)showUserCardVCWithUserID:(int)userID; diff --git a/xdts-ios 3/TreeHole/Code/Base/PYAppService.m b/xdts-ios 3/TreeHole/Code/Base/PYAppService.m index b990b2d..bbb477c 100755 --- a/xdts-ios 3/TreeHole/Code/Base/PYAppService.m +++ b/xdts-ios 3/TreeHole/Code/Base/PYAppService.m @@ -673,52 +673,81 @@ static AppConfig *gAppConfig; static NSString *currentOrderId = nil; -//+ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo -//{ -// currentOrderId = orderId; -// PayReq *request = [[PayReq alloc] init]; -// request.partnerId = payInfo[@"partnerId"]; -// request.prepayId= payInfo[@"prepayId"]; -// request.package = payInfo[@"package"]; -// request.nonceStr= payInfo[@"nonceStr"]; -// request.timeStamp= [payInfo[@"timeStamp"] intValue]; -// request.sign = payInfo[@"sign"]; -// [WXApi sendReq:request completion:^(BOOL success) { -// if (!success) { -// [SVProgressHUD showErrorWithStatus:@"唤起微信支付失败"]; -// } -// }]; -//} +static NSString *currentUserId = nil; + ++ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo +{ + currentOrderId = orderId; + currentUserId = @""; + PayReq *request = [[PayReq alloc] init]; + request.partnerId = payInfo[@"partnerId"]; + request.prepayId= payInfo[@"prepayId"]; + request.package = payInfo[@"package"]; + request.nonceStr= payInfo[@"nonceStr"]; + request.timeStamp= [payInfo[@"timeStamp"] intValue]; + request.sign = payInfo[@"sign"]; + [WXApi sendReq:request completion:^(BOOL success) { + if (!success) { + [SVProgressHUD showErrorWithStatus:@"唤起微信支付失败"]; + } + }]; +} + ++ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo userId:(NSString *)userId { + currentUserId = userId; + currentOrderId = orderId; + PayReq *request = [[PayReq alloc] init]; + request.partnerId = payInfo[@"partnerId"]; + request.prepayId= payInfo[@"prepayId"]; + request.package = payInfo[@"package"]; + request.nonceStr= payInfo[@"nonceStr"]; + request.timeStamp= [payInfo[@"timeStamp"] intValue]; + request.sign = payInfo[@"sign"]; + [WXApi sendReq:request completion:^(BOOL success) { + if (!success) { + [SVProgressHUD showErrorWithStatus:@"唤起微信支付失败"]; + } + }]; + +} - (void)onAppDidBecomeActive { // [self checkWXOrderIFNeed]; } -//- (void)checkWXOrderIFNeed { -// if (!currentOrderId) { -// return; -// } -// [PYHTTPManager postWithPath:@"wxcheckorder" params:@{ -// @"order_no": currentOrderId ?: @"" -// } callback:^(id _Nullable rsp, NSError * _Nullable error) { -// if (!error) { -// [SVProgressHUD dismiss]; -// if ([rsp[@"is_pay_succeed"] boolValue]) { -// currentOrderId = nil; -// [[NSNotificationCenter defaultCenter] postNotificationName:BuyVIPSuccessNotification object:nil]; -// [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) { -// config.title = @"VIP购买成功"; -// config.message = @"你现在是我们小酒馆最尊贵的客人"; -// config.otherTitle = @"确定"; -// }]; -// } else { -//// [SVProgressHUD showErrorWithStatus:@"支付失败"]; -// } -// } else { -//// [SVProgressHUD showErrorWithStatus:@"支付失败"]; -// } -// }]; -//} +- (void)checkWXOrderIFNeed { + if (!currentOrderId) { + return; + } + [PYHTTPManager postWithPath:@"wxcheckorder" params:@{ + @"order_uuid": currentOrderId ?: @"" + } callback:^(id _Nullable rsp, NSError * _Nullable error) { + if (!error) { + [SVProgressHUD dismiss]; + if ([rsp[@"is_pay_succeed"] boolValue]) { + if (currentUserId.length > 0) { + + [[NSNotificationCenter defaultCenter] postNotificationName:@"receivedVipMsgnotifi" object:currentUserId]; + currentOrderId = nil; + currentUserId = nil; + } else { + + [[NSNotificationCenter defaultCenter] postNotificationName:BuyVIPSuccessNotification object:nil]; + [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) { + config.title = @"VIP购买成功"; + config.message = @"你现在是我们小酒馆最尊贵的客人"; + config.otherTitle = @"确定"; + }]; + } + + } else { +// [SVProgressHUD showErrorWithStatus:@"支付失败"]; + } + } else { + [SVProgressHUD showErrorWithStatus:@"支付失败"]; + } + }]; +} + (void)showBadgeOnTabBarItemAtIndex:(int)index number:(int)number { @@ -786,9 +815,9 @@ static NSString *currentOrderId = nil; /// 微信回调 - (void)onResp:(BaseResp *)resp { -// if ([resp isKindOfClass:[PayResp class]]) { // 支付回调 -// [self checkWXOrderIFNeed]; -// } + if ([resp isKindOfClass:[PayResp class]]) { // 支付回调 + [self checkWXOrderIFNeed]; + } } @end diff --git a/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleUserNearbyTableViewCell.m b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleUserNearbyTableViewCell.m index ef3bb83..0f848fa 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleUserNearbyTableViewCell.m +++ b/xdts-ios 3/TreeHole/Code/Features/Bottle/View/BottleUserNearbyTableViewCell.m @@ -195,7 +195,7 @@ -(void)setDataModel:(userNearbyModel *)dataModel{ _dataModel = dataModel; [_userImgV sd_setImageWithURL:[NSURL URLWithString:_dataModel.avatar] placeholderImage:[UIImage imageNamed:@"TH_defalut_avatar"]]; - if ([_dataModel.user_vip_kind isEqualToString:@"1"]) { + if ([_dataModel.user_vip_kind isEqualToString:@"1"] || [_dataModel.user_vip_kind isEqualToString:@"10"] ) { _userNameLab.textColor = COLOR_WITH_RGB(0xF8D07D); _userVipImgV.hidden = NO; }else{ diff --git a/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/ChatViewController.m b/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/ChatViewController.m index 42f539c..7574054 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/ChatViewController.m +++ b/xdts-ios 3/TreeHole/Code/Features/Chat/ViewController/ChatViewController.m @@ -173,7 +173,7 @@ return; */ - if ([UserService currentUser].isVIP) { +// if ([UserService currentUser].isVIP) { [PYAppService sendVipVC:@"vip_page" forUserID:self.convData.userID]; @@ -181,9 +181,9 @@ // [[NSNotificationCenter defaultCenter] removeObserver:self name:@"sendVipMsgnotifi" object:nil]; // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sengVipMsg:) name:@"sendVipMsgnotifi" object:nil]; - }else { - [ToastUtil showToast:@"需要成为会员才可以赠送VIP哦~"]; - } +// }else { +// [ToastUtil showToast:@"需要成为会员才可以赠送VIP哦~"]; +// } } diff --git a/xdts-ios 3/TreeHole/Code/Features/Settings/ViewController/SettingsViewController.m b/xdts-ios 3/TreeHole/Code/Features/Settings/ViewController/SettingsViewController.m index 38dccf8..fe5a12d 100644 --- a/xdts-ios 3/TreeHole/Code/Features/Settings/ViewController/SettingsViewController.m +++ b/xdts-ios 3/TreeHole/Code/Features/Settings/ViewController/SettingsViewController.m @@ -71,7 +71,7 @@ }]; }]; [logoutItem addSubview:logoutLabel]; - logoutItem.bottom = SCREEN_HEIGHT - NAVIGATION_BAR_HEIGHT; + logoutItem.bottom = SCREEN_HEIGHT - NAVIGATION_BAR_HEIGHT + 20; [self.view addSubview:logoutItem]; self.tableView.contentSize = CGSizeMake(0, logoutItem.bottom); diff --git a/xdts-ios 3/TreeHole/Code/Features/VIP/ApplePayService.m b/xdts-ios 3/TreeHole/Code/Features/VIP/ApplePayService.m index e498979..67d6cd7 100644 --- a/xdts-ios 3/TreeHole/Code/Features/VIP/ApplePayService.m +++ b/xdts-ios 3/TreeHole/Code/Features/VIP/ApplePayService.m @@ -92,31 +92,33 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache if (exExtraDay != nil) { extraTotalDay = @(exExtraDay.intValue + storeExtraDay.intValue); } - -// [PYHTTPManager postWithPath:@"wxgoodprepay" params:@{ -// @"vip_good_id": ID -// } callback:^(id _Nullable rsp, NSError * _Nullable error) { -// if (error) { -// [SVProgressHUD showErrorWithStatus:@"创建订单失败"]; -// return; -// } -// [PYAppService payByWetChatPayWithOrderId:rsp[@"trade_no"] payInfo:rsp]; -// }]; - NSString *goodsID = ID; - NSMutableDictionary *paramsM = [@{ - @"apple_good_id": goodsID, - @"extra_vip_day": extraTotalDay - } mutableCopy]; - - [paramsM addEntriesFromDictionary:extInfo]; - - [PYHTTPManager postWithPath:@"iaporder" params:paramsM callback:^(id _Nullable rsp, NSError * _Nullable error) { - if (error) { - [SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]]; - return; - } - [ApplePayService payProductWithId:goodsID orderId:rsp[@"trade_uuid"] restoreProduct:NO isFastBuy:isFastBuy]; - }]; + + [PYHTTPManager postWithPath:@"wxgoodprepay" params:@{ + @"vip_good_id": @([ID intValue]),@"vip_source":@"",@"extra_vip_day":extraTotalDay + + + } callback:^(id _Nullable rsp, NSError * _Nullable error) { + if (error) { + [SVProgressHUD showErrorWithStatus:@"创建订单失败"]; + return; + } + [PYAppService payByWetChatPayWithOrderId:rsp[@"trade_no"] payInfo:rsp]; + }]; +// NSString *goodsID = ID; +// NSMutableDictionary *paramsM = [@{ +// @"apple_good_id": goodsID, +// @"extra_vip_day": extraTotalDay +// } mutableCopy]; +// +// [paramsM addEntriesFromDictionary:extInfo]; +// +// [PYHTTPManager postWithPath:@"iaporder" params:paramsM callback:^(id _Nullable rsp, NSError * _Nullable error) { +// if (error) { +// [SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]]; +// return; +// } +// [ApplePayService payProductWithId:goodsID orderId:rsp[@"trade_uuid"] restoreProduct:NO isFastBuy:isFastBuy]; +// }]; } + (void)SendStartPay:(NSString *)ID UserID:(NSString *)userID isFastBuy:(BOOL)isFastBuy extInfo:(NSDictionary *)extInfo @@ -146,7 +148,7 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];//获取app版本信息 NSMutableDictionary *paramsM = [@{ - @"ios_good_id": goodsID, + @"vip_good_id": @([goodsID intValue]), @"give_user_id": @(VuserID), @"extra_vip_day": extraTotalDay, // @"device_platform" :@"iOS", @@ -156,15 +158,15 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache [paramsM addEntriesFromDictionary:extInfo]; - [PYHTTPManager postWithPath:@"ios/givevip" params:paramsM callback:^(id _Nullable rsp1, NSError * _Nullable error) { + [PYHTTPManager postWithPath:@"android/givevip" params:paramsM callback:^(id _Nullable rsp1, NSError * _Nullable error) { NSLog(@"rsp===%@,goodsID===%@",rsp1,paramsM); NSString *vipType ; - if ([goodsID containsString:@"68"]) { + if ([goodsID containsString:@"1"]) { vipType = @"赠送你一个月会员"; - }else if ([goodsID containsString:@"128"]) + }else if ([goodsID containsString:@"13"]) { vipType = @"赠送你三个月会员"; }else{ @@ -173,7 +175,7 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache - if (error) { + if (!error) { // [SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]]; [SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]]; NSLog(@"message===%@",error.userInfo[@"message"]); @@ -181,11 +183,11 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache int code = [error.userInfo[@"code"] intValue]; if (code==0) { - + [PYAppService payByWetChatPayWithOrderId:rsp1[@"trade_no"] payInfo:rsp1 userId:vipType]; - [ApplePayService payProductWithId:goodsID orderId:rsp1[@"trade_uuid"] restoreProduct:NO isFastBuy:isFastBuy]; +// [ApplePayService payProductWithId:goodsID orderId:rsp1[@"trade_uuid"] restoreProduct:NO isFastBuy:isFastBuy]; +// - [[NSNotificationCenter defaultCenter] postNotificationName:@"receivedVipMsgnotifi" object:vipType]; }else if (code==1100) diff --git a/xdts-ios 3/TreeHole/Code/Features/VIP/VIPViewController.m b/xdts-ios 3/TreeHole/Code/Features/VIP/VIPViewController.m index f3efb99..840aa0d 100644 --- a/xdts-ios 3/TreeHole/Code/Features/VIP/VIPViewController.m +++ b/xdts-ios 3/TreeHole/Code/Features/VIP/VIPViewController.m @@ -174,12 +174,12 @@ [[NSNotificationCenter defaultCenter] removeObserver:self name:@"receivedVipMsgnotifi" object:nil]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:ImageNamed(@"TH_down_btn") style:UIBarButtonItemStyleDone target:self action:@selector(close)]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"恢复购买" style:UIBarButtonItemStylePlain target:self action:@selector(restore)]; +// self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"恢复购买" style:UIBarButtonItemStylePlain target:self action:@selector(restore)]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refresh) name:BuyVIPSuccessNotification object:nil]; } - (void)refresh { - [PYHTTPManager getWithPath:@"vipconfig" params:nil callback:^(id _Nullable rsp, NSError * _Nullable error) { + [PYHTTPManager getWithPath:self.userID.length > 0 ? @"vipconfig" : @"vipconfig/experience" params:nil callback:^(id _Nullable rsp, NSError * _Nullable error) { NSLog(@"会员页面 : %@",rsp); [self endLoading:error]; if (!error) { @@ -286,18 +286,19 @@ NSString *userID = [self.userID stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"hole_"]]; NSLog(@"userID%@",userID); - [ApplePayService sendStartVipPay:goodsID isFastBuy:NO source:self.vipSource UserID:userID]; + [ApplePayService sendStartVipPay:[NSString stringWithFormat:@"%@",@(weakself.selectedGoodsInfo.good.vip_good_id)] isFastBuy:NO source:self.vipSource UserID:userID]; } + } else { + [ApplePayService startVipPay:[NSString stringWithFormat:@"%@",@(weakself.selectedGoodsInfo.good.vip_good_id)] isFastBuy:NO source:self.vipSource]; } - [ApplePayService startVipPay:goodsID isFastBuy:NO source:self.vipSource]; }]; [bottomView addSubview:buyButton]; - RichTextLabel *richLabel = [RichTextLabel richTextFullString:[NSString stringWithFormat:@"查阅服务协议·隐私协议·会员服务协议,购买后你可以随时在iTunes商店设置页取消订阅,点击右上角也可恢复之前的购买"] items:@[ + RichTextLabel *richLabel = [RichTextLabel richTextFullString:[NSString stringWithFormat:@"查阅服务协议·隐私协议·会员服务协议"] items:@[ [RichLabelItem itemWithText:@"服务协议" action:^{ [PYAppService openWebVCWithTitle:@"服务协议" url:@"http://iquanpai.com/app-h5/4_131.html"]; }], diff --git a/xdts-ios 3/TreeHole/Code/Utility/MTGridSelect/MTGridSelectView.m b/xdts-ios 3/TreeHole/Code/Utility/MTGridSelect/MTGridSelectView.m index 66005e9..8fa4013 100644 --- a/xdts-ios 3/TreeHole/Code/Utility/MTGridSelect/MTGridSelectView.m +++ b/xdts-ios 3/TreeHole/Code/Utility/MTGridSelect/MTGridSelectView.m @@ -257,13 +257,16 @@ CGSize itemSize = config.itemSize; if (CGSizeEqualToSize(itemSize, CGSizeZero)) { - itemSize.width = (config.contentWidth - config.contentInset.left - config.contentInset.right - config.columnSpacing * (config.maxColumn - 1)) / config.maxColumn; - itemSize.height = config.itemHeight > 0 ? config.itemHeight : itemSize.width * config.itemRatio; + itemSize.width = (config.contentWidth - config.contentInset.left - config.contentInset.right - config.columnSpacing * (self.itemModels.count- 1)) / self.itemModels.count; + itemSize.height = config.itemHeight > 0 ? config.itemHeight : itemSize.width * (self.itemModels.count == 4 ? 0.25 : config.itemRatio); } - flowLayout.itemSize = itemSize; + itemSize.width = (config.contentWidth - config.contentInset.left - config.contentInset.right - config.columnSpacing * (self.itemModels.count- 1)) / self.itemModels.count; - CGFloat contentHeight = config.contentInset.top + config.contentInset.bottom + (itemSize.height + config.rowSpacing) * (self.itemModels.count / config.maxColumn + 1) - config.rowSpacing; - CGFloat contentWidth = config.contentInset.left + config.contentInset.right + (itemSize.width + config.columnSpacing) * config.maxColumn - config.columnSpacing; + CGFloat contentHeight = config.contentInset.top + config.contentInset.bottom + (itemSize.height + config.rowSpacing)- config.rowSpacing; + CGFloat contentWidth = config.contentInset.left + config.contentInset.right + (itemSize.width + config.columnSpacing) * self.itemModels.count - config.columnSpacing; + + + flowLayout.itemSize = CGSizeMake(itemSize.width, contentHeight); self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, config.contentWidth, contentHeight) collectionViewLayout:flowLayout]; [self layoutSubviews]; diff --git a/xdts-ios 3/TreeHole/Info.plist b/xdts-ios 3/TreeHole/Info.plist index ab306b5..80e8358 100644 --- a/xdts-ios 3/TreeHole/Info.plist +++ b/xdts-ios 3/TreeHole/Info.plist @@ -11,7 +11,7 @@ Editor CFBundleURLSchemes - wx1f7c5b876fffd4e1 + wx6f74f7bdf0f9ea4f diff --git a/xdts-ios 3/TreeHole/TreeHole.entitlements b/xdts-ios 3/TreeHole/TreeHole.entitlements index 6fd4ea3..eaed8c6 100644 --- a/xdts-ios 3/TreeHole/TreeHole.entitlements +++ b/xdts-ios 3/TreeHole/TreeHole.entitlements @@ -7,6 +7,7 @@ com.apple.developer.associated-domains applinks:h5.diandi.club + applinks:https://xidi.iquanpai.com/app/