Compare commits

..

13 Commits

Author SHA1 Message Date
liyuhua
375d9e38e7 主题色优化 2024-06-04 18:04:08 +08:00
liyuhua
39d5c1c320 修复bug 2024-06-04 17:07:24 +08:00
liyuhua
6a5f5b3001 修复bug 2024-06-04 15:47:22 +08:00
liyuhua
b990f01a6e 修复bug 2024-06-03 18:59:43 +08:00
liyuhua
98cedafaae 修复bug 2024-06-03 16:38:22 +08:00
liyuhua
21eac2aceb 修复bug 2024-06-03 11:45:47 +08:00
liyuhua
79fcdb859a 修复bug 2024-06-03 11:03:41 +08:00
liyuhua
9198548b06 修复bug 2024-06-03 10:51:16 +08:00
liyuhua
bf113af79c 房间游戏 2024-05-31 19:56:25 +08:00
liyuhua
259ce7a18a 房间游戏 2024-05-30 10:58:35 +08:00
liyuhua
7e678da77d 阿语翻译更改 2024-05-29 10:16:52 +08:00
liyuhua
1012ca0f5b 房间游戏 2024-05-28 18:05:54 +08:00
liyuhua
0732e4c46f 房间游戏 2024-05-28 18:05:42 +08:00
151 changed files with 1117 additions and 1841 deletions

View File

@@ -290,7 +290,6 @@
237852A12C072D8D00E360AC /* MSRoomGameModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A02C072D8D00E360AC /* MSRoomGameModel.m */; }; 237852A12C072D8D00E360AC /* MSRoomGameModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A02C072D8D00E360AC /* MSRoomGameModel.m */; };
237852A42C082A9800E360AC /* MSRoomGameSendTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A32C082A9800E360AC /* MSRoomGameSendTextView.m */; }; 237852A42C082A9800E360AC /* MSRoomGameSendTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A32C082A9800E360AC /* MSRoomGameSendTextView.m */; };
237852A72C08764B00E360AC /* MSRoomGameResultsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A62C08764B00E360AC /* MSRoomGameResultsModel.m */; }; 237852A72C08764B00E360AC /* MSRoomGameResultsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A62C08764B00E360AC /* MSRoomGameResultsModel.m */; };
237852AA2C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237852A92C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m */; };
237B94BC2A984DA7007853E3 /* XPTrumpetPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */; }; 237B94BC2A984DA7007853E3 /* XPTrumpetPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */; };
237B94BD2A984DA7007853E3 /* XPNobleTrumpetModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B32A984DA7007853E3 /* XPNobleTrumpetModel.m */; }; 237B94BD2A984DA7007853E3 /* XPNobleTrumpetModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B32A984DA7007853E3 /* XPNobleTrumpetModel.m */; };
237B94BE2A984DA7007853E3 /* XPRoomTrumpetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B72A984DA7007853E3 /* XPRoomTrumpetViewController.m */; }; 237B94BE2A984DA7007853E3 /* XPRoomTrumpetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94B72A984DA7007853E3 /* XPRoomTrumpetViewController.m */; };
@@ -2116,8 +2115,6 @@
237852A32C082A9800E360AC /* MSRoomGameSendTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSRoomGameSendTextView.m; sourceTree = "<group>"; }; 237852A32C082A9800E360AC /* MSRoomGameSendTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSRoomGameSendTextView.m; sourceTree = "<group>"; };
237852A52C08764B00E360AC /* MSRoomGameResultsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSRoomGameResultsModel.h; sourceTree = "<group>"; }; 237852A52C08764B00E360AC /* MSRoomGameResultsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSRoomGameResultsModel.h; sourceTree = "<group>"; };
237852A62C08764B00E360AC /* MSRoomGameResultsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSRoomGameResultsModel.m; sourceTree = "<group>"; }; 237852A62C08764B00E360AC /* MSRoomGameResultsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSRoomGameResultsModel.m; sourceTree = "<group>"; };
237852A82C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MsRoomMessagChatHallHeadView.h; sourceTree = "<group>"; };
237852A92C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MsRoomMessagChatHallHeadView.m; sourceTree = "<group>"; };
237B94AD2A984DA7007853E3 /* XPTrumpetPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTrumpetPresenter.h; sourceTree = "<group>"; }; 237B94AD2A984DA7007853E3 /* XPTrumpetPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTrumpetPresenter.h; sourceTree = "<group>"; };
237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPTrumpetPresenter.m; sourceTree = "<group>"; }; 237B94AE2A984DA7007853E3 /* XPTrumpetPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPTrumpetPresenter.m; sourceTree = "<group>"; };
237B94B02A984DA7007853E3 /* XPRoomTrumpetProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPRoomTrumpetProtocol.h; sourceTree = "<group>"; }; 237B94B02A984DA7007853E3 /* XPRoomTrumpetProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPRoomTrumpetProtocol.h; sourceTree = "<group>"; };
@@ -10188,8 +10185,6 @@
E8AEAEF227141C7C0017FCE0 /* XPRoomMessageContainerView.m */, E8AEAEF227141C7C0017FCE0 /* XPRoomMessageContainerView.m */,
235714932BEDF517004C81D6 /* MsRoomMessagChatHallView.h */, 235714932BEDF517004C81D6 /* MsRoomMessagChatHallView.h */,
235714942BEDF517004C81D6 /* MsRoomMessagChatHallView.m */, 235714942BEDF517004C81D6 /* MsRoomMessagChatHallView.m */,
237852A82C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.h */,
237852A92C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m */,
); );
path = MessageContainerView; path = MessageContainerView;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -11833,7 +11828,6 @@
237700FA2BCCD25500D661F1 /* YYLabel+MSRTL.m in Sources */, 237700FA2BCCD25500D661F1 /* YYLabel+MSRTL.m in Sources */,
E84BF7DD277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m in Sources */, E84BF7DD277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m in Sources */,
E8F6135C291E26BD00E12650 /* NSMutableDictionary+Saft.m in Sources */, E8F6135C291E26BD00E12650 /* NSMutableDictionary+Saft.m in Sources */,
237852AA2C0D98BF00E360AC /* MsRoomMessagChatHallHeadView.m in Sources */,
239D0F992BFB43BC002977CE /* MSRoomOnLineAvatarView.m in Sources */, 239D0F992BFB43BC002977CE /* MSRoomOnLineAvatarView.m in Sources */,
1427213429A75A2600C7C423 /* XPMonentsLatestPresenter.m in Sources */, 1427213429A75A2600C7C423 /* XPMonentsLatestPresenter.m in Sources */,
E83ABEFD280EB5E200322EE4 /* ContentOpenLiveInfoModel.m in Sources */, E83ABEFD280EB5E200322EE4 /* ContentOpenLiveInfoModel.m in Sources */,
@@ -12770,7 +12764,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 20.20.23; MARKETING_VERSION = 20.20.22;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@@ -12808,7 +12802,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 20.20.23; MARKETING_VERSION = 20.20.22;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "ms_room_game_button@2x.png", "filename" : "ms_room_game_underwa_coin_bg@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ms_room_game_button@3x.png", "filename" : "ms_room_game_underwa_coin_bg@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_room_game_victory_border_first@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_room_game_victory_border_first@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_room_game_switch_button@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_room_game_switch_button@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_room_message_chat_hall_head_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_room_message_chat_hall_head_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "exchange_diamonds_icon@2x.png", "filename" : "exchange_diamonds_arrow@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "exchange_diamonds_icon@3x.png", "filename" : "exchange_diamonds_arrow@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_exchange_coin_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_exchange_coin_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_exchange_diamonds_coin_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_exchange_diamonds_coin_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_exchange_diamonds_diamonds_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_exchange_diamonds_diamonds_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_income_record_coin@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_income_record_coin@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_income_recorddiamond@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_income_recorddiamond@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_mine_coin_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_mine_coin_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_mine_diamond_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_mine_diamond_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_mine_top_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_mine_top_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "ms_mine_purse_arrow@2x.png", "filename" : "mine_recharge_balance_bg@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ms_mine_purse_arrow@3x.png", "filename" : "mine_recharge_balance_bg@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ms_mine_recharge_coin@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ms_mine_recharge_coin@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 804 B

View File

@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
///内置版本号 ///内置版本号
#define PI_App_Version @"1.0.8" #define PI_App_Version @"1.0.7"
///渠道 ///渠道
#define PI_App_Source @"appstore" #define PI_App_Source @"appstore"
#define PI_Test_Flight @"TestFlight" #define PI_Test_Flight @"TestFlight"

View File

@@ -191,7 +191,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
make.width.mas_offset(kGetScaleWidth(162)); make.width.mas_offset(kGetScaleWidth(162));
make.height.mas_equalTo(kGetScaleWidth(32)); make.height.mas_equalTo(kGetScaleWidth(32));
make.centerX.equalTo(self.view); make.centerX.equalTo(self.view);
make.top.equalTo(self.bgImageView.mas_bottom).mas_offset(kGetScaleWidth(-15)); make.top.equalTo(self.bgImageView.mas_bottom).mas_offset(kGetScaleWidth(10));
}]; }];
@@ -732,7 +732,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
if(!_bgImageView){ if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init]; _bgImageView = [[UIImageView alloc]init];
_bgImageView.image = kImage(@"pi_app_login_new_bg"); _bgImageView.image = kImage(@"pi_app_login_new_bg");
_bgImageView.contentMode = UIViewContentModeScaleAspectFit; _bgImageView.contentMode = 2;
} }
return _bgImageView; return _bgImageView;
} }

View File

@@ -125,8 +125,7 @@
[[self getView] onGetLittleGameListSuccess:array ]; [[self getView] onGetLittleGameListSuccess:array ];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] onGetLittleGameListFail]; [[self getView] onGetLittleGameListFail];
} errorToast:NO] } errorToast:NO]];
roomUid:uid];
} }
/// ///
/// @param mgId ID /// @param mgId ID

View File

@@ -14,7 +14,8 @@
@property (nonatomic,strong) UILabel *titleView; @property (nonatomic,strong) UILabel *titleView;
/// ///
@property (nonatomic,strong) XPMinePersonalCenterItemView *myRoomView; @property (nonatomic,strong) XPMinePersonalCenterItemView *myRoomView;
///
@property (nonatomic,strong) XPMinePersonalCenterItemView *earningsRecordView;
/// ///
@property (nonatomic,strong) XPMinePersonalCenterItemView *giveDiamondView; @property (nonatomic,strong) XPMinePersonalCenterItemView *giveDiamondView;
@@ -39,7 +40,7 @@
[self.contentView addSubview:self.bgView]; [self.contentView addSubview:self.bgView];
[self.bgView addSubview:self.titleView]; [self.bgView addSubview:self.titleView];
[self.bgView addSubview:self.myRoomView]; [self.bgView addSubview:self.myRoomView];
[self.bgView addSubview:self.earningsRecordView];
[self.bgView addSubview:self.giveDiamondView]; [self.bgView addSubview:self.giveDiamondView];
self.giveDiamondView.hidden = YES; self.giveDiamondView.hidden = YES;
} }
@@ -60,20 +61,42 @@
make.height.equalTo(@38); make.height.equalTo(@38);
make.top.mas_equalTo(44); make.top.mas_equalTo(44);
}]; }];
[self.earningsRecordView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.height.width.equalTo(self.myRoomView);
make.trailing.mas_equalTo(-35);
}];
[self.giveDiamondView mas_makeConstraints:^(MASConstraintMaker *make) { [self.giveDiamondView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.height.width.equalTo(self.myRoomView); make.top.height.width.equalTo(self.myRoomView);
make.trailing.mas_equalTo(-kGetScaleWidth(35)); make.trailing.mas_equalTo(0);
}]; }];
} }
-(void)setIsHaveGiveDiamond:(BOOL)isHaveGiveDiamond{ -(void)setIsHaveGiveDiamond:(BOOL)isHaveGiveDiamond{
_isHaveGiveDiamond = isHaveGiveDiamond; _isHaveGiveDiamond = isHaveGiveDiamond;
self.myRoomView.isHaveGiveDiamond = _isHaveGiveDiamond; self.myRoomView.isHaveGiveDiamond = _isHaveGiveDiamond;
self.earningsRecordView.isHaveGiveDiamond = _isHaveGiveDiamond;
self.giveDiamondView.isHaveGiveDiamond = _isHaveGiveDiamond; self.giveDiamondView.isHaveGiveDiamond = _isHaveGiveDiamond;
self.giveDiamondView.hidden = !_isHaveGiveDiamond; CGFloat width = (KScreenWidth - 30) / 3;
if(_isHaveGiveDiamond == YES){
self.giveDiamondView.hidden = NO;
[self.myRoomView mas_updateConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.width.mas_greaterThanOrEqualTo(width);
make.height.equalTo(@68);
}];
[self.earningsRecordView mas_updateConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-width);
}];
return;
}
self.giveDiamondView.hidden = YES;
[self.myRoomView mas_updateConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(35);
make.width.mas_greaterThanOrEqualTo(104);
make.height.equalTo(@38);
}];
[self.earningsRecordView mas_updateConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-35);
}];
} }
-(void)clickMyRoomAction{ -(void)clickMyRoomAction{
@@ -121,7 +144,16 @@
} }
return _myRoomView; return _myRoomView;
} }
-(XPMinePersonalCenterItemView *)earningsRecordView{
if(!_earningsRecordView){
_earningsRecordView = [[XPMinePersonalCenterItemView alloc]initWithFrame:CGRectZero];
[_earningsRecordView setTitle:YMLocalizedString(@"XPMinePersonalCenterCell2")];
[_earningsRecordView setImage:@"mine_earnings_record"];
UITapGestureRecognizer *earningsRecordTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickEarningsRecordAction)];
[_earningsRecordView addGestureRecognizer:earningsRecordTap];
}
return _earningsRecordView;
}
- (XPMinePersonalCenterItemView *)giveDiamondView{ - (XPMinePersonalCenterItemView *)giveDiamondView{
if (!_giveDiamondView){ if (!_giveDiamondView){
_giveDiamondView = [[XPMinePersonalCenterItemView alloc]initWithFrame:CGRectZero]; _giveDiamondView = [[XPMinePersonalCenterItemView alloc]initWithFrame:CGRectZero];

View File

@@ -40,15 +40,10 @@
} }
-(void)getExchangeDiamondInformation{ -(void)getExchangeDiamondInformation{
@kWeakify(self);
[Api getExchangeDiamondInformation:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getExchangeDiamondInformation:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
XPExchangeDiamondsModel *model = [XPExchangeDiamondsModel modelWithDictionary:data.data]; XPExchangeDiamondsModel *model = [XPExchangeDiamondsModel modelWithDictionary:data.data];
XPExchangeDiamondsModel *tempModel = [XPExchangeDiamondsModel modelWithDictionary:data.data]; [[self getView]getExchangeDiamondInformation:model];
model.golds = tempModel.diamonds; } showLoading:YES]];
model.diamonds = tempModel.golds;
[[self getView] getExchangeDiamondInformation:model];
} showLoading:YES]];
} }
-(void)confirmExchangeDiamondWithGoldNum:(NSString *)goldNum diamondNum:(NSString *)diamondNum currency:(NSString *)currency{ -(void)confirmExchangeDiamondWithGoldNum:(NSString *)goldNum diamondNum:(NSString *)diamondNum currency:(NSString *)currency{
[Api confirmExchangeDiamond:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api confirmExchangeDiamond:[self createHttpCompletion:^(BaseModel * _Nonnull data) {

View File

@@ -10,7 +10,7 @@
@protocol XPExchangeDiamondsVCDelegate <NSObject> @protocol XPExchangeDiamondsVCDelegate <NSObject>
-(void)confirmExchangeDiamondsWithDiamondSuccess:(NSString *_Nullable)diamond gold:(NSString *_Nonnull)gold; -(void)confirmExchangeDiamondsWithDiamondSuccess:(NSString *)diamond gold:(NSString *)gold;
@end @end

View File

@@ -23,11 +23,6 @@
@property (nonatomic,strong) XPExchangeDiamondsView *exchangeView; @property (nonatomic,strong) XPExchangeDiamondsView *exchangeView;
@property (nonatomic,copy) NSString *diamond; @property (nonatomic,copy) NSString *diamond;
@property (nonatomic,copy) NSString *gold; @property (nonatomic,copy) NSString *gold;
@property(nonatomic,strong) UIImageView *bgImageView;
///
@property (nonatomic,strong) UIButton *backBtn;
///
@property (nonatomic,strong) UILabel *titleLabel;
@end @end
@implementation XPExchangeDiamondsVC @implementation XPExchangeDiamondsVC
@@ -68,7 +63,7 @@
[self.presenter confirmExchangeDiamondWithGoldNum:self.gold diamondNum:self.diamond currency:@"1"]; [self.presenter confirmExchangeDiamondWithGoldNum:self.gold diamondNum:self.diamond currency:@"1"];
} }
#pragma mark - XPExchangeDiamondsViewDelegate #pragma mark - XPExchangeDiamondsViewDelegate
-(void)confirmExchangeDiamondsWithDiamond:(NSString *)diamond gold:(NSString *)gold{ -(void)confirmExchangeDiamondsWithDiamond:(NSString *)diamond gold:(NSString *)gold currency:(NSString *)currency{
self.diamond = diamond; self.diamond = diamond;
self.gold = [NSString stringWithFormat:@"%.0f",ceilf(diamond.doubleValue / self.model.rate)]; self.gold = [NSString stringWithFormat:@"%.0f",ceilf(diamond.doubleValue / self.model.rate)];
XPMineConfirmGiveDiamondView *confirmView = [[XPMineConfirmGiveDiamondView alloc]initWithFrame:CGRectZero]; XPMineConfirmGiveDiamondView *confirmView = [[XPMineConfirmGiveDiamondView alloc]initWithFrame:CGRectZero];
@@ -78,42 +73,18 @@
confirmView.delegate = self; confirmView.delegate = self;
[TTPopup popupView:confirmView style:TTPopupStyleAlert]; [TTPopup popupView:confirmView style:TTPopupStyleAlert];
} }
- (BOOL)isHiddenNavBar {
return YES;
}
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
self.title = YMLocalizedString(@"XPExchangeDiamondsView0"); self.title = YMLocalizedString(@"XPExchangeDiamondsView0");
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.backBtn];
[self.view addSubview:self.titleLabel];
[self.view addSubview:self.exchangeView]; [self.view addSubview:self.exchangeView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.equalTo(self.view);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kStatusBarHeight);
make.height.mas_equalTo(44);
make.centerX.mas_equalTo(self.view);
}];
[self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.top.mas_equalTo(kStatusBarHeight);
make.width.height.mas_equalTo(44);
}];
[self.exchangeView mas_makeConstraints:^(MASConstraintMaker *make) { [self.exchangeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.equalTo(self.view); make.edges.equalTo(self.view);
make.top.equalTo(self.titleLabel.mas_bottom).mas_offset(kGetScaleWidth(48));
}]; }];
} }
///
- (void)backBtnAction {
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - #pragma mark -
- (XPExchangeDiamondsView *)exchangeView{ - (XPExchangeDiamondsView *)exchangeView{
if (!_exchangeView){ if (!_exchangeView){
@@ -122,31 +93,6 @@
} }
return _exchangeView; return _exchangeView;
} }
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [UIImageView new];
_bgImageView.contentMode = UIViewContentModeScaleToFill;
_bgImageView.image = kImage(@"ms_mine_diamond_bg");
}
return _bgImageView;
}
- (UIButton *)backBtn {
if (!_backBtn) {
_backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_backBtn setImage:[[UIImage imageNamed:@"room_info_back"]ms_SetImageForRTL] forState:UIControlStateNormal];
[_backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backBtn;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.text = YMLocalizedString(@"XPIncomeRecordVC1");
_titleLabel.textColor = UIColor.blackColor;
_titleLabel.font = kFontBold(16);
}
return _titleLabel;
}
@end @end

View File

@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol XPExchangeDiamondsViewDelegate <NSObject> @protocol XPExchangeDiamondsViewDelegate <NSObject>
-(void)confirmExchangeDiamondsWithDiamond:(NSString *)diamond gold:(NSString *)gold ; -(void)confirmExchangeDiamondsWithDiamond:(NSString *)diamond gold:(NSString *)gold currency:(NSString *)currency;
@end @end

View File

@@ -20,7 +20,6 @@
/// ///
@property (nonatomic,copy) NSString *diamondNum; @property (nonatomic,copy) NSString *diamondNum;
@property (nonatomic,assign) IncomeRecordViewType chooseType; @property (nonatomic,assign) IncomeRecordViewType chooseType;
@end @end
@implementation XPExchangeDiamondsView @implementation XPExchangeDiamondsView
@@ -36,12 +35,12 @@
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
self.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor clearColor];
[self addSubview:self.myGoldView]; [self addSubview:self.myGoldView];
[self addSubview:self.myDiamondsView]; [self addSubview:self.myDiamondsView];
[self addSubview:self.confirmBtn]; [self addSubview:self.confirmBtn];
@kWeakify(self)
@kWeakify(self)
self.myGoldView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) { self.myGoldView.inputCounthandle = ^(NSString *_Nonnull goldNum,NSString *_Nonnull diamondNum) {
@kStrongify(self) @kStrongify(self)
if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){ if(goldNum.integerValue == 0 && diamondNum.integerValue == 0){
@@ -77,27 +76,22 @@
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.myDiamondsView mas_makeConstraints:^(MASConstraintMaker *make) { [self.myGoldView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(0)); make.top.mas_equalTo(kGetScaleWidth(15));
make.leading.mas_equalTo(kGetScaleWidth(15)); make.leading.mas_equalTo(kGetScaleWidth(15));
make.trailing.mas_equalTo(-kGetScaleWidth(15)); make.trailing.mas_equalTo(-kGetScaleWidth(15));
make.height.mas_equalTo(kGetScaleWidth(72)); make.height.mas_equalTo(kGetScaleWidth(116));
}]; }];
[self.myGoldView mas_makeConstraints:^(MASConstraintMaker *make) { [self.myDiamondsView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.width.height.equalTo(self.myDiamondsView); make.leading.trailing.height.equalTo(self.myGoldView);
make.top.equalTo(self.myDiamondsView.mas_bottom).mas_offset(kGetScaleWidth(28)); make.top.equalTo(self.myGoldView.mas_bottom);
}]; }];
[self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.myGoldView.mas_bottom).mas_offset(kGetScaleWidth(33)); make.top.mas_equalTo(kGetScaleWidth(296));
make.width.mas_equalTo(kGetScaleWidth(303)); make.width.mas_equalTo(kGetScaleWidth(345));
make.height.mas_equalTo(kGetScaleWidth(48)); make.height.mas_equalTo(kGetScaleWidth(46));
make.centerX.equalTo(self); make.centerX.equalTo(self);
}]; }];
}
///
- (void)backBtnAction {
} }
-(void)setModel:(XPExchangeDiamondsModel *)model{ -(void)setModel:(XPExchangeDiamondsModel *)model{
_model = model; _model = model;
@@ -105,7 +99,7 @@
_myDiamondsView.model = _model; _myDiamondsView.model = _model;
} }
-(void)confirmAction{ -(void)confirmAction{
if( self.model.diamonds < self.diamondNum.doubleValue){ if( self.model.golds < self.goldNum.doubleValue){
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPExchangeDiamondsView2")]; [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPExchangeDiamondsView2")];
return; return;
} }
@@ -119,16 +113,15 @@
} }
[self.myGoldView resignResponder]; [self.myGoldView resignResponder];
[self.myDiamondsView resignResponder]; [self.myDiamondsView resignResponder];
if(self.delegate && [self.delegate respondsToSelector:@selector(confirmExchangeDiamondsWithDiamond:gold:)]){ if(self.delegate && [self.delegate respondsToSelector:@selector(confirmExchangeDiamondsWithDiamond:gold:currency:)]){
[self.delegate confirmExchangeDiamondsWithDiamond:self.diamondNum gold:self.goldNum]; [self.delegate confirmExchangeDiamondsWithDiamond:self.diamondNum gold:self.goldNum currency:self.chooseType == IncomeRecord_Diamond ? @"1" : @"3"];
} }
} }
#pragma mark - #pragma mark -
- (XPExchangeDiamondsItemView *)myGoldView{ - (XPExchangeDiamondsItemView *)myGoldView{
if (!_myGoldView){ if (!_myGoldView){
_myGoldView = [[XPExchangeDiamondsItemView alloc]initWithFrame:CGRectZero type:IncomeRecord_Gold]; _myGoldView = [[XPExchangeDiamondsItemView alloc]initWithFrame:CGRectZero type:IncomeRecord_Gold];
[_myGoldView setCornerWithLeftTopCorner:kGetScaleWidth(14) rightTopCorner:kGetScaleWidth(14) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(kGetScaleWidth(345), kGetScaleWidth(116))];
} }
return _myGoldView; return _myGoldView;
} }
@@ -136,18 +129,18 @@
-(XPExchangeDiamondsItemView *)myDiamondsView{ -(XPExchangeDiamondsItemView *)myDiamondsView{
if (!_myDiamondsView){ if (!_myDiamondsView){
_myDiamondsView = [[XPExchangeDiamondsItemView alloc]initWithFrame:CGRectZero type:IncomeRecord_Diamond]; _myDiamondsView = [[XPExchangeDiamondsItemView alloc]initWithFrame:CGRectZero type:IncomeRecord_Diamond];
[_myDiamondsView setCornerWithLeftTopCorner:0 rightTopCorner:0 bottomLeftCorner:kGetScaleWidth(14) bottomRightCorner:kGetScaleWidth(14) size:CGSizeMake(kGetScaleWidth(345), kGetScaleWidth(116))];
} }
return _myDiamondsView; return _myDiamondsView;
} }
-(UIButton *)confirmBtn{ -(UIButton *)confirmBtn{
if (!_confirmBtn){ if (!_confirmBtn){
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(345), kGetScaleWidth(48))]; UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(345), kGetScaleWidth(46))];
_confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom]; _confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_confirmBtn setTitle:YMLocalizedString(@"XPExchangeDiamondsView1") forState:UIControlStateNormal]; [_confirmBtn setTitle:YMLocalizedString(@"XPExchangeDiamondsView1") forState:UIControlStateNormal];
_confirmBtn.titleLabel.font = kFontHeavy(16); _confirmBtn.titleLabel.font = [UIFont systemFontOfSize:16];
[_confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_confirmBtn.layer.cornerRadius = kGetScaleWidth(24); _confirmBtn.layer.cornerRadius = kGetScaleWidth(23);
_confirmBtn.layer.masksToBounds = YES; _confirmBtn.layer.masksToBounds = YES;
_confirmBtn.enabled = NO; _confirmBtn.enabled = NO;
[_confirmBtn setBackgroundImage:image forState:UIControlStateNormal]; [_confirmBtn setBackgroundImage:image forState:UIControlStateNormal];
@@ -169,7 +162,8 @@
@property (nonatomic,strong) UIButton *iconView; @property (nonatomic,strong) UIButton *iconView;
/// ///
@property (nonatomic,strong) XPTextField *numberView; @property (nonatomic,strong) XPTextField *numberView;
///
@property (nonatomic,strong) UIButton *arrowView;
@property (nonatomic,assign) IncomeRecordViewType type; @property (nonatomic,assign) IncomeRecordViewType type;
@end @end
@@ -188,50 +182,61 @@
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
self.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor whiteColor];
[self addSubview:self.titleNumView]; [self addSubview:self.titleNumView];
[self addSubview:self.bgImageView]; [self addSubview:self.bgImageView];
[self addSubview:self.arrowView];
[self.bgImageView addSubview:self.iconView]; [self.bgImageView addSubview:self.iconView];
[self.bgImageView addSubview:self.numberView]; [self.bgImageView addSubview:self.numberView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.titleNumView mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleNumView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(15)); make.leading.mas_equalTo(kGetScaleWidth(15));
make.top.mas_equalTo(kGetScaleWidth(0)); make.top.mas_equalTo(kGetScaleWidth(16));
make.height.mas_equalTo(kGetScaleWidth(14)); make.height.mas_equalTo(kGetScaleWidth(20));
make.trailing.mas_equalTo(-kGetScaleWidth(15)); make.trailing.mas_equalTo(-kGetScaleWidth(73));
}];
[self.arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(30));
make.height.mas_equalTo(kGetScaleWidth(30));
make.trailing.mas_equalTo(-kGetScaleWidth(38));
make.centerY.equalTo(self.titleNumView);
}]; }];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(15)); make.leading.mas_equalTo(kGetScaleWidth(14));
make.trailing.mas_equalTo(-kGetScaleWidth(15)); make.trailing.mas_equalTo(-kGetScaleWidth(14));
make.top.equalTo(self.titleNumView.mas_bottom).mas_offset(kGetScaleWidth(10)); make.top.mas_equalTo(kGetScaleWidth(48));
make.height.mas_equalTo(kGetScaleWidth(48)); make.height.mas_equalTo(kGetScaleWidth(52));
}]; }];
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(28)); make.width.mas_equalTo(kGetScaleWidth(40));
make.height.mas_equalTo(kGetScaleWidth(28)); make.height.mas_equalTo(kGetScaleWidth(40));
make.leading.mas_equalTo(kGetScaleWidth(9)); make.leading.mas_equalTo(kGetScaleWidth(10));
make.centerY.equalTo(self.bgImageView); make.centerY.equalTo(self.bgImageView);
}]; }];
[self.numberView mas_makeConstraints:^(MASConstraintMaker *make) { [self.numberView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.equalTo(self.bgImageView); make.top.bottom.equalTo(self.bgImageView);
make.trailing.mas_equalTo(-kGetScaleWidth(12)); make.trailing.mas_equalTo(-kGetScaleWidth(12));
make.leading.equalTo(self.iconView.mas_trailing).mas_offset(8); make.leading.equalTo(self.iconView.mas_trailing).mas_offset(5);
}]; }];
} }
#pragma mark - #pragma mark -
-(void)setModel:(XPExchangeDiamondsModel *)model{ -(void)setModel:(XPExchangeDiamondsModel *)model{
_model = model; _model = model;
if(self.type == IncomeRecord_Gold){ if(self.type == IncomeRecord_Diamond){
_titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView0"),@(_model.golds)]; _titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView0"),@(_model.diamonds)];
UIImage *image = [UIImage imageNamed:@"ms_exchange_coin_icon"]; NSString *diamondNum = [NSString stringWithFormat:@"%ld",_model.minDiamonds];;
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:diamondNum attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16 weight:UIFontWeightMedium],NSForegroundColorAttributeName:UIColorFromRGB(0xACB8D9)}];
_numberView.attributedPlaceholder = attStr;
UIImage *image = [UIImage imageNamed:@"exchange_gold_icon"];
[_iconView setImage:image forState:UIControlStateNormal]; [_iconView setImage:image forState:UIControlStateNormal];
}else{ }else{
_titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView1"),_model.diamonds]; NSString *goldNum = [NSString stringWithFormat:@"%.0f",ceilf(_model.minDiamonds / _model.rate)];
UIImage *image = [UIImage imageNamed:@"exchange_new_diamonds_icon"]; NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:goldNum attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16 weight:UIFontWeightMedium],NSForegroundColorAttributeName:UIColorFromRGB(0xACB8D9)}];
_numberView.attributedPlaceholder = attStr;
_titleNumView.text = [NSString stringWithFormat:YMLocalizedString(@"XPExchangeDiamondsItemView1"),_model.golds];
UIImage *image = [UIImage imageNamed:@"exchange_diamonds_icon"];
[_iconView setImage:image forState:UIControlStateNormal]; [_iconView setImage:image forState:UIControlStateNormal];
} }
@@ -258,7 +263,7 @@
} }
NSInteger count = textField.text.integerValue; NSInteger count = textField.text.integerValue;
if(self.type == IncomeRecord_Gold){ if(self.type == IncomeRecord_Diamond){
NSString *goldNum = [NSString stringWithFormat:@"%.0f",ceilf(count / _model.rate)]; NSString *goldNum = [NSString stringWithFormat:@"%.0f",ceilf(count / _model.rate)];
if(self.inputCounthandle){ if(self.inputCounthandle){
self.inputCounthandle(goldNum, textField.text); self.inputCounthandle(goldNum, textField.text);
@@ -276,9 +281,9 @@
- (UILabel *)titleNumView { - (UILabel *)titleNumView {
if (!_titleNumView) { if (!_titleNumView) {
_titleNumView = [[UILabel alloc] init]; _titleNumView = [[UILabel alloc] init];
_titleNumView.font = kFontBold(15); _titleNumView.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
_titleNumView.textColor = UIColorFromRGB(0x00223D); _titleNumView.textColor =[DJDKMIMOMColor inputTextColor];
NSString *title = self.type == IncomeRecord_Gold ? YMLocalizedString(@"XPExchangeDiamondsItemView0"): YMLocalizedString(@"XPExchangeDiamondsItemView1"); NSString *title = self.type == IncomeRecord_Diamond ? YMLocalizedString(@"XPExchangeDiamondsItemView0"): YMLocalizedString(@"XPExchangeDiamondsItemView1");
_titleNumView.text = [NSString stringWithFormat:title,@"0"]; _titleNumView.text = [NSString stringWithFormat:title,@"0"];
} }
return _titleNumView; return _titleNumView;
@@ -288,10 +293,11 @@
if (!_bgImageView){ if (!_bgImageView){
_bgImageView = [UIImageView new]; _bgImageView = [UIImageView new];
if(self.type == IncomeRecord_Gold){ if(self.type == IncomeRecord_Gold){
_bgImageView.image = kImage(@"ms_exchange_diamonds_coin_bg"); _bgImageView.image = [UIImage gradientColorImageFromColors:@[ UIColorFromRGB(0xDCE6FD),UIColorFromRGB(0xD8E3FE)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(317), kGetScaleWidth(52))];
}else{ }else{
_bgImageView.image = kImage(@"ms_exchange_diamonds_diamonds_bg"); _bgImageView.image = [UIImage gradientColorImageFromColors:@[ UIColorFromRGB(0xFEECD2),UIColorFromRGB(0xFFDE90)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(317), kGetScaleWidth(52))];
} }
[_bgImageView setCornerWithLeftTopCorner:kGetScaleWidth(8) rightTopCorner:kGetScaleWidth(8) bottomLeftCorner:kGetScaleWidth(8) bottomRightCorner:kGetScaleWidth(8) size:CGSizeMake(kGetScaleWidth(317), kGetScaleWidth(52))];
_bgImageView.userInteractionEnabled = YES; _bgImageView.userInteractionEnabled = YES;
} }
@@ -299,8 +305,11 @@
} }
-(UIButton *)iconView{ -(UIButton *)iconView{
if (!_iconView){ if (!_iconView){
UIImage *image = self.type == IncomeRecord_Gold ? [UIImage imageNamed:@"ms_exchange_coin_icon"] : [UIImage imageNamed:@"exchange_new_diamonds_icon"]; UIImage *image = self.type == IncomeRecord_Diamond ? [UIImage imageNamed:@"exchange_gold_icon"] : [UIImage imageNamed:@"exchange_diamonds_icon"];
_iconView = [UIButton buttonWithType:UIButtonTypeCustom]; _iconView = [UIButton buttonWithType:UIButtonTypeCustom];
_iconView.backgroundColor = [UIColor whiteColor];
_iconView.layer.cornerRadius = kGetScaleWidth(20);
_iconView.layer.masksToBounds = YES;
[_iconView setImage:image forState:UIControlStateNormal]; [_iconView setImage:image forState:UIControlStateNormal];
} }
return _iconView; return _iconView;
@@ -311,15 +320,22 @@
_numberView = [[XPTextField alloc]initWithFrame:CGRectZero]; _numberView = [[XPTextField alloc]initWithFrame:CGRectZero];
_numberView.keyboardType = UIKeyboardTypeNumberPad; _numberView.keyboardType = UIKeyboardTypeNumberPad;
_numberView.isValidation = YES; _numberView.isValidation = YES;
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:YMLocalizedString(@"XPExchangeDiamondsView6") attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16 weight:UIFontWeightMedium],NSForegroundColorAttributeName:[UIColor colorWithWhite:1 alpha:0.6]}]; NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:@"0" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16 weight:UIFontWeightMedium],NSForegroundColorAttributeName:UIColorFromRGB(0xACB8D9)}];
_numberView.attributedPlaceholder = attStr; _numberView.attributedPlaceholder = attStr;
_numberView.font = kFontMedium(15); _numberView.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
_numberView.textColor = [UIColor whiteColor]; _numberView.textColor = [DJDKMIMOMColor inputTextColor];
// _numberView.textAlignment = NSTextAlignmentRight; _numberView.textAlignment = NSTextAlignmentRight;
[_numberView addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; [_numberView addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
} }
return _numberView; return _numberView;
} }
-(UIButton *)arrowView{
if (!_arrowView){
_arrowView = [UIButton new];
[_arrowView setImage:[UIImage imageNamed:@"exchange_diamonds_arrow"] forState:UIControlStateNormal];
_arrowView.hidden = self.type == IncomeRecord_Gold;
}
return _arrowView;
}
@end @end

View File

@@ -22,27 +22,14 @@
///tool ///tool
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "YUMIHtmlUrl.h" #import "YUMIHtmlUrl.h"
#import <JXCategoryView/JXCategoryView.h>
#import <JXCategoryView/JXCategoryIndicatorBackgroundView.h> @interface XPIncomeRecordVC ()<XPExchangeDiamondsVCDelegate,XPIncomeRecordViewDelegate,XPIncomeRecordProtocol>
#import <JXCategoryView/JXCategoryListContainerView.h>
@interface XPIncomeRecordVC ()<XPExchangeDiamondsVCDelegate,XPIncomeRecordViewDelegate,XPIncomeRecordProtocol,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate>
/// ///
@property (nonatomic,strong) XPIncomeRecordView *diamondView; @property (nonatomic,strong) XPIncomeRecordView *diamondView;
/// ///
@property (nonatomic,strong) XPIncomeRecordView *goldView; @property (nonatomic,strong) XPIncomeRecordView *goldView;
///model ///model
@property (nonatomic,strong) XPIncomeRecordModel *recordModel; @property (nonatomic,strong) XPIncomeRecordModel *recordModel;
///
@property (nonatomic, strong) NSArray<NSString *> *titles;
///
@property (nonatomic, strong) JXCategoryTitleView *titleView;
///lineView
@property (nonatomic, strong) JXCategoryListContainerView *pi_containerView;
@property(nonatomic,strong) UIImageView *bgImageView;
///
@property (nonatomic,strong) UIButton *backBtn;
///
@property (nonatomic,strong) UILabel *titleLabel;
@end @end
@implementation XPIncomeRecordVC @implementation XPIncomeRecordVC
@@ -58,64 +45,26 @@
[self.presenter requestQueryWithRoomType]; [self.presenter requestQueryWithRoomType];
} }
- (BOOL)isHiddenNavBar {
return YES;
}
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
self.title = YMLocalizedString(@"XPIncomeRecordVC0"); self.title = YMLocalizedString(@"XPIncomeRecordVC0");
[self.view addSubview:self.bgImageView]; [self.view addSubview:self.diamondView];
[self.view addSubview:self.backBtn]; [self.view addSubview:self.goldView];
[self.view addSubview:self.titleLabel]; self.goldView.isClanPresident = YES;
[self.view addSubview:self.titleView];
[self.view addSubview:self.pi_containerView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.diamondView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.equalTo(self.view); make.top.mas_equalTo(kGetScaleWidth(18));
make.leading.trailing.equalTo(self.view).inset(kGetScaleWidth(15));
make.height.mas_equalTo(kGetScaleWidth(144));
}]; }];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.goldView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kStatusBarHeight); make.leading.trailing.equalTo(self.diamondView);
make.height.mas_equalTo(44); make.top.equalTo(self.diamondView.mas_bottom).mas_offset(kGetScaleWidth(20));
make.centerX.mas_equalTo(self.view); make.height.mas_equalTo( kGetScaleWidth(144));
}]; }];
[self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.top.mas_equalTo(kStatusBarHeight);
make.width.height.mas_equalTo(44);
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.titleLabel.mas_bottom).mas_offset(kGetScaleWidth(33));
make.width.mas_equalTo(KScreenWidth);
make.height.mas_equalTo(kGetScaleWidth(30));
}];
[self.pi_containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleView.mas_bottom).offset(19);
}];
}
#pragma mark - JXCategoryViewDelegate
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
return self.titles.count;
}
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
if (index == 0) {
return self.goldView;
} else {
return self.diamondView;
}
}
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index{
self.bgImageView.image = index == 0 ? kImage(@"ms_mine_top_bg"):kImage(@"ms_mine_diamond_bg");
self.titleView.titleColor = index == 0 ? UIColorFromRGB(0xA88238):UIColorFromRGB(0x7E8373);
} }
#pragma mark - XPExchangeDiamondsVCDelegate #pragma mark - XPExchangeDiamondsVCDelegate
-(void)confirmExchangeDiamondsWithDiamondSuccess:(NSString *)diamond gold:(NSString *)gold{ -(void)confirmExchangeDiamondsWithDiamondSuccess:(NSString *)diamond gold:(NSString *)gold{
@@ -123,8 +72,8 @@
self.recordModel.golds = self.recordModel.golds - gold.doubleValue; self.recordModel.golds = self.recordModel.golds - gold.doubleValue;
NSString *diamondNum = [NSString stringWithFormat:@"%.0f",self.recordModel.diamonds]; NSString *diamondNum = [NSString stringWithFormat:@"%.0f",self.recordModel.diamonds];
NSString *goldNum = [NSString stringWithFormat:@"%.2f",self.recordModel.golds]; NSString *goldNum = [NSString stringWithFormat:@"%.2f",self.recordModel.golds];
self.diamondView.number = goldNum; self.diamondView.number = diamondNum;
self.goldView.number = diamondNum; self.goldView.number = goldNum;
} }
#pragma mark - XPIncomeRecordProtocol #pragma mark - XPIncomeRecordProtocol
- (void)requestQueryWithRoomTypeFail{ - (void)requestQueryWithRoomTypeFail{
@@ -140,8 +89,8 @@
-(void)getRecordIncomeSuccess:(XPIncomeRecordModel *)model{ -(void)getRecordIncomeSuccess:(XPIncomeRecordModel *)model{
[self hideHUD]; [self hideHUD];
self.recordModel = model; self.recordModel = model;
self.goldView.number = @(model.diamonds).stringValue; self.diamondView.number = @(model.diamonds).stringValue;
self.diamondView.number = [NSString stringWithFormat:@"%.2f",model.golds]; self.goldView.number = [NSString stringWithFormat:@"%.2f",model.golds];
// NSString * myUid = [AccountInfoStorage instance].getUid; // NSString * myUid = [AccountInfoStorage instance].getUid;
// if(![self.clanInfo.clan.elderUid isEqualToString:myUid]){ // if(![self.clanInfo.clan.elderUid isEqualToString:myUid]){
// self.goldView.isClanPresident = !self.recordModel.hasGoldExchangeAuth; // self.goldView.isClanPresident = !self.recordModel.hasGoldExchangeAuth;
@@ -189,28 +138,21 @@
default: default:
{ {
// NSString * myUid = [AccountInfoStorage instance].getUid;
// if(![self.clanInfo.clan.elderUid isEqualToString:myUid]){
XPWebViewController * webVC =[[XPWebViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = URLWithType(kGoldEarningsRecord); webVC.url = URLWithType(kGoldEarningsRecord);
[self.navigationController pushViewController:webVC animated:YES]; [self.navigationController pushViewController:webVC animated:YES];
// return;
//
// }
// XPIncomeRecordGoldDetailsVC *goldDetailVC = [XPIncomeRecordGoldDetailsVC new];
// [self.navigationController pushViewController:goldDetailVC animated:YES];
break; break;
} }
} }
} }
///
- (void)backBtnAction {
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - #pragma mark -
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [UIImageView new];
_bgImageView.contentMode = UIViewContentModeScaleToFill;
_bgImageView.image = kImage(@"ms_mine_top_bg");
}
return _bgImageView;
}
- (XPIncomeRecordView *)diamondView{ - (XPIncomeRecordView *)diamondView{
if (!_diamondView){ if (!_diamondView){
_diamondView = [[XPIncomeRecordView alloc]initWithFrame:CGRectZero type:IncomeRecord_Diamond]; _diamondView = [[XPIncomeRecordView alloc]initWithFrame:CGRectZero type:IncomeRecord_Diamond];
@@ -225,65 +167,6 @@
} }
return _goldView; return _goldView;
} }
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] init];
_titleView.delegate = self;
_titleView.titles = self.titles;
_titleView.backgroundColor = [UIColor clearColor];
_titleView.titleColor = UIColorFromRGB(0xA88238);
_titleView.titleSelectedColor = UIColorFromRGB(0x4E390A);
_titleView.titleFont = kFontBold(16);
_titleView.titleSelectedFont = kFontHeavy(16);
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.listContainer = self.pi_containerView;
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
lineView.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(11), kGetScaleWidth(3));
lineView.verticalMargin = 0;
lineView.backgroundColor = UIColorFromRGB(0xAA7400);
lineView.layer.masksToBounds = YES;
lineView.layer.cornerRadius = kGetScaleWidth(3)/2;
_titleView.indicators = @[lineView];
}
return _titleView;
}
- (NSArray<NSString *> *)titles{
if(!_titles){
_titles = @[YMLocalizedString(@"XPIncomeRecordView4"),YMLocalizedString(@"XPIncomeRecordView5")];
}
return _titles;
}
- (JXCategoryListContainerView *)pi_containerView {
if (!_pi_containerView) {
_pi_containerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
_pi_containerView.defaultSelectedIndex = 0;
_pi_containerView.scrollView.tag = 1009;
}
return _pi_containerView;
}
- (UIButton *)backBtn {
if (!_backBtn) {
_backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_backBtn setImage:[[UIImage imageNamed:@"room_info_back"]ms_SetImageForRTL] forState:UIControlStateNormal];
[_backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backBtn;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.text = YMLocalizedString(@"XPIncomeRecordVC1");
_titleLabel.textColor = UIColor.blackColor;
_titleLabel.font = kFontBold(16);
}
return _titleLabel;
}
/* /*
#pragma mark - Navigation #pragma mark - Navigation

View File

@@ -6,13 +6,12 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <JXCategoryView/JXCategoryListContainerView.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger { typedef enum : NSUInteger {
IncomeRecord_Gold,///金币
IncomeRecord_Diamond,///钻石 IncomeRecord_Diamond,///钻石
IncomeRecord_Gold///金币
} IncomeRecordViewType; } IncomeRecordViewType;
typedef enum : NSUInteger { typedef enum : NSUInteger {
@@ -29,7 +28,7 @@ typedef enum : NSUInteger {
@end @end
@interface XPIncomeRecordView : UIView<JXCategoryListContentViewDelegate> @interface XPIncomeRecordView : UIView
@property (nonatomic,copy) NSString *number; @property (nonatomic,copy) NSString *number;
@property (nonatomic,assign) BOOL isClanPresident; @property (nonatomic,assign) BOOL isClanPresident;
@property (nonatomic,weak) id<XPIncomeRecordViewDelegate> delegate; @property (nonatomic,weak) id<XPIncomeRecordViewDelegate> delegate;

View File

@@ -11,19 +11,19 @@
/// ///
@property (nonatomic,strong) UIImageView *bgImageView; @property (nonatomic,strong) UIImageView *bgImageView;
@property(nonatomic,strong) UIImageView *coinView;
/// ///
@property (nonatomic,strong) UILabel *titleView; @property (nonatomic,strong) UILabel *titleView;
/// ///
@property (nonatomic,strong) UIButton *detailView; @property (nonatomic,strong) UIButton *detailView;
@property(nonatomic,strong) UIButton *detailArrowView;
/// ///
@property (nonatomic,strong) UILabel *numberView; @property (nonatomic,strong) UILabel *numberView;
///btn
@property (nonatomic,strong) UIStackView *btnStackView;
///
@property (nonatomic,strong) UIButton *payBtn;
/// ///
@property (nonatomic,strong) UIButton *clickBtn; @property (nonatomic,strong) UIButton *exchangeBtn;
@property (nonatomic,assign) IncomeRecordViewType type; @property (nonatomic,assign) IncomeRecordViewType type;
@end @end
@@ -38,70 +38,64 @@
} }
return self; return self;
} }
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self;
}
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
[self addSubview:self.bgImageView]; [self addSubview:self.bgImageView];
[self addSubview:self.clickBtn];
[self.bgImageView addSubview:self.coinView];
[self.bgImageView addSubview:self.titleView]; [self.bgImageView addSubview:self.titleView];
[self.bgImageView addSubview:self.detailArrowView];
[self.bgImageView addSubview:self.detailView]; [self.bgImageView addSubview:self.detailView];
[self.bgImageView addSubview:self.numberView]; [self.bgImageView addSubview:self.numberView];
[self.bgImageView addSubview:self.btnStackView];
[self.btnStackView addArrangedSubview:self.payBtn];
[self.btnStackView addArrangedSubview:self.exchangeBtn];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(0)); make.edges.equalTo(self);
make.width.mas_equalTo(kGetScaleWidth(339));
make.height.mas_equalTo(kGetScaleWidth(118));
make.centerX.equalTo(self);
}];
[self.coinView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(47));
make.leading.mas_equalTo(kGetScaleWidth(15));
make.centerY.equalTo(self.bgImageView);
}]; }];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(36)); make.top.mas_equalTo(kGetScaleWidth(17));
make.leading.mas_equalTo(kGetScaleWidth(68)); make.leading.mas_equalTo(kGetScaleWidth(20));
make.height.mas_equalTo(kGetScaleWidth(20));
}];
[self.detailArrowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-kGetScaleWidth(20));
make.width.mas_equalTo(kGetScaleWidth(4.5));
make.height.mas_equalTo(kGetScaleWidth(8));
make.top.mas_equalTo(kGetScaleWidth(38));
}]; }];
[self.detailView mas_makeConstraints:^(MASConstraintMaker *make) { [self.detailView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-kGetScaleWidth(27)); make.trailing.mas_equalTo(-kGetScaleWidth(20));
make.height.mas_equalTo(kGetScaleWidth(12)); make.height.mas_equalTo(kGetScaleWidth(18));
make.centerY.equalTo(self.detailArrowView); make.width.mas_equalTo(kGetScaleWidth(45));
make.centerY.equalTo(self.titleView);
}]; }];
[self.numberView mas_makeConstraints:^(MASConstraintMaker *make) { [self.numberView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(self.titleView); make.leading.equalTo(self.titleView);
make.top.mas_equalTo(kGetScaleWidth(61)); make.top.mas_equalTo(kGetScaleWidth(49));
make.height.mas_equalTo(kGetScaleWidth(20));
make.trailing.mas_equalTo(-kGetScaleWidth(20));
}]; }];
[self.clickBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.btnStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(303)); make.leading.trailing.equalTo(self.bgImageView).inset(kGetScaleWidth(20));
make.height.mas_equalTo(kGetScaleWidth(48)); make.height.mas_equalTo(kGetScaleWidth(40));
make.top.equalTo(self.bgImageView.mas_bottom).mas_offset(kGetScaleWidth(46)); make.top.mas_equalTo(kGetScaleWidth(86));
make.centerX.equalTo(self); }];
[self.payBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kGetScaleWidth(40));
}];
[self.exchangeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kGetScaleWidth(40));
}]; }];
} }
-(void)setNumber:(NSString *)number{ -(void)setNumber:(NSString *)number{
_number = number; _number = number;
_numberView.text = _number; _numberView.text = _number;
} }
-(void)setIsClanPresident:(BOOL)isClanPresident{
_isClanPresident = isClanPresident;
// _exchangeBtn.hidden = _isClanPresident;
// _detailView.hidden = !_isClanPresident;
}
#pragma mark - btnClick #pragma mark - btnClick
-(void)clickDetailViewAction{ -(void)clickDetailViewAction{
if(self.type == IncomeRecord_Gold){ if(self.type == IncomeRecord_Diamond){
[self clickDiamondDetailAction]; [self clickDiamondDetailAction];
return; return;
} }
@@ -113,10 +107,10 @@
[self.delegate clickHandleWithType:ClickType_Diamond_Detail]; [self.delegate clickHandleWithType:ClickType_Diamond_Detail];
} }
} }
///
-(void)clickBtnAction{ -(void)clickDiamondPayAction{
if(self.delegate && [self.delegate respondsToSelector:@selector(clickHandleWithType:)]){ if(self.delegate && [self.delegate respondsToSelector:@selector(clickHandleWithType:)]){
[self.delegate clickHandleWithType:self.type == IncomeRecord_Gold ? ClickType_Diamond_Pay : ClickType_Gold_Exchangel]; [self.delegate clickHandleWithType:ClickType_Diamond_Pay];
} }
} }
/// ///
@@ -125,7 +119,12 @@
[self.delegate clickHandleWithType:ClickType_Gold_Detail]; [self.delegate clickHandleWithType:ClickType_Gold_Detail];
} }
} }
///
-(void)clickGoldExchangelAction{
if(self.delegate && [self.delegate respondsToSelector:@selector(clickHandleWithType:)]){
[self.delegate clickHandleWithType:ClickType_Gold_Exchangel];
}
}
#pragma mark - #pragma mark -
- (UIImageView *)bgImageView{ - (UIImageView *)bgImageView{
@@ -133,23 +132,19 @@
_bgImageView = [UIImageView new]; _bgImageView = [UIImageView new];
_bgImageView.userInteractionEnabled = YES; _bgImageView.userInteractionEnabled = YES;
_bgImageView.contentMode = UIViewContentModeScaleAspectFill; _bgImageView.contentMode = UIViewContentModeScaleAspectFill;
_bgImageView.image = self.type == IncomeRecord_Gold ? [UIImage imageNamed:@"income_record_gold_bg"]:[UIImage imageNamed:@"income_record_diamond_bg"]; _bgImageView.layer.cornerRadius = 10.f;
_bgImageView.clipsToBounds = YES;
_bgImageView.image = self.type == IncomeRecord_Diamond ? [UIImage imageNamed:@"income_record_gold_bg"]:[UIImage imageNamed:@"income_record_diamond_bg"];
} }
return _bgImageView; return _bgImageView;
} }
- (UIImageView *)coinView{
if(!_coinView){
_coinView = [UIImageView new];
_coinView.image = self.type == IncomeRecord_Gold ? [UIImage imageNamed:@"ms_income_record_coin"]:[UIImage imageNamed:@"ms_income_recorddiamond"];
}
return _coinView;
}
- (UILabel *)titleView { - (UILabel *)titleView {
if (!_titleView) { if (!_titleView) {
_titleView = [[UILabel alloc] init]; _titleView = [[UILabel alloc] init];
_titleView.font = kFontBold(15); _titleView.font = [UIFont systemFontOfSize:20 weight:UIFontWeightMedium];
_titleView.textColor = self.type == IncomeRecord_Gold ? UIColorFromRGB(0x9F4805) : UIColorFromRGB(0xffffff); _titleView.textColor = self.type == IncomeRecord_Diamond ? UIColorFromRGB(0x1B1558) : UIColorFromRGB(0x572714);
_titleView.text = self.type == IncomeRecord_Gold ? YMLocalizedString(@"XPDressUpShopViewController7"):YMLocalizedString(@"XPExchangeDiamondsItemView2"); _titleView.text = self.type == IncomeRecord_Diamond ? YMLocalizedString(@"XPIncomeRecordView4"):YMLocalizedString(@"XPIncomeRecordView5");
} }
return _titleView; return _titleView;
} }
@@ -158,47 +153,68 @@
if (!_detailView){ if (!_detailView){
_detailView = [UIButton new]; _detailView = [UIButton new];
[_detailView setTitle:YMLocalizedString(@"XPIncomeRecordView0") forState:UIControlStateNormal]; [_detailView setTitle:YMLocalizedString(@"XPIncomeRecordView0") forState:UIControlStateNormal];
[_detailView setTitleColor:self.type == IncomeRecord_Gold ? UIColorFromRGB(0xB38C3F):UIColorFromRGB(0x737D83) forState:UIControlStateNormal]; [_detailView setTitleColor:self.type == IncomeRecord_Diamond ? UIColorFromRGB(0x1B1558):UIColorFromRGB(0x582815) forState:UIControlStateNormal];
_detailView.titleLabel.font = [UIFont systemFontOfSize:13]; _detailView.titleLabel.font = [UIFont systemFontOfSize:13];
CGFloat width = [[NSBundle getLanguageText]hasPrefix:@"zh"] ? 40 : 50;
_detailView.imageEdgeInsets = UIEdgeInsetsMake(0, kGetScaleWidth(width), 0, 0);
_detailView.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
[_detailView setImage:self.type == IncomeRecord_Diamond ? [[UIImage imageNamed:@"income_record_arrow_1"]ms_SetImageForRTL]: [[UIImage imageNamed:@"income_record_arrow_2"]ms_SetImageForRTL] forState:UIControlStateNormal];
[_detailView addTarget:self action:@selector(clickDetailViewAction) forControlEvents:UIControlEventTouchUpInside]; [_detailView addTarget:self action:@selector(clickDetailViewAction) forControlEvents:UIControlEventTouchUpInside];
} }
return _detailView; return _detailView;
} }
- (UIButton *)detailArrowView{
if(!_detailArrowView){
_detailArrowView = [UIButton new];
[_detailArrowView setBackgroundImage:self.type == IncomeRecord_Gold ? [[UIImage imageNamed:@"income_record_arrow_1"]ms_SetImageForRTL]: [[UIImage imageNamed:@"income_record_arrow_2"]ms_SetImageForRTL] forState:UIControlStateNormal];
[_detailArrowView setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
[_detailArrowView addTarget:self action:@selector(clickDetailViewAction) forControlEvents:UIControlEventTouchUpInside];
}
return _detailArrowView;
}
- (UILabel *)numberView { - (UILabel *)numberView {
if (!_numberView) { if (!_numberView) {
_numberView = [[UILabel alloc] init]; _numberView = [[UILabel alloc] init];
_numberView.font = kFontHeavy(24); _numberView.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
_numberView.textColor = self.type == IncomeRecord_Gold ? UIColorFromRGB(0xFFFBD5) : UIColorFromRGB(0xFFFBD5); _numberView.textColor = self.type == IncomeRecord_Diamond ? UIColorFromRGB(0x1B1558) : UIColorFromRGB(0x572714);
_numberView.text = @"0"; _numberView.text = @"0";
} }
return _numberView; return _numberView;
} }
- (UIButton *)clickBtn{ - (UIStackView *)btnStackView{
if(!_clickBtn){ if (!_btnStackView){
_clickBtn = [UIButton new]; _btnStackView = [[UIStackView alloc] init];
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x70E9FF),UIColorFromRGB(0xAE87FF),UIColorFromRGB(0xFF5CE1)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(303), kGetScaleWidth(48))]; _btnStackView.axis = UILayoutConstraintAxisHorizontal;
[_clickBtn setBackgroundImage:image forState:UIControlStateNormal]; _btnStackView.distribution = UIStackViewDistributionFillEqually;
[_clickBtn setTitle:self.type == IncomeRecord_Gold ? YMLocalizedString(@"XPIncomeRecordView1") : YMLocalizedString(@"XPTreasureFairyShopingExchangeCell1") forState:UIControlStateNormal]; _btnStackView.alignment = UIStackViewAlignmentFill;
[_clickBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; _btnStackView.spacing = kGetScaleWidth(13);
_clickBtn.titleLabel.font = kFontHeavy(16);
[_clickBtn addTarget:self action:@selector(clickBtnAction) forControlEvents:UIControlEventTouchUpInside];
_clickBtn.layer.cornerRadius = kGetScaleWidth(48)/2;
_clickBtn.layer.masksToBounds = YES;
} }
return _clickBtn; return _btnStackView;
}
- (UIButton *)payBtn{
if (!_payBtn){
_payBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_payBtn setTitle:YMLocalizedString(@"XPIncomeRecordView1") forState:UIControlStateNormal];
_payBtn.hidden = self.type == IncomeRecord_Gold;
[_payBtn setTitleColor:UIColorFromRGB(0x93570B) forState:UIControlStateNormal];
_payBtn.layer.cornerRadius = kGetScaleWidth(20);
_payBtn.layer.masksToBounds = YES;
_payBtn.layer.borderWidth = 1;
_payBtn.layer.borderColor = UIColorFromRGB(0x93570B).CGColor;
[_payBtn addTarget:self action:@selector(clickDiamondPayAction) forControlEvents:UIControlEventTouchUpInside];
}
return _payBtn;
} }
-(UIButton *)exchangeBtn{
if (!_exchangeBtn){
_exchangeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_exchangeBtn setTitle:YMLocalizedString(@"XPIncomeRecordView2") forState:UIControlStateNormal];
_exchangeBtn.backgroundColor = UIColorFromRGB(0xB1BFFA);
[_exchangeBtn setTitleColor:UIColorFromRGB(0x130C4F) forState:UIControlStateNormal];
_exchangeBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
_exchangeBtn.layer.masksToBounds = YES;
_exchangeBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
_exchangeBtn.hidden = self.type == IncomeRecord_Diamond;
_exchangeBtn.layer.cornerRadius = kGetScaleWidth(20);
[_exchangeBtn addTarget:self action:@selector(clickGoldExchangelAction) forControlEvents:UIControlEventTouchUpInside];
}
return _exchangeBtn;
}
@end @end

View File

@@ -15,7 +15,8 @@
/// ///
@property (nonatomic, strong) UIView *bgView; @property (nonatomic, strong) UIView *bgView;
@property(nonatomic,strong) UIView *bgPriceView; ///
@property (nonatomic, strong) UIView *selectedBgView;
/// ///
@property (nonatomic, strong) UILabel *priceLabel; @property (nonatomic, strong) UILabel *priceLabel;
/// 💎 /// 💎
@@ -37,34 +38,33 @@
- (void)createUI { - (void)createUI {
[self.contentView addSubview:self.bgView]; [self.contentView addSubview:self.bgView];
[self.bgView addSubview:self.bgPriceView]; [self.bgView addSubview:self.selectedBgView];
[self.bgPriceView addSubview:self.priceLabel]; [self.bgView addSubview:self.priceLabel];
[self.bgView addSubview:self.iconImageView]; [self.bgView addSubview:self.iconImageView];
[self.bgView addSubview:self.numLabel]; [self.bgView addSubview:self.numLabel];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView); make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(16));
make.top.mas_equalTo(kGetScaleWidth(0));
make.height.mas_equalTo(kGetScaleWidth(60));
}]; }];
[self.selectedBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.bgView);
}];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(13)); make.centerY.equalTo(self.bgView);
make.width.mas_equalTo(kGetScaleWidth(55)); make.width.height.mas_equalTo(kGetScaleWidth(24));
make.height.mas_equalTo(kGetScaleWidth(48)); make.leading.mas_equalTo(kGetScaleWidth(18));
make.centerX.equalTo(self.bgView);
}];
[self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.equalTo(self.bgView).inset(kGetScaleWidth(0));
make.top.mas_equalTo(kGetScaleWidth(66));
}];
[self.bgPriceView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.equalTo(self.bgView);
make.height.mas_equalTo(kGetScaleWidth(26));
}]; }];
[self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.bgPriceView); make.trailing.mas_equalTo(-kGetScaleWidth(18));
make.centerY.equalTo(self.bgView);
}];
[self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.bgView);
make.leading.equalTo(self.iconImageView.mas_trailing).mas_offset(kGetScaleWidth(5));
}]; }];
} }
@@ -80,7 +80,7 @@
- (void)setSelectedStyle:(BOOL)selectedStyle { - (void)setSelectedStyle:(BOOL)selectedStyle {
_selectedStyle = selectedStyle; _selectedStyle = selectedStyle;
_bgView.layer.borderWidth = _selectedStyle ? 1 : 0; self.selectedBgView.hidden = !selectedStyle;
} }
#pragma mark - #pragma mark -
@@ -88,29 +88,34 @@
- (UIView *)bgView { - (UIView *)bgView {
if (!_bgView) { if (!_bgView) {
_bgView = [[UIView alloc] init]; _bgView = [[UIView alloc] init];
_bgView.backgroundColor = UIColorFromRGB(0xF3F0E6); _bgView.backgroundColor = UIColorFromRGB(0xF0F5F6);
_bgView.layer.cornerRadius = kGetScaleWidth(9); _bgView.layer.cornerRadius = kGetScaleWidth(13);
_bgView.layer.masksToBounds = YES; _bgView.layer.masksToBounds = YES;
_bgView.layer.borderColor = UIColorFromRGB(0xFFB05E).CGColor;
} }
return _bgView; return _bgView;
} }
- (UIView *)bgPriceView{ - (UIView *)selectedBgView {
if(!_bgPriceView){ if (!_selectedBgView) {
_bgPriceView = [UIView new]; _selectedBgView = [[UIView alloc] init];
_bgPriceView.backgroundColor = UIColorFromRGB(0xFFF09C); UIImage *bgImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE6FDFF),UIColorFromRGB(0xFAEDFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(343), kGetScaleWidth(60))];
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x13E2F5),UIColorFromRGB(0x9DB4FF),UIColorFromRGB(0xCC67FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(344), kGetScaleWidth(60))];
_selectedBgView.backgroundColor = [UIColor colorWithPatternImage:bgImage];
_selectedBgView.layer.cornerRadius = kGetScaleWidth(13);
_selectedBgView.layer.masksToBounds = YES;
_selectedBgView.layer.borderColor = [UIColor colorWithPatternImage:image].CGColor;
_selectedBgView.layer.borderWidth = 1;
_selectedBgView.hidden = YES;
} }
return _bgPriceView; return _selectedBgView;
} }
- (UILabel *)priceLabel { - (UILabel *)priceLabel {
if (!_priceLabel) { if (!_priceLabel) {
_priceLabel = [[UILabel alloc] init]; _priceLabel = [[UILabel alloc] init];
_priceLabel.textColor = UIColorFromRGB(0x513C0B); _priceLabel.textColor = UIColorFromRGB(0x1F1B4F);
_priceLabel.font = kFontBold(12); _priceLabel.font = kFontMedium(18);
_priceLabel.textAlignment = NSTextAlignmentCenter;
} }
return _priceLabel; return _priceLabel;
} }
@@ -119,7 +124,7 @@
if (!_iconImageView) { if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init]; _iconImageView = [[UIImageView alloc] init];
_iconImageView.contentMode = UIViewContentModeScaleAspectFit; _iconImageView.contentMode = UIViewContentModeScaleAspectFit;
_iconImageView.image = [UIImage imageNamed:@"ms_mine_recharge_coin"]; _iconImageView.image = [UIImage imageNamed:@"exchange_gold_icon"];
} }
return _iconImageView; return _iconImageView;
} }
@@ -127,8 +132,8 @@
- (UILabel *)numLabel { - (UILabel *)numLabel {
if (!_numLabel) { if (!_numLabel) {
_numLabel = [[UILabel alloc] init]; _numLabel = [[UILabel alloc] init];
_numLabel.textColor = UIColorFromRGB(0x8A4B00); _numLabel.textColor = UIColorFromRGB(0x1F1B4F);
_numLabel.font = kFontBold(15); _numLabel.font = kFontBold(20);
_numLabel.textAlignment = NSTextAlignmentCenter; _numLabel.textAlignment = NSTextAlignmentCenter;
} }
return _numLabel; return _numLabel;

View File

@@ -21,7 +21,8 @@
@property (nonatomic, strong) UILabel *balanceTextLabel; @property (nonatomic, strong) UILabel *balanceTextLabel;
/// ///
@property (nonatomic, strong) UILabel *balanceLabel; @property (nonatomic, strong) UILabel *balanceLabel;
/// 💎
@property (nonatomic, strong) UIImageView *iconImageView;
@end @end
@@ -38,7 +39,7 @@
- (void)createUI { - (void)createUI {
[self addSubview:self.bgImageView]; [self addSubview:self.bgImageView];
[self.bgImageView addSubview:self.balanceBgVeiw]; [self.bgImageView addSubview:self.balanceBgVeiw];
[self.balanceBgVeiw addSubview:self.iconImageView];
[self.balanceBgVeiw addSubview:self.balanceTextLabel]; [self.balanceBgVeiw addSubview:self.balanceTextLabel];
[self.balanceBgVeiw addSubview:self.balanceLabel]; [self.balanceBgVeiw addSubview:self.balanceLabel];
@@ -46,21 +47,27 @@
make.edges.equalTo(self); make.edges.equalTo(self);
}]; }];
[self.balanceBgVeiw mas_makeConstraints:^(MASConstraintMaker *make) { [self.balanceBgVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(339)); make.width.mas_equalTo(kGetScaleWidth(343));
make.height.mas_equalTo(kGetScaleWidth(118)); make.height.mas_equalTo(kGetScaleWidth(86));
make.centerX.equalTo(self.bgImageView); make.centerX.equalTo(self.bgImageView);
make.bottom.mas_equalTo(-kGetScaleWidth(0)); make.bottom.mas_equalTo(-kGetScaleWidth(22));
}]; }];
[self.balanceTextLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.balanceTextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(33)); make.centerX.equalTo(self.balanceBgVeiw).mas_offset(kGetScaleWidth(13));
make.top.mas_equalTo(kGetScaleWidth(36)); make.top.mas_equalTo(kGetScaleWidth(14));
make.height.mas_equalTo(kGetScaleWidth(14)); make.height.mas_equalTo(kGetScaleWidth(14));
}]; }];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(21));
make.trailing.equalTo(self.balanceTextLabel.mas_leading).mas_offset(-kGetScaleWidth(5));
make.centerY.equalTo(self.balanceTextLabel);
}];
[self.balanceLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.balanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.balanceTextLabel.mas_bottom).mas_offset(kGetScaleWidth(10)); make.bottom.mas_equalTo(-kGetScaleWidth(14));
make.leading.mas_equalTo(kGetScaleWidth(33)); make.centerX.equalTo(self.balanceBgVeiw);
make.leading.trailing.equalTo(self.balanceBgVeiw).inset(kGetScaleWidth(10));
}]; }];
} }
@@ -76,23 +83,23 @@
- (UIImageView *)bgImageView { - (UIImageView *)bgImageView {
if (!_bgImageView) { if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] init]; _bgImageView = [[UIImageView alloc] init];
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x13E2F5),UIColorFromRGB(0x9DB4FF),UIColorFromRGB(0xCC67FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(KScreenWidth, kGetScaleWidth(123))];
_bgImageView.image = kImage(@"ms_mine_top_bg"); _bgImageView.image = image;
} }
return _bgImageView; return _bgImageView;
} }
- (UIImageView *)balanceBgVeiw{ - (UIImageView *)balanceBgVeiw{
if(!_balanceBgVeiw){ if(!_balanceBgVeiw){
_balanceBgVeiw = [UIImageView new]; _balanceBgVeiw = [UIImageView new];
_balanceBgVeiw.image = kImage(@"ms_mine_coin_bg"); _balanceBgVeiw.image = kImage(@"mine_recharge_balance_bg");
} }
return _balanceBgVeiw; return _balanceBgVeiw;
} }
- (UILabel *)balanceTextLabel { - (UILabel *)balanceTextLabel {
if (!_balanceTextLabel) { if (!_balanceTextLabel) {
_balanceTextLabel = [[UILabel alloc] init]; _balanceTextLabel = [[UILabel alloc] init];
_balanceTextLabel.textColor = UIColorFromRGB(0x9F4805); _balanceTextLabel.textColor = UIColorFromRGB(0x333333);
_balanceTextLabel.font = kFontBold(15); _balanceTextLabel.font = kFontRegular(14);
_balanceTextLabel.text = YMLocalizedString(@"XPIAPRechargeHeaderView0"); _balanceTextLabel.text = YMLocalizedString(@"XPIAPRechargeHeaderView0");
} }
return _balanceTextLabel; return _balanceTextLabel;
@@ -101,14 +108,21 @@
- (UILabel *)balanceLabel { - (UILabel *)balanceLabel {
if (!_balanceLabel) { if (!_balanceLabel) {
_balanceLabel = [[UILabel alloc] init]; _balanceLabel = [[UILabel alloc] init];
_balanceLabel.textColor = UIColorFromRGB(0xFFFBD5); _balanceLabel.textColor = UIColorFromRGB(0x1F1B4F);
_balanceLabel.font = kFontBold(24); _balanceLabel.font = kFontMedium(32);
_balanceLabel.textAlignment = NSTextAlignmentCenter; _balanceLabel.textAlignment = NSTextAlignmentCenter;
_balanceLabel.text = @"0"; _balanceLabel.text = @"0";
_balanceLabel.adjustsFontSizeToFitWidth = YES; _balanceLabel.adjustsFontSizeToFitWidth = YES;
} }
return _balanceLabel; return _balanceLabel;
} }
- (UIImageView *)iconImageView {
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
_iconImageView.contentMode = UIViewContentModeScaleAspectFit;
_iconImageView.image = [UIImage imageNamed:@"exchange_gold_icon"];
}
return _iconImageView;
}
@end @end

View File

@@ -64,7 +64,8 @@
/// ///
@property (nonatomic,copy) NSString *orderId; @property (nonatomic,copy) NSString *orderId;
//////banner
@property(nonatomic,copy) NSArray *bannerList;
@end @end
@@ -93,7 +94,7 @@
[self initHttpData]; [self initHttpData];
} }
- (void)createUI { - (void)createUI {
self.view.backgroundColor = UIColorFromRGB(0xF4F5FA); self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.headerView]; [self.view addSubview:self.headerView];
[self.view addSubview:self.collectionView]; [self.view addSubview:self.collectionView];
@@ -104,7 +105,7 @@
[self.stackView addArrangedSubview:self.agreeLabel]; [self.stackView addArrangedSubview:self.agreeLabel];
[self.stackView addArrangedSubview:self.protcoloButton]; [self.stackView addArrangedSubview:self.protcoloButton];
CGFloat height = kGetScaleWidth(236); CGFloat height = kGetScaleWidth(123)+kNavigationHeight;
[self.headerView mas_makeConstraints:^(MASConstraintMaker *make) { [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.mas_equalTo(0); make.leading.trailing.top.mas_equalTo(0);
make.height.mas_equalTo(height); make.height.mas_equalTo(height);
@@ -124,7 +125,7 @@
}]; }];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.headerView.mas_bottom).mas_offset(kGetScaleWidth(21)); make.top.mas_equalTo(self.headerView.mas_bottom).mas_offset(-kGetScaleWidth(22));
make.leading.trailing.mas_equalTo(0); make.leading.trailing.mas_equalTo(0);
make.bottom.equalTo(self.rechargeBtn.mas_top).mas_offset(-kGetScaleWidth(10)); make.bottom.equalTo(self.rechargeBtn.mas_top).mas_offset(-kGetScaleWidth(10));
}]; }];
@@ -169,7 +170,7 @@
[self showSuccessToast:YMLocalizedString(@"XPIAPRechargeViewController11")]; [self showSuccessToast:YMLocalizedString(@"XPIAPRechargeViewController11")];
return; return;
} }
NSInteger index = self.selectedIndex.row; NSInteger index = self.bannerList.count > 0 ? self.selectedIndex.row - 1 : self.selectedIndex.row;
if(index < self.dataSource.count){ if(index < self.dataSource.count){
RechargeListModel *model = [self.dataSource safeObjectAtIndex1:index]; RechargeListModel *model = [self.dataSource safeObjectAtIndex1:index];
if (model.chargeProdId) { if (model.chargeProdId) {
@@ -205,9 +206,12 @@
[self.presenter getUserWalletInfo]; [self.presenter getUserWalletInfo];
} }
- (void)getBannerListSuccessWithList:(NSArray *)list{ - (void)getBannerListSuccessWithList:(NSArray *)list{
self.bannerList = list;
self.selectedIndex = [NSIndexPath indexPathForRow:0 inSection:0]; if(self.bannerList.count > 0){
self.selectedIndex = [NSIndexPath indexPathForRow:1 inSection:0];
}else{
self.selectedIndex = [NSIndexPath indexPathForRow:0 inSection:0];
}
[self.collectionView reloadData]; [self.collectionView reloadData];
} }
/// ///
@@ -431,31 +435,41 @@
#pragma mark - UICollectionViewDelegate #pragma mark - UICollectionViewDelegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if(self.bannerList.count > 0){
return self.dataSource.count + 1;
}
return self.dataSource.count; return self.dataSource.count;
} }
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
return CGSizeMake(kGetScaleWidth(108), kGetScaleWidth(121)); return self.bannerList.count > 0 && indexPath.row == 0 ? CGSizeMake(KScreenWidth, kGetScaleWidth(114)) : CGSizeMake(KScreenWidth, kGetScaleWidth(80));
} }
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.row == 0 && self.bannerList.count > 0){
XPIAPRechargeHeadCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPIAPRechargeHeadCell class]) forIndexPath:indexPath];
cell.bannerList = self.bannerList;
cell.delegate = self;
return cell;
}
XPIAPRechargeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeCollectionViewCell.self) forIndexPath:indexPath]; XPIAPRechargeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeCollectionViewCell.self) forIndexPath:indexPath];
NSInteger count = indexPath.item; NSInteger count = self.bannerList.count > 0 ? indexPath.item - 1 : indexPath.item;
cell.rechargeModel = [self.dataSource safeObjectAtIndex1:count]; cell.rechargeModel = [self.dataSource safeObjectAtIndex1:count];
cell.selectedStyle = self.selectedIndex.item == indexPath.item; cell.selectedStyle = self.selectedIndex.item == indexPath.item;
return cell; return cell;
} }
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.row == 0 && self.bannerList.count > 0)return;
self.selectedIndex = indexPath; self.selectedIndex = indexPath;
[collectionView reloadData]; [collectionView reloadData];
} }
#pragma mark - XPIAPRechargeHeadCellDelegate #pragma mark - XPIAPRechargeHeadCellDelegate
- (void)xpIAPRechargeHeadCell:(XPIAPRechargeHeadCell *)cycleScrollView didSelectItemAtIndex:(NSInteger)index{ - (void)xpIAPRechargeHeadCell:(XPIAPRechargeHeadCell *)cycleScrollView didSelectItemAtIndex:(NSInteger)index{
RechargeListModel *bannerModel = [self.bannerList safeObjectAtIndex1:index];
XPWebViewController * webVC= [[XPWebViewController alloc] init];
webVC.url = bannerModel.linkUrl;
[self.navigationController pushViewController:webVC animated:YES];
} }
#pragma mark - #pragma mark -
@@ -463,12 +477,12 @@
if (!_collectionView) { if (!_collectionView) {
MSBaseRTLFlowLayout *layout = [[MSBaseRTLFlowLayout alloc] init]; MSBaseRTLFlowLayout *layout = [[MSBaseRTLFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionVertical; layout.scrollDirection = UICollectionViewScrollDirectionVertical;
layout.minimumLineSpacing = kGetScaleWidth(8); layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = kGetScaleWidth(8); layout.minimumInteritemSpacing = 0;
layout.sectionInset = UIEdgeInsetsMake(0, kGetScaleWidth(17), 0, kGetScaleWidth(17)); layout.sectionInset = UIEdgeInsetsMake(kGetScaleWidth(16), 0, kGetScaleWidth(16), 0);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.backgroundColor = UIColor.clearColor; _collectionView.backgroundColor = UIColor.whiteColor;
_collectionView.alwaysBounceVertical = YES; _collectionView.alwaysBounceVertical = YES;
[_collectionView registerClass:[XPIAPRechargeCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeCollectionViewCell.self)]; [_collectionView registerClass:[XPIAPRechargeCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeCollectionViewCell.self)];
[_collectionView registerClass:[XPIAPRechargeHeadCell class] forCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeHeadCell.self)]; [_collectionView registerClass:[XPIAPRechargeHeadCell class] forCellWithReuseIdentifier:NSStringFromClass(XPIAPRechargeHeadCell.self)];
@@ -476,7 +490,8 @@
_collectionView.delegate = self; _collectionView.delegate = self;
_collectionView.dataSource = self; _collectionView.dataSource = self;
_collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; _collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
_collectionView.layer.cornerRadius = kGetScaleWidth(16);
_collectionView.layer.masksToBounds = YES;
// _collectionView.contentInset = UIEdgeInsetsMake(kHeaderViewHeight, 0, 0, 0); // _collectionView.contentInset = UIEdgeInsetsMake(kHeaderViewHeight, 0, 0, 0);
} }
@@ -551,8 +566,8 @@
if (!_titleLabel) { if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init]; _titleLabel = [[UILabel alloc] init];
_titleLabel.text = YMLocalizedString(@"XPIAPRechargeViewController6"); _titleLabel.text = YMLocalizedString(@"XPIAPRechargeViewController6");
_titleLabel.textColor = UIColor.blackColor; _titleLabel.textColor = UIColor.whiteColor;
_titleLabel.font = kFontBold(16); _titleLabel.font = kFontSemibold(17);
} }
return _titleLabel; return _titleLabel;
} }

View File

@@ -153,7 +153,7 @@
} }
-(UIButton *)confirmBtn{ -(UIButton *)confirmBtn{
if (!_confirmBtn){ if (!_confirmBtn){
_confirmBtn = [UIButton buttonInitWithText:YMLocalizedString(@"TTAlertConfig0") font:kFontMedium(16) textColor:[DJDKMIMOMColor inputTextColor] image:nil bgImage:nil]; _confirmBtn = [UIButton buttonInitWithText:YMLocalizedString(@"XPIncomeRecordGoldDetailsPickViewView1") font:kFontMedium(16) textColor:[DJDKMIMOMColor inputTextColor] image:nil bgImage:nil];
[_confirmBtn addTarget:self action:@selector(confirmAction) forControlEvents:UIControlEventTouchUpInside]; [_confirmBtn addTarget:self action:@selector(confirmAction) forControlEvents:UIControlEventTouchUpInside];
} }
return _confirmBtn; return _confirmBtn;

View File

@@ -14,7 +14,6 @@
@property (nonatomic, strong) UIImageView *bgImageView; @property (nonatomic, strong) UIImageView *bgImageView;
@property (nonatomic, strong) UILabel *coinLabel; @property (nonatomic, strong) UILabel *coinLabel;
@property (nonatomic, strong) UILabel *descLabel; @property (nonatomic, strong) UILabel *descLabel;
@property(nonatomic,strong) UIImageView *arrowView;
@end @end
@@ -35,7 +34,6 @@
[self addSubview:self.bgImageView]; [self addSubview:self.bgImageView];
[self addSubview:self.coinLabel]; [self addSubview:self.coinLabel];
[self addSubview:self.descLabel]; [self addSubview:self.descLabel];
[self addSubview:self.arrowView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
@@ -44,28 +42,20 @@
}]; }];
[self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(16); make.top.mas_equalTo(13);
make.leading.mas_equalTo(16); make.leading.mas_equalTo(14);
make.trailing.mas_equalTo(0); make.trailing.mas_equalTo(0);
make.height.mas_equalTo(18); make.height.mas_equalTo(24);
}]; }];
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.coinLabel); make.leading.mas_equalTo(self.coinLabel);
make.top.equalTo(self.coinLabel.mas_bottom).mas_offset(4); make.top.mas_equalTo(self.coinLabel.mas_bottom);
make.height.mas_equalTo(14);
}];
[self.arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(5);
make.height.mas_equalTo(7);
make.leading.equalTo(self.descLabel.mas_trailing).mas_offset(2);
make.centerY.equalTo(self.descLabel);
}]; }];
} }
- (void)setDiamonds:(NSString *)diamonds { - (void)setDiamonds:(NSString *)diamonds {
self.coinLabel.text = diamonds;
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
@@ -80,9 +70,9 @@
- (UILabel *)descLabel { - (UILabel *)descLabel {
if (!_descLabel) { if (!_descLabel) {
_descLabel = [[UILabel alloc] init]; _descLabel = [[UILabel alloc] init];
_descLabel.font = [UIFont systemFontOfSize:9 weight:UIFontWeightRegular]; _descLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
_descLabel.textColor = UIColorFromRGB(0x628ebb); _descLabel.textColor = UIColorRGBAlpha(0x000000, 0.3);
_descLabel.text = YMLocalizedString(@"XPMineAccountView1"); _descLabel.text = YMLocalizedString(@"XPMineAccountView0");
} }
return _descLabel; return _descLabel;
} }
@@ -91,19 +81,12 @@
- (UILabel *)coinLabel { - (UILabel *)coinLabel {
if (!_coinLabel) { if (!_coinLabel) {
_coinLabel = [[UILabel alloc] init]; _coinLabel = [[UILabel alloc] init];
_coinLabel.text = YMLocalizedString(@"XPIncomeRecordVC1"); _coinLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
_coinLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; _coinLabel.textColor = [DJDKMIMOMColor mainTextColor];
_coinLabel.textColor = UIColorFromRGB(0x185491);
} }
return _coinLabel; return _coinLabel;
} }
- (UIImageView *)arrowView{
if(!_arrowView){
_arrowView = [UIImageView new];
_arrowView.image = [kImage(@"ms_mine_purse_arrow") ms_SetImageForRTL];
}
return _arrowView;
}
@end @end

View File

@@ -365,7 +365,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
return cell; return cell;
}else if (indexPath.section == 1) { }else if (indexPath.section == 1) {
XPMinePersonalCenterCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMinePersonalCenterCell class])]; XPMinePersonalCenterCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMinePersonalCenterCell class])];
cell.isHaveGiveDiamond = NO; // cell.isHaveGiveDiamond = self.isHavePermission;
@kWeakify(self) @kWeakify(self)
cell.clickAction = ^(int type){ cell.clickAction = ^(int type){
@kStrongify(self) @kStrongify(self)
@@ -461,9 +461,11 @@ UIKIT_EXTERN NSString *kRequestRicket;
} }
/// ///
-(void)pushThirdPartyPayVC{ -(void)pushThirdPartyPayVC{
[self pushEarningsRecordVC]; XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
webVC.type = @"4";
[self.navigationController pushViewController:webVC animated:YES];
} }
/// ///
-(void)pushEarningsRecordVC{ -(void)pushEarningsRecordVC{
XPIncomeRecordVC *incomeRecordVC = [XPIncomeRecordVC new]; XPIncomeRecordVC *incomeRecordVC = [XPIncomeRecordVC new];

View File

@@ -46,6 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
//是否为周榜top1 //是否为周榜top1
@property(nonatomic,assign) BOOL isWeekTop1; @property(nonatomic,assign) BOOL isWeekTop1;
@property(nonatomic,copy) NSString *inRoomUid; @property(nonatomic,copy) NSString *inRoomUid;
//是否在麦位 //是否在麦位
@property(nonatomic,assign) BOOL inMic; @property(nonatomic,assign) BOOL inMic;
///是否在线 ///是否在线

View File

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,assign) CGFloat noCheckedWidth; @property(nonatomic,assign) CGFloat noCheckedWidth;
@property(nonatomic,copy) NSString *name; @property(nonatomic,copy) NSString *name;
@property(nonatomic,copy) NSString *id; @property(nonatomic,copy) NSString *id;
@property(nonatomic,assign) BOOL isHomeRecommend; @property(nonatomic,assign) BOOL isHomeRecommen;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -197,7 +197,6 @@
[[self getView] onGetLittleGameListSuccess:array]; [[self getView] onGetLittleGameListSuccess:array];
}fail:^(NSInteger code, NSString * _Nullable msg) { }fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getHomeRecommendDataFail]; [[self getView] getHomeRecommendDataFail];
}errorToast:NO] }errorToast:NO]];
roomUid:@""];
} }
@end @end

View File

@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPNewHomePartyTableViewCell : UITableViewCell @interface XPNewHomePartyTableViewCell : UITableViewCell
@property (nonatomic,strong) HomePlayRoomModel *roomInfo; @property (nonatomic,strong) HomePlayRoomModel *roomInfo;
@property (nonatomic,strong) HomeRecommendRoomModel *roomInfo1;
@property(nonatomic,weak) id<XPNewHomePartyTableViewCellDelegate>delegate; @property(nonatomic,weak) id<XPNewHomePartyTableViewCellDelegate>delegate;
///声音卡时svga是否播放动画 ///声音卡时svga是否播放动画
-(void)setPlaySoundStatus:(BOOL)isPlay; -(void)setPlaySoundStatus:(BOOL)isPlay;

View File

@@ -243,8 +243,15 @@
-(void)setPlaySoundTime:(NSInteger)time{ -(void)setPlaySoundTime:(NSInteger)time{
_audioView.voiceDura = @(time).stringValue; _audioView.voiceDura = @(time).stringValue;
} }
- (void)setRoomInfo1:(HomeRecommendRoomModel *)roomInfo1 {
_roomInfo1 = roomInfo1;
if (_roomInfo1) {
}
}
-(void)didSelectItemAction{ -(void)didSelectItemAction{
if(self.delegate && [self.delegate respondsToSelector:@selector(xPNewHomePartyTableViewCell:didSelectItem:)]){ if(self.delegate && [self.delegate respondsToSelector:@selector(xPNewHomePartyTableViewCell:didSelectItem:)]){

View File

@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,weak) id<XPHomeRecommendViewControllerDelegate>delegate; @property(nonatomic,weak) id<XPHomeRecommendViewControllerDelegate>delegate;
@property(nonatomic,copy) HeaderRefreshComplete refreshComplete; @property(nonatomic,copy) HeaderRefreshComplete refreshComplete;
@property(nonatomic,strong) PIHomeCategoryTitleModel *tagModel; @property(nonatomic,strong) PIHomeCategoryTitleModel *tagModel;
- (void)headerRefresh;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -56,6 +56,8 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
@property (nonatomic,strong) NSMutableArray<HomePlayRoomModel *> *personalRoomList; @property (nonatomic,strong) NSMutableArray<HomePlayRoomModel *> *personalRoomList;
/// ///
@property (nonatomic,strong) RoomInfoModel * roomInfo; @property (nonatomic,strong) RoomInfoModel * roomInfo;
///,
@property (nonatomic,assign) BOOL isRequestData;
/// ///
@property (nonatomic,strong) CountDownHelper *countDownHelper; @property (nonatomic,strong) CountDownHelper *countDownHelper;
///cell ///cell
@@ -101,9 +103,53 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
-(void)dealloc{ -(void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self]; [[NSNotificationCenter defaultCenter]removeObserver:self];
} }
#pragma mark - InitHttp
-(void)requestData{
return;
///
if(self.pi_playAudioCell != nil){
if(self.refreshComplete){
self.refreshComplete();
}
return;
}
///
if(self.isRequestData == YES){
if(self.refreshComplete){
self.refreshComplete();
}
return;
}
self.isRequestData = YES;
[self.presenter getHomeListDataWith:1 completeHandle:^(BOOL isSuccess, NSArray *playGameList, NSArray *friendList) {
dispatch_async(dispatch_get_main_queue(), ^{
self.isRequestData = NO;
if(playGameList.count > 0){
self.playTeamList = [NSMutableArray arrayWithArray:playGameList];
}
if(friendList.count > 0){
[self getFriendList:friendList];
}
if(self.refreshComplete){
self.refreshComplete();
}
if(self.pi_playAudioCell == nil){///
[self.tableView reloadData];
}
});
}];
}
- (void)headerRefresh {
self.isRequestData = NO;
[self requestData];
}
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(shieldingNotification) name:kShieldingNotification object:nil];
self.view.backgroundColor = [UIColor clearColor]; self.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.tableView]; [self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -111,7 +157,9 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
}]; }];
} }
-(void)shieldingNotification{
[self requestData];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource #pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
@@ -384,7 +432,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
-(void)xPNewHomePartyTableViewCell:(XPNewHomePartyTableViewCell *_Nullable)cell didSelectChat:(HomePlayRoomModel *_Nonnull)roomModel{ -(void)xPNewHomePartyTableViewCell:(XPNewHomePartyTableViewCell *_Nullable)cell didSelectChat:(HomePlayRoomModel *_Nonnull)roomModel{
if(roomModel.inMic == YES){ if(roomModel.inMic == YES){
[XPRoomViewController openRoom:roomModel.inRoomUid fromNick:roomModel.nick fromType:UserEnterRoomFromType_Follow_User fromUid:roomModel.uid viewController:self]; [XPRoomViewController openRoom:roomModel.inRoomUid fromNick:roomModel.nick fromType:UserEnterRoomFromType_Follow_User fromUid:roomModel.uid viewController:self];
return; return;
} }

View File

@@ -56,7 +56,9 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
UIKIT_EXTERN NSString * const kOpenRoomNotification; UIKIT_EXTERN NSString * const kOpenRoomNotification;
@interface XPNewHomeViewController ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate, XPHomeContainerProtocol, XPNewHomeNavViewDelegate,XPNewHomeHeadViewDelegate,XPHomeRecommendOtherRoomViewDelegate,XPHomeRecommendViewControllerDelegate> @interface XPNewHomeViewController ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate, XPHomeContainerProtocol, XPNewHomeNavViewDelegate,XPNewHomeHeadViewDelegate,XPHomeRecommendOtherRoomViewDelegate,XPHomeRecommendViewControllerDelegate>
{
NSTimer * timer;
}
/// ///
@property (nonatomic,strong) UIImageView *backImageView; @property (nonatomic,strong) UIImageView *backImageView;
/// ///
@@ -87,11 +89,12 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
} }
return self; return self;
} }
-(void)dealloc{ -(void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self]; [[NSNotificationCenter defaultCenter]removeObserver:self];
} [timer fire];
timer = nil;
}
- (BOOL)isHiddenNavBar { - (BOOL)isHiddenNavBar {
return YES; return YES;
} }
@@ -99,7 +102,6 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
- (XPHomeContainerPresenter *)createPresenter { - (XPHomeContainerPresenter *)createPresenter {
return [[XPHomeContainerPresenter alloc] init]; return [[XPHomeContainerPresenter alloc] init];
} }
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
if(self.isEmpty == NO){ if(self.isEmpty == NO){
@@ -107,17 +109,27 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
[self initHttp]; [self initHttp];
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
[self addTimer];
} }
}
}
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
if (timer) {
[timer setFireDate:[NSDate distantPast]]; //
}
} }
- (void)viewWillDisappear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
if (timer) {
//
[timer setFireDate:[NSDate distantFuture]]; //
}
} }
- (void)tokenInvalid { - (void)tokenInvalid {
[[AccountInfoStorage instance] saveAccountInfo:nil]; [[AccountInfoStorage instance] saveAccountInfo:nil];
@@ -133,11 +145,15 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
} }
#pragma mark - Private Method #pragma mark - Private Method
- (void)addTimer { - (void)addTimer {
// PIHomeCategoryTitleModel *tagModel = [self.tagModelList safeObjectAtIndex1:self.type]; @kWeakify(self);
// XPHomePartyViewController *homeVC = [self.validListDict objectForKey:[NSNumber numberWithInteger:self.type]]; timer = [XPWeakTimer scheduledTimerWithTimeInterval:15 block:^(id userInfo) {
// homeVC.tagModel = tagModel; @kStrongify(self);
PIHomeCategoryTitleModel *tagModel = [self.tagModelList safeObjectAtIndex1:self.type];
XPHomePartyViewController *homeVC = [self.validListDict objectForKey:[NSNumber numberWithInteger:self.type]];
homeVC.tagModel = tagModel;
[self.recommendVC headerRefresh];
} userInfo:nil repeats:YES];
} }
- (void)initSubViews { - (void)initSubViews {
self.type = 0; self.type = 0;
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#F3F5FA"]; self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#F3F5FA"];
@@ -174,16 +190,24 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
self.pagingView.mainTableView.mj_header = header; self.pagingView.mainTableView.mj_header = header;
[ClientConfig shareConfig].inviteCode = @""; [ClientConfig shareConfig].inviteCode = @"";
[self.pagingView.mainTableView.mj_header beginRefreshing]; [self.pagingView.mainTableView.mj_header beginRefreshing];
@kWeakify(self); @kWeakify(self);
self.recommendVC.refreshComplete = ^{ self.recommendVC.refreshComplete = ^{
@kStrongify(self); @kStrongify(self);
[self.pagingView.mainTableView.mj_header endRefreshing]; [self.pagingView.mainTableView.mj_header endRefreshing];
}; };
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(homeVCRefreshComplete) name:@"khomeVCRefreshComplete" object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(homeVCRefreshComplete) name:@"khomeVCRefreshComplete" object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(logOut) name:@"kInLoginVC" object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(logOut) name:@"kInLoginVC" object:nil];
} }
-(void)homeVCRefreshComplete{ -(void)homeVCRefreshComplete{
[self.pagingView.mainTableView.mj_header endRefreshing]; [self.pagingView.mainTableView.mj_header endRefreshing];
@@ -194,10 +218,15 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
} }
-(void)headerRefresh{ -(void)headerRefresh{
[self initHttp]; [self initHttp];
// if(self.titleView.index == self.tagModelList.count - 1){
// [self.recommendVC headerRefresh];
// }else{
PIHomeCategoryTitleModel *tagModel = [self.tagModelList safeObjectAtIndex1:self.type];
XPHomePartyViewController *homeVC = [self.validListDict objectForKey:[NSNumber numberWithInteger:self.type]];
homeVC.tagModel = tagModel;
PIHomeCategoryTitleModel *tagModel = [self.tagModelList safeObjectAtIndex1:self.type];
XPHomePartyViewController *homeVC = [self.validListDict objectForKey:[NSNumber numberWithInteger:self.type]]; // }
homeVC.tagModel = tagModel;
} }
-(void)openRoomNotification:(NSNotification *)notification{ -(void)openRoomNotification:(NSNotification *)notification{
@@ -231,6 +260,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
} }
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.mas_equalTo(self.view); make.leading.trailing.top.mas_equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(223)); make.height.mas_equalTo(kGetScaleWidth(223));
@@ -241,17 +271,24 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
make.height.mas_equalTo(kNavigationHeight); make.height.mas_equalTo(kNavigationHeight);
}]; }];
[self.pagingView mas_makeConstraints:^(MASConstraintMaker *make) { [self.pagingView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.navView.mas_bottom).mas_offset(kGetScaleWidth(10)); make.top.equalTo(self.navView.mas_bottom).mas_offset(kGetScaleWidth(10));
make.leading.bottom.trailing.mas_equalTo(0); make.leading.bottom.trailing.mas_equalTo(0);
}]; }];
} }
- (void)initHttp { - (void)initHttp {
[self.presenter getHomeTopData]; [self.presenter getHomeTopData];
[self requestCheckIp]; [self requestCheckIp];
} }
#pragma mark - XPNewHomeNavViewDelegate #pragma mark - XPNewHomeNavViewDelegate
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender { - (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender {
XPWebViewController * webVC =[[XPWebViewController alloc] init]; XPWebViewController * webVC =[[XPWebViewController alloc] init];
@@ -262,12 +299,13 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickOpenRoom:(UIButton *)sender { - (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickOpenRoom:(UIButton *)sender {
NSString* roomUid = [AccountInfoStorage instance].getUid; NSString* roomUid = [AccountInfoStorage instance].getUid;
[self opRoom:roomUid]; [self opRoom:roomUid];
}
}
-(void)opRoom:(NSString *)roomUid{ -(void)opRoom:(NSString *)roomUid{
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 401){ if(code == 401){
[self tokenInvalid]; [self tokenInvalid];
[self showErrorToast:msg]; [self showErrorToast:msg];
return; return;
@@ -287,6 +325,8 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
[self showErrorToast:msg]; [self showErrorToast:msg];
} }
} uid:roomUid intoUid:roomUid]; } uid:roomUid intoUid:roomUid];
} }
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickSearch:(UIView *)sender { - (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickSearch:(UIView *)sender {
@@ -327,14 +367,23 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
} }
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index { - (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
id homeV = [self.validListDict objectForKey:[NSNumber numberWithInteger:index]];
if (homeV) {
return homeV;
} // if (index == self.tagModelList.count - 1) {
XPHomePartyViewController *homeVC = [[XPHomePartyViewController alloc] init]; // self.recommendVC.tagModel = [self.tagModelList safeObjectAtIndex1:index];
homeVC.tagModel = [self.tagModelList safeObjectAtIndex1:index]; // return self.recommendVC;
[self.validListDict setObject:homeVC forKey:@(index)]; // } else {
return homeVC; id homeV = [self.validListDict objectForKey:[NSNumber numberWithInteger:index]];
if (homeV) {
return homeV;
}
XPHomePartyViewController *homeVC = [[XPHomePartyViewController alloc] init];
homeVC.tagModel = [self.tagModelList safeObjectAtIndex1:index];
[self.validListDict setObject:homeVC forKey:@(index)];
return homeVC;
// }
} }
#pragma mark - JXCategoryListContentViewDelegate #pragma mark - JXCategoryListContentViewDelegate
@@ -360,6 +409,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
return NO; return NO;
} }
return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]; return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];
} }
#pragma mark - XPHomeContainerProtocol #pragma mark - XPHomeContainerProtocol
@@ -376,7 +426,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
NSMutableArray *list = [NSMutableArray new]; NSMutableArray *list = [NSMutableArray new];
NSMutableArray *titleArray = [NSMutableArray array]; NSMutableArray *titleArray = [NSMutableArray array];
for (PIHomeCategoryTitleModel *model in array) { for (PIHomeCategoryTitleModel *model in array) {
if (model.isHomeRecommend == YES){ if (model.isHomeRecommen == YES){
[list insertObject:model atIndex:0]; [list insertObject:model atIndex:0];
[titleArray insertObject:model.name atIndex:0]; [titleArray insertObject:model.name atIndex:0];
}else{ }else{
@@ -403,7 +453,10 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
} }
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index{ - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index{
self.type = index; self.type = index;
} }
#pragma mark - XPNewHomeHeadViewDelegate #pragma mark - XPNewHomeHeadViewDelegate

View File

@@ -69,6 +69,7 @@
} cancelHandler:^{ } cancelHandler:^{
}]; }];
} }
} showLoading:NO errorToast:NO] uid:roomUid intoUid:uid]; } showLoading:NO errorToast:NO] uid:roomUid intoUid:uid];
} }

View File

@@ -11,19 +11,16 @@
#import "XPRedPacketModel.h" #import "XPRedPacketModel.h"
#import "RoomInfoModel.h" #import "RoomInfoModel.h"
#import "ActivityInfoModel.h" #import "ActivityInfoModel.h"
#import "LittleGameInfoModel.h"
typedef void(^OpenRedPacketHandle)(XPRedPacketModel *_Nullable,RoomType type ,BOOL isChangeRoom); typedef void(^OpenRedPacketHandle)(XPRedPacketModel *_Nullable,RoomType type ,BOOL isChangeRoom);
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XPRoomActivityContainerView : UIView<RoomGuestDelegate> @interface XPRoomActivityContainerView : UIView<RoomGuestDelegate>
@property(nonatomic,copy)OpenRedPacketHandle openRedPacketHandle;
@property(nonatomic,strong) NSMutableArray *redPacketList; @property(nonatomic,strong) NSMutableArray *redPacketList;
@property(nonatomic,copy)OpenRedPacketHandle openRedPacketHandle;
@property(nonatomic,strong) NSMutableArray<ActivityInfoModel *> *playList; @property(nonatomic,strong) NSMutableArray<ActivityInfoModel *> *playList;
@property(nonatomic,strong) NSMutableArray<LittleGameInfoModel *> *littleGameList; - (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate;
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
- (void)updateView;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -14,7 +14,6 @@
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "Api+Room.h" #import "Api+Room.h"
#import "Api+TreasureFairy.h" #import "Api+TreasureFairy.h"
#import "Api+LittleGame.h"
#import "ClientConfig.h" #import "ClientConfig.h"
#import "NetImageView.h" #import "NetImageView.h"
#import "TTPopup.h" #import "TTPopup.h"
@@ -27,7 +26,6 @@
#import "FirstRechargeModel.h" #import "FirstRechargeModel.h"
#import "TreasureFairyLimitModel.h" #import "TreasureFairyLimitModel.h"
#import "XPRedPacketResultModel.h" #import "XPRedPacketResultModel.h"
///View ///View
#import "XPRoomHalfWebView.h" #import "XPRoomHalfWebView.h"
#import "XPCandyTreeViewController.h" #import "XPCandyTreeViewController.h"
@@ -41,11 +39,10 @@
#import "PIRoomEnterRedPacketView.h" #import "PIRoomEnterRedPacketView.h"
#import "BaseNavigationController.h" #import "BaseNavigationController.h"
#import "PIRoomActivityWebView.h" #import "PIRoomActivityWebView.h"
#import "PIRoomActivityClickView.h"
#import "MSRoomMenuGameVC.h" #import "PIRoomActivityChoosePlayView.h"
UIKIT_EXTERN NSString *kShowFirstRechargeView; UIKIT_EXTERN NSString *kShowFirstRechargeView;
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate> @interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate,PIRoomActivityClickViewDelegate,PIRoomActivityChoosePlayViewDelegate>
/// ///
@property (nonatomic,strong) UIStackView *stackView; @property (nonatomic,strong) UIStackView *stackView;
/// ///
@@ -53,9 +50,8 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
/// ///
@property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView; @property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView;
///
/// @property(nonatomic,strong) PIRoomActivityClickView *clickPlayView;
@property(nonatomic, strong) UIButton *gameMenuButton;
/// ///
@property (nonatomic,strong) UIImageView *joinDatingView; @property (nonatomic,strong) UIImageView *joinDatingView;
@@ -65,31 +61,25 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
@property (nonatomic,strong) NSMutableArray<ActivityInfoModel *> *activityList; @property (nonatomic,strong) NSMutableArray<ActivityInfoModel *> *activityList;
/// ///
@property (nonatomic,assign) BOOL isLoadActivity; @property (nonatomic,assign) BOOL isLoadActivity;
@property(nonatomic,assign) BOOL isShowChoosePlayView;
@end @end
@implementation XPRoomActivityContainerView @implementation XPRoomActivityContainerView
-(void)dealloc{ -(void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self]; [[NSNotificationCenter defaultCenter]removeObserver:self];
} }
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate { - (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate {
self = [super init]; self = [super init];
if (self) { if (self) {
self.hostDelegate = delegate; self.hostDelegate = delegate;
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
[self requestActivityList];
} }
return self; return self;
} }
- (void)updateView {
if (self.isLoadActivity) {
[self configLittleGameActivity];
} else {
[self requestActivityList];
}
}
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
[self addSubview:self.stackView]; [self addSubview:self.stackView];
@@ -98,7 +88,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.stackView addArrangedSubview:emptyView]; [self.stackView addArrangedSubview:emptyView];
[self.stackView addArrangedSubview:self.redPacketView]; [self.stackView addArrangedSubview:self.redPacketView];
[self.stackView addArrangedSubview:self.joinDatingView]; [self.stackView addArrangedSubview:self.joinDatingView];
[self.stackView addArrangedSubview:self.gameMenuButton]; [self.stackView addArrangedSubview:self.clickPlayView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
@@ -110,76 +102,68 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) { [self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(itemWidth , itemWidth)); make.size.mas_equalTo(CGSizeMake(itemWidth , itemWidth));
}]; }];
[self.redPacketView mas_makeConstraints:^(MASConstraintMaker *make) { [self.redPacketView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(58)); make.width.height.mas_equalTo(kGetScaleWidth(58));
}]; }];
[self.gameMenuButton mas_makeConstraints:^(MASConstraintMaker *make) {
[self.clickPlayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0); make.leading.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(76, 76)); make.size.mas_equalTo(CGSizeMake(81, 66));
}]; }];
[self.joinDatingView mas_makeConstraints:^(MASConstraintMaker *make) { [self.joinDatingView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(35 * kScreenHeightScale); make.height.mas_equalTo(35 * kScreenHeightScale);
}]; }];
} }
- (void)requestActivityList { - (void)requestActivityList {
@kWeakify(self);
RACSubject* playRAC = [RACSubject subject];
RACSubject* littleGameRAC = [RACSubject subject]; RACSubject* list = [RACSubject subject];
[[RACSignal combineLatest:@[playRAC, littleGameRAC] RACSubject* play = [RACSubject subject];
reduce:^id(NSArray<ActivityInfoModel*> *playModels, NSArray<LittleGameInfoModel*> *littleGameModels){ [[RACSignal combineLatest:@[list, play] reduce:^id(NSArray<ActivityInfoModel*> * listModel, NSArray<ActivityInfoModel*> * playModel){
@kStrongify(self); self.activityList = [NSMutableArray arrayWithArray:listModel];
self.playList = [NSMutableArray arrayWithArray:playModels]; self.playList = [NSMutableArray arrayWithArray:playModel];
self.littleGameList = [NSMutableArray arrayWithArray:littleGameModels]; [self dealWithData];
return nil; return nil;
}] subscribeError:^(NSError * _Nullable error) {}]; }] subscribeError:^(NSError * _Nullable error) {
RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; }];
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
[Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
[list sendNext:array];
[list sendCompleted];
return;
}
[list sendError:nil];
} roomId:roomId];
[Api roomActivityList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if (code == 200) {
NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
self.activityList = [NSMutableArray arrayWithArray:array];
[self dealWithData];
}
} roomId:roomId];
[Api getPlayList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api getPlayList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) { if (code == 200) {
NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data]; NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
[playRAC sendNext:array]; [play sendNext:array];
[playRAC sendCompleted]; [play sendCompleted];
} else { return;
[playRAC sendError:nil];
} }
[play sendError:nil];
} roomId:roomId]; } roomId:roomId];
NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
[Api getLittleGameList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
NSArray * array = [LittleGameInfoModel modelsWithArray:data.data];
[littleGameRAC sendNext:array];
[littleGameRAC sendCompleted];
} else {
[littleGameRAC sendError:nil];
}
}
roomUid:roomUid];
} }
-(void)dealWithData{ -(void)dealWithData{
self.isLoadActivity = YES; self.isLoadActivity = YES;
self.pi_cycleScrollView.hidden = NO; self.pi_cycleScrollView.hidden = NO;
if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) { if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) {
[self configLittleGameActivity]; [self configLittleGameActivity];
} else { } else {
NSMutableArray *picArray = [NSMutableArray array]; NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) { for (ActivityInfoModel *model in self.activityList) {
[picArray addObject:model.icon]; [picArray addObject:model.icon];
@@ -191,10 +175,25 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} else { } else {
[self.pi_cycleScrollView setAutoScroll:NO]; [self.pi_cycleScrollView setAutoScroll:NO];
} }
if(self.playList.count > 0){
ActivityInfoModel *playModel = self.playList.firstObject;
self.clickPlayView.model = playModel;
// if(self.isShowChoosePlayView == NO){
// self.clickPlayView.hidden = NO;
// }
}else{
self.clickPlayView.hidden = YES;
}
} }
} }
- (void)configLittleGameActivity { - (void)configLittleGameActivity {
NSMutableArray *list = [NSMutableArray array]; NSMutableArray *list = [NSMutableArray array];
[list addObjectsFromArray:self.activityList]; [list addObjectsFromArray:self.activityList];
@@ -220,29 +219,27 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
#pragma mark - RoomGuestDelegat #pragma mark - RoomGuestDelegat
- (void)onRoomUpdate { - (void)onRoomUpdate {
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
if (roomInfo.type == RoomType_Anchor || roomInfo.roomModeType == RoomModeType_Open_Blind) {
self.gameMenuButton.hidden = YES;
} else {
self.gameMenuButton.hidden = NO;
}
self.redPacketView.type = roomInfo.type; self.redPacketView.type = roomInfo.type;
if (roomInfo.type == RoomType_MiniGame) { if (roomInfo.type == RoomType_MiniGame) {
if(self.isShowChoosePlayView == YES){
PIRoomActivityChoosePlayView *choosePlayView = [self.hostDelegate.getSuperView viewWithTag:98021];
self.isShowChoosePlayView = NO;
CGFloat y = self.frame.size.height + self.frame.origin.y - 124;
[UIView animateWithDuration:0.1 animations:^{
choosePlayView.frame = CGRectMake(KScreenWidth, y, 201, 124);
}completion:^(BOOL finished) {
[choosePlayView removeFromSuperview];
}];
}
self.redPacketView.hidden = YES; self.redPacketView.hidden = YES;
[self.gameMenuButton removeFromSuperview]; self.clickPlayView.hidden = YES;
[self.pi_cycleScrollView removeFromSuperview];
[self.stackView insertArrangedSubview:self.gameMenuButton atIndex:0];
[self.stackView addArrangedSubview:self.pi_cycleScrollView];
[self.gameMenuButton bringSubviewToFront:self.stackView];
if (self.isLoadActivity) { if (self.isLoadActivity) {
[self configLittleGameActivity]; [self configLittleGameActivity];
} else { } else {
[self requestActivityList]; [self requestActivityList];
} }
} else { } else {
[self.gameMenuButton removeFromSuperview];
[self.pi_cycleScrollView removeFromSuperview];
[self.stackView insertArrangedSubview:self.pi_cycleScrollView atIndex:0];
[self.stackView addArrangedSubview:self.gameMenuButton];
self.redPacketView.redPacketList = self.redPacketList; self.redPacketView.redPacketList = self.redPacketList;
NSMutableArray *picArray = [NSMutableArray array]; NSMutableArray *picArray = [NSMutableArray array];
for (ActivityInfoModel *model in self.activityList) { for (ActivityInfoModel *model in self.activityList) {
@@ -256,6 +253,15 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.pi_cycleScrollView setAutoScroll:NO]; [self.pi_cycleScrollView setAutoScroll:NO];
} }
if(self.playList.count > 0){
ActivityInfoModel *playModel = self.playList.firstObject;
self.clickPlayView.model = playModel;
// if(self.isShowChoosePlayView == NO){
// self.clickPlayView.hidden = NO;
// }
}else{
self.clickPlayView.hidden = YES;
}
if (roomInfo.roomModeType == RoomModeType_Open_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) { if (roomInfo.roomModeType == RoomModeType_Open_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) {
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode ) { if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode ) {
self.joinDatingView.image = [UIImage getLanguageImage:@"room_pk_normal_member_enter"]; self.joinDatingView.image = [UIImage getLanguageImage:@"room_pk_normal_member_enter"];
@@ -278,6 +284,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} else { } else {
self.joinDatingView.hidden = YES; self.joinDatingView.hidden = YES;
} }
} }
if(self.openRedPacketHandle){ if(self.openRedPacketHandle){
@@ -366,7 +375,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
fairyVC.roomUid =[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; fairyVC.roomUid =[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
fairyVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight); fairyVC.view.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
[[XCCurrentVCStackManager shareManager].getCurrentVC addChildViewController:fairyVC]; [[XCCurrentVCStackManager shareManager].getCurrentVC addChildViewController:fairyVC];
// [fairyVC.navigationController setNavigationBarHidden:YES animated:NO]; [fairyVC.navigationController setNavigationBarHidden:YES animated:NO];
[[XCCurrentVCStackManager shareManager].getCurrentVC.view addSubview:fairyVC.view]; [[XCCurrentVCStackManager shareManager].getCurrentVC.view addSubview:fairyVC.view];
[UIView animateWithDuration:0.2 animations:^{ [UIView animateWithDuration:0.2 animations:^{
@@ -400,10 +409,12 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
-(void)jumpPlayActionWithIndex:(NSInteger)index imageUrlList:(NSArray *)imageUrlList{ -(void)jumpPlayActionWithIndex:(NSInteger)index imageUrlList:(NSArray *)imageUrlList{
if (imageUrlList.count > index) { if (imageUrlList.count > index) {
NSString *pic = imageUrlList[index]; NSString *pic = imageUrlList[index];
NSMutableArray *inftList = [NSMutableArray array]; NSMutableArray *inftList = [NSMutableArray array];
NSMutableArray *modelList = [NSMutableArray array]; NSMutableArray *modelList = [NSMutableArray array];
[modelList addObjectsFromArray:self.playList];
[modelList addObjectsFromArray:self.activityList]; [modelList addObjectsFromArray:self.activityList];
ActivityInfoModel * info; ActivityInfoModel * info;
for (int i = 0 ; i < modelList.count; i++) { for (int i = 0 ; i < modelList.count; i++) {
@@ -411,7 +422,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
if([getInfo.icon isEqualToString:pic]){ if([getInfo.icon isEqualToString:pic]){
info = getInfo; info = getInfo;
} }
if(getInfo.skipType == 3){ if(getInfo.skipType == 3 && i > self.playList.count){
[inftList addObject:getInfo]; [inftList addObject:getInfo];
} }
} }
@@ -438,21 +449,24 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
}]; }];
}else { }else {
// if(index < self.playList.count){
// if(info.showType == ActivityShowType_Half){ if(index < self.playList.count){
// XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
// webView.isPlayView = YES; if(info.showType == ActivityShowType_Half){
// webView.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
// webView.url = info.skipContent; webView.isPlayView = YES;
// [TTPopup popupView:webView style:TTPopupStyleActionSheet]; webView.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
// return; webView.url = info.skipContent;
// } [TTPopup popupView:webView style:TTPopupStyleActionSheet];
// XPWebViewController * webVC = [[XPWebViewController alloc] init]; return;
// webVC.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; }
// webVC.url = info.skipContent; XPWebViewController * webVC = [[XPWebViewController alloc] init];
// [self.hostDelegate.getCurrentNav pushViewController:webVC animated:YES]; webVC.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
// return; webVC.url = info.skipContent;
// } [self.hostDelegate.getCurrentNav pushViewController:webVC animated:YES];
return;
}
if (info.skipType == ActivitySkipType_Room) { if (info.skipType == ActivitySkipType_Room) {
[self.hostDelegate exitRoom]; [self.hostDelegate exitRoom];
@@ -490,6 +504,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
}completion:^(BOOL finished) { }completion:^(BOOL finished) {
}]; }];
} }
- (void)firstRechargeTapRecognizer { - (void)firstRechargeTapRecognizer {
@@ -529,20 +544,30 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
XPSailingViewController * sailingVC = [[XPSailingViewController alloc] initWithRoomUid:roomUid]; XPSailingViewController * sailingVC = [[XPSailingViewController alloc] initWithRoomUid:roomUid];
[self.hostDelegate.getCurrentNav presentViewController:sailingVC animated:YES completion:nil]; [self.hostDelegate.getCurrentNav presentViewController:sailingVC animated:YES completion:nil];
} }
- (void)didTapGameMenuButton {
MSRoomMenuGameVC *vc = [[MSRoomMenuGameVC alloc] initWithDelegate:self.hostDelegate roomMenuType:MSRoomMenuTypeLittleGame];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
}
#pragma mark- PIRoomEnterRedPacketViewDelegate #pragma mark- PIRoomEnterRedPacketViewDelegate
-(void)openRedPacketWithModel:(XPRedPacketModel *)redModel{ -(void)openRedPacketWtihModel:(XPRedPacketModel *)redModel{
if(self.openRedPacketHandle){ if(self.openRedPacketHandle){
self.openRedPacketHandle(redModel,self.hostDelegate.getRoomInfo.type,NO); self.openRedPacketHandle(redModel,self.hostDelegate.getRoomInfo.type,NO);
} }
} }
#pragma mark - PIRoomActivityClickViewDelegate
- (void)showChoosePlayViewAction{
self.clickPlayView.hidden = YES;
self.isShowChoosePlayView = YES;
PIRoomActivityChoosePlayView *choosePlayView = [[PIRoomActivityChoosePlayView alloc]initWithFrame:CGRectZero];
choosePlayView.delegate = self;
choosePlayView.playList = self.playList;
CGFloat y = self.frame.size.height + self.frame.origin.y - 124;
choosePlayView.tag = 98021;
[self.hostDelegate.getSuperView addSubview:choosePlayView];
choosePlayView.frame = isMSRTL() ? CGRectMake(-201, y, 201, 124) : CGRectMake(KScreenWidth, y, 201, 124);
[UIView animateWithDuration:0.1 animations:^{
choosePlayView.frame = isMSRTL() ? CGRectMake(15, y, 201, 124) : CGRectMake(KScreenWidth - 201, y, 201, 124);
}];
}
-(void)clickPlayTypeWithModel:(ActivityInfoModel *)model{ -(void)clickPlayTypeWithModel:(ActivityInfoModel *)model{
if ([model.code isEqualToString:@"FIND_LOVE"]) { if ([model.code isEqualToString:@"FIND_LOVE"]) {
[self lookLoveTapRecognizer]; [self lookLoveTapRecognizer];
@@ -577,7 +602,20 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
[self.hostDelegate.getCurrentNav pushViewController:webVC animated:YES]; [self.hostDelegate.getCurrentNav pushViewController:webVC animated:YES];
} }
} }
#pragma mark- PIRoomActivityChoosePlayViewDelegate
-(void)choosePlayTypeWithView:(PIRoomActivityChoosePlayView *)view model:(ActivityInfoModel *)model{
[self clickPlayTypeWithModel:model];
}
-(void)hiddenViewActionWithView:(PIRoomActivityChoosePlayView *)view{
self.isShowChoosePlayView = NO;
CGFloat y = self.frame.size.height + self.frame.origin.y - 124;
[UIView animateWithDuration:0.1 animations:^{
view.frame = isMSRTL() ? CGRectMake(-201, y, 201, 124) : CGRectMake(KScreenWidth, y, 201, 124);
}completion:^(BOOL finished) {
// self.clickPlayView.hidden = NO;
[view removeFromSuperview];
}];
}
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (SDCycleScrollView *)pi_cycleScrollView { - (SDCycleScrollView *)pi_cycleScrollView {
if (!_pi_cycleScrollView) { if (!_pi_cycleScrollView) {
@@ -599,10 +637,14 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
for (UIView *subView in _pi_cycleScrollView.subviews) { for (UIView *subView in _pi_cycleScrollView.subviews) {
subView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; subView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
} }
} }
return _pi_cycleScrollView; return _pi_cycleScrollView;
} }
- (UIStackView *)stackView { - (UIStackView *)stackView {
if (!_stackView) { if (!_stackView) {
_stackView = [[UIStackView alloc] init]; _stackView = [[UIStackView alloc] init];
@@ -610,10 +652,14 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
_stackView.distribution = UIStackViewDistributionFill; _stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter; _stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 0; _stackView.spacing = 0;
} }
return _stackView; return _stackView;
} }
- (UIImageView *)joinDatingView { - (UIImageView *)joinDatingView {
if (!_joinDatingView) { if (!_joinDatingView) {
_joinDatingView = [[UIImageView alloc] init]; _joinDatingView = [[UIImageView alloc] init];
@@ -634,6 +680,10 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
return _activityList; return _activityList;
} }
- (PIRoomEnterRedPacketView *)redPacketView{ - (PIRoomEnterRedPacketView *)redPacketView{
if(!_redPacketView){ if(!_redPacketView){
_redPacketView = [[PIRoomEnterRedPacketView alloc]initWithFrame:CGRectZero]; _redPacketView = [[PIRoomEnterRedPacketView alloc]initWithFrame:CGRectZero];
@@ -642,17 +692,13 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
return _redPacketView; return _redPacketView;
} }
- (PIRoomActivityClickView *)clickPlayView{
- (UIButton *)gameMenuButton { if(!_clickPlayView){
if (!_gameMenuButton) { _clickPlayView = [[PIRoomActivityClickView alloc]initWithFrame:CGRectZero];
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom]; _clickPlayView.hidden = YES;
[b setImage:[UIImage imageNamed:@"ms_room_game_button"] forState:UIControlStateNormal]; _clickPlayView.delegate = self;
[b addTarget:self action:@selector(didTapGameMenuButton) forControlEvents:UIControlEventTouchUpInside];
b.hidden = YES;
_gameMenuButton = b;
} }
return _gameMenuButton; return _clickPlayView;
} }
@end @end

View File

@@ -31,7 +31,6 @@
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
self.selectionStyle = UITableViewCellSelectionStyleNone; self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.emptyImageView]; [self.contentView addSubview:self.emptyImageView];
[self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.addButton]; [self.contentView addSubview:self.addButton];

View File

@@ -224,8 +224,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
} }
#pragma mark - XPRoomMusicLibraryEmptyTableViewCellDelegate #pragma mark - XPRoomMusicLibraryEmptyTableViewCellDelegate
- (void)xPRoomMusicLibraryEmptyTableViewCell:(XPRoomMusicLibraryEmptyTableViewCell *)cell - (void)xPRoomMusicLibraryEmptyTableViewCell:(XPRoomMusicLibraryEmptyTableViewCell *)cell didClickAdd:(UIButton *)sender {
didClickAdd:(UIButton *)sender {
XPRoomTransferMusicViewController * transferVC = [[XPRoomTransferMusicViewController alloc] init]; XPRoomTransferMusicViewController * transferVC = [[XPRoomTransferMusicViewController alloc] init];
[self.navigationController pushViewController:transferVC animated:YES]; [self.navigationController pushViewController:transferVC animated:YES];
} }

View File

@@ -22,9 +22,6 @@
#import "NSArray+Safe.h" #import "NSArray+Safe.h"
///Model ///Model
#import "Music+CoreDataClass.h" #import "Music+CoreDataClass.h"
static NSInteger spacing = 47 * 2;
@interface XPRoomTransferMusicViewController ()<MyHTTPConnectionDelegate> @interface XPRoomTransferMusicViewController ()<MyHTTPConnectionDelegate>
/// ///
@property (nonatomic,strong) UIStackView *stackView; @property (nonatomic,strong) UIStackView *stackView;
@@ -43,10 +40,9 @@ static NSInteger spacing = 47 * 2;
/// ///
@property (nonatomic,strong) UILabel *descriptionLabel; @property (nonatomic,strong) UILabel *descriptionLabel;
/// ///
@property (nonatomic,strong) UIButton *musicCountButton; @property (nonatomic,strong) UIButton *musiceCountButton;
/// ///
@property (nonatomic,strong) UIButton *saveButton; @property (nonatomic,strong) UIButton *saveButton;
@property (nonatomic,strong) UIButton *copyButton;
@property (nonatomic,strong) HTTPServer *httpServer; @property (nonatomic,strong) HTTPServer *httpServer;
@property (strong, nonatomic) NSString *ipAddress; @property (strong, nonatomic) NSString *ipAddress;
/// ///
@@ -75,9 +71,8 @@ static NSInteger spacing = 47 * 2;
[self.stackView addArrangedSubview:self.singleTypeLabel]; [self.stackView addArrangedSubview:self.singleTypeLabel];
[self.stackView addArrangedSubview:self.computerImageView]; [self.stackView addArrangedSubview:self.computerImageView];
[self.stackView addArrangedSubview:self.descriptionLabel]; [self.stackView addArrangedSubview:self.descriptionLabel];
[self.stackView addArrangedSubview:self.musicCountButton]; [self.stackView addArrangedSubview:self.musiceCountButton];
[self.stackView addArrangedSubview:self.saveButton]; [self.stackView addArrangedSubview:self.saveButton];
[self.stackView addArrangedSubview:self.copyButton];
[self.wifiView addSubview:self.wifiImaegView]; [self.wifiView addSubview:self.wifiImaegView];
[self.wifiView addSubview:self.wifiLabel]; [self.wifiView addSubview:self.wifiLabel];
@@ -108,7 +103,7 @@ static NSInteger spacing = 47 * 2;
}]; }];
[self.ipLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.ipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(KScreenWidth - spacing); make.width.mas_equalTo(KScreenWidth - 47 * 2);
}]; }];
[self.singleTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.singleTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -120,20 +115,16 @@ static NSInteger spacing = 47 * 2;
}]; }];
[self.descriptionLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.descriptionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(KScreenWidth - spacing); make.width.mas_equalTo(KScreenWidth - 47 * 2);
}]; }];
[self.musicCountButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.musiceCountButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(178, 35)); make.size.mas_equalTo(CGSizeMake(178, 35));
}]; }];
[self.saveButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.saveButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(KScreenWidth - spacing, 45)); make.size.mas_equalTo(CGSizeMake(KScreenWidth - 47* 2, 45));
}]; }];
[self.copyButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(KScreenWidth - spacing, 45));
}];
} }
- (void)monitorNet { - (void)monitorNet {
@@ -149,7 +140,7 @@ static NSInteger spacing = 47 * 2;
self.ipAddress = YMLocalizedString(@"XPRoomTransferMusicViewController3"); self.ipAddress = YMLocalizedString(@"XPRoomTransferMusicViewController3");
self.wifiLabel.text = YMLocalizedString(@"XPRoomTransferMusicViewController2"); self.wifiLabel.text = YMLocalizedString(@"XPRoomTransferMusicViewController2");
} else { } else {
self.ipAddress = [NSString stringWithFormat:@"http://%@:%d/?lang=%@",[SJXCSMIPHelper deviceIPAddress],[self.httpServer listeningPort],[NSBundle getLanguageText]]; self.ipAddress = [NSString stringWithFormat:@"http://%@:%d/?lang=%@",[SJXCSMIPHelper deviceIPAdress],[self.httpServer listeningPort],[NSBundle getLanguageText]];
self.wifiLabel.text = YMLocalizedString(@"XPRoomTransferMusicViewController5"); self.wifiLabel.text = YMLocalizedString(@"XPRoomTransferMusicViewController5");
} }
self.ipLabel.text = self.ipAddress; self.ipLabel.text = self.ipAddress;
@@ -245,7 +236,7 @@ static NSInteger spacing = 47 * 2;
[[XPCoreDataManager shareInstance] save]; [[XPCoreDataManager shareInstance] save];
dispatch_main_sync_safe(^{ dispatch_main_sync_safe(^{
self.numberSong++; self.numberSong++;
[self.musicCountButton setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomTransferMusicViewController13"), self.numberSong] forState:UIControlStateNormal]; [self.musiceCountButton setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomTransferMusicViewController13"), self.numberSong] forState:UIControlStateNormal];
self.currentMusic = nil; self.currentMusic = nil;
}); });
} }
@@ -266,13 +257,6 @@ static NSInteger spacing = 47 * 2;
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
} }
- (void)didTapCopyButton {
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = self.ipLabel.text;
[self showSuccessToast:YMLocalizedString(@"XPRoomTransferMusicViewController20")];
}
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (UIStackView *)stackView { - (UIStackView *)stackView {
if (!_stackView) { if (!_stackView) {
@@ -357,31 +341,17 @@ static NSInteger spacing = 47 * 2;
return _descriptionLabel; return _descriptionLabel;
} }
- (UIButton *)musicCountButton { - (UIButton *)musiceCountButton {
if (!_musicCountButton) { if (!_musiceCountButton) {
_musicCountButton = [UIButton buttonWithType:UIButtonTypeCustom]; _musiceCountButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_musicCountButton setTitle:YMLocalizedString(@"XPRoomTransferMusicViewController17") forState:UIControlStateNormal]; [_musiceCountButton setTitle:YMLocalizedString(@"XPRoomTransferMusicViewController17") forState:UIControlStateNormal];
[_musicCountButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_musiceCountButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_musicCountButton.titleLabel.font = [UIFont systemFontOfSize:14]; _musiceCountButton.titleLabel.font = [UIFont systemFontOfSize:14];
[_musicCountButton setBackgroundColor:[UIColor colorWithWhite:0 alpha:0.4]]; [_musiceCountButton setBackgroundColor:[UIColor colorWithWhite:0 alpha:0.4]];
_musicCountButton.layer.masksToBounds = YES; _musiceCountButton.layer.masksToBounds = YES;
_musicCountButton.layer.cornerRadius = 35/2; _musiceCountButton.layer.cornerRadius = 35/2;
} }
return _musicCountButton; return _musiceCountButton;
}
- (UIButton *)copyButton {
if (!_copyButton) {
_copyButton = [[UIButton alloc] init];
[_copyButton setTitle:YMLocalizedString(@"XPRoomTransferMusicViewController19") forState:UIControlStateNormal];
[_copyButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
_copyButton.titleLabel.font = [UIFont systemFontOfSize:16];
[_copyButton addTarget:self action:@selector(didTapCopyButton) forControlEvents:UIControlEventTouchUpInside];
_copyButton.layer.cornerRadius = 45/2;
_copyButton.layer.masksToBounds = YES;
[_copyButton setBackgroundColor:[DJDKMIMOMColor alertBackgroundColor]];
}
return _copyButton;
} }
- (UIButton *)saveButton { - (UIButton *)saveButton {

View File

@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPRoomFunctionContainerView : UIView <RoomGuestDelegate> @interface XPRoomFunctionContainerView : UIView <RoomGuestDelegate>
///是否第一次更新在线人数 ///是否第一次更新在线人数
@property(nonatomic,assign) BOOL isFirstUpdate; @property(nonatomic,assign) BOOL isFirstUpdate;
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate; - (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate;
- (void)hiddenSudGamePostionView; - (void)hiddenSudGamePostionView;
///获取当前的音乐 ///获取当前的音乐
- (Music *)getCurrentMusic; - (Music *)getCurrentMusic;

Some files were not shown because too many files have changed in this diff Show More