提交
This commit is contained in:
@@ -280,7 +280,7 @@
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticePhotosStatusChange object:nil];
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
showToast(msg)
|
||||
}];
|
||||
}else{
|
||||
[QXMineNetwork createPhotosWithName:self.textField.text
|
||||
@@ -295,7 +295,7 @@
|
||||
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
showToast(msg)
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,10 @@
|
||||
#import "QXPhotosDetailVC.h"
|
||||
#import "QXIntimateContentView.h"
|
||||
#import "QXHeartBeatSpaceViewController.h"
|
||||
#import "QXMenuPopView.h"
|
||||
#import "QXReportViewController.h"
|
||||
|
||||
@interface QXUserHomePageViewController ()<JXCategoryViewDelegate,JXPagerViewDelegate,SDCycleScrollViewDelegate>
|
||||
@interface QXUserHomePageViewController ()<JXCategoryViewDelegate,JXPagerViewDelegate,SDCycleScrollViewDelegate,QXMenuPopViewDelegate>
|
||||
@property (nonatomic,strong)UIImageView * backgourdImageView;
|
||||
@property (nonatomic,strong)SDCycleScrollView * cycleScrollView;
|
||||
@property (nonatomic,strong)UIButton *backBtn;
|
||||
@@ -46,6 +48,13 @@
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationController.navigationBar.backgroundColor = [UIColor clearColor];
|
||||
if (![self.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
UIButton*moreBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
|
||||
[moreBtn setImage:[UIImage imageNamed:@"dynamic_more"] forState:(UIControlStateNormal)];
|
||||
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
|
||||
[moreBtn addTarget:self action:@selector(moreAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:moreBtn];
|
||||
}
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.bgImageHidden = YES;
|
||||
@@ -114,6 +123,13 @@
|
||||
|
||||
self.pagingView.frame = CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight);
|
||||
}
|
||||
|
||||
-(void)moreAction{
|
||||
QXMenuPopView *menuView = [[QXMenuPopView alloc] initWithPoint:CGPointMake(SCREEN_WIDTH-60, NavContentHeight+10)];
|
||||
menuView.dataArray = @[QXText(@"举报"),QXText(@"拉黑")];
|
||||
menuView.delegate = self;
|
||||
[menuView showInView:KEYWINDOW];
|
||||
}
|
||||
-(void)getUserInfo{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork userHomePageWithUserId:self.user_id successBlock:^(QXUserHomeModel * _Nonnull userModel) {
|
||||
@@ -150,6 +166,20 @@
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
-(void)didSelectedIndex:(NSInteger)index menuTitle:(NSString*)menuTitle{
|
||||
if ([menuTitle isEqualToString:QXText(@"举报")]) {
|
||||
QXReportViewController *reportVC = [[QXReportViewController alloc] init];
|
||||
reportVC.reportType = @"1";
|
||||
reportVC.fromId = self.user_id;
|
||||
[self.navigationController pushViewController:reportVC animated:YES];
|
||||
}else if ([menuTitle isEqualToString:QXText(@"拉黑")]) {
|
||||
[QXMineNetwork addOrRemoveBlackListIsAdd:YES userId:self.user_id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(@"操作成功");
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
}
|
||||
#pragma mark - JXPagingViewDelegate
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
|
||||
@@ -90,12 +90,16 @@
|
||||
weakSelf.topView.model = model;
|
||||
weakSelf.contentView.model = model;
|
||||
[weakSelf.contentView reloadData];
|
||||
if (weakSelf.model.nobility_info.status.intValue == 0) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
weakSelf.bottomView.hidden = YES;;
|
||||
}else{
|
||||
[weakSelf.userAvatarView setHeadIcon:model.user_info.avatar dress:@""];
|
||||
weakSelf.bottomNickNameLabel.text = [NSString stringWithFormat:@"%@的当前爵位状态是%@",model.user_info.nickname,model.nobility_info.name];
|
||||
weakSelf.bottomView.hidden = NO;;
|
||||
if (weakSelf.model.nobility_info.status.intValue == 0) {
|
||||
weakSelf.bottomView.hidden = YES;;
|
||||
}else{
|
||||
[weakSelf.userAvatarView setHeadIcon:model.user_info.avatar dress:@""];
|
||||
weakSelf.bottomNickNameLabel.text = [NSString stringWithFormat:@"%@的当前爵位状态是%@",model.user_info.nickname,model.nobility_info.name];
|
||||
weakSelf.bottomView.hidden = NO;;
|
||||
}
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
[weakSelf.navigationController popToRootViewControllerAnimated:YES];
|
||||
}
|
||||
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface QXRechargeListModel : NSObject
|
||||
@property (nonatomic,strong)NSString *money;
|
||||
@property (nonatomic,strong)NSString *coins;
|
||||
@property (nonatomic,strong)NSString *product_id;
|
||||
@property (nonatomic,strong)NSString *ios_coins;
|
||||
@property (nonatomic,assign)BOOL isSelected;
|
||||
@end
|
||||
|
||||
|
||||
@@ -854,8 +854,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
充值列表
|
||||
*/
|
||||
+(void)getRechargeListSuccessBlock:(void (^)(NSArray<QXRechargeListModel*>* list))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
+(void)getRechargeListIsAppStore:(BOOL)isAppStore
|
||||
successBlock:(void (^)(NSArray<QXRechargeListModel*>* list))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
/**
|
||||
支付
|
||||
type 1微信2支付宝 3通联支付宝 4通联微信
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
[QXGlobal shareGlobal].loginModel.hide_status = userModel.hide_status;
|
||||
[QXGlobal shareGlobal].loginModel.singer_status = userModel.singer_status;
|
||||
[[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
|
||||
BOOL api_version = [responseObject[@"api_version"] boolValue];
|
||||
[QXGlobal shareGlobal].isAppStore = api_version;
|
||||
// BOOL api_version = [responseObject[@"api_version"] boolValue];
|
||||
// [QXGlobal shareGlobal].isAppStore = api_version;
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:userModel.is_can_chat forKey:kIsCanChat];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:userModel.can_chat_money forKey:kIsCanChatMoney];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
@@ -1689,8 +1689,11 @@
|
||||
}];
|
||||
}
|
||||
|
||||
+(void)getRechargeListSuccessBlock:(void (^)(NSArray<QXRechargeListModel *> * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
[[QXRequset shareInstance] getWithUrl:QXRechargeList parameters:@{} needCache:NO success:^(id responseObject) {
|
||||
+(void)getRechargeListIsAppStore:(BOOL)isAppStore
|
||||
successBlock:(void (^)(NSArray<QXRechargeListModel *> * _Nonnull))successBlock
|
||||
failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
NSString *urlString = isAppStore?QXRechargeListIOS:QXRechargeList;
|
||||
[[QXRequset shareInstance] getWithUrl:urlString parameters:@{} needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
NSArray*list = [NSArray yy_modelArrayWithClass:[QXRechargeListModel class] json:responseObject[@"data"]];
|
||||
successBlock(list);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
-(void)setModel:(QXRechargeListModel *)model{
|
||||
_model = model;
|
||||
self.priceLabel.text = model.money;
|
||||
[self.cornBtn setTitle:model.coins forState:(UIControlStateNormal)];
|
||||
[self.cornBtn setTitle:QXGlobal.shareGlobal.isAppStore?model.ios_coins:model.coins forState:(UIControlStateNormal)];
|
||||
if (model.money.intValue == 0 && model.coins.intValue == 0) {
|
||||
self.customLabel.hidden = NO;
|
||||
self.cornBtn.hidden = YES;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#import "QXMineNetwork.h"
|
||||
#import <AlipaySDK/AlipaySDK.h>
|
||||
#import <WXApi.h>
|
||||
#import "QXIAPManager.h"
|
||||
|
||||
@class QXRechargeCustomView,QXRechargeHeaderView;
|
||||
@interface QXRechargeView()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UIGestureRecognizerDelegate>
|
||||
@@ -38,10 +39,10 @@
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
|
||||
model.money = @"0";
|
||||
model.coins = @"0";
|
||||
[self.rechargeDataArray addObject:model];
|
||||
// QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
|
||||
// model.money = @"0";
|
||||
// model.coins = @"0";
|
||||
// [self.rechargeDataArray addObject:model];
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
|
||||
tap.delegate = self;
|
||||
tap.enabled = NO;
|
||||
@@ -84,40 +85,47 @@
|
||||
}
|
||||
|
||||
-(void)getRechargeList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRechargeListSuccessBlock:^(NSArray<QXRechargeListModel *> * _Nonnull list) {
|
||||
[weakSelf.rechargeDataArray removeAllObjects];
|
||||
[weakSelf.rechargeDataArray addObjectsFromArray:list];
|
||||
// QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
|
||||
// model.money = @"0";
|
||||
// model.coins = @"0";
|
||||
// [weakSelf.rechargeDataArray addObject:model];
|
||||
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
|
||||
[weakSelf.payTypeArray removeAllObjects];
|
||||
if (model.wx.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.wx];
|
||||
}
|
||||
if (model.ali.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.ali];
|
||||
}
|
||||
if (model.wx_tl.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.wx_tl];
|
||||
}
|
||||
if (model.ali_tl.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.ali_tl];
|
||||
}
|
||||
if (!self.isOnlyDisplayPayType) {
|
||||
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
|
||||
}
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRechargeListIsAppStore:YES successBlock:^(NSArray<QXRechargeListModel *> * _Nonnull list) {
|
||||
[weakSelf.rechargeDataArray removeAllObjects];
|
||||
[weakSelf.rechargeDataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}else{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRechargeListIsAppStore:NO successBlock:^(NSArray<QXRechargeListModel *> * _Nonnull list) {
|
||||
[weakSelf.rechargeDataArray removeAllObjects];
|
||||
[weakSelf.rechargeDataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
|
||||
[weakSelf.payTypeArray removeAllObjects];
|
||||
if (model.wx.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.wx];
|
||||
}
|
||||
if (model.ali.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.ali];
|
||||
}
|
||||
if (model.wx_tl.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.wx_tl];
|
||||
}
|
||||
if (model.ali_tl.is_pay_open.intValue == 1) {
|
||||
[weakSelf.payTypeArray addObject:model.ali_tl];
|
||||
}
|
||||
if (!self.isOnlyDisplayPayType) {
|
||||
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
|
||||
}
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setIsPop:(BOOL)isPop{
|
||||
@@ -166,67 +174,101 @@
|
||||
//}
|
||||
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
if (self.isOnlyDisplayPayType) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
return 1;
|
||||
}else{
|
||||
if (self.isOnlyDisplayPayType) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
if (section == 0 && !self.isOnlyDisplayPayType) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
return self.rechargeDataArray.count;
|
||||
}else{
|
||||
if (section == 0 && !self.isOnlyDisplayPayType) {
|
||||
return self.rechargeDataArray.count;
|
||||
}
|
||||
return self.payTypeArray.count;
|
||||
}
|
||||
return self.payTypeArray.count;
|
||||
}
|
||||
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
QXRechargePriceCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRechargePriceCell" forIndexPath:indexPath];
|
||||
cell.model = self.rechargeDataArray[indexPath.row];
|
||||
return cell;
|
||||
}else{
|
||||
QXRechargePayTypeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRechargePayTypeCell" forIndexPath:indexPath];
|
||||
cell.model = self.payTypeArray[indexPath.row];
|
||||
return cell;
|
||||
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
|
||||
QXRechargePriceCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRechargePriceCell" forIndexPath:indexPath];
|
||||
cell.model = self.rechargeDataArray[indexPath.row];
|
||||
return cell;
|
||||
}else{
|
||||
QXRechargePayTypeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRechargePayTypeCell" forIndexPath:indexPath];
|
||||
cell.model = self.payTypeArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
}
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
return CGSizeMake((SCREEN_WIDTH-16*2-12*2-1)/3, 76);
|
||||
}else{
|
||||
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
|
||||
return CGSizeMake((SCREEN_WIDTH-16*2-12*2-1)/3, 76);
|
||||
}
|
||||
return CGSizeMake(SCREEN_WIDTH, 40);
|
||||
}
|
||||
return CGSizeMake(SCREEN_WIDTH, 40);
|
||||
}
|
||||
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
|
||||
if (section == 0) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
return 12;
|
||||
}else{
|
||||
if (section == 0) {
|
||||
return 12;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0 && [kind isEqualToString:UICollectionElementKindSectionFooter] && self.isCustom) {
|
||||
self.rechargeCustomView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"QXRechargeCustomView" forIndexPath:indexPath];
|
||||
return self.rechargeCustomView;
|
||||
}else if (indexPath.section == 1 && [kind isEqualToString:UICollectionElementKindSectionHeader] ) {
|
||||
self.rechargeHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXRechargeHeaderView" forIndexPath:indexPath];
|
||||
return self.rechargeHeaderView;
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
return nil;
|
||||
}else{
|
||||
if (indexPath.section == 0 && [kind isEqualToString:UICollectionElementKindSectionFooter] && self.isCustom) {
|
||||
self.rechargeCustomView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"QXRechargeCustomView" forIndexPath:indexPath];
|
||||
return self.rechargeCustomView;
|
||||
}else if (indexPath.section == 1 && [kind isEqualToString:UICollectionElementKindSectionHeader] ) {
|
||||
self.rechargeHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXRechargeHeaderView" forIndexPath:indexPath];
|
||||
return self.rechargeHeaderView;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
|
||||
if (section == 0) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
return CGSizeZero;
|
||||
}else{
|
||||
if (section == 0) {
|
||||
return CGSizeZero;
|
||||
}
|
||||
return CGSizeMake(SCREEN_WIDTH, 40);
|
||||
}
|
||||
return CGSizeMake(SCREEN_WIDTH, 40);
|
||||
}
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section{
|
||||
if (section == 0 && self.isCustom) {
|
||||
return CGSizeMake(SCREEN_WIDTH, 50);
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
return CGSizeZero;
|
||||
}else{
|
||||
if (section == 0 && self.isCustom) {
|
||||
return CGSizeMake(SCREEN_WIDTH, 50);
|
||||
}
|
||||
return CGSizeZero;
|
||||
}
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
QXRechargeListModel *model = self.rechargeDataArray[indexPath.row];
|
||||
if (self.selectedModel) {
|
||||
self.selectedModel.isSelected = NO;
|
||||
@@ -240,40 +282,61 @@
|
||||
}
|
||||
[collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
|
||||
}else{
|
||||
QXPayTypeModel *model = self.payTypeArray[indexPath.row];
|
||||
if (model == self.selectedPayTypeModel) {
|
||||
return;
|
||||
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
|
||||
QXRechargeListModel *model = self.rechargeDataArray[indexPath.row];
|
||||
if (self.selectedModel) {
|
||||
self.selectedModel.isSelected = NO;
|
||||
}
|
||||
model.isSelected = YES;
|
||||
self.selectedModel = model;
|
||||
if (model.money.intValue == 0 && model.coins.intValue == 0) {
|
||||
self.isCustom = YES;
|
||||
}else{
|
||||
self.isCustom = NO;
|
||||
}
|
||||
[collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
|
||||
}else{
|
||||
QXPayTypeModel *model = self.payTypeArray[indexPath.row];
|
||||
if (model == self.selectedPayTypeModel) {
|
||||
return;
|
||||
}
|
||||
if (self.selectedPayTypeModel) {
|
||||
self.selectedPayTypeModel.isSelected = NO;
|
||||
}
|
||||
model.isSelected = YES;
|
||||
self.selectedPayTypeModel = model;
|
||||
[collectionView reloadData];
|
||||
}
|
||||
if (self.selectedPayTypeModel) {
|
||||
self.selectedPayTypeModel.isSelected = NO;
|
||||
}
|
||||
model.isSelected = YES;
|
||||
self.selectedPayTypeModel = model;
|
||||
[collectionView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)rechargeAction:(UIButton*)sender{
|
||||
if (self.selectedPayTypeModel == nil) {
|
||||
showToast(@"请选择支付方式");
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.selectedModel == nil) {
|
||||
showToast(@"请选择充值金额");
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *coins = @"0";
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
self.selectedPayTypeModel = [[QXPayTypeModel alloc] init];
|
||||
self.selectedPayTypeModel.type = @"6";
|
||||
coins = self.selectedModel.ios_coins;
|
||||
}else{
|
||||
coins = self.selectedModel.coins;
|
||||
if (self.selectedPayTypeModel == nil) {
|
||||
showToast(@"请选择支付方式");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@weakify(self)
|
||||
[QXMineNetwork rechargePayWithMoney:self.selectedModel.money coin:self.selectedModel.coins type:self.selectedPayTypeModel.type userId:QXGlobal.shareGlobal.loginModel.user_id typeId:self.gift_bag_id nobility_id:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[QXMineNetwork rechargePayWithMoney:self.selectedModel.money coin:coins type:self.selectedPayTypeModel.type userId:QXGlobal.shareGlobal.loginModel.user_id typeId:self.gift_bag_id nobility_id:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
@strongify(self)
|
||||
if (self.selectedPayTypeModel.type.intValue == 2) {
|
||||
NSDictionary *resultDict = dict[@"data"];
|
||||
NSString *order = [NSString stringWithFormat:@"%@",resultDict[@"ali"]];
|
||||
[[AlipaySDK defaultService] payOrder:order fromScheme:AppScheme callback:^(NSDictionary *resultDic) {
|
||||
NSLog(@"支付宝H5支付回调 - %@", resultDic);
|
||||
|
||||
|
||||
}];
|
||||
}else if (self.selectedPayTypeModel.type.intValue == 1) {
|
||||
NSDictionary *resultDict = dict[@"data"][@"wx"];
|
||||
@@ -293,7 +356,7 @@
|
||||
req.package = package;
|
||||
req.sign = sign;
|
||||
[WXApi sendReq:req completion:^(BOOL success) {
|
||||
|
||||
|
||||
}];
|
||||
}
|
||||
else if (self.selectedPayTypeModel.type.intValue == 4) {
|
||||
@@ -303,7 +366,7 @@
|
||||
NSString *thirdPartSchema = [NSString stringWithFormat:@"thirdPartSchema=%@://",AppScheme];
|
||||
NSString *json1 = [json stringByReplacingOccurrencesOfString:@"\\" withString:@""];
|
||||
NSCharacterSet *customSet1 = [[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[]{}\""] invertedSet];
|
||||
// NSCharacterSet *customSet2 = [[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[]{}\""] invertedSet];
|
||||
// NSCharacterSet *customSet2 = [[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[]{}\""] invertedSet];
|
||||
NSCharacterSet *customSet3 = [[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[]{}\""] invertedSet];
|
||||
NSString *json2 = [json1 stringByAddingPercentEncodingWithAllowedCharacters:customSet1];
|
||||
NSString *encodedString = [thirdPartSchema stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
||||
@@ -326,6 +389,9 @@
|
||||
launchMiniProgramReq.path = [NSString stringWithFormat:@"pages/orderDetail/orderDetail?%@",param];
|
||||
launchMiniProgramReq.miniProgramType = WXMiniProgramTypeRelease;
|
||||
[WXApi sendReq:launchMiniProgramReq completion:nil];
|
||||
}else if (self.selectedPayTypeModel.type.intValue == 6) {
|
||||
NSString*order_no = [NSString stringWithFormat:@"%@",dict[@"data"][@"order_no"]];
|
||||
[[QXIAPManager sharedInstance] buyGoodsWithId:self.selectedModel.product_id orderNo:order_no];
|
||||
}
|
||||
if (self.isPop) {
|
||||
[self hide];
|
||||
|
||||
@@ -126,9 +126,14 @@
|
||||
}
|
||||
}
|
||||
-(void)setHaveNobility:(BOOL)have{
|
||||
self.openBtn.hidden = have;
|
||||
self.buyBtn.hidden = !have;
|
||||
self.currentNobilityLabel.hidden = !have;
|
||||
if (QXGlobal.shareGlobal.isAppStore) {
|
||||
self.openBtn.hidden = YES;
|
||||
self.buyBtn.hidden = YES;
|
||||
}else{
|
||||
self.openBtn.hidden = have;
|
||||
self.buyBtn.hidden = !have;
|
||||
self.currentNobilityLabel.hidden = !have;
|
||||
}
|
||||
self.currentNobilityLabel.text = self.model.nobility_info.name;
|
||||
self.currentNobilityTimeLabel.text = have?[NSString stringWithFormat:@"截止时间:%@",self.model.nobility_info.end_time]:@"您尚未开通任何爵位";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user