2.4.1代码上传,增加微信支付功能
This commit is contained in:
parent
f30140a3d7
commit
b020b9c196
@ -39,7 +39,7 @@ target 'TreeHole' do
|
|||||||
# 手机一键登录
|
# 手机一键登录
|
||||||
# pod 'CL_ShanYanSDK', '= 2.3.4.8'
|
# pod 'CL_ShanYanSDK', '= 2.3.4.8'
|
||||||
# 微信sdk
|
# 微信sdk
|
||||||
# pod 'WechatOpenSDK', '= 1.8.7.1'
|
|
||||||
# Toast
|
# Toast
|
||||||
pod 'Toast', '4.0.0'
|
pod 'Toast', '4.0.0'
|
||||||
# 腾讯IMSDK
|
# 腾讯IMSDK
|
||||||
@ -93,6 +93,8 @@ target 'TreeHole' do
|
|||||||
|
|
||||||
pod 'TXLiteAVSDK_Professional'
|
pod 'TXLiteAVSDK_Professional'
|
||||||
|
|
||||||
|
# pod 'WechatOpenSDK', '1.8.7.1'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
target 'HoleNotification' do
|
target 'HoleNotification' do
|
||||||
|
|||||||
@ -4319,7 +4319,11 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@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_BUNDLE_IDENTIFIER = com.zncdts.app123;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -4377,7 +4381,11 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@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_BUNDLE_IDENTIFIER = com.zncdts.app123;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
|||||||
@ -57,6 +57,12 @@
|
|||||||
[TUILogin initWithSdkAppID:TIM_APPID]; // SDKAppID 可以在 即时通信 IM 控制台中获取
|
[TUILogin initWithSdkAppID:TIM_APPID]; // SDKAppID 可以在 即时通信 IM 控制台中获取
|
||||||
[Bugly startWithAppId:BUGLY_APPID];
|
[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 处理
|
// apple pay 处理
|
||||||
[[ApplePayService sharedInstance] autoHandleUpdatedTransactions];
|
[[ApplePayService sharedInstance] autoHandleUpdatedTransactions];
|
||||||
// 初始化
|
// 初始化
|
||||||
|
|||||||
@ -69,10 +69,10 @@
|
|||||||
[WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
|
[WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
|
||||||
NSLog(@"WeChatSDK: %@", log);
|
NSLog(@"WeChatSDK: %@", log);
|
||||||
}];
|
}];
|
||||||
|
//
|
||||||
//向微信注册
|
// //向微信注册
|
||||||
[WXApi registerApp:WEIXIN_APP_ID
|
// [WXApi registerApp:WEIXIN_APP_ID
|
||||||
universalLink:UNIVERSAL_LINK];
|
// universalLink:UNIVERSAL_LINK];
|
||||||
//// //调用自检函数
|
//// //调用自检函数
|
||||||
// [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
|
// [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
|
||||||
// NSLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
|
// NSLog(@"%@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
|
||||||
|
|||||||
@ -91,7 +91,9 @@ typedef NS_ENUM(NSUInteger, AuthorizationType) {
|
|||||||
+ (AppConfig *)appConfig;
|
+ (AppConfig *)appConfig;
|
||||||
+ (void)getAppConfigWithCompletion:(void(^)(AppConfig *config))completion;
|
+ (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;
|
+ (void)showUserCardVCWithUserID:(int)userID;
|
||||||
|
|||||||
@ -673,52 +673,81 @@ static AppConfig *gAppConfig;
|
|||||||
|
|
||||||
static NSString *currentOrderId = nil;
|
static NSString *currentOrderId = nil;
|
||||||
|
|
||||||
//+ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo
|
static NSString *currentUserId = nil;
|
||||||
//{
|
|
||||||
// currentOrderId = orderId;
|
+ (void)payByWetChatPayWithOrderId:(NSString *)orderId payInfo:(NSDictionary *)payInfo
|
||||||
// PayReq *request = [[PayReq alloc] init];
|
{
|
||||||
// request.partnerId = payInfo[@"partnerId"];
|
currentOrderId = orderId;
|
||||||
// request.prepayId= payInfo[@"prepayId"];
|
currentUserId = @"";
|
||||||
// request.package = payInfo[@"package"];
|
PayReq *request = [[PayReq alloc] init];
|
||||||
// request.nonceStr= payInfo[@"nonceStr"];
|
request.partnerId = payInfo[@"partnerId"];
|
||||||
// request.timeStamp= [payInfo[@"timeStamp"] intValue];
|
request.prepayId= payInfo[@"prepayId"];
|
||||||
// request.sign = payInfo[@"sign"];
|
request.package = payInfo[@"package"];
|
||||||
// [WXApi sendReq:request completion:^(BOOL success) {
|
request.nonceStr= payInfo[@"nonceStr"];
|
||||||
// if (!success) {
|
request.timeStamp= [payInfo[@"timeStamp"] intValue];
|
||||||
// [SVProgressHUD showErrorWithStatus:@"唤起微信支付失败"];
|
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 {
|
- (void)onAppDidBecomeActive {
|
||||||
// [self checkWXOrderIFNeed];
|
// [self checkWXOrderIFNeed];
|
||||||
}
|
}
|
||||||
|
|
||||||
//- (void)checkWXOrderIFNeed {
|
- (void)checkWXOrderIFNeed {
|
||||||
// if (!currentOrderId) {
|
if (!currentOrderId) {
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
// [PYHTTPManager postWithPath:@"wxcheckorder" params:@{
|
[PYHTTPManager postWithPath:@"wxcheckorder" params:@{
|
||||||
// @"order_no": currentOrderId ?: @""
|
@"order_uuid": currentOrderId ?: @""
|
||||||
// } callback:^(id _Nullable rsp, NSError * _Nullable error) {
|
} callback:^(id _Nullable rsp, NSError * _Nullable error) {
|
||||||
// if (!error) {
|
if (!error) {
|
||||||
// [SVProgressHUD dismiss];
|
[SVProgressHUD dismiss];
|
||||||
// if ([rsp[@"is_pay_succeed"] boolValue]) {
|
if ([rsp[@"is_pay_succeed"] boolValue]) {
|
||||||
// currentOrderId = nil;
|
if (currentUserId.length > 0) {
|
||||||
// [[NSNotificationCenter defaultCenter] postNotificationName:BuyVIPSuccessNotification object:nil];
|
|
||||||
// [MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) {
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"receivedVipMsgnotifi" object:currentUserId];
|
||||||
// config.title = @"VIP购买成功";
|
currentOrderId = nil;
|
||||||
// config.message = @"你现在是我们小酒馆最尊贵的客人";
|
currentUserId = nil;
|
||||||
// config.otherTitle = @"确定";
|
} else {
|
||||||
// }];
|
|
||||||
// } else {
|
[[NSNotificationCenter defaultCenter] postNotificationName:BuyVIPSuccessNotification object:nil];
|
||||||
//// [SVProgressHUD showErrorWithStatus:@"支付失败"];
|
[MTAlertView showWithSetupBlcok:^(MTAlertViewConfig *config) {
|
||||||
// }
|
config.title = @"VIP购买成功";
|
||||||
// } else {
|
config.message = @"你现在是我们小酒馆最尊贵的客人";
|
||||||
//// [SVProgressHUD showErrorWithStatus:@"支付失败"];
|
config.otherTitle = @"确定";
|
||||||
// }
|
}];
|
||||||
// }];
|
}
|
||||||
//}
|
|
||||||
|
} else {
|
||||||
|
// [SVProgressHUD showErrorWithStatus:@"支付失败"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
[SVProgressHUD showErrorWithStatus:@"支付失败"];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
+ (void)showBadgeOnTabBarItemAtIndex:(int)index number:(int)number {
|
+ (void)showBadgeOnTabBarItemAtIndex:(int)index number:(int)number {
|
||||||
|
|
||||||
@ -786,9 +815,9 @@ static NSString *currentOrderId = nil;
|
|||||||
/// 微信回调
|
/// 微信回调
|
||||||
- (void)onResp:(BaseResp *)resp
|
- (void)onResp:(BaseResp *)resp
|
||||||
{
|
{
|
||||||
// if ([resp isKindOfClass:[PayResp class]]) { // 支付回调
|
if ([resp isKindOfClass:[PayResp class]]) { // 支付回调
|
||||||
// [self checkWXOrderIFNeed];
|
[self checkWXOrderIFNeed];
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -195,7 +195,7 @@
|
|||||||
-(void)setDataModel:(userNearbyModel *)dataModel{
|
-(void)setDataModel:(userNearbyModel *)dataModel{
|
||||||
_dataModel = dataModel;
|
_dataModel = dataModel;
|
||||||
[_userImgV sd_setImageWithURL:[NSURL URLWithString:_dataModel.avatar] placeholderImage:[UIImage imageNamed:@"TH_defalut_avatar"]];
|
[_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);
|
_userNameLab.textColor = COLOR_WITH_RGB(0xF8D07D);
|
||||||
_userVipImgV.hidden = NO;
|
_userVipImgV.hidden = NO;
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -173,7 +173,7 @@
|
|||||||
return;
|
return;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ([UserService currentUser].isVIP) {
|
// if ([UserService currentUser].isVIP) {
|
||||||
|
|
||||||
[PYAppService sendVipVC:@"vip_page" forUserID:self.convData.userID];
|
[PYAppService sendVipVC:@"vip_page" forUserID:self.convData.userID];
|
||||||
|
|
||||||
@ -181,9 +181,9 @@
|
|||||||
// [[NSNotificationCenter defaultCenter] removeObserver:self name:@"sendVipMsgnotifi" object:nil];
|
// [[NSNotificationCenter defaultCenter] removeObserver:self name:@"sendVipMsgnotifi" object:nil];
|
||||||
|
|
||||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sengVipMsg:) name:@"sendVipMsgnotifi" object:nil];
|
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sengVipMsg:) name:@"sendVipMsgnotifi" object:nil];
|
||||||
}else {
|
// }else {
|
||||||
[ToastUtil showToast:@"需要成为会员才可以赠送VIP哦~"];
|
// [ToastUtil showToast:@"需要成为会员才可以赠送VIP哦~"];
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,7 @@
|
|||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
[logoutItem addSubview:logoutLabel];
|
[logoutItem addSubview:logoutLabel];
|
||||||
logoutItem.bottom = SCREEN_HEIGHT - NAVIGATION_BAR_HEIGHT;
|
logoutItem.bottom = SCREEN_HEIGHT - NAVIGATION_BAR_HEIGHT + 20;
|
||||||
[self.view addSubview:logoutItem];
|
[self.view addSubview:logoutItem];
|
||||||
|
|
||||||
self.tableView.contentSize = CGSizeMake(0, logoutItem.bottom);
|
self.tableView.contentSize = CGSizeMake(0, logoutItem.bottom);
|
||||||
|
|||||||
@ -93,30 +93,32 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache
|
|||||||
extraTotalDay = @(exExtraDay.intValue + storeExtraDay.intValue);
|
extraTotalDay = @(exExtraDay.intValue + storeExtraDay.intValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [PYHTTPManager postWithPath:@"wxgoodprepay" params:@{
|
[PYHTTPManager postWithPath:@"wxgoodprepay" params:@{
|
||||||
// @"vip_good_id": ID
|
@"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) {
|
} callback:^(id _Nullable rsp, NSError * _Nullable error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
[SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]];
|
[SVProgressHUD showErrorWithStatus:@"创建订单失败"];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
[ApplePayService payProductWithId:goodsID orderId:rsp[@"trade_uuid"] restoreProduct:NO isFastBuy:isFastBuy];
|
[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
|
+ (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版本信息
|
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];//获取app版本信息
|
||||||
|
|
||||||
NSMutableDictionary *paramsM = [@{
|
NSMutableDictionary *paramsM = [@{
|
||||||
@"ios_good_id": goodsID,
|
@"vip_good_id": @([goodsID intValue]),
|
||||||
@"give_user_id": @(VuserID),
|
@"give_user_id": @(VuserID),
|
||||||
@"extra_vip_day": extraTotalDay,
|
@"extra_vip_day": extraTotalDay,
|
||||||
// @"device_platform" :@"iOS",
|
// @"device_platform" :@"iOS",
|
||||||
@ -156,15 +158,15 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache
|
|||||||
|
|
||||||
[paramsM addEntriesFromDictionary:extInfo];
|
[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);
|
NSLog(@"rsp===%@,goodsID===%@",rsp1,paramsM);
|
||||||
NSString *vipType ;
|
NSString *vipType ;
|
||||||
|
|
||||||
if ([goodsID containsString:@"68"]) {
|
if ([goodsID containsString:@"1"]) {
|
||||||
vipType = @"赠送你一个月会员";
|
vipType = @"赠送你一个月会员";
|
||||||
|
|
||||||
}else if ([goodsID containsString:@"128"])
|
}else if ([goodsID containsString:@"13"])
|
||||||
{
|
{
|
||||||
vipType = @"赠送你三个月会员";
|
vipType = @"赠送你三个月会员";
|
||||||
}else{
|
}else{
|
||||||
@ -173,7 +175,7 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (error) {
|
if (!error) {
|
||||||
// [SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]];
|
// [SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]];
|
||||||
[SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]];
|
[SVProgressHUD showSuccessWithStatus:error.userInfo[@"message"]];
|
||||||
NSLog(@"message===%@",error.userInfo[@"message"]);
|
NSLog(@"message===%@",error.userInfo[@"message"]);
|
||||||
@ -181,11 +183,11 @@ static NSString * const kDidReportPayActionCacheKey = @"kDidReportPayActionCache
|
|||||||
int code = [error.userInfo[@"code"] intValue];
|
int code = [error.userInfo[@"code"] intValue];
|
||||||
|
|
||||||
if (code==0) {
|
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)
|
}else if (code==1100)
|
||||||
|
|||||||
@ -174,12 +174,12 @@
|
|||||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"receivedVipMsgnotifi" object:nil];
|
[[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.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];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refresh) name:BuyVIPSuccessNotification object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)refresh {
|
- (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);
|
NSLog(@"会员页面 : %@",rsp);
|
||||||
[self endLoading:error];
|
[self endLoading:error];
|
||||||
if (!error) {
|
if (!error) {
|
||||||
@ -286,18 +286,19 @@
|
|||||||
NSString *userID = [self.userID stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"hole_"]];
|
NSString *userID = [self.userID stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"hole_"]];
|
||||||
|
|
||||||
NSLog(@"userID%@",userID);
|
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];
|
[bottomView addSubview:buyButton];
|
||||||
|
|
||||||
|
|
||||||
RichTextLabel *richLabel = [RichTextLabel richTextFullString:[NSString stringWithFormat:@"查阅服务协议·隐私协议·会员服务协议,购买后你可以随时在iTunes商店设置页取消订阅,点击右上角也可恢复之前的购买"] items:@[
|
RichTextLabel *richLabel = [RichTextLabel richTextFullString:[NSString stringWithFormat:@"查阅服务协议·隐私协议·会员服务协议"] items:@[
|
||||||
[RichLabelItem itemWithText:@"服务协议" action:^{
|
[RichLabelItem itemWithText:@"服务协议" action:^{
|
||||||
[PYAppService openWebVCWithTitle:@"服务协议" url:@"http://iquanpai.com/app-h5/4_131.html"];
|
[PYAppService openWebVCWithTitle:@"服务协议" url:@"http://iquanpai.com/app-h5/4_131.html"];
|
||||||
}],
|
}],
|
||||||
|
|||||||
@ -257,13 +257,16 @@
|
|||||||
CGSize itemSize = config.itemSize;
|
CGSize itemSize = config.itemSize;
|
||||||
|
|
||||||
if (CGSizeEqualToSize(itemSize, CGSizeZero)) {
|
if (CGSizeEqualToSize(itemSize, CGSizeZero)) {
|
||||||
itemSize.width = (config.contentWidth - config.contentInset.left - config.contentInset.right - config.columnSpacing * (config.maxColumn - 1)) / config.maxColumn;
|
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 * config.itemRatio;
|
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 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) * config.maxColumn - config.columnSpacing;
|
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.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, config.contentWidth, contentHeight) collectionViewLayout:flowLayout];
|
||||||
[self layoutSubviews];
|
[self layoutSubviews];
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<string>Editor</string>
|
<string>Editor</string>
|
||||||
<key>CFBundleURLSchemes</key>
|
<key>CFBundleURLSchemes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>wx1f7c5b876fffd4e1</string>
|
<string>wx6f74f7bdf0f9ea4f</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
<key>com.apple.developer.associated-domains</key>
|
<key>com.apple.developer.associated-domains</key>
|
||||||
<array>
|
<array>
|
||||||
<string>applinks:h5.diandi.club</string>
|
<string>applinks:h5.diandi.club</string>
|
||||||
|
<string>applinks:https://xidi.iquanpai.com/app/</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user