添加了我的房间的入口和开启自己房间的逻辑
This commit is contained in:
22
xplan-ios/Assets.xcassets/Mine/mine_normal_my_room.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Mine/mine_normal_my_room.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "mine_normal_my_room@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "mine_normal_my_room@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Mine/mine_normal_my_room.imageset/mine_normal_my_room@2x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/mine_normal_my_room.imageset/mine_normal_my_room@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
xplan-ios/Assets.xcassets/Mine/mine_normal_my_room.imageset/mine_normal_my_room@3x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/mine_normal_my_room.imageset/mine_normal_my_room@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
@@ -54,18 +54,24 @@
|
||||
|
||||
/// 获取普通的items
|
||||
- (void)getNormalItems {
|
||||
|
||||
XPMineItemModel * myRoomItem = [[XPMineItemModel alloc] init];
|
||||
myRoomItem.itmeName = @"我的房间";
|
||||
myRoomItem.itmeImageName = @"mine_normal_my_room";
|
||||
myRoomItem.type = XPMineItemType_My_Room;
|
||||
myRoomItem.cornerType = UIRectCornerTopLeft | UIRectCornerTopRight;
|
||||
|
||||
XPMineItemModel * teenagerItem = [[XPMineItemModel alloc] init];
|
||||
teenagerItem.itmeName = @"青少年模式";
|
||||
teenagerItem.itmeImageName = @"mine_normal_teenager";
|
||||
teenagerItem.type = XPMineItemType_Teenager_Mode;
|
||||
teenagerItem.cornerType = UIRectCornerTopLeft | UIRectCornerTopRight;
|
||||
|
||||
XPMineItemModel * realNameItem = [[XPMineItemModel alloc] init];
|
||||
realNameItem.itmeName = @"实名认证";
|
||||
realNameItem.itmeImageName = @"mine_normal_real_name_authentic";
|
||||
realNameItem.type = XPMineItemType_Real_Name_Authentic;
|
||||
realNameItem.cornerType = UIRectCornerBottomLeft | UIRectCornerBottomRight;
|
||||
NSArray * array = @[teenagerItem, realNameItem];
|
||||
NSArray * array = @[myRoomItem,teenagerItem, realNameItem];
|
||||
[[self getView] onGetNormalItemsSuccess:array];
|
||||
}
|
||||
|
||||
|
@@ -29,9 +29,6 @@
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "XPMineRechargeViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
|
||||
#warning todo 测试
|
||||
#import "BaseNavigationController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
|
||||
|
||||
@@ -130,13 +127,9 @@
|
||||
break;
|
||||
case XPMineItemType_Account:
|
||||
{
|
||||
NSString* roomUid = [NSString stringWithFormat:@"%d", 1004587];
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
return;
|
||||
XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
|
||||
[self.navigationController pushViewController:rechargeVC animated:YES];
|
||||
}
|
||||
|
||||
break;
|
||||
case XPMineItemType_Invite_Friend:
|
||||
[self pushWebViewWIthUrl:URLWithType(kUserInviteFriendURL)];
|
||||
@@ -148,7 +141,12 @@
|
||||
[self.navigationController pushViewController:infoVC animated:YES];
|
||||
}
|
||||
break;
|
||||
|
||||
case XPMineItemType_My_Room:
|
||||
{
|
||||
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -29,11 +29,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param roomPwd 房间密码
|
||||
/// @param roomDesc 房间介绍
|
||||
/// @param backPic 房间背景
|
||||
- (void)openUserRoomWithTitle:(NSString *)title
|
||||
type:(RoomType)type
|
||||
roomPwd:(NSString *)roomPwd
|
||||
roomDesc:(NSString *)roomDesc
|
||||
backPic:(NSString *)backPic;
|
||||
- (void)openRoom:(NSString *)title
|
||||
type:(RoomType)type
|
||||
roomPwd:(NSString *)roomPwd
|
||||
roomDesc:(NSString *)roomDesc
|
||||
backPic:(NSString *)backPic;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -76,13 +76,17 @@
|
||||
/// @param roomPwd 房间密码
|
||||
/// @param roomDesc 房间介绍
|
||||
/// @param backPic 房间背景
|
||||
- (void)openUserRoomWithTitle:(NSString *)title
|
||||
type:(RoomType)type
|
||||
roomPwd:(NSString *)roomPwd
|
||||
roomDesc:(NSString *)roomDesc
|
||||
backPic:(NSString *)backPic {
|
||||
- (void)openRoom:(NSString *)title
|
||||
type:(RoomType)type
|
||||
roomPwd:(NSString *)roomPwd
|
||||
roomDesc:(NSString *)roomDesc
|
||||
backPic:(NSString *)backPic {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
if (title.length <= 0) {
|
||||
title = @"";
|
||||
}
|
||||
|
||||
if (roomPwd.length <= 0) {
|
||||
roomPwd = @"";
|
||||
}
|
||||
|
@@ -27,8 +27,6 @@
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
#warning to do Malloc 数据
|
||||
[self initMallocData];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@@ -150,9 +150,11 @@
|
||||
[self.presenter getUserInfoWithUid:uid];
|
||||
} else {
|
||||
if ([self.roomUid isEqualToString:uid]) {
|
||||
// TODO: 进入自己房间,需要重新开房。
|
||||
[self showSuccessToast:@"请选择进入其他人的房间"];
|
||||
[self enterRoomFail];
|
||||
if (roomInfo.roomId > 0) {
|
||||
[self.presenter openRoom:roomInfo.title type:roomInfo.type roomPwd:roomInfo.roomPwd roomDesc:roomInfo.roomDesc backPic:@""];
|
||||
} else {///没有开启过房间 一般都是刚注册账号
|
||||
[self.presenter getUserInfoWithUid:uid];
|
||||
}
|
||||
} else {
|
||||
// TODO: 房主已经下线。
|
||||
[self showSuccessToast:@"房主已下线"];
|
||||
@@ -163,7 +165,12 @@
|
||||
|
||||
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
self.userInfo = userInfo;
|
||||
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
|
||||
if (self.roomInfo.roomId > 0) {
|
||||
[self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo];
|
||||
} else {
|
||||
NSString * title = [NSString stringWithFormat:@"%@的房间", userInfo.nick];
|
||||
[self.presenter openRoom:title type:RoomType_Game roomPwd:@"" roomDesc:@"" backPic:@""];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)openRoomSuccess:(RoomInfoModel *)roomInfo {
|
||||
|
Reference in New Issue
Block a user