游戏优化
This commit is contained in:
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@end
|
||||
|
||||
@interface XPHomePartyNavView : UIView
|
||||
|
||||
@property(nonatomic,copy) NSString *title;
|
||||
@property (nonatomic, weak) id<XPHomePartyNavViewDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
@@ -55,7 +55,10 @@
|
||||
[self.delegate xPHomePartyNavViewDidClickBack];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setTitle:(NSString *)title{
|
||||
_title = title;
|
||||
_titleLabel.text = _title;
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (UILabel *)titleLabel {
|
||||
if(!_titleLabel) {
|
||||
@@ -72,6 +75,7 @@
|
||||
_backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_backBtn setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal];
|
||||
[_backBtn addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_backBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
}
|
||||
return _backBtn;
|
||||
}
|
||||
|
@@ -192,6 +192,7 @@
|
||||
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal];
|
||||
[_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateSelected];
|
||||
[_backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_backButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
}
|
||||
return _backButton;
|
||||
}
|
||||
|
@@ -12,9 +12,10 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SessionViewController : MvpViewController
|
||||
@property (nonatomic, strong,readonly) NIMSession * session;
|
||||
|
||||
- (instancetype)initWithSession:(NIMSession *)session;
|
||||
@property (nonatomic, assign) SessionListOpenType openType;
|
||||
- (instancetype)initWithSession:(NIMSession *)session;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -686,7 +686,7 @@
|
||||
}
|
||||
-(void)sendInitiateInvitationGameSuccess{
|
||||
[self showSuccessToast:@"邀请成功"];
|
||||
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kGameOrderListRefreshData" object:nil];
|
||||
}
|
||||
- (void)didFailRetry:(NIMMessage *)message {
|
||||
if (message.isReceivedMsg) {
|
||||
|
@@ -23,7 +23,7 @@
|
||||
///价格
|
||||
@property(nonatomic,strong) UILabel *priceView;
|
||||
///支付
|
||||
@property(nonatomic,strong) UIButton *payBtn;
|
||||
@property(nonatomic,strong) NetImageView *payBtn;
|
||||
|
||||
///跟随进房卡片
|
||||
@property (nonatomic, strong) XPSessionMessageHeadView *followInRoomView;
|
||||
@@ -137,13 +137,24 @@
|
||||
self.bgImageView.hidden = NO;
|
||||
|
||||
_iconView.imageUrl = _gameInfo.logo;
|
||||
_bgImageView.imageUrl = _gameInfo.background;
|
||||
_payBtn.imageUrl = _gameInfo.btnRgb;
|
||||
|
||||
self.tierView.textColor = UIColorFromRGB(0xBBBCBD);
|
||||
self.tierBgView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.6];;
|
||||
[_bgImageView loadImageWithUrl:_gameInfo.background completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
||||
self.tierView.textColor = [ThemeColor colorWithHexString:gameInfo.tagRgb];
|
||||
self.tierBgView.backgroundColor = [ThemeColor colorWithHexString:gameInfo.tagBg];
|
||||
self.bgImageView.image = image;
|
||||
}];
|
||||
_titleView.text = _gameInfo.gameName;
|
||||
_tierView.text = _gameInfo.tier;
|
||||
_tierBgView.hidden = _gameInfo.tier.length == 0;
|
||||
|
||||
|
||||
|
||||
|
||||
NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ 钻/局",_gameInfo.price] attributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||
[textAtt addAttributes:@{NSFontAttributeName:kFontRegular(10),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[textAtt.string rangeOfString:@"钻/局"]];
|
||||
[textAtt addAttributes:@{NSFontAttributeName:kFontRegular(10),NSForegroundColorAttributeName:[UIColor colorWithWhite:1 alpha:0.8]} range:[textAtt.string rangeOfString:@"钻/局"]];
|
||||
UIImage *iconImage = kImage(@"mine_game_diamond");
|
||||
NSTextAttachment * attachment = [[NSTextAttachment alloc] init];
|
||||
attachment.bounds = CGRectMake(0, roundf(_priceView.font.capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height);;
|
||||
@@ -160,7 +171,7 @@
|
||||
- (NetImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = kImage(@"mine_user_game_cell");
|
||||
config.placeHolder = kImage(@"mine_user_game_cell_bg");
|
||||
_bgImageView = [[NetImageView alloc]initWithConfig:config];
|
||||
_bgImageView.layer.cornerRadius = kGetScaleWidth(12);
|
||||
_bgImageView.layer.masksToBounds = YES;
|
||||
@@ -173,9 +184,7 @@
|
||||
NetImageConfig *config = [NetImageConfig new];
|
||||
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
|
||||
_iconView = [[NetImageView alloc]initWithConfig:config];
|
||||
_iconView.layer.cornerRadius = kGetScaleWidth(50)/2;
|
||||
_iconView.layer.masksToBounds = YES;
|
||||
|
||||
|
||||
|
||||
}
|
||||
return _iconView;
|
||||
@@ -213,14 +222,19 @@
|
||||
}
|
||||
return _priceView;
|
||||
}
|
||||
- (UIButton *)payBtn{
|
||||
- (NetImageView *)payBtn{
|
||||
if(!_payBtn){
|
||||
_payBtn = [UIButton new];
|
||||
[_payBtn setBackgroundImage:kImage(@"mine_game_pay_btn") forState:UIControlStateNormal];
|
||||
[_payBtn setTitleColor:UIColorFromRGB(0x683F0B) forState:UIControlStateNormal];
|
||||
[_payBtn setTitle:@"下单" forState:UIControlStateNormal];
|
||||
_payBtn.titleLabel.font = kFontMedium(12);
|
||||
[_payBtn addTarget:self action:@selector(payAtion) forControlEvents:UIControlEventTouchUpInside];
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = kImage(@"mine_user_game_cell_pay_bg");
|
||||
|
||||
_payBtn = [[NetImageView alloc]initWithConfig:config];
|
||||
UIButton *payTitleBnt = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, kGetScaleWidth(72), kGetScaleWidth(28))];
|
||||
[payTitleBnt setTitleColor:UIColorFromRGB(0x683F0B) forState:UIControlStateNormal];
|
||||
[payTitleBnt setTitle:@"下单" forState:UIControlStateNormal];
|
||||
payTitleBnt.titleLabel.font = kFontMedium(12);
|
||||
[payTitleBnt addTarget:self action:@selector(payAtion) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_payBtn addSubview:payTitleBnt];
|
||||
_payBtn.userInteractionEnabled = YES;
|
||||
}
|
||||
return _payBtn;
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ typedef NS_ENUM(NSInteger, XPMineItemType) {
|
||||
XPMineItemType_FansTeam = 72,///粉丝团
|
||||
XPMineItemType_DressUp_Market = 73, ///装扮商场
|
||||
XPMineItemType_My_Dressup = 74,///我的装扮
|
||||
XPMineItemType_Game_Order = 76,///订单记录
|
||||
|
||||
};
|
||||
|
||||
|
@@ -15,11 +15,13 @@
|
||||
[Api getGameParterOrderListWithCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray *list = [UserGameInfoVo modelsWithArray:data.data[@"records"]];
|
||||
[[self getView]getGameParterOrderListSuccess:list];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView]getGameParterOrderListFail];
|
||||
} showLoading:YES errorToast:YES] uid:uid searchType:searchType currSize:currSize pageSize:pageSize];
|
||||
}
|
||||
-(void)initiateInvitationGameWithGameId:(NSString *)gameId gameUid:(NSString *)gameUid inning:(NSString *)inning uid:(NSString *)uid{
|
||||
-(void)initiateInvitationGameWithGameId:(NSString *)gameId gameUid:(NSString *)gameUid inning:(NSString *)inning uid:(NSString *)uid {
|
||||
[Api sendInitiateInvitationGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView]sendInitiateInvitationGameSuccess:uid];
|
||||
[[self getView]sendInitiateInvitationGameSuccess];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}showLoading:YES errorToast:YES ] gameId:gameId gameUid:gameUid inning:inning uid:uid];
|
||||
|
@@ -10,10 +10,13 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPMineGameOrderItemProtocol <NSObject>
|
||||
@optional
|
||||
///获取订单记录成功
|
||||
- (void)getGameParterOrderListSuccess:(NSArray *)list;
|
||||
///获取订单记录失败
|
||||
- (void)getGameParterOrderListFail;
|
||||
///发起邀请成功
|
||||
-(void)sendInitiateInvitationGameSuccess:(NSString *)uid;
|
||||
-(void)sendInitiateInvitationGameSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -140,7 +140,7 @@
|
||||
}
|
||||
}
|
||||
-(void)copyAction{
|
||||
[UIPasteboard generalPasteboard].string = [NSString stringWithFormat:@"%@", self.gameInfo.toErBanNo];
|
||||
[UIPasteboard generalPasteboard].string = [NSString stringWithFormat:@"%@", self.gameInfo.orderNo];
|
||||
[XCHUDTool showSuccessWithMessage:@"复制成功"];
|
||||
}
|
||||
-(void)inviteAction{
|
||||
@@ -170,15 +170,18 @@
|
||||
_priceView.attributedText = textAtt;
|
||||
|
||||
|
||||
NSMutableAttributedString *orderAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.toErBanNo] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)}];
|
||||
[textAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)} range:[textAtt.string rangeOfString:@"订单编号:"]];
|
||||
NSMutableAttributedString *tiemAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"下单时间:%@ ",_gameInfo.createTime] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}];
|
||||
[tiemAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)} range:[textAtt.string rangeOfString:@"下单时间:"]];
|
||||
_timeView.attributedText = tiemAtt;
|
||||
|
||||
|
||||
NSMutableAttributedString *orderAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.orderNo] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}];
|
||||
[textAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)} range:[textAtt.string rangeOfString:@"订单编号:"]];
|
||||
UIImage *orderIconImage = kImage(@"mine_game_copy");
|
||||
NSTextAttachment * orderAttachment = [[NSTextAttachment alloc] init];
|
||||
attachment.bounds = CGRectMake(0, roundf(kFontRegular(12).capHeight - orderIconImage.size.height)/2.f, orderIconImage.size.width, orderIconImage.size.height);;
|
||||
orderAttachment.image = orderIconImage;
|
||||
[orderAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:orderAttachment] atIndex:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.toErBanNo].length];
|
||||
[orderAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:orderAttachment] atIndex:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.orderNo].length];
|
||||
_orderNumView.attributedText = orderAtt;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
@@ -7,9 +7,17 @@
|
||||
|
||||
#import "MvpViewController.h"
|
||||
#import <JXCategoryView/JXCategoryListContainerView.h>
|
||||
#import "UserGameInfoVo.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol XPMineGameOrderItemVCDelegate <NSObject>
|
||||
|
||||
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface XPMineGameOrderItemVC : MvpViewController<JXCategoryListContentViewDelegate>
|
||||
@property(nonatomic,weak) id<XPMineGameOrderItemVCDelegate>delegate;
|
||||
@property(nonatomic,copy) NSString *type;
|
||||
@end
|
||||
|
||||
|
@@ -17,16 +17,20 @@
|
||||
#import "WalletInfoModel.h"
|
||||
#import "Api+Mine.h"
|
||||
#import "XPMineNewRechargeViewController.h"
|
||||
@interface XPMineGameOrderItemVC ()<UITableViewDelegate,UITableViewDataSource,XPMineGameOrderItemProtocol,XPMineGameOrderDetailsViewDelegate,XPMinePlaceOrderViewDelegate>
|
||||
@interface XPMineGameOrderItemVC ()<UITableViewDelegate,UITableViewDataSource,XPMineGameOrderItemProtocol>
|
||||
@property(nonatomic,strong) UITableView *tableView;
|
||||
@property(nonatomic,strong) NSMutableArray *orderList;
|
||||
@property(nonatomic,assign) NSInteger page;
|
||||
///余额
|
||||
@property(nonatomic, copy)NSString *diamonds;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPMineGameOrderItemVC
|
||||
|
||||
-(void)dealloc{
|
||||
[[NSNotificationCenter defaultCenter]removeObserver:self];
|
||||
}
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
- (__kindof id)createPresenter {
|
||||
return [[XPMineGameOrderItemPresenter alloc] init];
|
||||
}
|
||||
@@ -35,7 +39,7 @@
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
[self initHeaderAndFooterRrfresh];
|
||||
[self getUserWallet];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(headerRefresh) name:@"kGameOrderListRefreshData" object:nil];
|
||||
}
|
||||
-(void)installUI{
|
||||
self.view.backgroundColor = UIColorFromRGB(0xF8F8FA);
|
||||
@@ -47,15 +51,7 @@
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
-(void)getUserWallet{
|
||||
|
||||
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
|
||||
self.diamonds = model.diamonds;
|
||||
}
|
||||
} uid:[AccountInfoStorage instance].getUid ticket:[AccountInfoStorage instance].getTicket];
|
||||
}
|
||||
|
||||
- (void)initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
@@ -83,6 +79,7 @@
|
||||
[self.presenter getGameParterOrderListWithUid:uid searchType:self.type currSize:pageStr pageSize:@"20"];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -UITableViewDelegate,UITableViewDataSource
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.orderList.count == 0 ? 1 : self.orderList.count;
|
||||
@@ -95,6 +92,7 @@
|
||||
if(self.orderList.count == 0){
|
||||
XPHomeListEmptyTableViewCell*cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class]) forIndexPath:indexPath];
|
||||
cell.text = @"暂无数据";
|
||||
cell.backgroundColor = UIColorFromRGB(0xF5F6FA);
|
||||
return cell;
|
||||
}
|
||||
XPMineGameOrderItemCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGameOrderItemCell class]) forIndexPath:indexPath];
|
||||
@@ -103,89 +101,22 @@
|
||||
return cell;
|
||||
}
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
XPMineGameOrderDetailsView *detailsView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
detailsView.gameInfo = [self.orderList safeObjectAtIndex1:indexPath.row];
|
||||
detailsView.delegate = self;
|
||||
[self.view addSubview:detailsView];
|
||||
if(self.type.integerValue == 1)return;
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(showGameOrderDetailsViewWithGameInfo:)]){
|
||||
[self.delegate showGameOrderDetailsViewWithGameInfo:[self.orderList safeObjectAtIndex1:indexPath.row]];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#pragma mark - JXCategoryListContentViewDelegate
|
||||
- (UIView *)listView {
|
||||
return self.view;
|
||||
}
|
||||
#pragma mark - XPMineGameOrderDetailsViewDelegate
|
||||
///再次邀请
|
||||
-(void)againinitiateInvitationWithGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
[self showLoading];
|
||||
[Api requestGamePartnerInfoList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[self hideHUD];
|
||||
if(code == 200){
|
||||
NSArray *list = [UserGameInfoVo modelsWithArray:data.data];
|
||||
XPMinePlaceOrderView *orderVeiw = [[XPMinePlaceOrderView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
|
||||
for (int i = 0; i < list.count; i++) {
|
||||
UserGameInfoVo *model = list[i];
|
||||
if([model.gameId isEqualToString:gameInfo.gameId]){
|
||||
orderVeiw.selectGameInfo = model;
|
||||
}
|
||||
}
|
||||
orderVeiw.inning = gameInfo.inning;
|
||||
|
||||
orderVeiw.diamonds = self.diamonds;
|
||||
orderVeiw.gameList = list;
|
||||
orderVeiw.delegate = self;
|
||||
[self.view addSubview:orderVeiw];
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} uid:gameInfo.toUid];
|
||||
|
||||
|
||||
}
|
||||
///发信息
|
||||
-(void)sendMessageHandleWithGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
NSString * sessionId = [NSString stringWithFormat:@"%@",gameInfo.toUid];
|
||||
NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[self.navigationController pushViewController:sessionVC animated:YES];
|
||||
}
|
||||
-(void)sendInitiateInvitationGameSuccess:(NSString *)uid{
|
||||
NSString * sessionId = [NSString stringWithFormat:@"%@",uid];
|
||||
NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[self.navigationController pushViewController:sessionVC animated:YES];
|
||||
}
|
||||
#pragma mark - XPMinePlaceOrderViewDelegate
|
||||
///发起邀请
|
||||
-(void)initiateInvitationWithGameInfo:(UserGameInfoVo *)gameInfo count:(NSString *)count{
|
||||
[self.presenter initiateInvitationGameWithGameId:gameInfo.gameId gameUid:gameInfo.uid inning:count uid:[AccountInfoStorage instance].getUid];
|
||||
}
|
||||
///充值
|
||||
-(void)payHandleWithShowView:(BOOL)isShow{
|
||||
if(isShow == YES){
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.title = @"提示";
|
||||
config.actionStyle = TTAlertActionConfirmStyle;
|
||||
config.message = [NSString stringWithFormat:@"余额不足,请充值"];
|
||||
TTAlertButtonConfig *confirmButtonConfig = [[TTAlertButtonConfig alloc]init];
|
||||
confirmButtonConfig.title = @"去充值";
|
||||
config.confirmButtonConfig = confirmButtonConfig;
|
||||
confirmButtonConfig.titleColor = UIColorFromRGB(0x2B2D33);
|
||||
confirmButtonConfig.backgroundColor = UIColorFromRGB(0xFFDA24);
|
||||
confirmButtonConfig.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
confirmButtonConfig.cornerRadius = 38/2;
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
XPMineNewRechargeViewController *payVC = [[XPMineNewRechargeViewController alloc]init];
|
||||
[self.navigationController pushViewController:payVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
XPMineNewRechargeViewController *payVC = [[XPMineNewRechargeViewController alloc]init];
|
||||
[self.navigationController pushViewController:payVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - XPMineGameOrderItemProtocol.h
|
||||
-(void)getGameParterOrderListSuccess:(NSArray *)list{
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
if(self.page == 1){
|
||||
self.orderList = [NSMutableArray arrayWithArray:list];
|
||||
[self.tableView reloadData];
|
||||
@@ -198,7 +129,10 @@
|
||||
[self.orderList addObjectsFromArray:list];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
-(void)getGameParterOrderListFail{
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
|
@@ -9,29 +9,61 @@
|
||||
#import <JXCategoryView/JXCategoryView.h>
|
||||
#import <JXCategoryView/JXCategoryIndicatorBackgroundView.h>
|
||||
#import "XPMineGameOrderItemVC.h"
|
||||
@interface XPMineGameOrderVC()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate>
|
||||
#import "XPHomePartyNavView.h"
|
||||
#import "XPMineGameOrderItemPresenter.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import "XPMineGameOrderItemVC.h"
|
||||
#import "XPMineGameOrderItemCell.h"
|
||||
#import "XPHomeListEmptyTableViewCell.h"
|
||||
#import "XPMineGameOrderItemPresenter.h"
|
||||
#import "XPMineGameOrderItemProtocol.h"
|
||||
#import "XPMineGameOrderDetailsView.h"
|
||||
#import "SessionViewController.h"
|
||||
#import "XPMinePlaceOrderView.h"
|
||||
#import "Api.h"
|
||||
#import "WalletInfoModel.h"
|
||||
#import "Api+Mine.h"
|
||||
#import "XPMineNewRechargeViewController.h"
|
||||
@interface XPMineGameOrderVC()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPHomePartyNavViewDelegate,XPMineGameOrderItemVCDelegate,XPMineGameOrderItemProtocol,XPMineGameOrderDetailsViewDelegate,XPMinePlaceOrderViewDelegate>
|
||||
///分页标题
|
||||
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
||||
///分页控件
|
||||
@property (nonatomic, strong) JXCategoryTitleView *titleView;
|
||||
///分页lineView
|
||||
@property (nonatomic, strong) JXCategoryListContainerView *contentView;
|
||||
///导航
|
||||
@property (nonatomic, strong) XPHomePartyNavView *navView;
|
||||
///余额
|
||||
@property(nonatomic, copy)NSString *diamonds;
|
||||
@property(nonatomic,copy) NSString *chatId;
|
||||
@end
|
||||
@implementation XPMineGameOrderVC
|
||||
|
||||
- (__kindof id)createPresenter {
|
||||
return [[XPMineGameOrderItemPresenter alloc] init];
|
||||
}
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
[self getUserWallet];
|
||||
}
|
||||
-(void)installUI{
|
||||
self.title = @"订单记录";
|
||||
|
||||
[self.view addSubview:self.navView];
|
||||
[self.view addSubview:self.titleView];
|
||||
[self.view addSubview:self.contentView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(0);
|
||||
make.left.right.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kNavigationHeight);
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.view);
|
||||
make.top.equalTo(self.navView.mas_bottom);
|
||||
make.left.right.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kGetScaleWidth(56));
|
||||
}];
|
||||
@@ -41,6 +73,15 @@
|
||||
make.left.right.bottom.mas_equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
-(void)getUserWallet{
|
||||
|
||||
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if(code == 200){
|
||||
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
|
||||
self.diamonds = model.diamonds;
|
||||
}
|
||||
} uid:[AccountInfoStorage instance].getUid ticket:[AccountInfoStorage instance].getTicket];
|
||||
}
|
||||
#pragma mark - JXCategoryViewDelegate
|
||||
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
|
||||
return self.titles.count;
|
||||
@@ -54,6 +95,7 @@
|
||||
} else {
|
||||
XPMineGameOrderItemVC *vc = [XPMineGameOrderItemVC new];
|
||||
vc.type = @(index).stringValue;
|
||||
vc.delegate = self;
|
||||
return vc;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +103,94 @@
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (void)xPHomePartyNavViewDidClickBack{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - XPMineGameOrderItemVCDelegate
|
||||
-(void)showGameOrderDetailsViewWithGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
XPMineGameOrderDetailsView *detailsView = [[XPMineGameOrderDetailsView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
detailsView.gameInfo = gameInfo;
|
||||
detailsView.delegate = self;
|
||||
[self.view addSubview:detailsView];
|
||||
}
|
||||
#pragma mark - XPMineGameOrderDetailsViewDelegate
|
||||
///再次邀请
|
||||
-(void)againinitiateInvitationWithGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
[self showLoading];
|
||||
NSString *uid = [gameInfo.toUid isEqualToString:[AccountInfoStorage instance].getUid] ? gameInfo.fromUid : gameInfo.toUid;
|
||||
[Api requestGamePartnerInfoList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[self hideHUD];
|
||||
if(code == 200){
|
||||
self.chatId = uid;
|
||||
NSArray *list = [UserGameInfoVo modelsWithArray:data.data];
|
||||
XPMinePlaceOrderView *orderVeiw = [[XPMinePlaceOrderView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
|
||||
for (int i = 0; i < list.count; i++) {
|
||||
UserGameInfoVo *model = list[i];
|
||||
if([model.gameId isEqualToString:gameInfo.gameId]){
|
||||
orderVeiw.selectGameInfo = model;
|
||||
}
|
||||
}
|
||||
orderVeiw.inning = gameInfo.inning;
|
||||
|
||||
orderVeiw.diamonds = self.diamonds;
|
||||
orderVeiw.gameList = list;
|
||||
orderVeiw.delegate = self;
|
||||
[self.view addSubview:orderVeiw];
|
||||
return;
|
||||
}
|
||||
[self showErrorToast:msg];
|
||||
} uid:uid];
|
||||
|
||||
|
||||
}
|
||||
///发信息
|
||||
-(void)sendMessageHandleWithGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
NSString *uid = [gameInfo.toUid isEqualToString:[AccountInfoStorage instance].getUid] ? gameInfo.fromUid : gameInfo.toUid;
|
||||
NSString * sessionId = [NSString stringWithFormat:@"%@",uid];
|
||||
NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[self.navigationController pushViewController:sessionVC animated:YES];
|
||||
}
|
||||
-(void)sendInitiateInvitationGameSuccess{
|
||||
|
||||
NIMSession * session = [NIMSession session:self.chatId type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[self.navigationController pushViewController:sessionVC animated:YES];
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kGameOrderListRefreshData" object:nil];
|
||||
|
||||
}
|
||||
#pragma mark - XPMinePlaceOrderViewDelegate
|
||||
///发起邀请
|
||||
-(void)initiateInvitationWithGameInfo:(UserGameInfoVo *)gameInfo count:(NSString *)count{
|
||||
NSString *uid = [gameInfo.toUid isEqualToString:[AccountInfoStorage instance].getUid] ? gameInfo.fromUid : gameInfo.toUid;
|
||||
[self.presenter initiateInvitationGameWithGameId:gameInfo.gameId gameUid:gameInfo.uid inning:count uid:[AccountInfoStorage instance].getUid];
|
||||
}
|
||||
///充值
|
||||
-(void)payHandleWithShowView:(BOOL)isShow{
|
||||
if(isShow == YES){
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.title = @"提示";
|
||||
config.actionStyle = TTAlertActionConfirmStyle;
|
||||
config.message = [NSString stringWithFormat:@"余额不足,请充值"];
|
||||
TTAlertButtonConfig *confirmButtonConfig = [[TTAlertButtonConfig alloc]init];
|
||||
confirmButtonConfig.title = @"去充值";
|
||||
config.confirmButtonConfig = confirmButtonConfig;
|
||||
confirmButtonConfig.titleColor = UIColorFromRGB(0x2B2D33);
|
||||
confirmButtonConfig.backgroundColor = UIColorFromRGB(0xFFDA24);
|
||||
confirmButtonConfig.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
confirmButtonConfig.cornerRadius = 38/2;
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
XPMineNewRechargeViewController *payVC = [[XPMineNewRechargeViewController alloc]init];
|
||||
[self.navigationController pushViewController:payVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
XPMineNewRechargeViewController *payVC = [[XPMineNewRechargeViewController alloc]init];
|
||||
[self.navigationController pushViewController:payVC animated:YES];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (JXCategoryTitleView *)titleView {
|
||||
if (!_titleView) {
|
||||
@@ -76,7 +205,7 @@
|
||||
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
|
||||
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
|
||||
_titleView.cellSpacing = kGetScaleWidth(15);
|
||||
_titleView.cellWidth = kGetScaleWidth(39);
|
||||
_titleView.cellWidth = (KScreenWidth - 60) / 2;
|
||||
_titleView.averageCellSpacingEnabled = NO;
|
||||
_titleView.defaultSelectedIndex = 0;
|
||||
_titleView.listContainer = self.contentView;
|
||||
@@ -104,4 +233,12 @@
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
- (XPHomePartyNavView *)navView {
|
||||
if (!_navView) {
|
||||
_navView = [[XPHomePartyNavView alloc] init];
|
||||
_navView.delegate = self;
|
||||
_navView.title = @"订单记录";
|
||||
}
|
||||
return _navView;
|
||||
}
|
||||
@end
|
||||
|
@@ -40,6 +40,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,copy) NSString *anchorDiamondNum;
|
||||
///房间收入
|
||||
@property (nonatomic,copy) NSString *roomDiamondNum;
|
||||
///点单收入
|
||||
@property(nonatomic,copy) NSString *gameOrderAmount;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -33,8 +33,10 @@
|
||||
@property (nonatomic,strong) UILabel *idLabel;
|
||||
///空白的view
|
||||
@property (nonatomic,strong) UIView * incomeSpaceView;
|
||||
///显示收入
|
||||
///显示收礼
|
||||
@property (nonatomic,strong) UILabel *incomeLabel;
|
||||
///点单
|
||||
@property(nonatomic,strong) UILabel *orderLabel;
|
||||
///箭头
|
||||
@property (nonatomic,strong) UIImageView *arrowImageView;
|
||||
@end
|
||||
@@ -59,6 +61,7 @@
|
||||
[self.stackView addArrangedSubview:self.spaceView];
|
||||
[self.stackView addArrangedSubview:self.nickStackView];
|
||||
[self.stackView addArrangedSubview:self.incomeSpaceView];
|
||||
[self.stackView addArrangedSubview:self.orderLabel];
|
||||
[self.stackView addArrangedSubview:self.incomeLabel];
|
||||
[self.stackView addArrangedSubview:self.arrowImageView];
|
||||
|
||||
@@ -87,15 +90,19 @@
|
||||
}];
|
||||
|
||||
[self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(90, 44));
|
||||
make.size.mas_equalTo(CGSizeMake(70, 44));
|
||||
}];
|
||||
|
||||
[self.spaceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(20);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.orderLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(70);
|
||||
make.height.mas_equalTo(60);
|
||||
}];
|
||||
[self.incomeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(70);
|
||||
make.height.mas_equalTo(60);
|
||||
}];
|
||||
|
||||
@@ -113,6 +120,7 @@
|
||||
self.nickLabel.text = _userInfo.nick;
|
||||
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", _userInfo.erbanNo];
|
||||
self.incomeLabel.text = _userInfo.totalGoldNum;
|
||||
self.orderLabel.text = _userInfo.gameOrderAmount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,10 +193,20 @@
|
||||
_incomeLabel.font = [UIFont boldSystemFontOfSize:14];
|
||||
_incomeLabel.textColor = [ThemeColor mainTextColor];
|
||||
_incomeLabel.numberOfLines = 2;
|
||||
_incomeLabel.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
return _incomeLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)orderLabel {
|
||||
if (!_orderLabel) {
|
||||
_orderLabel = [[UILabel alloc] init];
|
||||
_orderLabel.font = [UIFont boldSystemFontOfSize:14];
|
||||
_orderLabel.textColor = [ThemeColor mainTextColor];
|
||||
_orderLabel.numberOfLines = 2;
|
||||
_orderLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _orderLabel;
|
||||
}
|
||||
- (UIImageView *)arrowImageView {
|
||||
if (!_arrowImageView) {
|
||||
_arrowImageView = [[UIImageView alloc] init];
|
||||
|
@@ -311,9 +311,9 @@
|
||||
if(!_orderView){
|
||||
_orderView = [[XPMineGuildPersonalBillRecordItemView alloc]initWithFrame:CGRectZero];
|
||||
_orderView.num = @"+0.0";
|
||||
_orderView.title = @"新用户送礼人数";
|
||||
_orderView.title = @"点单流水";
|
||||
}
|
||||
return _userGiftView;
|
||||
return _orderView;
|
||||
}
|
||||
- (XPGuildTimeMonthPickerView *)monthPickerView {
|
||||
if (!_monthPickerView) {
|
||||
|
@@ -23,6 +23,8 @@
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///收入
|
||||
@property (nonatomic,strong) UILabel *incomeLabel;
|
||||
///点单
|
||||
@property(nonatomic,strong) UILabel *orderView;
|
||||
@end
|
||||
|
||||
@implementation XPGuildIncomeSectionView
|
||||
@@ -43,6 +45,7 @@
|
||||
[self.stackView addArrangedSubview:self.rankLabel];
|
||||
[self.stackView addArrangedSubview:self.roomLabel];
|
||||
[self.stackView addArrangedSubview:self.nickLabel];
|
||||
[self.stackView addArrangedSubview:self.orderView];
|
||||
[self.stackView addArrangedSubview:self.incomeLabel];
|
||||
}
|
||||
|
||||
@@ -53,7 +56,7 @@
|
||||
}];
|
||||
|
||||
[self.rankLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(52);
|
||||
make.width.mas_equalTo(50);
|
||||
}];
|
||||
|
||||
[self.roomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -61,8 +64,11 @@
|
||||
}];
|
||||
|
||||
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(110);
|
||||
make.width.mas_equalTo(80);
|
||||
}];
|
||||
[self.orderView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(100);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -72,16 +78,24 @@
|
||||
case GuildIncomeType_Clan:
|
||||
case GuildIncomeType_Anchor:
|
||||
{
|
||||
self.orderView.hidden = YES;
|
||||
self.nickLabel.hidden = YES;
|
||||
self.roomLabel.text = @"房间";
|
||||
self.incomeLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self.nickLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(110);
|
||||
}];
|
||||
}
|
||||
break;
|
||||
case GuildIncomeType_Hall:
|
||||
{
|
||||
self.nickLabel.hidden = NO;
|
||||
self.roomLabel.text = @"头像";
|
||||
self.incomeLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.incomeLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.orderView.hidden = NO;
|
||||
[self.nickLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(80);
|
||||
}];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -137,7 +151,7 @@
|
||||
- (UILabel *)incomeLabel {
|
||||
if (!_incomeLabel) {
|
||||
_incomeLabel = [[UILabel alloc] init];
|
||||
_incomeLabel.text = @"收入(钻石)";
|
||||
_incomeLabel.text = @"收礼";
|
||||
_incomeLabel.font = [UIFont systemFontOfSize:12];
|
||||
_incomeLabel.textColor = [ThemeColor textThirdColor];
|
||||
_incomeLabel.textAlignment = NSTextAlignmentLeft;
|
||||
@@ -145,6 +159,15 @@
|
||||
return _incomeLabel;
|
||||
}
|
||||
|
||||
|
||||
- (UILabel *)orderView{
|
||||
if(!_orderView){
|
||||
_orderView = [[UILabel alloc] init];
|
||||
_orderView.text = @"点单";
|
||||
_orderView.font = [UIFont systemFontOfSize:12];
|
||||
_orderView.textColor = [ThemeColor textThirdColor];
|
||||
_orderView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _orderView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -54,7 +54,7 @@
|
||||
UserGameInfoVo *gameInfo = [self.gameList safeObjectAtIndex1:indexPath.row];
|
||||
CGFloat height = 98;
|
||||
if(gameInfo.tags.count > 2){
|
||||
height = (gameInfo.tags.count - 2) * 22;
|
||||
height = (gameInfo.tags.count - 2) * 24;
|
||||
}
|
||||
return kGetScaleWidth(height);
|
||||
}
|
||||
|
@@ -275,9 +275,14 @@
|
||||
if (index == 0) {
|
||||
viewController = self.userDataVC;
|
||||
} else if (index == 1) {
|
||||
viewController = self.monentsVC;
|
||||
if(self.titles.count == 2){
|
||||
viewController = self.monentsVC;
|
||||
}else{
|
||||
viewController = self.gameVC;
|
||||
}
|
||||
|
||||
}else if(index == 2){
|
||||
viewController = self.gameVC;
|
||||
viewController = self.monentsVC;
|
||||
}
|
||||
return (id <JXPagerViewListViewDelegate>)viewController;
|
||||
}
|
||||
@@ -364,7 +369,7 @@
|
||||
self.gameVC.gameList = userInfo.userGamePartner;
|
||||
self.attentionButton.hidden = YES;
|
||||
self.headView.attentionButton.hidden = NO;
|
||||
self.titles = @[@"资料", @"动态",@"游戏开黑"];
|
||||
self.titles = @[@"资料",@"游戏开黑", @"动态"];
|
||||
|
||||
}else{
|
||||
self.banButton.hidden = YES;
|
||||
|
@@ -56,11 +56,13 @@
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHidden:) name:UIKeyboardWillHideNotification object:nil];
|
||||
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
|
||||
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(hiddenCurView) name:@"kGameOrderListRefreshData" object:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)hiddenCurView{
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
- (void)keyboardWillShow:(NSNotification *)notification {
|
||||
|
||||
CGRect keyboardRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
||||
@@ -359,6 +361,7 @@
|
||||
UserGameInfoVo *gameInfo = [self.gameList safeObjectAtIndex1:_inning.integerValue];
|
||||
NSInteger count = self.inningView.text.integerValue;
|
||||
self.priceVeiw.text = @(gameInfo.price.integerValue * count).stringValue;
|
||||
self.subtractBtn.enabled = count > 1;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UIButton *)backView{
|
||||
|
@@ -22,7 +22,7 @@
|
||||
///价格
|
||||
@property(nonatomic,strong) UILabel *priceView;
|
||||
///支付
|
||||
@property(nonatomic,strong) UIButton *payBtn;
|
||||
@property(nonatomic,strong)NetImageView *payBtn;
|
||||
@property(nonatomic,strong) UITableView *tableView;
|
||||
|
||||
|
||||
@@ -62,19 +62,19 @@
|
||||
make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(16));
|
||||
}];
|
||||
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(50));
|
||||
make.top.mas_equalTo(kGetScaleWidth(20));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(17));
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(52));
|
||||
make.top.mas_equalTo(kGetScaleWidth(18));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(16));
|
||||
}];
|
||||
[self.priceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(16));
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(14));
|
||||
make.height.mas_equalTo(kGetScaleWidth(21));
|
||||
make.width.mas_greaterThanOrEqualTo(10);
|
||||
make.top.mas_equalTo(kGetScaleWidth(12));
|
||||
}];
|
||||
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.equalTo(self.iconView.mas_trailing).mas_offset(kGetScaleWidth(15));
|
||||
make.leading.equalTo(self.iconView.mas_trailing).mas_offset(kGetScaleWidth(14));
|
||||
make.top.mas_equalTo(kGetScaleWidth(10));
|
||||
make.height.mas_equalTo(kGetScaleWidth(22));
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
make.leading.mas_equalTo(kGetScaleWidth(82));
|
||||
make.width.mas_equalTo(kGetScaleWidth(160));
|
||||
make.top.equalTo(self.titleView.mas_bottom);
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(14));
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(12));
|
||||
}];
|
||||
[self.payBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(76));
|
||||
@@ -106,12 +106,25 @@
|
||||
- (void)setGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
_gameInfo = gameInfo;
|
||||
_iconView.imageUrl = _gameInfo.logo;
|
||||
_bgImageView.imageUrl = _gameInfo.background;
|
||||
|
||||
|
||||
_payBtn.imageUrl = _gameInfo.btnRgb;
|
||||
|
||||
self.tierView.textColor = UIColorFromRGB(0xBBBCBD);
|
||||
self.tierBgView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.6];;
|
||||
[_bgImageView loadImageWithUrl:_gameInfo.background completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
||||
self.tierView.textColor = [ThemeColor colorWithHexString:gameInfo.tagRgb];
|
||||
self.tierBgView.backgroundColor = [ThemeColor colorWithHexString:gameInfo.tagBg];
|
||||
self.bgImageView.image = image;
|
||||
}];
|
||||
_titleView.text = _gameInfo.gameName;
|
||||
_tierView.text = _gameInfo.tier;
|
||||
_tierBgView.hidden = _gameInfo.tier.length == 0;
|
||||
|
||||
|
||||
|
||||
NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ 钻/局",_gameInfo.price] attributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
||||
[textAtt addAttributes:@{NSFontAttributeName:kFontRegular(10),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[textAtt.string rangeOfString:@"钻/局"]];
|
||||
[textAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:[UIColor colorWithWhite:1 alpha:0.8]} range:[textAtt.string rangeOfString:@"钻/局"]];
|
||||
UIImage *iconImage = kImage(@"mine_game_diamond");
|
||||
NSTextAttachment * attachment = [[NSTextAttachment alloc] init];
|
||||
attachment.bounds = CGRectMake(0, roundf(_priceView.font.capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height);;
|
||||
@@ -143,7 +156,7 @@
|
||||
- (NetImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = kImage(@"mine_user_game_cell");
|
||||
config.placeHolder = kImage(@"mine_user_game_cell_bg");
|
||||
_bgImageView = [[NetImageView alloc]initWithConfig:config];
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
@@ -154,8 +167,6 @@
|
||||
NetImageConfig *config = [NetImageConfig new];
|
||||
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
|
||||
_iconView = [[NetImageView alloc]initWithConfig:config];
|
||||
_iconView.layer.cornerRadius = kGetScaleWidth(50)/2;
|
||||
_iconView.layer.masksToBounds = YES;
|
||||
|
||||
}
|
||||
return _iconView;
|
||||
@@ -193,15 +204,19 @@
|
||||
}
|
||||
return _priceView;
|
||||
}
|
||||
- (UIButton *)payBtn{
|
||||
|
||||
- (NetImageView *)payBtn{
|
||||
if(!_payBtn){
|
||||
_payBtn = [UIButton new];
|
||||
[_payBtn setBackgroundImage:kImage(@"mine_game_pay_btn") forState:UIControlStateNormal];
|
||||
[_payBtn setTitleColor:UIColorFromRGB(0x683F0B) forState:UIControlStateNormal];
|
||||
[_payBtn setTitle:@"咨询下单" forState:UIControlStateNormal];
|
||||
_payBtn.titleLabel.font = kFontMedium(12);
|
||||
[_payBtn addTarget:self action:@selector(consultingOrderAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = kImage(@"mine_user_game_cell_pay_bg");
|
||||
_payBtn = [[NetImageView alloc]initWithConfig:config];;
|
||||
UIButton *payTitleBnt = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, kGetScaleWidth(72), kGetScaleWidth(30))];
|
||||
[payTitleBnt setTitleColor:UIColorFromRGB(0x683F0B) forState:UIControlStateNormal];
|
||||
[payTitleBnt setTitle:@"咨询下单" forState:UIControlStateNormal];
|
||||
payTitleBnt.titleLabel.font = kFontMedium(12);
|
||||
[payTitleBnt addTarget:self action:@selector(consultingOrderAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_payBtn addSubview:payTitleBnt];
|
||||
_payBtn.userInteractionEnabled = YES;
|
||||
}
|
||||
return _payBtn;
|
||||
}
|
||||
@@ -211,7 +226,7 @@
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.scrollEnabled = NO;
|
||||
_tableView.rowHeight = kGetScaleWidth(22);
|
||||
_tableView.rowHeight = kGetScaleWidth(24);
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
[_tableView registerClass:[XPMineUserGameTypeCell class] forCellReuseIdentifier:NSStringFromClass([XPMineUserGameTypeCell class])];
|
||||
|
@@ -290,6 +290,12 @@
|
||||
|
||||
}
|
||||
break;
|
||||
case XPMineItemType_Game_Order:
|
||||
{
|
||||
XPMineGameOrderVC* orderVC = [[XPMineGameOrderVC alloc]init];
|
||||
[self.navigationController pushViewController:orderVC animated:YES];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -402,9 +408,8 @@
|
||||
///点击了访客
|
||||
- (void)xpMineHeadViewClickVisitor {
|
||||
|
||||
XPMineGameOrderVC* orderVC = [[XPMineGameOrderVC alloc]init];
|
||||
[self.navigationController pushViewController:orderVC animated:YES];
|
||||
// [self pushViewControllerWithType:XPMineItemType_Visitor functionItem:nil];
|
||||
|
||||
[self pushViewControllerWithType:XPMineItemType_Visitor functionItem:nil];
|
||||
}
|
||||
|
||||
///点击了足迹
|
||||
|
@@ -8,9 +8,17 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "UserGameInfoVo.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol XPRoomGameInviteBannerViewDelegate <NSObject>
|
||||
|
||||
-(void)sendGameInviteMessageWithGameInfo:(UserGameInfoVo *)gameInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface XPRoomGameInviteBannerView : UIView
|
||||
@property(nonatomic,weak) id<XPRoomGameInviteBannerViewDelegate>delegate;
|
||||
@property(nonatomic,strong) UserGameInfoVo *gameInfo;
|
||||
-(void)show;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -99,6 +99,23 @@
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)show{
|
||||
[self performSelector:@selector(closeView) withObject:nil afterDelay:3];
|
||||
|
||||
}
|
||||
-(void)closeView{
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
-(void)closeAction{
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(closeView) object:nil];
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
-(void)sendMessageBtnAction{
|
||||
[self removeFromSuperview];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(sendGameInviteMessageWithGameInfo:)]){
|
||||
[self.delegate sendGameInviteMessageWithGameInfo:self.gameInfo];
|
||||
}
|
||||
}
|
||||
-(void)setGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
_gameInfo = gameInfo;
|
||||
_headVeiw.imageUrl = _gameInfo.toAvatar;
|
||||
@@ -131,6 +148,7 @@
|
||||
_backBtn = [UIButton new];
|
||||
[_backBtn setImage:kImage(@"room_game_invite_banner_back") forState:UIControlStateNormal];
|
||||
[_backBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
||||
[_backBtn addTarget:self action:@selector(closeAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _backBtn;
|
||||
}
|
||||
@@ -179,6 +197,7 @@
|
||||
[_inspectView setTitle:@"立即查看" forState:UIControlStateNormal];
|
||||
[_inspectView setTitleColor:UIColorFromRGB(0x695CEB) forState:UIControlStateNormal];
|
||||
_inspectView.titleLabel.font = kFontMedium(12);
|
||||
[_inspectView addTarget:self action:@selector(sendMessageBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _inspectView;
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey";
|
||||
UIKIT_EXTERN NSString * kNewUserRechargeKey;
|
||||
UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
|
||||
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol, NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate, NIMChatManagerDelegate, XPAnchorCardViewDelegate, NIMBroadcastManagerDelegate, XPRoomYearActivityViewDelegate>
|
||||
@interface TabbarViewController () <BaseMvpProtocol, MainProtocol, NIMLoginManagerDelegate, NIMSystemNotificationManagerDelegate, NIMChatManagerDelegate, XPAnchorCardViewDelegate, NIMBroadcastManagerDelegate, XPRoomYearActivityViewDelegate,XPRoomGameInviteBannerViewDelegate>
|
||||
|
||||
/// 分割线
|
||||
@property (nonatomic, strong) UIView *lineView;
|
||||
@@ -504,6 +504,10 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
XPNewUserRechargeSucessView * firstRechargeView= [[XPNewUserRechargeSucessView alloc] init];
|
||||
firstRechargeView.rechargeInfo = model;
|
||||
[TTPopup popupView:firstRechargeView style:TTPopupStyleAlert];
|
||||
}else if(attachment.first == CustomMessageType_Initiat_Invitation && attachment.second == Custom_Message_Sub_Initiat_Invitation_Initiating_User){
|
||||
|
||||
UserGameInfoVo *gameInfo = [UserGameInfoVo modelWithDictionary:attachment.data];
|
||||
[self showGameVeiwWithGameInfo:gameInfo];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -554,10 +558,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
XPVersionUpdateModel *updateModel = [XPVersionUpdateModel modelWithDictionary:attachment.data];
|
||||
[self getVersionUpdate:updateModel];
|
||||
}
|
||||
}else if(attachment.first == CustomMessageType_Initiat_Invitation && attachment.second == Custom_Message_Sub_Initiat_Invitation_Initiating_User){
|
||||
|
||||
UserGameInfoVo *gameInfo = [UserGameInfoVo modelWithDictionary:attachment.data];
|
||||
[self showGameVeiwWithGameInfo:gameInfo];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -565,19 +565,37 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
__block BOOL isInChat = NO;
|
||||
[self.getKeyWindowNav.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj isKindOfClass:[SessionViewController class]]) {
|
||||
isInChat = YES;
|
||||
SessionViewController *chatVC = (SessionViewController *)obj;
|
||||
if(![gameInfo.fromUid isEqualToString:chatVC.session.sessionId]){
|
||||
isInChat = YES;
|
||||
}
|
||||
*stop = YES;
|
||||
}
|
||||
}];
|
||||
if(isInChat == YES)return;
|
||||
if([gameInfo.fromUid isEqualToString:[AccountInfoStorage instance].getUid]){
|
||||
return;
|
||||
}
|
||||
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
|
||||
XPRoomGameInviteBannerView *gameView = [[XPRoomGameInviteBannerView alloc]initWithFrame:CGRectMake(0, -kGetScaleWidth(92), KScreenWidth, kGetScaleWidth(92))];
|
||||
gameView.gameInfo = gameInfo;
|
||||
[kWindow addSubview:gameView];
|
||||
[UIView animateWithDuration:1 animations:^{
|
||||
gameView.frame = CGRectMake(0, kNavigationHeight + 15, KScreenWidth, kGetScaleWidth(92));
|
||||
gameView.delegate = self;
|
||||
[UIView animateWithDuration:0.5 animations:^{
|
||||
UIWindow *window = UIApplication.sharedApplication.windows.firstObject;
|
||||
CGFloat topPadding = window.safeAreaInsets.top;
|
||||
gameView.frame = CGRectMake(0, topPadding + 15, KScreenWidth, kGetScaleWidth(92));
|
||||
}completion:^(BOOL finished) {
|
||||
[gameView show];
|
||||
}];
|
||||
}
|
||||
#pragma mark - XPRoomGameInviteBannerViewDelegate
|
||||
-(void)sendGameInviteMessageWithGameInfo:(UserGameInfoVo *)gameInfo{
|
||||
NSString * sessionId = [NSString stringWithFormat:@"%@",gameInfo.fromUid];
|
||||
NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[self.navigationController pushViewController:sessionVC animated:YES];
|
||||
}
|
||||
- (UINavigationController *)getKeyWindowNav {
|
||||
if ([XCCurrentVCStackManager shareManager].getCurrentVC) {
|
||||
return [XCCurrentVCStackManager shareManager].getCurrentVC.navigationController;
|
||||
|
Reference in New Issue
Block a user